diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-21 13:06:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-21 13:06:14 +0100 |
commit | 86d9d349cce54984ef7f4b67647ae73bf1c48f88 (patch) | |
tree | f1a65e0d48eb386d67b993fd9e56ddf3051614cd /libavcodec/h264.c | |
parent | 92656787cfeaf28af368bd4c20ffbaedc8ad3ca9 (diff) | |
parent | 23e85be58fc64b2e804e68b0034a08a6d257e523 (diff) | |
download | ffmpeg-86d9d349cce54984ef7f4b67647ae73bf1c48f88.tar.gz |
Merge commit '23e85be58fc64b2e804e68b0034a08a6d257e523'
* commit '23e85be58fc64b2e804e68b0034a08a6d257e523':
h264: add a parameter to the CHROMA444 macro.
h264: add a parameter to the CHROMA422 macro.
Conflicts:
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_cavlc.c
libavcodec/h264_loopfilter.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 87322a2b83..2adee84bf3 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2089,8 +2089,8 @@ static av_always_inline void backup_mb_border(H264Context *h, uint8_t *src_y, uint8_t *top_border; int top_idx = 1; const int pixel_shift = h->pixel_shift; - int chroma444 = CHROMA444; - int chroma422 = CHROMA422; + int chroma444 = CHROMA444(h); + int chroma422 = CHROMA422(h); src_y -= linesize; src_cb -= uvlinesize; @@ -2486,7 +2486,7 @@ void ff_h264_hl_decode_mb(H264Context *h) const int mb_type = h->cur_pic.mb_type[mb_xy]; int is_complex = CONFIG_SMALL || h->is_complex || IS_INTRA_PCM(mb_type) || h->qscale == 0; - if (CHROMA444) { + if (CHROMA444(h)) { if (is_complex || h->pixel_shift) hl_decode_mb_444_complex(h); else @@ -2988,51 +2988,51 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) { switch (h->sps.bit_depth_luma) { case 9: - if (CHROMA444) { + if (CHROMA444(h)) { if (h->avctx->colorspace == AVCOL_SPC_RGB) { return AV_PIX_FMT_GBRP9; } else return AV_PIX_FMT_YUV444P9; - } else if (CHROMA422) + } else if (CHROMA422(h)) return AV_PIX_FMT_YUV422P9; else return AV_PIX_FMT_YUV420P9; break; case 10: - if (CHROMA444) { + if (CHROMA444(h)) { if (h->avctx->colorspace == AVCOL_SPC_RGB) { return AV_PIX_FMT_GBRP10; } else return AV_PIX_FMT_YUV444P10; - } else if (CHROMA422) + } else if (CHROMA422(h)) return AV_PIX_FMT_YUV422P10; else return AV_PIX_FMT_YUV420P10; break; case 12: - if (CHROMA444) { + if (CHROMA444(h)) { if (h->avctx->colorspace == AVCOL_SPC_RGB) { return AV_PIX_FMT_GBRP12; } else return AV_PIX_FMT_YUV444P12; - } else if (CHROMA422) + } else if (CHROMA422(h)) return AV_PIX_FMT_YUV422P12; else return AV_PIX_FMT_YUV420P12; break; case 14: - if (CHROMA444) { + if (CHROMA444(h)) { if (h->avctx->colorspace == AVCOL_SPC_RGB) { return AV_PIX_FMT_GBRP14; } else return AV_PIX_FMT_YUV444P14; - } else if (CHROMA422) + } else if (CHROMA422(h)) return AV_PIX_FMT_YUV422P14; else return AV_PIX_FMT_YUV420P14; break; case 8: - if (CHROMA444) { + if (CHROMA444(h)) { if (h->avctx->colorspace == AVCOL_SPC_RGB) { av_log(h->avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n"); return AV_PIX_FMT_GBR24P; @@ -3041,7 +3041,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) } return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P : AV_PIX_FMT_YUV444P; - } else if (CHROMA422) { + } else if (CHROMA422(h)) { return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P : AV_PIX_FMT_YUV422P; } else { @@ -3082,7 +3082,7 @@ static int h264_slice_header_init(H264Context *h, int reinit) h->avctx->coded_height = h->height; } else{ avcodec_set_dimensions(h->avctx, h->width, h->height); - h->avctx->width -= (2>>CHROMA444)*FFMIN(h->sps.crop_right, (8<<CHROMA444)-1); + h->avctx->width -= (2>>CHROMA444(h))*FFMIN(h->sps.crop_right, (8<<CHROMA444(h))-1); h->avctx->height -= (1<<h->chroma_y_shift)*FFMIN(h->sps.crop_bottom, (16>>h->chroma_y_shift)-1) * (2 - h->sps.frame_mbs_only_flag); } @@ -4147,10 +4147,10 @@ static void loop_filter(H264Context *h, int start_x, int end_x) dest_y = h->cur_pic.f.data[0] + ((mb_x << pixel_shift) + mb_y * h->linesize) * 16; dest_cb = h->cur_pic.f.data[1] + - (mb_x << pixel_shift) * (8 << CHROMA444) + + (mb_x << pixel_shift) * (8 << CHROMA444(h)) + mb_y * h->uvlinesize * block_h; dest_cr = h->cur_pic.f.data[2] + - (mb_x << pixel_shift) * (8 << CHROMA444) + + (mb_x << pixel_shift) * (8 << CHROMA444(h)) + mb_y * h->uvlinesize * block_h; // FIXME simplify above |