Re: [FFmpeg-devel] [PATCH]lavd/decklink_dec: Use correct case for codec point / fourcc v210

2020-12-12 Thread Marton Balint



On Fri, 11 Dec 2020, Carl Eugen Hoyos wrote:


Hi!

Attached patch fixes ticket #9005.


Why are the codec_tags set at all? Can't we simply remove setting of all 
the codec tags in decklink? They hold no additional information to 
codec id and pixel format. This should also fix the issue IMHO.


Regards,
Marton
___
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 3/3] lavfi/dnn: check the return value from sws_getContext

2020-12-12 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel  On Behalf Of Jun
> Zhao
> Sent: 2020年12月9日 17:53
> To: ffmpeg-devel@ffmpeg.org
> Cc: Jun Zhao 
> Subject: [FFmpeg-devel] [PATCH 3/3] lavfi/dnn: check the return value from
> sws_getContext
> 
> From: Jun Zhao 
> 
> sws_getContext may be return NULL, and it's will be dereferenced, so add the
> check.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavfilter/dnn/dnn_io_proc.c | 28 
>  1 file changed, 28 insertions(+)
> 
> diff --git a/libavfilter/dnn/dnn_io_proc.c b/libavfilter/dnn/dnn_io_proc.c 
> index
> db13d7f..c9b49be 100644
> --- a/libavfilter/dnn/dnn_io_proc.c
> +++ b/libavfilter/dnn/dnn_io_proc.c
> @@ -41,6 +41,13 @@ DNNReturnType proc_from_dnn_to_frame(AVFrame
> *frame, DNNData *output, void *log_
>   frame->height,
>   AV_PIX_FMT_GRAY8,
>   0, NULL, NULL, NULL);
> +if (!sws_ctx) {
> +av_log(log_ctx, AV_LOG_ERROR, "Impossible to create scale
> context for the conversion "
> +"fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n",
> +av_get_pix_fmt_name(AV_PIX_FMT_GRAYF32),
> frame->width * 3, frame->height,
> +av_get_pix_fmt_name(AV_PIX_FMT_GRAY8),
> frame->width * 3, frame->height);
> +return DNN_ERROR;
> +}
>  sws_scale(sws_ctx, (const uint8_t *[4]){(const uint8_t
> *)output->data, 0, 0, 0},
> (const int[4]){frame->width * 3 * sizeof(float),
> 0, 0, 0}, 0, frame->height,
> (uint8_t * const*)frame->data,
> frame->linesize); @@ -64,6 +71,13 @@ DNNReturnType
> proc_from_dnn_to_frame(AVFrame *frame, DNNData *output, void *log_
>   frame->height,
>   AV_PIX_FMT_GRAY8,
>   0, NULL, NULL, NULL);
> +if (!sws_ctx) {
> +av_log(log_ctx, AV_LOG_ERROR, "Impossible to create scale
> context for the conversion "
> +"fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n",
> +av_get_pix_fmt_name(AV_PIX_FMT_GRAYF32),
> frame->width, frame->height,
> +av_get_pix_fmt_name(AV_PIX_FMT_GRAY8),
> frame->width, frame->height);
> +return DNN_ERROR;
> +}
>  sws_scale(sws_ctx, (const uint8_t *[4]){(const uint8_t
> *)output->data, 0, 0, 0},
> (const int[4]){frame->width * sizeof(float), 0, 0,
> 0}, 0, frame->height,
> (uint8_t * const*)frame->data,
> frame->linesize); @@ -97,6 +111,13 @@ DNNReturnType
> proc_from_frame_to_dnn(AVFrame *frame, DNNData *input, void *log_c
>   frame->height,
>   AV_PIX_FMT_GRAYF32,
>   0, NULL, NULL, NULL);
> +if (!sws_ctx) {
> +av_log(log_ctx, AV_LOG_ERROR, "Impossible to create scale
> context for the conversion "
> +"fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n",
> +av_get_pix_fmt_name(AV_PIX_FMT_GRAY8),
> frame->width * 3, frame->height,
> +
> av_get_pix_fmt_name(AV_PIX_FMT_GRAYF32),frame->width * 3,
> frame->height);
> +return DNN_ERROR;
> +}
>  sws_scale(sws_ctx, (const uint8_t **)frame->data,
> frame->linesize, 0, frame->height,
> (uint8_t * const*)(&input->data), @@ -121,6
> +142,13 @@ DNNReturnType proc_from_frame_to_dnn(AVFrame *frame,
> DNNData *input, void *log_c
>   frame->height,
>   AV_PIX_FMT_GRAYF32,
>   0, NULL, NULL, NULL);
> +if (!sws_ctx) {
> +av_log(log_ctx, AV_LOG_ERROR, "Impossible to create scale
> context for the conversion "
> +"fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n",
> +av_get_pix_fmt_name(AV_PIX_FMT_GRAY8),
> frame->width, frame->height,
> +
> av_get_pix_fmt_name(AV_PIX_FMT_GRAYF32),frame->width, frame->height);
> +return DNN_ERROR;
> +}
>  sws_scale(sws_ctx, (const uint8_t **)frame->data,
> frame->linesize, 0, frame->height,
> (uint8_t * const*)(&input->data),
> --
the two patches look good to me, will push soon, thanks.
___
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".

[FFmpeg-devel] [PATCH 2/2] avformat/voc_packet: Add a basic check on max_size

2020-12-12 Thread Michael Niedermayer
Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 
'int'
Fixes: 
28127/clusterfuzz-testcase-minimized-ffmpeg_dem_VOC_fuzzer-4880586455646208

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/voc_packet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/voc_packet.c b/libavformat/voc_packet.c
index 1e2e19e1c3..3492227deb 100644
--- a/libavformat/voc_packet.c
+++ b/libavformat/voc_packet.c
@@ -44,6 +44,8 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream 
*st, int max_size)
AVINDEX_KEYFRAME);
 
 while (!voc->remaining_size) {
+if (max_size < 4)
+return AVERROR_INVALIDDATA;
 type = avio_r8(pb);
 if (type == VOC_TYPE_EOF)
 return AVERROR_EOF;
-- 
2.17.1

___
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".

[FFmpeg-devel] [PATCH 1/2] avformat/wtvdec: Check for EOF before potentially reseting the eof state

2020-12-12 Thread Michael Niedermayer
Fixes: infinite loop
Fixes: 
28042/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6311288967528448

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/wtvdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 77908e6392..6c41e3c1a3 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -953,6 +953,9 @@ static int parse_chunks(AVFormatContext *s, int mode, 
int64_t seekts, int *len_p
 } else
 av_log(s, AV_LOG_WARNING, "unsupported chunk:"FF_PRI_GUID"\n", 
FF_ARG_GUID(g));
 
+if (avio_feof(pb))
+break;
+
 avio_skip(pb, WTV_PAD8(len) - consumed);
 }
 return AVERROR_EOF;
-- 
2.17.1

___
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".

[FFmpeg-devel] [PATCH 5/7] fate: add tests for AVID

2020-12-12 Thread Anton Khirnov
Samples cut from tickets 971 and 4741
---
 tests/fate/video.mak   |  6 ++
 tests/ref/fate/avid-interlaced |  7 +++
 tests/ref/fate/avid-meridian   | 15 +++
 3 files changed, 28 insertions(+)
 create mode 100644 tests/ref/fate/avid-interlaced
 create mode 100644 tests/ref/fate/avid-meridian

diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index 4877740863..a5f3107c38 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -43,6 +43,12 @@ fate-auravision-v1: CMD = framecrc -i 
$(TARGET_SAMPLES)/auravision/SOUVIDEO.AVI
 FATE_VIDEO-$(call DEMDEC, AVI, AURA2) += fate-auravision-v2
 fate-auravision-v2: CMD = framecrc -i 
$(TARGET_SAMPLES)/auravision/salma-hayek-in-ugly-betty-partial-avi -an
 
+FATE_VIDEO-$(call DEMDEC, AVI, AVRN) += fate-avid-interlaced
+fate-avid-interlaced: CMD = framecrc -i 
$(TARGET_SAMPLES)/avid/avid_ntsc_interlaced.avi
+
+FATE_VIDEO-$(call DEMDEC, MOV, AVRN) += fate-avid-meridian
+fate-avid-meridian: CMD = framecrc -i 
$(TARGET_SAMPLES)/avid/avidmeridianntsc.mov
+
 FATE_VIDEO-$(call DEMDEC, BETHSOFTVID, BETHSOFTVID) += fate-bethsoft-vid
 fate-bethsoft-vid: CMD = framecrc -i 
$(TARGET_SAMPLES)/bethsoft-vid/ANIM0001.VID -t 5 -pix_fmt rgb24 -vf scale -af 
aresample
 
diff --git a/tests/ref/fate/avid-interlaced b/tests/ref/fate/avid-interlaced
new file mode 100644
index 00..2efa5839cb
--- /dev/null
+++ b/tests/ref/fate/avid-interlaced
@@ -0,0 +1,7 @@
+#tb 0: 100/2397
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 720x486
+#sar 0: 0/1
+0,  0,  0,1,   699840, 0xc59a264e
+0,  1,  1,1,   699840, 0x06f13712
diff --git a/tests/ref/fate/avid-meridian b/tests/ref/fate/avid-meridian
new file mode 100644
index 00..313351ed06
--- /dev/null
+++ b/tests/ref/fate/avid-meridian
@@ -0,0 +1,15 @@
+#tb 0: 20859/50
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 320x240
+#sar 0: 0/1
+0,  0,  0,1,   153600, 0xbfd35869
+0,  1,  1,1,   153600, 0xbe7c74a0
+0,  2,  2,1,   153600, 0x9f2524ee
+0,  3,  3,1,   153600, 0x3c8df375
+0,  4,  4,1,   153600, 0xe0ac5d7d
+0,  5,  5,1,   153600, 0xf0c6da50
+0,  6,  6,1,   153600, 0xbd50751f
+0,  7,  7,1,   153600, 0x51caf5f7
+0,  8,  8,1,   153600, 0x27752d4f
+0,  9,  9,1,   153600, 0x63a0d0dc
-- 
2.28.0

___
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".

[FFmpeg-devel] [PATCH 6/7] lavc/mjpegdec: cosmetics, org->orig

2020-12-12 Thread Anton Khirnov
---
 libavcodec/mjpegdec.c | 6 +++---
 libavcodec/mjpegdec.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 82098e4295..ea3f125cca 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -172,7 +172,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
 s->start_code= -1;
 s->first_picture = 1;
 s->got_picture   = 0;
-s->org_height= avctx->coded_height;
+s->orig_height= avctx->coded_height;
 avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
 avctx->colorspace = AVCOL_SPC_BT470BG;
 s->hwaccel_pix_fmt = s->hwaccel_sw_pix_fmt = AV_PIX_FMT_NONE;
@@ -466,8 +466,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 /* test interlaced mode */
 if (s->first_picture   &&
 (s->multiscope != 2 || s->avctx->time_base.den >= 25 * 
s->avctx->time_base.num) &&
-s->org_height != 0 &&
-s->height < ((s->org_height * 3) / 4)) {
+s->orig_height != 0 &&
+s->height < ((s->orig_height * 3) / 4)) {
 s->interlaced= 1;
 s->bottom_field  = s->interlace_polarity;
 s->picture_ptr->interlaced_frame = 1;
diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h
index d9844adf4e..be86ee5135 100644
--- a/libavcodec/mjpegdec.h
+++ b/libavcodec/mjpegdec.h
@@ -59,7 +59,7 @@ typedef struct MJpegDecodeContext {
 VLC vlcs[3][4];
 int qscale[4];  ///< quantizer scale calculated from quant_matrixes
 
-int org_height;  /* size given at codec init */
+int orig_height;  /* size given at codec init */
 int first_picture;/* true if decoding first picture */
 int interlaced; /* true if interlaced */
 int bottom_field;   /* true if bottom field */
-- 
2.28.0

___
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".

[FFmpeg-devel] [PATCH 1/7] tools/target_dec_fuzzer: use non-obsolete decoding API

2020-12-12 Thread Anton Khirnov
---
 tools/target_dec_fuzzer.c | 36 
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 11530cbf79..23ffca3923 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -88,6 +88,14 @@ static int subtitle_handler(AVCodecContext *avctx, void 
*frame,
 return ret;
 }
 
+static int audio_video_handler(AVCodecContext *avctx, AVFrame *frame,
+   int *got_frame, const AVPacket *dummy)
+{
+int ret = avcodec_receive_frame(avctx, frame);
+*got_frame = ret >= 0;
+return ret;
+}
+
 // Ensure we don't loop forever
 const uint32_t maxiteration = 8096;
 const uint64_t maxpixels_per_frame = 4096 * 4096;
@@ -133,8 +141,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 }
 
 switch (c->type) {
-case AVMEDIA_TYPE_AUDIO   : decode_handler = avcodec_decode_audio4; break;
-case AVMEDIA_TYPE_VIDEO   : decode_handler = avcodec_decode_video2; break;
+case AVMEDIA_TYPE_AUDIO   :
+case AVMEDIA_TYPE_VIDEO   : decode_handler = audio_video_handler  ; break;
 case AVMEDIA_TYPE_SUBTITLE: decode_handler = subtitle_handler ; break;
 }
 switch (c->id) {
@@ -194,7 +202,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 
 if (ctx->max_pixels == 0 || ctx->max_pixels > maxpixels_per_frame)
 ctx->max_pixels = maxpixels_per_frame; //To reduce false positive OOM 
and hangs
-ctx->refcounted_frames = 1; //To reduce false positive timeouts and focus 
testing on the refcounted API
 
 ctx->max_samples = maxsamples_per_frame;
 
@@ -306,6 +313,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 last = data;
 
 while (parsepkt.size > 0) {
+int decode_more;
 
 if (parser) {
 av_init_packet(&avpkt);
@@ -338,8 +346,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
   avcodec_flush_buffers(ctx);
   flushpattern = (flushpattern >> 3) + (flushpattern << 61);
 
+  if (ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) {
+  int ret = avcodec_send_packet(ctx, &avpkt);
+  decode_more = ret >= 0;
+  } else
+  decode_more = 1;
+
   // Iterate through all data
-  while (avpkt.size > 0 && it++ < maxiteration) {
+  while (decode_more && it++ < maxiteration) {
 av_frame_unref(frame);
 int ret = decode_handler(ctx, frame, &got_frame, &avpkt);
 
@@ -360,10 +374,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 
 if (ret <= 0 || ret > avpkt.size)
break;
-if (ctx->codec_type != AVMEDIA_TYPE_AUDIO)
-ret = avpkt.size;
-avpkt.data += ret;
-avpkt.size -= ret;
+
+if (ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
+avpkt.data += ret;
+avpkt.size -= ret;
+decode_more = avpkt.size > 0;
+} else
+decode_more = ret >= 0;
   }
   av_packet_unref(&avpkt);
 }
@@ -373,6 +390,9 @@ maximums_reached:
 
 av_packet_unref(&avpkt);
 
+if (ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)
+avcodec_send_packet(ctx, NULL);
+
 do {
 got_frame = 0;
 av_frame_unref(frame);
-- 
2.28.0

___
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".

[FFmpeg-devel] [PATCH 3/7] api-band-test: use non-obsolete decoding API

2020-12-12 Thread Anton Khirnov
---
 tests/api/api-band-test.c | 90 +++
 1 file changed, 53 insertions(+), 37 deletions(-)

diff --git a/tests/api/api-band-test.c b/tests/api/api-band-test.c
index 257e741694..34bed1d6be 100644
--- a/tests/api/api-band-test.c
+++ b/tests/api/api-band-test.c
@@ -71,14 +71,12 @@ static int video_decode(const char *input_filename)
 AVCodecParameters *origin_par = NULL;
 uint8_t *byte_buffer = NULL;
 AVFrame *fr = NULL;
-AVPacket pkt;
+AVPacket *pkt;
 AVFormatContext *fmt_ctx = NULL;
 int number_of_written_bytes;
 int video_stream;
-int got_frame = 0;
 int byte_buffer_size;
 int result;
-int end_of_stream = 0;
 
 draw_horiz_band_called = 0;
 
@@ -135,6 +133,12 @@ static int video_decode(const char *input_filename)
 return AVERROR(ENOMEM);
 }
 
+pkt = av_packet_alloc();
+if (!pkt) {
+av_log(NULL, AV_LOG_ERROR, "Cannot allocate packet\n");
+return AVERROR(ENOMEM);
+}
+
 if (strcmp(codec->name, "flv") && strcmp(codec->name, "mpeg4") && 
strcmp(codec->name, "huffyuv")) {
 av_log(NULL, AV_LOG_ERROR, "Wrong codec\n");
 return -1;
@@ -155,48 +159,60 @@ static int video_decode(const char *input_filename)
 memset(slice_byte_buffer, 0, byte_buffer_size);
 slice_byte_buffer_size = byte_buffer_size;
 
-av_init_packet(&pkt);
-do {
-if (!end_of_stream) {
-if (av_read_frame(fmt_ctx, &pkt) < 0) {
-end_of_stream = 1;
-}
+result = 0;
+while (result >= 0) {
+result = av_read_frame(fmt_ctx, pkt);
+if (result >= 0 && pkt->stream_index != video_stream) {
+av_packet_unref(pkt);
+continue;
 }
-if (end_of_stream) {
-pkt.data = NULL;
-pkt.size = 0;
+
+if (result < 0)
+result = avcodec_send_packet(ctx, NULL);
+else
+result = avcodec_send_packet(ctx, pkt);
+
+av_packet_unref(pkt);
+
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Error submitting a packet for 
decoding\n");
+return result;
 }
-if (pkt.stream_index == video_stream || end_of_stream) {
-got_frame = 0;
-result = avcodec_decode_video2(ctx, fr, &got_frame, &pkt);
-if (result < 0) {
+
+while (result >= 0) {
+result = avcodec_receive_frame(ctx, fr);
+if (result == AVERROR_EOF)
+goto finish;
+else if (result == AVERROR(EAGAIN)) {
+result = 0;
+break;
+} else if (result < 0) {
 av_log(NULL, AV_LOG_ERROR, "Error decoding frame\n");
 return result;
 }
-if (got_frame) {
-number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, 
byte_buffer_size,
-(const uint8_t* const *)fr->data, 
(const int*) fr->linesize,
-ctx->pix_fmt, ctx->width, ctx->height, 
1);
-if (number_of_written_bytes < 0) {
-av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
-return number_of_written_bytes;
-}
-if (draw_horiz_band_called == 0) {
-av_log(NULL, AV_LOG_ERROR, "draw_horiz_band haven't been 
called!\n");
-return -1;
-}
-if (av_adler32_update(0, (const uint8_t*)byte_buffer, 
number_of_written_bytes) !=
-av_adler32_update(0, (const uint8_t*)slice_byte_buffer, 
number_of_written_bytes)) {
-av_log(NULL, AV_LOG_ERROR, "Decoded frames with and 
without draw_horiz_band are not the same!\n");
-return -1;
-}
+
+number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, 
byte_buffer_size,
+(const uint8_t* const *)fr->data, (const 
int*) fr->linesize,
+ctx->pix_fmt, ctx->width, ctx->height, 1);
+if (number_of_written_bytes < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
+return number_of_written_bytes;
+}
+if (draw_horiz_band_called == 0) {
+av_log(NULL, AV_LOG_ERROR, "draw_horiz_band haven't been 
called!\n");
+return -1;
+}
+if (av_adler32_update(0, (const uint8_t*)byte_buffer, 
number_of_written_bytes) !=
+av_adler32_update(0, (const uint8_t*)slice_byte_buffer, 
number_of_written_bytes)) {
+av_log(NULL, AV_LOG_ERROR, "Decoded frames with and without 
draw_horiz_band are not the same!\n");
+return -1;
 }
-av_packet_unref(&pkt);
-av_init_packet(&pkt);
+av_frame_unref(fr);
   

[FFmpeg-devel] [PATCH 4/7] api-seek-test: use non-obsolete decoding API

2020-12-12 Thread Anton Khirnov
---
 tests/api/api-seek-test.c | 104 +++---
 1 file changed, 62 insertions(+), 42 deletions(-)

diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index ae33581244..bb9f5c89b3 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -73,16 +73,14 @@ static int compare_crc_in_array(uint32_t crc, int64_t pts)
 }
 
 static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream,
-AVCodecContext *ctx, AVFrame *fr, uint64_t 
ts_start, uint64_t ts_end, int no_seeking)
+AVCodecContext *ctx, AVPacket *pkt, AVFrame 
*fr,
+uint64_t ts_start, uint64_t ts_end, int 
no_seeking)
 {
 int number_of_written_bytes;
-int got_frame = 0;
 int result;
-int end_of_stream = 0;
 int byte_buffer_size;
 uint8_t *byte_buffer;
 uint32_t crc;
-AVPacket pkt;
 
 byte_buffer_size = av_image_get_buffer_size(ctx->pix_fmt, ctx->width, 
ctx->height, 16);
 byte_buffer = av_malloc(byte_buffer_size);
@@ -101,53 +99,66 @@ static int compute_crc_of_packets(AVFormatContext 
*fmt_ctx, int video_stream,
 avcodec_flush_buffers(ctx);
 }
 
-av_init_packet(&pkt);
 do {
-if (!end_of_stream)
-if (av_read_frame(fmt_ctx, &pkt) < 0)
-end_of_stream = 1;
-if (end_of_stream) {
-pkt.data = NULL;
-pkt.size = 0;
+result = av_read_frame(fmt_ctx, pkt);
+if (result >= 0 && pkt->stream_index != video_stream) {
+av_packet_unref(pkt);
+continue;
 }
-if (pkt.stream_index == video_stream || end_of_stream) {
-got_frame = 0;
-if ((pkt.pts == AV_NOPTS_VALUE) && (!end_of_stream)) {
+
+if (result < 0)
+result = avcodec_send_packet(ctx, NULL);
+else {
+if (pkt->pts == AV_NOPTS_VALUE) {
 av_log(NULL, AV_LOG_ERROR, "Error: frames doesn't have pts 
values\n");
 return -1;
 }
-result = avcodec_decode_video2(ctx, fr, &got_frame, &pkt);
-if (result < 0) {
+result = avcodec_send_packet(ctx, pkt);
+}
+
+av_packet_unref(pkt);
+
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Error submitting a packet for 
decoding\n");
+return result;
+}
+
+while (result >= 0) {
+result = avcodec_receive_frame(ctx, fr);
+if (result == AVERROR_EOF)
+goto finish;
+else if (result == AVERROR(EAGAIN)) {
+result = 0;
+break;
+} else if (result < 0) {
 av_log(NULL, AV_LOG_ERROR, "Error decoding frame\n");
 return result;
 }
-if (got_frame) {
-number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, 
byte_buffer_size,
-(const uint8_t* const *)fr->data, 
(const int*) fr->linesize,
-ctx->pix_fmt, ctx->width, ctx->height, 
1);
-if (number_of_written_bytes < 0) {
-av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
-return number_of_written_bytes;
-}
-if ((!no_seeking) && (fr->pts > ts_end))
-break;
-crc = av_adler32_update(0, (const uint8_t*)byte_buffer, 
number_of_written_bytes);
-printf("%10"PRId64", 0x%08"PRIx32"\n", fr->pts, crc);
-if (no_seeking) {
-if (add_crc_to_array(crc, fr->pts) < 0)
-return -1;
-}
-else {
-if (compare_crc_in_array(crc, fr->pts) < 0)
-return -1;
-}
+
+number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, 
byte_buffer_size,
+(const uint8_t* const *)fr->data, (const 
int*) fr->linesize,
+ctx->pix_fmt, ctx->width, ctx->height, 1);
+if (number_of_written_bytes < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
+return number_of_written_bytes;
+}
+if ((!no_seeking) && (fr->pts > ts_end))
+break;
+crc = av_adler32_update(0, (const uint8_t*)byte_buffer, 
number_of_written_bytes);
+printf("%10"PRId64", 0x%08"PRIx32"\n", fr->pts, crc);
+if (no_seeking) {
+if (add_crc_to_array(crc, fr->pts) < 0)
+return -1;
+}
+else {
+if (compare_crc_in_array(crc, fr->pts) < 0)
+return -1;
 }
+av_frame_unref(fr);
 }
-av_packet_unref(&pkt);
-av_ini

[FFmpeg-devel] [PATCH 7/7] Handle AVID MJPEG streams directly in the MJPEG decoder.

2020-12-12 Thread Anton Khirnov
AVID streams, currently handled by the AVRN decoder can be (depending on
extradata contents) either MJPEG or raw video. To decode the MJPEG
variant, the AVRN decoder currently instantiates a MJPEG decoder
internally and forwards decoded frames to the caller (possibly after
cropping them).

This is suboptimal, because the AVRN decoder does not forward all the
features of the internal MJPEG decoder, such as direct rendering.
Handling such forwarding in a full and generic manner would be quite
hard, so it is simpler to just handle those streams in the MJPEG decoder
directly.

The AVRN decoder, which now handles only the raw streams, can now be
marked as supporting direct rendering.

This also removes the last remaining internal use of the obsolete
decoding API.
---
 libavcodec/avrndec.c  | 74 ++-
 libavcodec/mjpegdec.c | 11 +++
 libavcodec/version.h  |  2 +-
 libavformat/avidec.c  |  6 
 libavformat/isom.c|  2 +-
 libavformat/version.h |  2 +-
 tests/fate/video.mak  |  2 +-
 7 files changed, 23 insertions(+), 76 deletions(-)

diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index d85e3c2000..a80851cefa 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -21,13 +21,10 @@
 
 #include "avcodec.h"
 #include "internal.h"
-#include "mjpeg.h"
-#include "mjpegdec.h"
+
 #include "libavutil/imgutils.h"
 
 typedef struct {
-AVCodecContext *mjpeg_avctx;
-int is_mjpeg;
 int interlace;
 int tff;
 } AVRnContext;
@@ -37,42 +34,6 @@ static av_cold int init(AVCodecContext *avctx)
 AVRnContext *a = avctx->priv_data;
 int ret;
 
-// Support "Resolution 1:1" for Avid AVI Codec
-a->is_mjpeg = avctx->extradata_size < 31 || memcmp(&avctx->extradata[28], 
"1:1", 3);
-
-if(!a->is_mjpeg && avctx->lowres) {
-av_log(avctx, AV_LOG_ERROR, "lowres is not possible with rawvideo\n");
-return AVERROR(EINVAL);
-}
-
-if(a->is_mjpeg) {
-const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG);
-AVDictionary *thread_opt = NULL;
-if (!codec) {
-av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n");
-return AVERROR_DECODER_NOT_FOUND;
-}
-
-a->mjpeg_avctx = avcodec_alloc_context3(codec);
-if (!a->mjpeg_avctx)
-return AVERROR(ENOMEM);
-
-av_dict_set(&thread_opt, "threads", "1", 0); // Is this needed ?
-a->mjpeg_avctx->refcounted_frames = 1;
-a->mjpeg_avctx->flags = avctx->flags;
-a->mjpeg_avctx->idct_algo = avctx->idct_algo;
-a->mjpeg_avctx->lowres = avctx->lowres;
-a->mjpeg_avctx->width = avctx->width;
-a->mjpeg_avctx->height = avctx->height;
-
-if ((ret = avcodec_open2(a->mjpeg_avctx, codec, &thread_opt)) < 0) {
-av_log(avctx, AV_LOG_ERROR, "MJPEG codec failed to open\n");
-}
-av_dict_free(&thread_opt);
-
-return ret;
-}
-
 if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
 return ret;
 
@@ -89,15 +50,6 @@ static av_cold int init(AVCodecContext *avctx)
 return 0;
 }
 
-static av_cold int end(AVCodecContext *avctx)
-{
-AVRnContext *a = avctx->priv_data;
-
-avcodec_free_context(&a->mjpeg_avctx);
-
-return 0;
-}
-
 static int decode_frame(AVCodecContext *avctx, void *data,
 int *got_frame, AVPacket *avpkt)
 {
@@ -107,28 +59,6 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 int buf_size   = avpkt->size;
 int y, ret, true_height;
 
-if(a->is_mjpeg) {
-ret = avcodec_decode_video2(a->mjpeg_avctx, data, got_frame, avpkt);
-
-if (ret >= 0 && *got_frame && avctx->width <= p->width && 
avctx->height <= p->height) {
-int shift = p->height - avctx->height;
-int subsample_h, subsample_v;
-
-av_pix_fmt_get_chroma_sub_sample(p->format, &subsample_h, 
&subsample_v);
-
-p->data[0] += p->linesize[0] * shift;
-if (p->data[2]) {
-p->data[1] += p->linesize[1] * (shift>>subsample_v);
-p->data[2] += p->linesize[2] * (shift>>subsample_v);
-}
-
-p->width  = avctx->width;
-p->height = avctx->height;
-}
-avctx->pix_fmt = a->mjpeg_avctx->pix_fmt;
-return ret;
-}
-
 true_height= buf_size / (2*avctx->width);
 
 if(buf_size < 2*avctx->width * avctx->height) {
@@ -167,8 +97,8 @@ AVCodec ff_avrn_decoder = {
 .id = AV_CODEC_ID_AVRN,
 .priv_data_size = sizeof(AVRnContext),
 .init   = init,
-.close  = end,
 .decode = decode_frame,
 .max_lowres = 3,
+.capabilities   = AV_CODEC_CAP_DR1,
 .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 };
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index ea3f125cca..39a05db35b 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpeg

[FFmpeg-devel] [PATCH 2/7] api-h264-test: use non-obsolete decoding API

2020-12-12 Thread Anton Khirnov
---
 tests/api/api-h264-test.c | 85 ---
 1 file changed, 53 insertions(+), 32 deletions(-)

diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c
index 678a1ea166..04bdfbc9d2 100644
--- a/tests/api/api-h264-test.c
+++ b/tests/api/api-h264-test.c
@@ -37,15 +37,13 @@ static int video_decode_example(const char *input_filename)
 AVCodecParameters *origin_par = NULL;
 AVFrame *fr = NULL;
 uint8_t *byte_buffer = NULL;
-AVPacket pkt;
+AVPacket *pkt;
 AVFormatContext *fmt_ctx = NULL;
 int number_of_written_bytes;
 int video_stream;
-int got_frame = 0;
 int byte_buffer_size;
 int i = 0;
 int result;
-int end_of_stream = 0;
 
 result = avformat_open_input(&fmt_ctx, input_filename, NULL, NULL);
 if (result < 0) {
@@ -97,6 +95,12 @@ static int video_decode_example(const char *input_filename)
 return AVERROR(ENOMEM);
 }
 
+pkt = av_packet_alloc();
+if (!pkt) {
+av_log(NULL, AV_LOG_ERROR, "Cannot allocate packet\n");
+return AVERROR(ENOMEM);
+}
+
 byte_buffer_size = av_image_get_buffer_size(ctx->pix_fmt, ctx->width, 
ctx->height, 16);
 byte_buffer = av_malloc(byte_buffer_size);
 if (!byte_buffer) {
@@ -106,43 +110,60 @@ static int video_decode_example(const char 
*input_filename)
 
 printf("#tb %d: %d/%d\n", video_stream, 
fmt_ctx->streams[video_stream]->time_base.num, 
fmt_ctx->streams[video_stream]->time_base.den);
 i = 0;
-av_init_packet(&pkt);
-do {
-if (!end_of_stream)
-if (av_read_frame(fmt_ctx, &pkt) < 0)
-end_of_stream = 1;
-if (end_of_stream) {
-pkt.data = NULL;
-pkt.size = 0;
+
+result = 0;
+while (result >= 0) {
+result = av_read_frame(fmt_ctx, pkt);
+if (result >= 0 && pkt->stream_index != video_stream) {
+av_packet_unref(pkt);
+continue;
+}
+
+if (result < 0)
+result = avcodec_send_packet(ctx, NULL);
+else {
+if (pkt->pts == AV_NOPTS_VALUE)
+pkt->pts = pkt->dts = i;
+result = avcodec_send_packet(ctx, pkt);
 }
-if (pkt.stream_index == video_stream || end_of_stream) {
-got_frame = 0;
-if (pkt.pts == AV_NOPTS_VALUE)
-pkt.pts = pkt.dts = i;
-result = avcodec_decode_video2(ctx, fr, &got_frame, &pkt);
-if (result < 0) {
+av_packet_unref(pkt);
+
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Error submitting a packet for 
decoding\n");
+return result;
+}
+
+while (result >= 0) {
+result = avcodec_receive_frame(ctx, fr);
+if (result == AVERROR_EOF)
+goto finish;
+else if (result == AVERROR(EAGAIN)) {
+result = 0;
+break;
+} else if (result < 0) {
 av_log(NULL, AV_LOG_ERROR, "Error decoding frame\n");
 return result;
 }
-if (got_frame) {
-number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, 
byte_buffer_size,
-(const uint8_t* const *)fr->data, 
(const int*) fr->linesize,
-ctx->pix_fmt, ctx->width, ctx->height, 
1);
-if (number_of_written_bytes < 0) {
-av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
-return number_of_written_bytes;
-}
-printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n", video_stream,
-   av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), 
fr->pkt_duration,
-   number_of_written_bytes, av_adler32_update(0, (const 
uint8_t*)byte_buffer, number_of_written_bytes));
+
+number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, 
byte_buffer_size,
+(const uint8_t* const *)fr->data, (const 
int*) fr->linesize,
+ctx->pix_fmt, ctx->width, ctx->height, 1);
+if (number_of_written_bytes < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
+av_frame_unref(fr);
+return number_of_written_bytes;
 }
-av_packet_unref(&pkt);
-av_init_packet(&pkt);
+printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n", video_stream,
+   av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), 
fr->pkt_duration,
+   number_of_written_bytes, av_adler32_update(0, (const 
uint8_t*)byte_buffer, number_of_written_bytes));
+
+av_frame_unref(fr);
 }
 i++;
-} while (!end_of_stream || got_frame);
+}
 
-av_packet_unref(&pkt);
+finish:
+av_packet_free(&pkt);
 av_frame_free(&fr);
 avformat_close_input(

Re: [FFmpeg-devel] [PATCH 5/7] fate: add tests for AVID

2020-12-12 Thread Anton Khirnov
Can someone with write access to FATE samples please put
https://0x0.st/iFsU.mov -> avid/avidmeridianntsc.mov
https://0x0.st/iFsD.avi -> avid/avid_ntsc_interlaced.avi

Thanks,
-- 
Anton Khirnov
___
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".

[FFmpeg-devel] Call for maintainers: vf_uspp, vf_mcdeint

2020-12-12 Thread Anton Khirnov
Hi,
as we are approaching the next major bump, vf_mcdeint and vf_uspp
filters are still using deprecated libavcodec APIs.

Does anyone care about preserving and maintaining them? If so, please
step forward and make them work with non-deprecated APIs.

-- 
Anton Khirnov
___
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 5/7] fate: add tests for AVID

2020-12-12 Thread James Almer

On 12/12/2020 12:51 PM, Anton Khirnov wrote:

Can someone with write access to FATE samples please put
https://0x0.st/iFsU.mov -> avid/avidmeridianntsc.mov
https://0x0.st/iFsD.avi -> avid/avid_ntsc_interlaced.avi

Thanks,


Done.
___
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 1/2] avformat/wtvdec: Check for EOF before potentially reseting the eof state

2020-12-12 Thread Peter Ross
On Sat, Dec 12, 2020 at 12:38:43PM +0100, Michael Niedermayer wrote:
> Fixes: infinite loop
> Fixes: 
> 28042/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6311288967528448
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/wtvdec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
> index 77908e6392..6c41e3c1a3 100644
> --- a/libavformat/wtvdec.c
> +++ b/libavformat/wtvdec.c
> @@ -953,6 +953,9 @@ static int parse_chunks(AVFormatContext *s, int mode, 
> int64_t seekts, int *len_p
>  } else
>  av_log(s, AV_LOG_WARNING, "unsupported chunk:"FF_PRI_GUID"\n", 
> FF_ARG_GUID(g));
>  
> +if (avio_feof(pb))
> +break;
> +
>  avio_skip(pb, WTV_PAD8(len) - consumed);
>  }
>  return AVERROR_EOF;
> -- 
> 2.17.1

curious how the infinte loop occurs here, as the while loop already tests 
avio_feof().

i suspect it is because the fuzzed case results in 'consumed > len', and 
therefore avio_skip is seeking backwards.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: PGP signature
___
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] fate: fix fate-filter-hqx on BE arches

2020-12-12 Thread Andriy Gelman
On Sat, 05. Dec 23:51, Michael Niedermayer wrote:
> On Fri, Dec 04, 2020 at 09:26:11PM -0500, Andriy Gelman wrote:
> > From: Andriy Gelman 
> > 
> > One of the inputs to the fate test has an rgba pixel format which needs
> > to be converted to rgb32 (argb on BE) for the hqx filter. Because auto
> > scaling in the fate test is disabled, this needs a separate scale
> > filter.
> > 
> > Signed-off-by: Andriy Gelman 
> > ---
> >  tests/fate/filter-video.mak | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> probably ok (cant test on MIPS atm)
> 

will apply and enable the tests on patchwork.

--
Andriy
___
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] swscale/rgb2rgb_template: use shuffle macro on BE arches

2020-12-12 Thread Andriy Gelman
On Wed, 02. Dec 22:09, Michael Niedermayer wrote:
> On Mon, Nov 30, 2020 at 12:46:51AM -0500, Andriy Gelman wrote:
> > From: Andriy Gelman 
> > 
> > Fixes fate-qtrle-32bit on PPC64 qemu
> 
> also fixes this on mips-qemu

> 
> LGTM
> 
> thx
> 

thanks, will apply and enable the test.

--
Andriy
___
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] swscale/rgb2rgb_template: use shuffle macro on BE arches

2020-12-12 Thread Carl Eugen Hoyos
Am Sa., 12. Dez. 2020 um 23:41 Uhr schrieb Andriy Gelman
:
>
> On Wed, 02. Dec 22:09, Michael Niedermayer wrote:
> > On Mon, Nov 30, 2020 at 12:46:51AM -0500, Andriy Gelman wrote:
> > > From: Andriy Gelman 
> > >
> > > Fixes fate-qtrle-32bit on PPC64 qemu
> >
> > also fixes this on mips-qemu
>
> >
> > LGTM
> >
> > thx
> >
>
> thanks, will apply and enable the test.

Please mention big-endian (instead of ppc64) in the commit message.

Carl Eugen
___
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 2/2] avformat/voc_packet: Add a basic check on max_size

2020-12-12 Thread Michael Niedermayer
On Sat, Dec 12, 2020 at 12:38:44PM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 
> 'int'
> Fixes: 
> 28127/clusterfuzz-testcase-minimized-ffmpeg_dem_VOC_fuzzer-4880586455646208
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/voc_packet.c | 2 ++
>  1 file changed, 2 insertions(+)

ill send a better patch, no need to review this

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Nations do behave wisely once they have exhausted all other alternatives. 
-- Abba Eban


signature.asc
Description: PGP signature
___
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 1/1] avformat/mov: fix timecode with counter mode flag set

2020-12-12 Thread Mark Reid
On Sat, Nov 28, 2020 at 8:08 PM  wrote:

> From: Mark Reid 
>
> The current behaviour ends up squaring the avg_frame_rate if the conter
> mode flag is set.
> This messes up the timecode calculation, and looks to me as a regression
> that
> seems to have been introduced 428b4aac.
>
> The new behaviour is use the "Number of frames" field for avg_frame_rate
> from the timecode atom as describe here:
>
> https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP4939-CH205-69831
>
> Number of frames
> An 8-bit integer that contains the number of frames per second for the
> timecode format.
> If the time is a counter, this is the number of frames for each
> counter tick.
>
> Here is a sample mov file with the counter flag set
> https://www.dropbox.com/s/5l4fucb9lhq523s/timecode_counter_mode.mov
>
> before the patch ffmpeg will report the timecode as:
> 00:37:11:97 and warns that the timecode framerate is 57600/1002001
>
> after patch:
> 14:50:55:02
>
> ---
>  libavformat/mov.c | 17 +
>  1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 2b90e31170..76c1ceb82a 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -2336,24 +2336,17 @@ static int mov_parse_stsd_data(MOVContext *c,
> AVIOContext *pb,
>  tmcd_ctx->tmcd_flags = val;
>  st->avg_frame_rate.num = AV_RB32(st->codecpar->extradata +
> 8); /* timescale */
>  st->avg_frame_rate.den = AV_RB32(st->codecpar->extradata +
> 12); /* frameDuration */
> -#if FF_API_LAVF_AVCTX
> -FF_DISABLE_DEPRECATION_WARNINGS
> -st->codec->time_base = av_inv_q(st->avg_frame_rate);
> -FF_ENABLE_DEPRECATION_WARNINGS
> -#endif
> +
>  /* adjust for per frame dur in counter mode */
>  if (tmcd_ctx->tmcd_flags & 0x0008) {
> -int timescale = AV_RB32(st->codecpar->extradata + 8);
> -int framedur = AV_RB32(st->codecpar->extradata + 12);
> -st->avg_frame_rate.num *= timescale;
> -st->avg_frame_rate.den *= framedur;
> +st->avg_frame_rate.num = st->codecpar->extradata[16] /*
> fps, frames per counter tick in counter mode */;
> +st->avg_frame_rate.den = 1;
> +}
>  #if FF_API_LAVF_AVCTX
>  FF_DISABLE_DEPRECATION_WARNINGS
> -st->codec->time_base.den *= timescale;
> -st->codec->time_base.num *= framedur;
> +st->codec->time_base = av_inv_q(st->avg_frame_rate);
>  FF_ENABLE_DEPRECATION_WARNINGS
>  #endif
> -}
>  if (size > 30) {
>  uint32_t len = AV_RB32(st->codecpar->extradata + 18); /*
> name atom length */
>  uint32_t format = AV_RB32(st->codecpar->extradata + 22);
> --
> 2.29.2
>
>
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 7/7] Handle AVID MJPEG streams directly in the MJPEG decoder.

2020-12-12 Thread James Almer

On 12/12/2020 12:45 PM, Anton Khirnov wrote:

AVID streams, currently handled by the AVRN decoder can be (depending on
extradata contents) either MJPEG or raw video. To decode the MJPEG
variant, the AVRN decoder currently instantiates a MJPEG decoder
internally and forwards decoded frames to the caller (possibly after
cropping them).

This is suboptimal, because the AVRN decoder does not forward all the
features of the internal MJPEG decoder, such as direct rendering.
Handling such forwarding in a full and generic manner would be quite
hard, so it is simpler to just handle those streams in the MJPEG decoder
directly.

The AVRN decoder, which now handles only the raw streams, can now be
marked as supporting direct rendering.

This also removes the last remaining internal use of the obsolete
decoding API.
---
  libavcodec/avrndec.c  | 74 ++-
  libavcodec/mjpegdec.c | 11 +++
  libavcodec/version.h  |  2 +-
  libavformat/avidec.c  |  6 
  libavformat/isom.c|  2 +-
  libavformat/version.h |  2 +-
  tests/fate/video.mak  |  2 +-
  7 files changed, 23 insertions(+), 76 deletions(-)

diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index d85e3c2000..a80851cefa 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -21,13 +21,10 @@
  
  #include "avcodec.h"

  #include "internal.h"
-#include "mjpeg.h"
-#include "mjpegdec.h"


You can probably also remove the jpegtables dep in configure and the 
mjpegdec.o entry in Makefile for the avrn decoder.



+
  #include "libavutil/imgutils.h"
  
  typedef struct {

-AVCodecContext *mjpeg_avctx;
-int is_mjpeg;
  int interlace;
  int tff;
  } AVRnContext;
@@ -37,42 +34,6 @@ static av_cold int init(AVCodecContext *avctx)
  AVRnContext *a = avctx->priv_data;
  int ret;
  
-// Support "Resolution 1:1" for Avid AVI Codec

-a->is_mjpeg = avctx->extradata_size < 31 || memcmp(&avctx->extradata[28], 
"1:1", 3);
-
-if(!a->is_mjpeg && avctx->lowres) {
-av_log(avctx, AV_LOG_ERROR, "lowres is not possible with rawvideo\n");
-return AVERROR(EINVAL);
-}
-
-if(a->is_mjpeg) {
-const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG);
-AVDictionary *thread_opt = NULL;
-if (!codec) {
-av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n");
-return AVERROR_DECODER_NOT_FOUND;
-}
-
-a->mjpeg_avctx = avcodec_alloc_context3(codec);
-if (!a->mjpeg_avctx)
-return AVERROR(ENOMEM);
-
-av_dict_set(&thread_opt, "threads", "1", 0); // Is this needed ?
-a->mjpeg_avctx->refcounted_frames = 1;
-a->mjpeg_avctx->flags = avctx->flags;
-a->mjpeg_avctx->idct_algo = avctx->idct_algo;
-a->mjpeg_avctx->lowres = avctx->lowres;
-a->mjpeg_avctx->width = avctx->width;
-a->mjpeg_avctx->height = avctx->height;
-
-if ((ret = avcodec_open2(a->mjpeg_avctx, codec, &thread_opt)) < 0) {
-av_log(avctx, AV_LOG_ERROR, "MJPEG codec failed to open\n");
-}
-av_dict_free(&thread_opt);
-
-return ret;
-}
-
  if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 
0)
  return ret;
  
@@ -89,15 +50,6 @@ static av_cold int init(AVCodecContext *avctx)

  return 0;
  }
  
-static av_cold int end(AVCodecContext *avctx)

-{
-AVRnContext *a = avctx->priv_data;
-
-avcodec_free_context(&a->mjpeg_avctx);
-
-return 0;
-}
-
  static int decode_frame(AVCodecContext *avctx, void *data,
  int *got_frame, AVPacket *avpkt)
  {
@@ -107,28 +59,6 @@ static int decode_frame(AVCodecContext *avctx, void *data,
  int buf_size   = avpkt->size;
  int y, ret, true_height;
  
-if(a->is_mjpeg) {

-ret = avcodec_decode_video2(a->mjpeg_avctx, data, got_frame, avpkt);
-
-if (ret >= 0 && *got_frame && avctx->width <= p->width && avctx->height 
<= p->height) {
-int shift = p->height - avctx->height;
-int subsample_h, subsample_v;
-
-av_pix_fmt_get_chroma_sub_sample(p->format, &subsample_h, 
&subsample_v);
-
-p->data[0] += p->linesize[0] * shift;
-if (p->data[2]) {
-p->data[1] += p->linesize[1] * (shift>>subsample_v);
-p->data[2] += p->linesize[2] * (shift>>subsample_v);
-}
-
-p->width  = avctx->width;
-p->height = avctx->height;
-}
-avctx->pix_fmt = a->mjpeg_avctx->pix_fmt;
-return ret;
-}
-
  true_height= buf_size / (2*avctx->width);
  
  if(buf_size < 2*avctx->width * avctx->height) {

@@ -167,8 +97,8 @@ AVCodec ff_avrn_decoder = {
  .id = AV_CODEC_ID_AVRN,
  .priv_data_size = sizeof(AVRnContext),
  .init   = init,
-.close  = end,
  .decode = decode_frame,
  .max_lowres = 3,
+.capabilities   = AV_CODEC_CAP_DR1,
  .ca

[FFmpeg-devel] [PATCH 2/5] avcodec/h2645_parse: Reduce the initial skipped_bytes_pos size with small inputs

2020-12-12 Thread Michael Niedermayer
Fixes: OOM
Fixes: 
23817/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-6300869057576960
Fixes: 
28055/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5706035297517568

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/h2645_parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 0f98b49fbe..af0b594c20 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -467,7 +467,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t 
*buf, int length,
 memset(pkt->nals + pkt->nals_allocated, 0, sizeof(*pkt->nals));
 
 nal = &pkt->nals[pkt->nb_nals];
-nal->skipped_bytes_pos_size = 1024; // initial buffer size
+nal->skipped_bytes_pos_size = FFMIN(1024, extract_length/3+1); // 
initial buffer size
 nal->skipped_bytes_pos = 
av_malloc_array(nal->skipped_bytes_pos_size, sizeof(*nal->skipped_bytes_pos));
 if (!nal->skipped_bytes_pos)
 return AVERROR(ENOMEM);
-- 
2.17.1

___
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".

[FFmpeg-devel] [PATCH 4/5] avformat/aadec: Check for EOF while reading chapters

2020-12-12 Thread Michael Niedermayer
Fixes: timeout
Fixes: 
28199/clusterfuzz-testcase-minimized-ffmpeg_dem_AA_fuzzer-4896162657861632

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/aadec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/aadec.c b/libavformat/aadec.c
index 63f8176a57..612e66906d 100644
--- a/libavformat/aadec.c
+++ b/libavformat/aadec.c
@@ -223,7 +223,8 @@ static int aa_read_header(AVFormatContext *s)
 while ((chapter_pos = avio_tell(pb)) >= 0 && chapter_pos < c->content_end) 
{
 int chapter_idx = s->nb_chapters;
 uint32_t chapter_size = avio_rb32(pb);
-if (chapter_size == 0) break;
+if (chapter_size == 0 || avio_feof(pb))
+break;
 chapter_pos -= start + CHAPTER_HEADER_SIZE * chapter_idx;
 avio_skip(pb, 4 + chapter_size);
 if (!avpriv_new_chapter(s, chapter_idx, st->time_base,
-- 
2.17.1

___
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".

[FFmpeg-devel] [PATCH 1/5] avformat/voc_packet: Add a basic check on max_size

2020-12-12 Thread Michael Niedermayer
Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 
'int'
Fixes: 
28127/clusterfuzz-testcase-minimized-ffmpeg_dem_VOC_fuzzer-4880586455646208

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/voc_packet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/voc_packet.c b/libavformat/voc_packet.c
index 1e2e19e1c3..9d7d2025cd 100644
--- a/libavformat/voc_packet.c
+++ b/libavformat/voc_packet.c
@@ -44,6 +44,8 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream 
*st, int max_size)
AVINDEX_KEYFRAME);
 
 while (!voc->remaining_size) {
+if (max_size < 4)
+max_size = 0;
 type = avio_r8(pb);
 if (type == VOC_TYPE_EOF)
 return AVERROR_EOF;
-- 
2.17.1

___
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".

[FFmpeg-devel] [PATCH 3/5] avformat/mpegts: Check pcr_incr before setting bitrate

2020-12-12 Thread Michael Niedermayer
Fixes: division by zero
Fixes: 
26459/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTSRAW_fuzzer-5666350112178176
Fixes: 
28154/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTSRAW_fuzzer-5195728439476224

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/mpegts.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 7549fc91c9..470fdf1272 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -3140,8 +3140,10 @@ static int mpegts_read_header(AVFormatContext *s)
 /* NOTE2: it is only the bitrate of the start of the stream */
 ts->pcr_incr = (pcrs[1] - pcrs[0]) / (packet_count[1] - 
packet_count[0]);
 ts->cur_pcr  = pcrs[0] - ts->pcr_incr * packet_count[0];
-s->bit_rate  = TS_PACKET_SIZE * 8 * 2700LL / ts->pcr_incr;
-st->codecpar->bit_rate = s->bit_rate;
+if (ts->pcr_incr) {
+s->bit_rate  = TS_PACKET_SIZE * 8 * 2700LL / ts->pcr_incr;
+st->codecpar->bit_rate = s->bit_rate;
+}
 st->start_time  = ts->cur_pcr;
 av_log(ts->stream, AV_LOG_TRACE, "start=%0.3f pcr=%0.3f incr=%d\n",
 st->start_time / 100.0, pcrs[0] / 27e6, ts->pcr_incr);
-- 
2.17.1

___
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".

[FFmpeg-devel] [PATCH 5/5] avformat/mov: Extend data_size check in mov_read_udta_string()

2020-12-12 Thread Michael Niedermayer
Fixes: signed integer overflow: -2147483634 - 16 cannot be represented in type 
'int'
Fixes: 
28322/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5711888402612224

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 710a15dea8..5d526a634d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -402,7 +402,7 @@ retry:
 if (c->itunes_metadata && atom.size > 8) {
 int data_size = avio_rb32(pb);
 int tag = avio_rl32(pb);
-if (tag == MKTAG('d','a','t','a') && data_size <= atom.size) {
+if (tag == MKTAG('d','a','t','a') && data_size <= atom.size && 
data_size >= 16) {
 data_type = avio_rb32(pb); // type
 avio_rb32(pb); // unknown
 str_size = data_size - 16;
-- 
2.17.1

___
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".

[FFmpeg-devel] [PATCH 1/3] avcodec/decode: set best_effort_timestamp on output frames for all decoders

2020-12-12 Thread James Almer
Fixes a decoding regression introduced by e9a2a87773, and as a side effect also
fixes bogus values set to certain audio frames that had some samples discarded,
where the offsets added to pts, pkt_dts and pkt_duration were not reflected in
best_effort_timestamp.

Signed-off-by: James Almer 
---
 libavcodec/decode.c| 11 ---
 tests/ref/fate/exif-image-embedded |  4 ++--
 tests/ref/fate/gaplessinfo-itunes1 |  2 +-
 tests/ref/fate/gaplessinfo-itunes2 |  2 +-
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 5a1849f944..d804b0bed0 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -372,10 +372,6 @@ static inline int decode_simple_internal(AVCodecContext 
*avctx, AVFrame *frame,
 if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
 if (frame->flags & AV_FRAME_FLAG_DISCARD)
 got_frame = 0;
-if (got_frame)
-frame->best_effort_timestamp = guess_correct_pts(avctx,
- frame->pts,
- frame->pkt_dts);
 } else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) {
 uint8_t *side;
 int side_size;
@@ -384,9 +380,6 @@ static inline int decode_simple_internal(AVCodecContext 
*avctx, AVFrame *frame,
 uint8_t discard_reason = 0;
 
 if (ret >= 0 && got_frame) {
-frame->best_effort_timestamp = guess_correct_pts(avctx,
- frame->pts,
- frame->pkt_dts);
 if (frame->format == AV_SAMPLE_FMT_NONE)
 frame->format = avctx->sample_fmt;
 if (!frame->channel_layout)
@@ -579,6 +572,10 @@ static int decode_receive_frame_internal(AVCodecContext 
*avctx, AVFrame *frame)
 avci->draining_done = 1;
 
 if (!ret) {
+frame->best_effort_timestamp = guess_correct_pts(avctx,
+ frame->pts,
+ frame->pkt_dts);
+
 /* the only case where decode data is not set should be decoders
  * that do not call ff_get_buffer() */
 av_assert0((frame->private_ref && frame->private_ref->size == 
sizeof(FrameDecodeData)) ||
diff --git a/tests/ref/fate/exif-image-embedded 
b/tests/ref/fate/exif-image-embedded
index 392c145efb..d9239b3c83 100644
--- a/tests/ref/fate/exif-image-embedded
+++ b/tests/ref/fate/exif-image-embedded
@@ -44,8 +44,8 @@ pkt_pts=353600
 pkt_pts_time=0.025057
 pkt_dts=353600
 pkt_dts_time=0.025057
-best_effort_timestamp=0
-best_effort_timestamp_time=0.00
+best_effort_timestamp=353600
+best_effort_timestamp_time=0.025057
 pkt_duration=15040
 pkt_duration_time=0.001066
 pkt_pos=16292
diff --git a/tests/ref/fate/gaplessinfo-itunes1 
b/tests/ref/fate/gaplessinfo-itunes1
index bb5c09ad34..c10e4cccfd 100644
--- a/tests/ref/fate/gaplessinfo-itunes1
+++ b/tests/ref/fate/gaplessinfo-itunes1
@@ -24,7 +24,7 @@ packet|pts=1291264|dts=1291264|duration=1024|flags=K_
 packet|pts=1292288|dts=1292288|duration=1024|flags=K_
 packet|pts=1293312|dts=1293312|duration=1024|flags=K_
 stream|nb_read_packets=1264
-frame|pkt_pts=2112|pkt_dts=2112|best_effort_timestamp=2048|pkt_duration=960|nb_samples=960
+frame|pkt_pts=2112|pkt_dts=2112|best_effort_timestamp=2112|pkt_duration=960|nb_samples=960
 
frame|pkt_pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=4096|pkt_dts=4096|best_effort_timestamp=4096|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=5120|pkt_dts=5120|best_effort_timestamp=5120|pkt_duration=1024|nb_samples=1024
diff --git a/tests/ref/fate/gaplessinfo-itunes2 
b/tests/ref/fate/gaplessinfo-itunes2
index 0603ba8bf2..752b953197 100644
--- a/tests/ref/fate/gaplessinfo-itunes2
+++ b/tests/ref/fate/gaplessinfo-itunes2
@@ -24,7 +24,7 @@ packet|pts=102400|dts=102400|duration=1024|flags=K_
 packet|pts=103424|dts=103424|duration=1024|flags=K_
 packet|pts=104448|dts=104448|duration=1024|flags=K_
 stream|nb_read_packets=103
-frame|pkt_pts=2112|pkt_dts=2112|best_effort_timestamp=2048|pkt_duration=960|nb_samples=960
+frame|pkt_pts=2112|pkt_dts=2112|best_effort_timestamp=2112|pkt_duration=960|nb_samples=960
 
frame|pkt_pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=4096|pkt_dts=4096|best_effort_timestamp=4096|pkt_duration=1024|nb_samples=1024
 
frame|pkt_pts=5120|pkt_dts=5120|best_effort_timestamp=5120|pkt_duration=1024|nb_samples=1024
-- 
2.29.2

___
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".

[FFmpeg-devel] [PATCH 2/3] avcodec/mjpegdec: stop setting AVFrame->best_effort_timestamp

2020-12-12 Thread James Almer
It's now set by the generic decode code.

Signed-off-by: James Almer 
---
 libavcodec/mjpegdec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 82098e4295..11fb809c10 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2605,7 +2605,6 @@ eoi_parser:
 s->got_picture = 0;
 
 frame->pkt_dts = s->pkt->dts;
-frame->best_effort_timestamp = s->pkt->pts;
 
 if (!s->lossless) {
 int qp = FFMAX3(s->qscale[0],
-- 
2.29.2

___
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".

[FFmpeg-devel] [PATCH 3/3] avcodec/libdav1d: stop setting AVFrame->best_effort_timestamp

2020-12-12 Thread James Almer
It's now set by the generic decode code.

Signed-off-by: James Almer 
---
 libavcodec/libdav1d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index de57bce33d..383e4557b4 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -313,7 +313,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, 
AVFrame *frame)
 }
 
 // match timestamps and packet size
-frame->pts = frame->best_effort_timestamp = p->m.timestamp;
+frame->pts = p->m.timestamp;
 #if FF_API_PKT_PTS
 FF_DISABLE_DEPRECATION_WARNINGS
 frame->pkt_pts = p->m.timestamp;
-- 
2.29.2

___
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] swscale/rgb2rgb_template: use shuffle macro on BE arches

2020-12-12 Thread Andriy Gelman
On Sun, 13. Dec 00:22, Carl Eugen Hoyos wrote:
> Am Sa., 12. Dez. 2020 um 23:41 Uhr schrieb Andriy Gelman
> :
> >
> > On Wed, 02. Dec 22:09, Michael Niedermayer wrote:
> > > On Mon, Nov 30, 2020 at 12:46:51AM -0500, Andriy Gelman wrote:
> > > > From: Andriy Gelman 
> > > >
> > > > Fixes fate-qtrle-32bit on PPC64 qemu
> > >
> > > also fixes this on mips-qemu
> >
> > >
> > > LGTM
> > >
> > > thx
> > >
> >
> > thanks, will apply and enable the test.

> 
> Please mention big-endian (instead of ppc64) in the commit message.

Updated and pushed.

--
Andriy
___
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".