1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/ituh263enc: Inline value of h263_flv

It is always two when we encode FLV1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-06-22 11:00:19 +02:00
parent c660f45f8e
commit 532ae5dc7d
3 changed files with 5 additions and 10 deletions

View File

@ -33,7 +33,7 @@ int ff_flv_encode_picture_header(MPVMainEncContext *const m)
put_bits(&s->pb, 17, 1);
/* 0: H.263 escape codes 1: 11-bit escape codes */
put_bits(&s->pb, 5, (s->c.h263_flv - 1));
put_bits(&s->pb, 5, 1);
put_bits(&s->pb, 8,
(((int64_t) s->c.picture_number * 30 * s->c.avctx->time_base.num) / // FIXME use timestamp
s->c.avctx->time_base.den) & 0xff); /* TemporalReference */

View File

@ -536,7 +536,7 @@ static void h263_encode_block(MPVEncContext *const s, int16_t block[], int n)
code = get_rl_index(rl, last, run, level);
put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
if (code == rl->n) {
if (!CONFIG_FLV_ENCODER || s->c.h263_flv <= 1) {
if (!CONFIG_FLV_ENCODER || s->c.codec_id != AV_CODEC_ID_FLV1) {
put_bits(&s->pb, 1, last);
put_bits(&s->pb, 6, run);
@ -861,13 +861,9 @@ av_cold void ff_h263_encode_init(MPVMainEncContext *const m)
#if CONFIG_FLV_ENCODER
case AV_CODEC_ID_FLV1:
m->encode_picture_header = ff_flv_encode_picture_header;
if (s->c.h263_flv > 1) {
s->min_qcoeff= -1023;
s->max_qcoeff= 1023;
} else {
s->min_qcoeff= -127;
s->max_qcoeff= 127;
}
/* format = 1; 11-bit codes */
s->min_qcoeff = -1023;
s->max_qcoeff = 1023;
break;
#endif
default: //nothing needed - default table already set in mpegvideo.c

View File

@ -936,7 +936,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
break;
case AV_CODEC_ID_FLV1:
s->c.out_format = FMT_H263;
s->c.h263_flv = 2; /* format = 1; 11-bit codes */
s->me.unrestricted_mv = 1;
s->rtp_mode = 0; /* don't allow GOB */
avctx->delay = 0;