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
9090 int tmpgexs;
9191 int first_slice;
9292 int extradata_decoded;
93+ int vbv_delay;
9394 int64_t timecode_frame_start; /*< GOP timecode frame start number, in non drop frame format */
9495 } Mpeg1Context;
9596
@@ -953,7 +954,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) · 857 unmodified lines
953954 (s->bit_rate != 0x3FFFF*400)) {
954955 avctx->rc_max_rate = s->bit_rate;
955956 } 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)) {
957958 avctx->bit_rate = s->bit_rate;
958959 }
959960 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
10241025 return AVERROR_INVALIDDATA;
10251026
10261027 vbv_delay = get_bits(&s->gb, 16);
1027− s->vbv_delay = vbv_delay;
1028+ s1->vbv_delay = vbv_delay;
10281029 if (s->pict_type == AV_PICTURE_TYPE_P ||
10291030 s->pict_type == AV_PICTURE_TYPE_B) {
10301031 s->full_pel[0] = get_bits1(&s->gb);
libavcodec/mpegvideo.h+0−1
@@ -204,7 +204,6 @@ typedef struct MpegEncContext { · 203 unmodified lines
204204 int adaptive_quant; ///< use adaptive quantization
205205 int dquant; ///< qscale difference to prev qscale
206206 int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
207− int vbv_delay;
208207 int last_pict_type; //FIXME removes
209208 int last_non_b_pict_type; ///< used for MPEG-4 gmc B-frames & ratecontrol
210209 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