aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-12-14 01:42:00 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-12-14 01:42:00 +0000
commit7ebfc0ea630e38a9c9653cdc9fe46f8b00e915a9 (patch)
tree4d99bbf321f7947c990d171ecf0deb1f9a4de730 /libavcodec/mpegvideo.c
parentd55f7b6521016250c2f22397454c05fc8ace600a (diff)
downloadffmpeg-7ebfc0ea630e38a9c9653cdc9fe46f8b00e915a9.tar.gz
error concealment regression test
Originally committed as revision 2606 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 7c515aa7fc..5dbe9be91b 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -4002,6 +4002,18 @@ static void encode_picture(MpegEncContext *s, int picture_number)
assert((get_bit_count(&s->pb)&7) == 0);
current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob;
+
+ if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
+ int r= get_bit_count(&s->pb)/8 + s->picture_number + s->codec_id + s->mb_x + s->mb_y;
+ int d= 100 / s->avctx->error_rate;
+ if(r % d == 0){
+ current_packet_size=0;
+#ifndef ALT_BITSTREAM_WRITER
+ s->pb.buf_ptr= s->ptr_lastgob;
+#endif
+ assert(pbBufPtr(&s->pb) == s->ptr_lastgob);
+ }
+ }
if (s->avctx->rtp_callback)
s->avctx->rtp_callback(s->ptr_lastgob, current_packet_size, 0);