Re: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution changes little

2019-05-21 Thread Fu, Linjie
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Fu, Linjie
> Sent: Friday, February 22, 2019 10:40
> To: Li, Zhong ; FFmpeg development discussions and
> patches 
> Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution
> changes little
> 
> > -Original Message-
> > From: Li, Zhong
> > Sent: Thursday, February 21, 2019 17:53
> > To: FFmpeg development discussions and patches  > de...@ffmpeg.org>
> > Cc: Fu, Linjie 
> > Subject: RE: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution
> > changes little
> >
> > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> > Behalf
> > > Of Linjie Fu
> > > Sent: Wednesday, February 13, 2019 6:00 PM
> > > To: ffmpeg-devel@ffmpeg.org
> > > Cc: Fu, Linjie 
> > > Subject: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution
> > changes
> > > little
> > >
> > > Currently, resolution change detection is based on 16 alignment, small
> > > resolution changes (same after FFALIGN 16) in coded width or coded
> height
> > > will not trigger the reinit and will lead to a decode failure.
> > >
> > > Modify to use last_coded_width and last_coded_height to detect the
> small
> > > resolution change.
> > >
> > > Signed-off-by: Linjie Fu 
> >
> > Is it still needed if https://patchwork.ffmpeg.org/patch/12112/ applied?
> 
> Garbage still exists after applying the patch set.
> Will comment under patch 12112.

Ping?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution changes little

2019-02-21 Thread Fu, Linjie
> -Original Message-
> From: Li, Zhong
> Sent: Thursday, February 21, 2019 17:53
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: Fu, Linjie 
> Subject: RE: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution
> changes little
> 
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> > Of Linjie Fu
> > Sent: Wednesday, February 13, 2019 6:00 PM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Fu, Linjie 
> > Subject: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution
> changes
> > little
> >
> > Currently, resolution change detection is based on 16 alignment, small
> > resolution changes (same after FFALIGN 16) in coded width or coded height
> > will not trigger the reinit and will lead to a decode failure.
> >
> > Modify to use last_coded_width and last_coded_height to detect the small
> > resolution change.
> >
> > Signed-off-by: Linjie Fu 
> 
> Is it still needed if https://patchwork.ffmpeg.org/patch/12112/ applied?

Garbage still exists after applying the patch set. 
Will comment under patch 12112.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution changes little

2019-02-21 Thread Li, Zhong
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Linjie Fu
> Sent: Wednesday, February 13, 2019 6:00 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Fu, Linjie 
> Subject: [FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution changes
> little
> 
> Currently, resolution change detection is based on 16 alignment, small
> resolution changes (same after FFALIGN 16) in coded width or coded height
> will not trigger the reinit and will lead to a decode failure.
> 
> Modify to use last_coded_width and last_coded_height to detect the small
> resolution change.
> 
> Signed-off-by: Linjie Fu 

Is it still needed if https://patchwork.ffmpeg.org/patch/12112/ applied? 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavc/qsvdec: reinit if the resolution changes little

2019-02-12 Thread Linjie Fu
Currently, resolution change detection is based on 16 alignment,
small resolution changes (same after FFALIGN 16) in coded width or
coded height will not trigger the reinit and will lead to a decode
failure.

Modify to use last_coded_width and last_coded_height to detect the
small resolution change.

Signed-off-by: Linjie Fu 
---
 libavcodec/qsvdec.c | 8 +---
 libavcodec/qsvdec.h | 2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 4a0be811fb..b29f869366 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -523,9 +523,9 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext 
*q,
 
 avctx->field_order  = q->parser->field_order;
 /* TODO: flush delayed frames on reinit */
-if (q->parser->format   != q->orig_pix_fmt||
-FFALIGN(q->parser->coded_width, 16)  != FFALIGN(avctx->coded_width, 
16) ||
-FFALIGN(q->parser->coded_height, 16) != FFALIGN(avctx->coded_height, 
16)) {
+if (q->parser->format != q->orig_pix_fmt ||
+q->last_coded_height != q->parser->coded_height ||
+q->last_coded_width !=  q->parser->coded_width) {
 enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE,
AV_PIX_FMT_NONE };
@@ -558,6 +558,8 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext 
*q,
 avctx->coded_height = FFALIGN(q->parser->coded_height, 16);
 avctx->level= q->avctx_internal->level;
 avctx->profile  = q->avctx_internal->profile;
+q->last_coded_width = q->parser->coded_width;
+q->last_coded_height = q->parser->coded_height;
 
 ret = ff_get_format(avctx, pix_fmts);
 if (ret < 0)
diff --git a/libavcodec/qsvdec.h b/libavcodec/qsvdec.h
index 111536caba..1af0c42404 100644
--- a/libavcodec/qsvdec.h
+++ b/libavcodec/qsvdec.h
@@ -55,6 +55,8 @@ typedef struct QSVContext {
 int zero_consume_run;
 int buffered_count;
 int reinit_flag;
+int last_coded_width;
+int last_coded_height;
 
 // the internal parser and codec context for parsing the data
 AVCodecParserContext *parser;
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel