Re: [libav-devel] [PATCH 1/2] lavc/qsvdec: set complete_frame flags for non-interlaced frames.

2018-03-20 Thread Li, Zhong
> From: libav-devel [mailto:libav-devel-boun...@libav.org] On Behalf Of
> Maxym Dmytrychenko
> Sent: Monday, March 19, 2018 5:59 PM
> To: libav development <libav-devel@libav.org>
> Subject: Re: [libav-devel] [PATCH 1/2] lavc/qsvdec: set complete_frame flags
> for non-interlaced frames.
> 
>  MFX_BITSTREAM_COMPLETE_FRAME support can be added as a param
> or can be only such if() conditions sufficient for all cases and streams ?

Yes, I think this flag is a common flag for all codecs (Not only for VC1.). 
According to the comments of MFX_BITSTREAM_COMPLETE_FRAME and grep it in MSDK 
sample_utils.cpp.
I have run the full decoding test internally for all codecs. 
Everything is ok but expect h264. Some interlace videos is treated as 
AV_FIELD_UNKNOWN(see 
https://github.com/libav/libav/blob/master/libavcodec/h264_parser.c#L463 ) thus 
making some h264 clips decoding failed.
I will update this patch. Thanks for your review!
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 1/2] lavc/qsvdec: set complete_frame flags for non-interlaced frames.

2018-03-19 Thread Maxym Dmytrychenko
 MFX_BITSTREAM_COMPLETE_FRAME support can be added as a param
 or can be only such if() conditions sufficient for all cases and streams ?

On Mon, Mar 19, 2018 at 10:33 AM, Zhong Li  wrote:

> Set the flag MFX_BITSTREAM_COMPLETE_FRAME when it is a completed frame.
> This can fix vc1 decoding segment fault issues because can't set the start
> code correctly.
> See: ./avconv -hwaccel qsv -c:v vc1_qsv -i /fate-suite/vc1/SA00040.vc1
> -vf "hwdownload, format=nv12" -f rawvideo /dev/null
>
> Signed-off-by: Zhong Li 
> ---
>  libavcodec/qsvdec.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index c74ec68..dc44865 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -321,6 +321,9 @@ static int qsv_decode(AVCodecContext *avctx,
> QSVContext *q,
>  bs.DataLength = avpkt->size;
>  bs.MaxLength  = bs.DataLength;
>  bs.TimeStamp  = avpkt->pts;
> +if (avctx->field_order == AV_FIELD_UNKNOWN ||
> +avctx->field_order == AV_FIELD_PROGRESSIVE)
> +bs.DataFlag   |= MFX_BITSTREAM_COMPLETE_FRAME;
>  }
>
>  sync = av_mallocz(sizeof(*sync));
> --
> 1.8.3.1
>
> ___
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 1/2] lavc/qsvdec: set complete_frame flags for non-interlaced frames.

2018-03-19 Thread Zhong Li
Set the flag MFX_BITSTREAM_COMPLETE_FRAME when it is a completed frame.
This can fix vc1 decoding segment fault issues because can't set the start
code correctly.
See: ./avconv -hwaccel qsv -c:v vc1_qsv -i /fate-suite/vc1/SA00040.vc1
-vf "hwdownload, format=nv12" -f rawvideo /dev/null

Signed-off-by: Zhong Li 
---
 libavcodec/qsvdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index c74ec68..dc44865 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -321,6 +321,9 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
 bs.DataLength = avpkt->size;
 bs.MaxLength  = bs.DataLength;
 bs.TimeStamp  = avpkt->pts;
+if (avctx->field_order == AV_FIELD_UNKNOWN ||
+avctx->field_order == AV_FIELD_PROGRESSIVE)
+bs.DataFlag   |= MFX_BITSTREAM_COMPLETE_FRAME;
 }
 
 sync = av_mallocz(sizeof(*sync));
-- 
1.8.3.1

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel