diff options
author | Mickaƫl Raulet <mraulet@insa-rennes.fr> | 2013-10-27 12:56:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-27 23:45:34 +0100 |
commit | 3c3ece24ea1e6fdc8984234184bec18bc8f70750 (patch) | |
tree | 2e8899c4bf25898f135d5c6c3e947538f517d63f /libavcodec/hevc.c | |
parent | dbe6f9f2c2330e7c230ddd61af1cc2069af1cf04 (diff) | |
download | ffmpeg-3c3ece24ea1e6fdc8984234184bec18bc8f70750.tar.gz |
hevc : cosmetic changes(cherry picked from commit 7308c0ccf13f18cebe4851e6dcd6b5c0b09be1dd)
Decreases the difference to Anton Khirnovs patch v5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 6e9c2eae99..acf55c0f9d 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -82,7 +82,7 @@ static void pic_arrays_free(HEVCContext *s) /* allocate arrays that depend on frame dimensions */ static int pic_arrays_init(HEVCContext *s) { - int log2_min_cb_size = s->sps->log2_min_coding_block_size; + int log2_min_cb_size = s->sps->log2_min_cb_size; int width = s->sps->width; int height = s->sps->height; int pic_size = width * height; @@ -92,8 +92,8 @@ static int pic_arrays_init(HEVCContext *s) int pic_width_in_min_pu = width >> s->sps->log2_min_pu_size; int pic_height_in_min_pu = height >> s->sps->log2_min_pu_size; int pic_size_in_min_pu = pic_width_in_min_pu * pic_height_in_min_pu; - int pic_width_in_min_tu = width >> s->sps->log2_min_transform_block_size; - int pic_height_in_min_tu = height >> s->sps->log2_min_transform_block_size; + int pic_width_in_min_tu = width >> s->sps->log2_min_tb_size; + int pic_height_in_min_tu = height >> s->sps->log2_min_tb_size; s->bs_width = width >> 3; s->bs_height = height >> 3; @@ -566,17 +566,16 @@ static int hls_slice_header(HEVCContext *s) sh->tc_offset = get_se_golomb(gb) * 2; } } else { - sh->disable_deblocking_filter_flag = s->pps->pps_disable_deblocking_filter_flag; + sh->disable_deblocking_filter_flag = s->pps->disable_dbf; sh->beta_offset = s->pps->beta_offset; - sh->tc_offset = s->pps->tc_offset; + sh->tc_offset = s->pps->tc_offset; } } else { sh->disable_deblocking_filter_flag = 0; sh->beta_offset = 0; - sh->tc_offset = 0; + sh->tc_offset = 0; } - if (s->pps->seq_loop_filter_across_slices_enabled_flag && (sh->slice_sample_adaptive_offset_flag[0] || sh->slice_sample_adaptive_offset_flag[1] || @@ -627,11 +626,11 @@ static int hls_slice_header(HEVCContext *s) if (s->pps->slice_header_extension_present_flag) { int length = get_ue_golomb_long(gb); for (i = 0; i < length; i++) - skip_bits(gb, 8); // slice_header_extension_data_byte + skip_bits(gb, 8); // slice_header_extension_data_byte } // Inferred parameters - sh->slice_qp = 26 + s->pps->pic_init_qp_minus26 + sh->slice_qp_delta; + sh->slice_qp = 26 + s->pps->pic_init_qp_minus26 + sh->slice_qp_delta; sh->slice_ctb_addr_rs = sh->slice_segment_addr; s->HEVClc->first_qp_group = !s->sh.dependent_slice_segment_flag; @@ -661,11 +660,11 @@ do { \ static void hls_sao_param(HEVCContext *s, int rx, int ry) { - HEVCLocalContext *lc = s->HEVClc; + HEVCLocalContext *lc = s->HEVClc; int sao_merge_left_flag = 0; int sao_merge_up_flag = 0; - int shift = s->sps->bit_depth - FFMIN(s->sps->bit_depth, 10); - SAOParams *sao = &CTB(s->sao, rx, ry); + int shift = s->sps->bit_depth - FFMIN(s->sps->bit_depth, 10); + SAOParams *sao = &CTB(s->sao, rx, ry); int c_idx, i; if (s->sh.slice_sample_adaptive_offset_flag[0] || @@ -713,7 +712,7 @@ static void hls_sao_param(HEVCContext *s, int rx, int ry) } // Inferred parameters - sao->offset_val[c_idx][0] = 0; //avoid undefined values + sao->offset_val[c_idx][0] = 0; for (i = 0; i < 4; i++) { sao->offset_val[c_idx][i + 1] = sao->offset_abs[c_idx][i] << shift; if (sao->type_idx[c_idx] == SAO_EDGE) { @@ -846,7 +845,7 @@ static void hls_transform_tree(HEVCContext *s, int x0, int y0, int xBase, int yB lc->cu.part_mode != PART_2Nx2N && trafo_depth == 0); if (log2_trafo_size <= s->sps->log2_max_trafo_size && - log2_trafo_size > s->sps->log2_min_transform_block_size && + log2_trafo_size > s->sps->log2_min_tb_size && trafo_depth < lc->cu.max_trafo_depth && !(lc->cu.intra_split_flag && trafo_depth == 0)) { split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size); @@ -882,8 +881,8 @@ static void hls_transform_tree(HEVCContext *s, int x0, int y0, int xBase, int yB hls_transform_tree(s, x1, y1, x0, y0, cb_xBase, cb_yBase, log2_cb_size, log2_trafo_size - 1, trafo_depth + 1, 3); } else { - int min_tu_size = 1 << s->sps->log2_min_transform_block_size; - int log2_min_tu_size = s->sps->log2_min_transform_block_size; + int min_tu_size = 1 << s->sps->log2_min_tb_size; + int log2_min_tu_size = s->sps->log2_min_tb_size; int pic_width_in_min_tu = s->sps->width >> log2_min_tu_size; int i, j; @@ -1083,8 +1082,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, int nPbW, int nP uint8_t *dst0 = POS(0, x0, y0); uint8_t *dst1 = POS(1, x0, y0); uint8_t *dst2 = POS(2, x0, y0); - int log2_min_cb_size = s->sps->log2_min_coding_block_size; - int pic_width_in_ctb = s->sps->width>>log2_min_cb_size; + int log2_min_cb_size = s->sps->log2_min_cb_size; + int min_cb_width = s->sps->width>>log2_min_cb_size; int x_cb = x0 >> log2_min_cb_size; int y_cb = y0 >> log2_min_cb_size; int ref_idx[2]; @@ -1403,9 +1402,9 @@ static int luma_intra_pred_mode(HEVCContext *s, int x0, int y0, int pu_size, static av_always_inline void set_ct_depth(HEVCContext *s, int x0, int y0, int log2_cb_size, int ct_depth) { - int length = (1 << log2_cb_size) >> s->sps->log2_min_coding_block_size; - int x_cb = x0 >> s->sps->log2_min_coding_block_size; - int y_cb = y0 >> s->sps->log2_min_coding_block_size; + int length = (1 << log2_cb_size) >> s->sps->log2_min_cb_size; + int x_cb = x0 >> s->sps->log2_min_cb_size; + int y_cb = y0 >> s->sps->log2_min_cb_size; int y; for (y = 0; y < length; y++) @@ -1476,9 +1475,9 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size) { int cb_size = 1 << log2_cb_size; HEVCLocalContext *lc = s->HEVClc; - int log2_min_cb_size = s->sps->log2_min_coding_block_size; + int log2_min_cb_size = s->sps->log2_min_cb_size; int length = cb_size >> log2_min_cb_size; - int pic_width_in_ctb = s->sps->width >> log2_min_cb_size; + int min_cb_width = s->sps->width >> log2_min_cb_size; int x_cb = x0 >> log2_min_cb_size; int y_cb = y0 >> log2_min_cb_size; int x, y; @@ -1505,10 +1504,10 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size) uint8_t skip_flag = ff_hevc_skip_flag_decode(s, x0, y0, x_cb, y_cb); lc->cu.pred_mode = MODE_SKIP; - x = y_cb * pic_width_in_ctb + x_cb; + x = y_cb * min_cb_width + x_cb; for (y = 0; y < length; y++) { memset(&s->skip_flag[x], skip_flag, length); - x += pic_width_in_ctb; + x += min_cb_width; } lc->cu.pred_mode = skip_flag ? MODE_SKIP : MODE_INTER; } @@ -1525,7 +1524,7 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size) if (s->sh.slice_type != I_SLICE) lc->cu.pred_mode = ff_hevc_pred_mode_decode(s); if (lc->cu.pred_mode != MODE_INTRA || - log2_cb_size == s->sps->log2_min_coding_block_size) { + log2_cb_size == s->sps->log2_min_cb_size) { lc->cu.part_mode = ff_hevc_part_mode_decode(s, log2_cb_size); lc->cu.intra_split_flag = lc->cu.part_mode == PART_NxN && lc->cu.pred_mode == MODE_INTRA; @@ -1611,10 +1610,10 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size) if (s->pps->cu_qp_delta_enabled_flag && lc->tu.is_cu_qp_delta_coded == 0) ff_hevc_set_qPy(s, x0, y0, x0, y0, log2_cb_size); - x = y_cb * pic_width_in_ctb + x_cb; + x = y_cb * min_cb_width + x_cb; for (y = 0; y < length; y++) { memset(&s->qp_y_tab[x], lc->qp_y, length); - x += pic_width_in_ctb; + x += min_cb_width; } set_ct_depth(s, x0, y0, log2_cb_size, lc->ct.depth); @@ -1630,12 +1629,12 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0, int log2_cb_size, lc->ct.depth = cb_depth; if ((x0 + (1 << log2_cb_size) <= s->sps->width) && (y0 + (1 << log2_cb_size) <= s->sps->height) && - log2_cb_size > s->sps->log2_min_coding_block_size) { + log2_cb_size > s->sps->log2_min_cb_size) { SAMPLE(s->split_cu_flag, x0, y0) = ff_hevc_split_coding_unit_flag_decode(s, cb_depth, x0, y0); } else { SAMPLE(s->split_cu_flag, x0, y0) = - (log2_cb_size > s->sps->log2_min_coding_block_size); + (log2_cb_size > s->sps->log2_min_cb_size); } if (s->pps->cu_qp_delta_enabled_flag && log2_cb_size >= s->sps->log2_ctb_size - s->pps->diff_cu_qp_delta_depth) { @@ -2007,8 +2006,8 @@ static int hevc_frame_start(HEVCContext *s) HEVCLocalContext *lc = s->HEVClc; int pic_width_in_min_pu = s->sps->width >> s->sps->log2_min_pu_size; int pic_height_in_min_pu = s->sps->height >> s->sps->log2_min_pu_size; - int pic_width_in_min_tu = s->sps->width >> s->sps->log2_min_transform_block_size; - int pic_height_in_min_tu = s->sps->height >> s->sps->log2_min_transform_block_size; + int pic_width_in_min_tu = s->sps->width >> s->sps->log2_min_tb_size; + int pic_height_in_min_tu = s->sps->height >> s->sps->log2_min_tb_size; int ret; memset(s->horizontal_bs, 0, 2 * s->bs_width * (s->bs_height + 1)); |