summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-08 01:17:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-08 01:17:45 +0200
commitbca50e5cd52240d885afeb3edb0fa2c74b352add (patch)
tree085fbd0d049055589a7d02bda569a6f53a9a0a3a /libavcodec
parentbc0cbaca62b6d74e88a637eedc0cbed80721a0c7 (diff)
avcodec/mpegvideo: Fix block height for lowres 3 interlaced blocks
Fixes green trash Fixes part of Ticket2535 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 00a236fb87..b03066bd3e 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2349,11 +2349,12 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy);
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
+ int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h;
uvsx = (uvsx << 2) >> lowres;
uvsy = (uvsy << 2) >> lowres;
- if (h >> s->chroma_y_shift) {
- pix_op[op_index](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
- pix_op[op_index](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
+ if (hc) {
+ pix_op[op_index](dest_cb, ptr_cb, uvlinesize, hc, uvsx, uvsy);
+ pix_op[op_index](dest_cr, ptr_cr, uvlinesize, hc, uvsx, uvsy);
}
}
// FIXME h261 lowres loop filter