From: Torsten J. <t....@gm...> - 2012-08-29 09:54:07
|
# HG changeset patch # User Torsten Jager <t....@gm...> # Date 1346222304 -10800 # Node ID 669b2d3d86e4fa0ba7e764fdb822e6cb3e521422 # Branch default # Parent 5111963c9f1748d0a067677ec71372e63d00c4bd color_matrix: recognize cropped letterbox HD (eg 1280x540) diff --git a/src/video_out/color_matrix.c b/src/video_out/color_matrix.c --- a/src/video_out/color_matrix.c +++ b/src/video_out/color_matrix.c @@ -166,7 +166,8 @@ int cm = VO_GET_FLAGS_CM (frame->flags); int cf = this->cm_state; - cm_m[10] = (frame->height - frame->crop_top - frame->crop_bottom) >= 720 ? 1 : 5; + cm_m[10] = (frame->height - frame->crop_top - frame->crop_bottom >= 720) || + (frame->width - frame->crop_left - frame->crop_right >= 1280) ? 1 : 5; cm_r[0] = cm & 1; return ((cm_m[((cf >> 2) << 3) | (cm >> 1)] << 1) | cm_r[cf & 2]); } --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -544,7 +544,9 @@ return -1; /* error happened */ } if ((cm >> 1) == 2) /* color matrix undefined */ - cm = (cm & 1) | (vo_frame->height - vo_frame->crop_top - vo_frame->crop_bottom >= 720 ? 2 : 10); + cm = (cm & 1) | + ((vo_frame->height - vo_frame->crop_top - vo_frame->crop_bottom >= 720) || + (vo_frame->width - vo_frame->crop_left - vo_frame->crop_right >= 1280) ? 2 : 10); else if ((cm >> 1) == 0) /* converted RGB source, always ITU 601 */ cm = (cm & 1) | 10; frame->yuv2rgb_factory->set_csc_levels (frame->yuv2rgb_factory, 0, 128, 128, cm); |