Revision ecfd40b3 libavcodec/mpeg12.c

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 */

Also available in: Unified diff