Showing the changes to libavcodec (4 of 4 files). Show all
Unified · Split
| @@ -350,7 +350,7 @@ static int mpeg1_encode_picture_header(MPVMainEncContext *const m) · 349 unmodified lines | ||
| 350 | 350 | (s->picture_number - mpeg12->gop_picture_number) & 0x3ff); |
| 351 | 351 | put_bits(&s->pb, 3, s->pict_type); |
| 352 | 352 | |
| 353 | − s->vbv_delay_pos = put_bytes_count(&s->pb, 0); | |
| 353 | + m->vbv_delay_pos = put_bytes_count(&s->pb, 0); | |
| 354 | 354 | put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */ |
| 355 | 355 | |
| 356 | 356 | // RAL: Forward f_code also needed for B-frames |
| @@ -401,7 +401,6 @@ typedef struct MpegEncContext { · 400 unmodified lines | ||
| 401 | 401 | |
| 402 | 402 | /* MPEG-1 specific */ |
| 403 | 403 | int last_mv_dir; ///< last mv_dir, used for B-frame encoding |
| 404 | − int vbv_delay_pos; ///< offset of vbv_delay in the bitstream | |
| 405 | 404 | |
| 406 | 405 | /* MPEG-2-specific - I wished not to have to support this mess. */ |
| 407 | 406 | int progressive_sequence; |
| @@ -2023,9 +2023,9 @@ vbv_retry: · 2022 unmodified lines | ||
| 2023 | 2023 | double inbits = avctx->rc_max_rate * |
| 2024 | 2024 | av_q2d(avctx->time_base); |
| 2025 | 2025 | int minbits = m->frame_bits - 8 * |
| 2026 | − (s->vbv_delay_pos - 1); | |
| 2026 | + (m->vbv_delay_pos - 1); | |
| 2027 | 2027 | double bits = m->rc_context.buffer_index + minbits - inbits; |
| 2028 | − uint8_t *const vbv_delay_ptr = s->pb.buf + s->vbv_delay_pos; | |
| 2028 | + uint8_t *const vbv_delay_ptr = s->pb.buf + m->vbv_delay_pos; | |
| 2029 | 2029 | |
| 2030 | 2030 | if (bits < 0) |
| 2031 | 2031 | av_log(avctx, AV_LOG_ERROR, |
| @@ -72,6 +72,9 @@ typedef struct MPVMainEncContext { · 71 unmodified lines | ||
| 72 | 72 | int lmin, lmax; |
| 73 | 73 | int vbv_ignore_qmax; |
| 74 | 74 | |
| 75 | + /* MPEG-1/2 specific */ | |
| 76 | + int vbv_delay_pos; ///< offset of vbv_delay in the bitstream | |
| 77 | + | |
| 75 | 78 | const uint8_t *fcode_tab; ///< smallest fcode needed for each MV |
| 76 | 79 | |
| 77 | 80 | /* frame skip options */ |