aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_ps.c
diff options
context:
space:
mode:
authorJason Garrett-Glaser <jason@x264.com>2011-06-21 04:16:33 -0700
committerJason Garrett-Glaser <jason@x264.com>2011-06-22 02:39:14 -0700
commit932db250243812380640112fd27a59bc0642bc8a (patch)
tree9f896e912bfb979059874046a9e568a87b472469 /libavcodec/h264_ps.c
parent85a88f9c0c0fcc2fc48121db1beb5ada68d24bdc (diff)
downloadffmpeg-932db250243812380640112fd27a59bc0642bc8a.tar.gz
H.264: fix 4:4:4 cropping warning
Diffstat (limited to 'libavcodec/h264_ps.c')
-rw-r--r--libavcodec/h264_ps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 5ca2361a6d..7491807460 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -396,6 +396,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
#endif
sps->crop= get_bits1(&s->gb);
if(sps->crop){
+ int crop_limit = sps->chroma_format_idc == 3 ? 16 : 8;
sps->crop_left = get_ue_golomb(&s->gb);
sps->crop_right = get_ue_golomb(&s->gb);
sps->crop_top = get_ue_golomb(&s->gb);
@@ -403,7 +404,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
if(sps->crop_left || sps->crop_top){
av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
}
- if(sps->crop_right >= (8<<CHROMA444) || sps->crop_bottom >= (8<<CHROMA444)){
+ if(sps->crop_right >= crop_limit || sps->crop_bottom >= crop_limit){
av_log(h->s.avctx, AV_LOG_ERROR, "brainfart cropping not supported, this could look slightly wrong ...\n");
}
}else{