summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-08 02:56:44 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-08 02:56:44 +0000
commitec7e2582ae4e434816fea2e5ff1aba30ce81c9b7 (patch)
tree7b3fad04627f1c9aed372238eb701d7ce92dc1af /libavcodec/mpegvideo_enc.c
parentb80b569242cf4c1a6860f7e94207364c0271f05a (diff)
downloadffmpeg-ec7e2582ae4e434816fea2e5ff1aba30ce81c9b7.tar.gz
fix 4:2:2 psnr
Originally committed as revision 14662 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 1ec9d058b5..f7600beb3c 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2012,6 +2012,7 @@ static void write_slice_end(MpegEncContext *s){
static int encode_thread(AVCodecContext *c, void *arg){
MpegEncContext *s= arg;
int mb_x, mb_y, pdif = 0;
+ int chr_h= 16>>s->chroma_y_shift;
int i, j;
MpegEncContext best_s, backup_s;
uint8_t bit_buf[2][MAX_MB_BYTES];
@@ -2606,11 +2607,11 @@ static int encode_thread(AVCodecContext *c, void *arg){
s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16,
s->dest[0], w, h, s->linesize);
s->current_picture.error[1] += sse(
- s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,
- s->dest[1], w>>1, h>>1, s->uvlinesize);
+ s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h,
+ s->dest[1], w>>1, h>>s->chroma_y_shift, s->uvlinesize);
s->current_picture.error[2] += sse(
- s, s->new_picture .data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,
- s->dest[2], w>>1, h>>1, s->uvlinesize);
+ s, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h,
+ s->dest[2], w>>1, h>>s->chroma_y_shift, s->uvlinesize);
}
if(s->loop_filter){
if(ENABLE_ANY_H263_ENCODER && s->out_format == FMT_H263)