Revision ecfd40b3

View differences:

libavcodec/mpeg12.c
142 142
                v = 0x3ffff;
143 143
            put_bits(&s->pb, 18, v);
144 144
            put_bits(&s->pb, 1, 1); /* marker */
145
            /* vbv buffer size: slightly greater than an I frame. We add
146
               some margin just in case */
147
            vbv_buffer_size = (3 * s->I_frame_bits) / (2 * 8);
145

  
146
            if(s->avctx->rc_buffer_size)
147
                vbv_buffer_size = s->avctx->rc_buffer_size;
148
            else
149
                /* VBV calculation: Scaled so that a VCD has the proper VBV size of 40 kilobytes */
150
                vbv_buffer_size = (( 20 * s->bit_rate) / (1151929 / 2)) * 8 * 1024;	 
148 151
            put_bits(&s->pb, 10, (vbv_buffer_size + 16383) / 16384); 
149 152
            put_bits(&s->pb, 1, 1); /* constrained parameter flag */
150 153
            put_bits(&s->pb, 1, 0); /* no custom intra matrix */
tests/ffmpeg.regression.ref
1 1
ffmpeg regression test
2
6c8b6ee8dd9c34f58908fe501d7dbe1e *./data/a-mpeg1.mpg
2
67be2deabb210740966ca5fda9a64bca *./data/a-mpeg1.mpg
3 3
59a66b108e8bbd3867c4ee27f4bbe2ca *./data/out.yuv
4 4
297793ed0fd5793182a92e63ffd764af *./data/a-msmpeg4.avi
5 5
951aa2df4ef4c1eeee3ccc8904de8e48 *./data/out.yuv

Also available in: Unified diff