replace a few pbBufPtr() by put_bits_count(), one of them was actually wrong

Originally committed as revision 2774 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 21 years ago
parent 80ee9fc0e3
commit cfbd16df75
  1. 6
      libavcodec/mpegvideo.c
  2. 16
      tests/ffmpeg.regression.ref
  3. 16
      tests/rotozoom.regression.ref

@ -2041,7 +2041,7 @@ int MPV_encode_picture(AVCodecContext *avctx,
} }
flush_put_bits(&s->pb); flush_put_bits(&s->pb);
s->frame_bits = (pbBufPtr(&s->pb) - s->pb.buf) * 8; s->frame_bits = put_bits_count(&s->pb);
stuffing_count= ff_vbv_update(s, s->frame_bits); stuffing_count= ff_vbv_update(s, s->frame_bits);
if(stuffing_count){ if(stuffing_count){
@ -2064,7 +2064,7 @@ int MPV_encode_picture(AVCodecContext *avctx,
av_log(s->avctx, AV_LOG_ERROR, "vbv buffer overflow\n"); av_log(s->avctx, AV_LOG_ERROR, "vbv buffer overflow\n");
} }
flush_put_bits(&s->pb); flush_put_bits(&s->pb);
s->frame_bits = (pbBufPtr(&s->pb) - s->pb.buf) * 8; s->frame_bits = put_bits_count(&s->pb);
} }
/* update mpeg1/2 vbv_delay for CBR */ /* update mpeg1/2 vbv_delay for CBR */
@ -4040,7 +4040,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(s->rtp_mode){ if(s->rtp_mode){
int current_packet_size, is_gob_start; int current_packet_size, is_gob_start;
current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob; //FIXME wrong current_packet_size= ((put_bits_count(&s->pb)+7)>>3) - (s->ptr_lastgob - s->pb.buf);
is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0; is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0;

@ -38,19 +38,19 @@ stddev: 0.00 PSNR:99.99 bytes:7602176
e9f63126859b97cd23cd1413038f8f7b *./data/a-mpeg4-rc.avi e9f63126859b97cd23cd1413038f8f7b *./data/a-mpeg4-rc.avi
90a159074b1b109569914ee63f387860 *./data/out.yuv 90a159074b1b109569914ee63f387860 *./data/out.yuv
stddev: 10.18 PSNR:27.96 bytes:7145472 stddev: 10.18 PSNR:27.96 bytes:7145472
c039531bedf6a2fa2dcb81aa4c87b44e *./data/a-mpeg4-adv.avi 6a91dc8f522608b0697886c939607791 *./data/a-mpeg4-adv.avi
87c1cb0f4e0d2217addd9b5074ed4538 *./data/out.yuv a1ad0c3b1652c50dfa3a97b97f984a49 *./data/out.yuv
stddev: 10.23 PSNR:27.92 bytes:7602176 stddev: 10.23 PSNR:27.92 bytes:7602176
af19b439fcbdeb15e45643427ca7df96 *./data/a-mpeg4-thread.avi 1b330a9b4c5e25256934eaf829c77595 *./data/a-mpeg4-thread.avi
7489d8ebadd11eb9c2329c401da06681 *./data/out.yuv d9322fbe12677e4805a4ca855f33a636 *./data/out.yuv
stddev: 12.09 PSNR:26.47 bytes:7145472 stddev: 12.09 PSNR:26.47 bytes:7145472
fb9c77f76543c32fd8b9b6b798831259 *./data/a-error-mpeg4-adv.avi 85c5eb303db25bb0556dc05cdd2dacad *./data/a-error-mpeg4-adv.avi
f5c82f35c4666a9c4ca0a2caa427e567 *./data/out.yuv 7ed8deb5c26930f4b77559b5fab9d5d3 *./data/out.yuv
stddev: 16.80 PSNR:23.61 bytes:7602176 stddev: 17.38 PSNR:23.32 bytes:7602176
4f288e46f8db954a31e1e4e1a7cd6aa8 *./data/a-mpeg4-nr.avi 4f288e46f8db954a31e1e4e1a7cd6aa8 *./data/a-mpeg4-nr.avi
b0b2814c888b987c75c204a82b8e5ab0 *./data/out.yuv b0b2814c888b987c75c204a82b8e5ab0 *./data/out.yuv
stddev: 7.02 PSNR:31.19 bytes:7602176 stddev: 7.02 PSNR:31.19 bytes:7602176
328ebd044362116e274739e23c482ee7 *./data/a-mpeg1b.mpg 30514877003cecd3f976ff377871511f *./data/a-mpeg1b.mpg
788a9d500dc8986231a18076fc80fd73 *./data/out.yuv 788a9d500dc8986231a18076fc80fd73 *./data/out.yuv
stddev: 10.07 PSNR:28.06 bytes:7145472 stddev: 10.07 PSNR:28.06 bytes:7145472
07042f42b3119c39eb26537a84a451df *./data/a-mjpeg.avi 07042f42b3119c39eb26537a84a451df *./data/a-mjpeg.avi

@ -38,19 +38,19 @@ stddev: 0.00 PSNR:99.99 bytes:7602176
6a469f42ce6946dd4c708f9e51e3da6a *./data/a-mpeg4-rc.avi 6a469f42ce6946dd4c708f9e51e3da6a *./data/a-mpeg4-rc.avi
df9de7134d961119705b4e0cabca1f12 *./data/out.yuv df9de7134d961119705b4e0cabca1f12 *./data/out.yuv
stddev: 4.20 PSNR:35.64 bytes:7145472 stddev: 4.20 PSNR:35.64 bytes:7145472
ca4243004b4a1fbbc9d29dc68574beb2 *./data/a-mpeg4-adv.avi 3d37612990e20e335695849387df170a *./data/a-mpeg4-adv.avi
7b58008327a50466cf777a93150cbf2e *./data/out.yuv 1654e08e6bfd63ee213d410edd5fb9c0 *./data/out.yuv
stddev: 4.77 PSNR:34.54 bytes:7602176 stddev: 4.77 PSNR:34.54 bytes:7602176
3dfa2fedd93e9703530f65128bf8765a *./data/a-mpeg4-thread.avi 2bf094c7d3167b9355c03b2a0908e6e2 *./data/a-mpeg4-thread.avi
8165220c38e1d9cf893ed7425ced152c *./data/out.yuv f82c59b99500efb6f0d2af880a315ed1 *./data/out.yuv
stddev: 3.92 PSNR:36.25 bytes:7145472 stddev: 3.92 PSNR:36.25 bytes:7145472
3794994d37b9647190fd7732243b4b24 *./data/a-error-mpeg4-adv.avi 22776b9119bb2fa6b4c7de57b4ffb134 *./data/a-error-mpeg4-adv.avi
016e90cf02cf9c4be346f182945fe979 *./data/out.yuv 66591e021f200f065ec95e9b0f3c5169 *./data/out.yuv
stddev: 9.66 PSNR:28.42 bytes:7602176 stddev: 6.54 PSNR:31.80 bytes:7602176
f68ca13a9b8216aa333968151bcb6ca0 *./data/a-mpeg4-nr.avi f68ca13a9b8216aa333968151bcb6ca0 *./data/a-mpeg4-nr.avi
a014c55328263220911cacc012e6e814 *./data/out.yuv a014c55328263220911cacc012e6e814 *./data/out.yuv
stddev: 4.67 PSNR:34.73 bytes:7602176 stddev: 4.67 PSNR:34.73 bytes:7602176
671802a2c5078e69f7f422765ea87f2a *./data/a-mpeg1b.mpg 26245e57b2dd6e2d9a0ef6d57fe6488d *./data/a-mpeg1b.mpg
d3d5876cef34b728602d5a22eee9249f *./data/out.yuv d3d5876cef34b728602d5a22eee9249f *./data/out.yuv
stddev: 5.93 PSNR:32.66 bytes:7145472 stddev: 5.93 PSNR:32.66 bytes:7145472
e9218a1db885fe0262e88f9df630307d *./data/a-mjpeg.avi e9218a1db885fe0262e88f9df630307d *./data/a-mjpeg.avi

Loading…
Cancel
Save