From 00ea78f4264a813700e2304c9ba293cb25c375a3 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 22 Jun 2025 11:02:47 +0200 Subject: [PATCH] avcodec/flvdec: Binarize h263_flv It used to be a tri-state encoding both whether to use FLV picture headers and whether to use the FLV way of encoding escape values, but the former is now unnecessary due to the switch to a function pointer for reading the header. So binarize h263_flv. Signed-off-by: Andreas Rheinhardt --- libavcodec/flvdec.c | 4 ++-- libavcodec/h263dec.c | 1 - libavcodec/ituh263dec.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c index c70d79f483..881f63ed1a 100644 --- a/libavcodec/flvdec.c +++ b/libavcodec/flvdec.c @@ -40,7 +40,7 @@ int ff_flv_decode_picture_header(H263DecContext *const h) av_log(h->c.avctx, AV_LOG_ERROR, "Bad picture format\n"); return AVERROR_INVALIDDATA; } - h->c.h263_flv = format + 1; + h->c.h263_flv = format; h->c.picture_number = get_bits(&h->gb, 8); /* picture timestamp */ format = get_bits(&h->gb, 3); switch (format) { @@ -101,7 +101,7 @@ int ff_flv_decode_picture_header(H263DecContext *const h) if (h->c.avctx->debug & FF_DEBUG_PICT_INFO) { av_log(h->c.avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n", h->c.droppable ? 'D' : av_get_picture_type_char(h->c.pict_type), - h->c.h263_flv - 1, h->c.qscale, h->c.picture_number); + h->c.h263_flv, h->c.qscale, h->c.picture_number); } return 0; diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 44c2bee6ac..670d250304 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -155,7 +155,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) #endif #if CONFIG_FLV_DECODER case AV_CODEC_ID_FLV1: - s->h263_flv = 1; h->decode_header = ff_flv_decode_picture_header; break; #endif diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 94cde850b5..0cd5d073ed 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -598,7 +598,7 @@ retry: return -1; } /* escape */ - if (CONFIG_FLV_DECODER && h->c.h263_flv > 1) { + if (CONFIG_FLV_DECODER && h->c.h263_flv) { int is11 = SHOW_UBITS(re, &h->gb, 1); SKIP_CACHE(re, &h->gb, 1); run = SHOW_UBITS(re, &h->gb, 7) + 1;