1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

h264: add a parameter to the CHROMA422 macro.

This way it does not look like a constant.
This commit is contained in:
Anton Khirnov 2013-03-09 20:37:11 +01:00
parent 6d2b6f21eb
commit e962bd08ee
7 changed files with 12 additions and 12 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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++)

View File

@ -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),

View File

@ -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);

View File

@ -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;

View File

@ -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];