It is always two when we encode FLV1.
Showing the changes to libavcodec (3 of 3 files). Show all
Unified · Split
| @@ -33,7 +33,7 @@ int ff_flv_encode_picture_header(MPVMainEncContext *const m) · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | put_bits(&s->pb, 17, 1); | 34 | put_bits(&s->pb, 17, 1); |
| 35 | /* 0: H.263 escape codes 1: 11-bit escape codes */ | 35 | /* 0: H.263 escape codes 1: 11-bit escape codes */ |
| 36 | put_bits(&s->pb, 5, (s->c.h263_flv - 1)); | 36 | put_bits(&s->pb, 5, 1); |
| 37 | put_bits(&s->pb, 8, | 37 | put_bits(&s->pb, 8, |
| 38 | (((int64_t) s->c.picture_number * 30 * s->c.avctx->time_base.num) / // FIXME use timestamp | 38 | (((int64_t) s->c.picture_number * 30 * s->c.avctx->time_base.num) / // FIXME use timestamp |
| 39 | s->c.avctx->time_base.den) & 0xff); /* TemporalReference */ | 39 | s->c.avctx->time_base.den) & 0xff); /* TemporalReference */ |
| @@ -536,7 +536,7 @@ static void h263_encode_block(MPVEncContext *const s, int16_t block[], int n) · 535 unmodified lines | |||
| 536 | code = get_rl_index(rl, last, run, level); | 536 | code = get_rl_index(rl, last, run, level); |
| 537 | put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); | 537 | put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); |
| 538 | if (code == rl->n) { | 538 | if (code == rl->n) { |
| 539 | if (!CONFIG_FLV_ENCODER || s->c.h263_flv <= 1) { | 539 | if (!CONFIG_FLV_ENCODER || s->c.codec_id != AV_CODEC_ID_FLV1) { |
| 540 | put_bits(&s->pb, 1, last); | 540 | put_bits(&s->pb, 1, last); |
| 541 | put_bits(&s->pb, 6, run); | 541 | put_bits(&s->pb, 6, run); |
| 542 | 542 | ||
| @@ -861,13 +861,9 @@ av_cold void ff_h263_encode_init(MPVMainEncContext *const m) · 318 unmodified lines | |||
| 861 | #if CONFIG_FLV_ENCODER | 861 | #if CONFIG_FLV_ENCODER |
| 862 | case AV_CODEC_ID_FLV1: | 862 | case AV_CODEC_ID_FLV1: |
| 863 | m->encode_picture_header = ff_flv_encode_picture_header; | 863 | m->encode_picture_header = ff_flv_encode_picture_header; |
| 864 | if (s->c.h263_flv > 1) { | 864 | /* format = 1; 11-bit codes */ |
| 865 | s->min_qcoeff= -1023; | 865 | s->min_qcoeff = -1023; |
| 866 | s->max_qcoeff= 1023; | 866 | s->max_qcoeff = 1023; |
| 867 | } else { | ||
| 868 | s->min_qcoeff= -127; | ||
| 869 | s->max_qcoeff= 127; | ||
| 870 | } | ||
| 871 | break; | 867 | break; |
| 872 | #endif | 868 | #endif |
| 873 | default: //nothing needed - default table already set in mpegvideo.c | 869 | default: //nothing needed - default table already set in mpegvideo.c |
| @@ -936,7 +936,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) · 935 unmodified lines | |||
| 936 | break; | 936 | break; |
| 937 | case AV_CODEC_ID_FLV1: | 937 | case AV_CODEC_ID_FLV1: |
| 938 | s->c.out_format = FMT_H263; | 938 | s->c.out_format = FMT_H263; |
| 939 | s->c.h263_flv = 2; /* format = 1; 11-bit codes */ | ||
| 940 | s->me.unrestricted_mv = 1; | 939 | s->me.unrestricted_mv = 1; |
| 941 | s->rtp_mode = 0; /* don't allow GOB */ | 940 | s->rtp_mode = 0; /* don't allow GOB */ |
| 942 | avctx->delay = 0; | 941 | avctx->delay = 0; |