Mercurial > libavcodec.hg
comparison mpegvideo_enc.c @ 7520:b8ad314749ff libavcodec
fix 4:2:2 psnr
author | bcoudurier |
---|---|
date | Fri, 08 Aug 2008 02:56:44 +0000 |
parents | d5c528384f13 |
children | f692318902dc |
comparison
equal
deleted
inserted
replaced
7519:4b6f7cdce8c5 | 7520:b8ad314749ff |
---|---|
2010 } | 2010 } |
2011 | 2011 |
2012 static int encode_thread(AVCodecContext *c, void *arg){ | 2012 static int encode_thread(AVCodecContext *c, void *arg){ |
2013 MpegEncContext *s= arg; | 2013 MpegEncContext *s= arg; |
2014 int mb_x, mb_y, pdif = 0; | 2014 int mb_x, mb_y, pdif = 0; |
2015 int chr_h= 16>>s->chroma_y_shift; | |
2015 int i, j; | 2016 int i, j; |
2016 MpegEncContext best_s, backup_s; | 2017 MpegEncContext best_s, backup_s; |
2017 uint8_t bit_buf[2][MAX_MB_BYTES]; | 2018 uint8_t bit_buf[2][MAX_MB_BYTES]; |
2018 uint8_t bit_buf2[2][MAX_MB_BYTES]; | 2019 uint8_t bit_buf2[2][MAX_MB_BYTES]; |
2019 uint8_t bit_buf_tex[2][MAX_MB_BYTES]; | 2020 uint8_t bit_buf_tex[2][MAX_MB_BYTES]; |
2604 | 2605 |
2605 s->current_picture.error[0] += sse( | 2606 s->current_picture.error[0] += sse( |
2606 s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, | 2607 s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, |
2607 s->dest[0], w, h, s->linesize); | 2608 s->dest[0], w, h, s->linesize); |
2608 s->current_picture.error[1] += sse( | 2609 s->current_picture.error[1] += sse( |
2609 s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8, | 2610 s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, |
2610 s->dest[1], w>>1, h>>1, s->uvlinesize); | 2611 s->dest[1], w>>1, h>>s->chroma_y_shift, s->uvlinesize); |
2611 s->current_picture.error[2] += sse( | 2612 s->current_picture.error[2] += sse( |
2612 s, s->new_picture .data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8, | 2613 s, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, |
2613 s->dest[2], w>>1, h>>1, s->uvlinesize); | 2614 s->dest[2], w>>1, h>>s->chroma_y_shift, s->uvlinesize); |
2614 } | 2615 } |
2615 if(s->loop_filter){ | 2616 if(s->loop_filter){ |
2616 if(ENABLE_ANY_H263_ENCODER && s->out_format == FMT_H263) | 2617 if(ENABLE_ANY_H263_ENCODER && s->out_format == FMT_H263) |
2617 ff_h263_loop_filter(s); | 2618 ff_h263_loop_filter(s); |
2618 } | 2619 } |