History

avcodec/mpegvideo: Move vbv_delay to Mpeg1Context

Only used there and only by the main thread.

Andreas Rheinhardt committed 4 years ago

Commit c709a3d1 parent 6e225122 files · +3 −3Browse files

Unified · Split

2 files
  1. libavcodec/mpeg12dec.c +3 −2
  2. libavcodec/mpegvideo.h +0 −1
libavcodec/mpeg12dec.c+3−2
@@ -90,6 +90,7 @@ typedef struct Mpeg1Context { · 89 unmodified lines
90 int tmpgexs;90 int tmpgexs;
91 int first_slice;91 int first_slice;
92 int extradata_decoded;92 int extradata_decoded;
93 int vbv_delay;
93 int64_t timecode_frame_start; /*< GOP timecode frame start number, in non drop frame format */94 int64_t timecode_frame_start; /*< GOP timecode frame start number, in non drop frame format */
94} Mpeg1Context;95} Mpeg1Context;
95 96
@@ -953,7 +954,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) · 857 unmodified lines
953 (s->bit_rate != 0x3FFFF*400)) {954 (s->bit_rate != 0x3FFFF*400)) {
954 avctx->rc_max_rate = s->bit_rate;955 avctx->rc_max_rate = s->bit_rate;
955 } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate &&956 } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate &&
956 (s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) {957 (s->bit_rate != 0x3FFFF*400 || s1->vbv_delay != 0xFFFF)) {
957 avctx->bit_rate = s->bit_rate;958 avctx->bit_rate = s->bit_rate;
958 }959 }
959 s1->save_aspect = s->avctx->sample_aspect_ratio;960 s1->save_aspect = s->avctx->sample_aspect_ratio;
@@ -1024,7 +1025,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf, · 64 unmodified lines
1024 return AVERROR_INVALIDDATA;1025 return AVERROR_INVALIDDATA;
1025 1026
1026 vbv_delay = get_bits(&s->gb, 16);1027 vbv_delay = get_bits(&s->gb, 16);
1027 s->vbv_delay = vbv_delay;1028 s1->vbv_delay = vbv_delay;
1028 if (s->pict_type == AV_PICTURE_TYPE_P ||1029 if (s->pict_type == AV_PICTURE_TYPE_P ||
1029 s->pict_type == AV_PICTURE_TYPE_B) {1030 s->pict_type == AV_PICTURE_TYPE_B) {
1030 s->full_pel[0] = get_bits1(&s->gb);1031 s->full_pel[0] = get_bits1(&s->gb);
libavcodec/mpegvideo.h+0−1
@@ -204,7 +204,6 @@ typedef struct MpegEncContext { · 203 unmodified lines
204 int adaptive_quant; ///< use adaptive quantization204 int adaptive_quant; ///< use adaptive quantization
205 int dquant; ///< qscale difference to prev qscale205 int dquant; ///< qscale difference to prev qscale
206 int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...206 int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
207 int vbv_delay;
208 int last_pict_type; //FIXME removes207 int last_pict_type; //FIXME removes
209 int last_non_b_pict_type; ///< used for MPEG-4 gmc B-frames & ratecontrol208 int last_non_b_pict_type; ///< used for MPEG-4 gmc B-frames & ratecontrol
210 int droppable;209 int droppable;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t