[FFmpeg-cvslog] h264: add a parameter to the CHROMA422 macro.
Anton Khirnov
git at videolan.org
Thu Mar 21 13:11:19 CET 2013
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Mar 9 20:37:11 2013 +0100| [e962bd08ee4b087d36ab0d7d7b3c90a642d46b3e] | committer: Anton Khirnov
h264: add a parameter to the CHROMA422 macro.
This way it does not look like a constant.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e962bd08ee4b087d36ab0d7d7b3c90a642d46b3e
---
libavcodec/h264.c | 8 ++++----
libavcodec/h264.h | 2 +-
libavcodec/h264_cabac.c | 2 +-
libavcodec/h264_cavlc.c | 2 +-
libavcodec/h264_loopfilter.c | 6 +++---
libavcodec/h264_mb_template.c | 2 +-
libavcodec/h264_mvpred.h | 2 +-
7 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index c350f49..a8926d7 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2042,7 +2042,7 @@ static av_always_inline void backup_mb_border(H264Context *h, uint8_t *src_y,
int top_idx = 1;
const int pixel_shift = h->pixel_shift;
int chroma444 = CHROMA444;
- int chroma422 = CHROMA422;
+ int chroma422 = CHROMA422(h);
src_y -= linesize;
src_cb -= uvlinesize;
@@ -2931,7 +2931,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
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;
@@ -2942,7 +2942,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
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;
@@ -2954,7 +2954,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
} else
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 {
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 1ea788d..ca94b3b 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -85,7 +85,7 @@
#define CABAC(h) h->pps.cabac
#endif
-#define CHROMA422 (h->sps.chroma_format_idc == 2)
+#define CHROMA422(h) (h->sps.chroma_format_idc == 2)
#define CHROMA444 (h->sps.chroma_format_idc == 3)
#define EXTENDED_SAR 255
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index ece7bbc..1bf4e5a 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -2357,7 +2357,7 @@ decode_intra_mb:
if(CHROMA444){
decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 1);
decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 2);
- } else if (CHROMA422) {
+ } else if (CHROMA422(h)) {
if( cbp&0x30 ){
int c;
for (c = 0; c < 2; c++)
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index 4f46373..171d84f 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -1113,7 +1113,7 @@ decode_intra_mb:
if( decode_luma_residual(h, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 2) < 0 ){
return -1;
}
- } else if (CHROMA422) {
+ } else if (CHROMA422(h)) {
if(cbp&0x30){
for(chroma_idx=0; chroma_idx<2; chroma_idx++)
if (decode_residual(h, gb, h->mb + ((256 + 16*16*chroma_idx) << pixel_shift),
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c
index 7b52236..ad54d0b 100644
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@ -246,7 +246,7 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h,
{
int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));
int chroma444 = CHROMA444;
- int chroma422 = CHROMA422;
+ int chroma422 = CHROMA422(h);
int mb_xy = h->mb_xy;
int left_type= h->left_type[LTOP];
@@ -467,7 +467,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u
int edge;
int chroma_qp_avg[2];
int chroma444 = CHROMA444;
- int chroma422 = CHROMA422;
+ int chroma422 = CHROMA422(h);
const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;
const int mbm_type = dir == 0 ? h->left_type[LTOP] : h->top_type;
@@ -784,7 +784,7 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
filter_mb_mbaff_edgev ( h, img_cb + 8*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1 );
filter_mb_mbaff_edgev ( h, img_cr, uvlinesize, bS , 1, rqp[0], a, b, 1 );
filter_mb_mbaff_edgev ( h, img_cr + 8*uvlinesize, uvlinesize, bS+4, 1, rqp[1], a, b, 1 );
- } else if (CHROMA422) {
+ } else if (CHROMA422(h)) {
filter_mb_mbaff_edgecv(h, img_cb, uvlinesize, bS , 1, bqp[0], a, b, 1);
filter_mb_mbaff_edgecv(h, img_cb + 8*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1);
filter_mb_mbaff_edgecv(h, img_cr, uvlinesize, bS , 1, rqp[0], a, b, 1);
diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
index 769ac94..957260a 100644
--- a/libavcodec/h264_mb_template.c
+++ b/libavcodec/h264_mb_template.c
@@ -53,7 +53,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h)
const int is_h264 = !CONFIG_SVQ3_DECODER || SIMPLE || h->avctx->codec_id == AV_CODEC_ID_H264;
void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
const int block_h = 16 >> h->chroma_y_shift;
- const int chroma422 = CHROMA422;
+ const int chroma422 = CHROMA422(h);
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 + mb_y * h->uvlinesize * block_h;
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h
index 1fb56f5..d391af6 100644
--- a/libavcodec/h264_mvpred.h
+++ b/libavcodec/h264_mvpred.h
@@ -561,7 +561,7 @@ static void fill_decode_caches(H264Context *h, int mb_type)
nnz_cache[3 + 8 * 7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 4 * 4];
nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] + 8 * 4];
nnz_cache[3 + 8 * 12 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 8 * 4];
- } else if (CHROMA422) {
+ } else if (CHROMA422(h)) {
nnz_cache[3 + 8 * 6 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 4 * 4];
nnz_cache[3 + 8 * 7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] - 2 + 4 * 4];
nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 8 * 4];
More information about the ffmpeg-cvslog
mailing list