diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-12 22:06:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-12 22:28:54 +0200 |
commit | d5fcca83b915df9536d595a1a44c24294b606836 (patch) | |
tree | e414b8d967bf761a6be218d4f16b6796d928d590 /libavcodec/hevc_filter.c | |
parent | 885afff01c720cc0a3c52802bd7f82bb81d9e576 (diff) | |
parent | b11acd57326db6c2cc1475dd0bea2a06fbc85aa2 (diff) | |
download | ffmpeg-d5fcca83b915df9536d595a1a44c24294b606836.tar.gz |
Merge commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2'
* commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2':
hevc: remove HEVCContext usage from hevc_ps
Conflicts:
libavcodec/hevc.c
libavcodec/hevc_cabac.c
libavcodec/hevc_filter.c
libavcodec/hevc_mvs.c
libavcodec/hevc_ps.c
libavcodec/hevc_refs.c
libavcodec/hevcpred_template.c
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc_filter.c')
-rw-r--r-- | libavcodec/hevc_filter.c | 186 |
1 files changed, 93 insertions, 93 deletions
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c index f50a640eab..45cb823d6e 100644 --- a/libavcodec/hevc_filter.c +++ b/libavcodec/hevc_filter.c @@ -56,12 +56,12 @@ static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset) // slice qp offset is not used for deblocking if (c_idx == 1) - offset = s->pps->cb_qp_offset; + offset = s->ps.pps->cb_qp_offset; else - offset = s->pps->cr_qp_offset; + offset = s->ps.pps->cr_qp_offset; qp_i = av_clip(qp_y + offset, 0, 57); - if (s->sps->chroma_format_idc == 1) { + if (s->ps.sps->chroma_format_idc == 1) { if (qp_i < 30) qp = qp_i; else if (qp_i > 43) @@ -79,14 +79,14 @@ static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset) static int get_qPy_pred(HEVCContext *s, int xBase, int yBase, int log2_cb_size) { HEVCLocalContext *lc = s->HEVClc; - int ctb_size_mask = (1 << s->sps->log2_ctb_size) - 1; - int MinCuQpDeltaSizeMask = (1 << (s->sps->log2_ctb_size - - s->pps->diff_cu_qp_delta_depth)) - 1; + int ctb_size_mask = (1 << s->ps.sps->log2_ctb_size) - 1; + int MinCuQpDeltaSizeMask = (1 << (s->ps.sps->log2_ctb_size - + s->ps.pps->diff_cu_qp_delta_depth)) - 1; int xQgBase = xBase - (xBase & MinCuQpDeltaSizeMask); int yQgBase = yBase - (yBase & MinCuQpDeltaSizeMask); - int min_cb_width = s->sps->min_cb_width; - int x_cb = xQgBase >> s->sps->log2_min_cb_size; - int y_cb = yQgBase >> s->sps->log2_min_cb_size; + int min_cb_width = s->ps.sps->min_cb_width; + int x_cb = xQgBase >> s->ps.sps->log2_min_cb_size; + int y_cb = yQgBase >> s->ps.sps->log2_min_cb_size; int availableA = (xBase & ctb_size_mask) && (xQgBase & ctb_size_mask); int availableB = (yBase & ctb_size_mask) && @@ -113,8 +113,8 @@ static int get_qPy_pred(HEVCContext *s, int xBase, int yBase, int log2_cb_size) else qPy_b = s->qp_y_tab[x_cb + (y_cb - 1) * min_cb_width]; - av_assert2(qPy_a >= -s->sps->qp_bd_offset && qPy_a < 52); - av_assert2(qPy_b >= -s->sps->qp_bd_offset && qPy_b < 52); + av_assert2(qPy_a >= -s->ps.sps->qp_bd_offset && qPy_a < 52); + av_assert2(qPy_b >= -s->ps.sps->qp_bd_offset && qPy_b < 52); return (qPy_a + qPy_b + 1) >> 1; } @@ -124,7 +124,7 @@ void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, int log2_cb_size) int qp_y = get_qPy_pred(s, xBase, yBase, log2_cb_size); if (s->HEVClc->tu.cu_qp_delta != 0) { - int off = s->sps->qp_bd_offset; + int off = s->ps.sps->qp_bd_offset; s->HEVClc->qp_y = FFUMOD(qp_y + s->HEVClc->tu.cu_qp_delta + 52 + 2 * off, 52 + off) - off; } else @@ -133,10 +133,10 @@ void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, int log2_cb_size) static int get_qPy(HEVCContext *s, int xC, int yC) { - int log2_min_cb_size = s->sps->log2_min_cb_size; + int log2_min_cb_size = s->ps.sps->log2_min_cb_size; int x = xC >> log2_min_cb_size; int y = yC >> log2_min_cb_size; - return s->qp_y_tab[x + y * s->sps->min_cb_width]; + return s->qp_y_tab[x + y * s->ps.sps->min_cb_width]; } static void copy_CTB(uint8_t *dst, const uint8_t *src, int width, int height, @@ -193,9 +193,9 @@ static void copy_CTB_to_hv(HEVCContext *s, const uint8_t *src, int stride_src, int x, int y, int width, int height, int c_idx, int x_ctb, int y_ctb) { - int sh = s->sps->pixel_shift; - int w = s->sps->width >> s->sps->hshift[c_idx]; - int h = s->sps->height >> s->sps->vshift[c_idx]; + int sh = s->ps.sps->pixel_shift; + int w = s->ps.sps->width >> s->ps.sps->hshift[c_idx]; + int h = s->ps.sps->height >> s->ps.sps->vshift[c_idx]; /* copy horizontal edges */ memcpy(s->sao_pixel_buffer_h[c_idx] + (((2 * y_ctb) * w + x) << sh), @@ -214,23 +214,23 @@ static void restore_tqb_pixels(HEVCContext *s, ptrdiff_t stride_src, ptrdiff_t stride_dst, int x0, int y0, int width, int height, int c_idx) { - if ( s->pps->transquant_bypass_enable_flag || - (s->sps->pcm.loop_filter_disable_flag && s->sps->pcm_enabled_flag)) { + if ( s->ps.pps->transquant_bypass_enable_flag || + (s->ps.sps->pcm.loop_filter_disable_flag && s->ps.sps->pcm_enabled_flag)) { int x, y; - int min_pu_size = 1 << s->sps->log2_min_pu_size; - int hshift = s->sps->hshift[c_idx]; - int vshift = s->sps->vshift[c_idx]; - int x_min = ((x0 ) >> s->sps->log2_min_pu_size); - int y_min = ((y0 ) >> s->sps->log2_min_pu_size); - int x_max = ((x0 + width ) >> s->sps->log2_min_pu_size); - int y_max = ((y0 + height) >> s->sps->log2_min_pu_size); - int len = (min_pu_size >> hshift) << s->sps->pixel_shift; + int min_pu_size = 1 << s->ps.sps->log2_min_pu_size; + int hshift = s->ps.sps->hshift[c_idx]; + int vshift = s->ps.sps->vshift[c_idx]; + int x_min = ((x0 ) >> s->ps.sps->log2_min_pu_size); + int y_min = ((y0 ) >> s->ps.sps->log2_min_pu_size); + int x_max = ((x0 + width ) >> s->ps.sps->log2_min_pu_size); + int y_max = ((y0 + height) >> s->ps.sps->log2_min_pu_size); + int len = (min_pu_size >> hshift) << s->ps.sps->pixel_shift; for (y = y_min; y < y_max; y++) { for (x = x_min; x < x_max; x++) { - if (s->is_pcm[y * s->sps->min_pu_width + x]) { + if (s->is_pcm[y * s->ps.sps->min_pu_width + x]) { int n; - uint8_t *src = src1 + (((y << s->sps->log2_min_pu_size) - y0) >> vshift) * stride_src + ((((x << s->sps->log2_min_pu_size) - x0) >> hshift) << s->sps->pixel_shift); - const uint8_t *dst = dst1 + (((y << s->sps->log2_min_pu_size) - y0) >> vshift) * stride_dst + ((((x << s->sps->log2_min_pu_size) - x0) >> hshift) << s->sps->pixel_shift); + uint8_t *src = src1 + (((y << s->ps.sps->log2_min_pu_size) - y0) >> vshift) * stride_src + ((((x << s->ps.sps->log2_min_pu_size) - x0) >> hshift) << s->ps.sps->pixel_shift); + const uint8_t *dst = dst1 + (((y << s->ps.sps->log2_min_pu_size) - y0) >> vshift) * stride_dst + ((((x << s->ps.sps->log2_min_pu_size) - x0) >> hshift) << s->ps.sps->pixel_shift); for (n = 0; n < (min_pu_size >> vshift); n++) { memcpy(src, dst, len); src += stride_src; @@ -242,7 +242,7 @@ static void restore_tqb_pixels(HEVCContext *s, } } -#define CTB(tab, x, y) ((tab)[(y) * s->sps->ctb_width + (x)]) +#define CTB(tab, x, y) ((tab)[(y) * s->ps.sps->ctb_width + (x)]) static void sao_filter_CTB(HEVCContext *s, int x, int y) { @@ -250,18 +250,18 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y) HEVCLocalContext *lc = s->HEVClc; int c_idx; int edges[4]; // 0 left 1 top 2 right 3 bottom - int x_ctb = x >> s->sps->log2_ctb_size; - int y_ctb = y >> s->sps->log2_ctb_size; - int ctb_addr_rs = y_ctb * s->sps->ctb_width + x_ctb; - int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[ctb_addr_rs]; + int x_ctb = x >> s->ps.sps->log2_ctb_size; + int y_ctb = y >> s->ps.sps->log2_ctb_size; + int ctb_addr_rs = y_ctb * s->ps.sps->ctb_width + x_ctb; + int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs]; SAOParams *sao = &CTB(s->sao, x_ctb, y_ctb); // flags indicating unfilterable edges uint8_t vert_edge[] = { 0, 0 }; uint8_t horiz_edge[] = { 0, 0 }; uint8_t diag_edge[] = { 0, 0, 0, 0 }; uint8_t lfase = CTB(s->filter_slice_edges, x_ctb, y_ctb); - uint8_t no_tile_filter = s->pps->tiles_enabled_flag && - !s->pps->loop_filter_across_tiles_enabled_flag; + uint8_t no_tile_filter = s->ps.pps->tiles_enabled_flag && + !s->ps.pps->loop_filter_across_tiles_enabled_flag; uint8_t restore = no_tile_filter || !lfase; uint8_t left_tile_edge = 0; uint8_t right_tile_edge = 0; @@ -270,24 +270,24 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y) edges[0] = x_ctb == 0; edges[1] = y_ctb == 0; - edges[2] = x_ctb == s->sps->ctb_width - 1; - edges[3] = y_ctb == s->sps->ctb_height - 1; + edges[2] = x_ctb == s->ps.sps->ctb_width - 1; + edges[3] = y_ctb == s->ps.sps->ctb_height - 1; if (restore) { if (!edges[0]) { - left_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]]; + left_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]]; vert_edge[0] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb - 1, y_ctb)) || left_tile_edge; } if (!edges[2]) { - right_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs+1]]; + right_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs+1]]; vert_edge[1] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb + 1, y_ctb)) || right_tile_edge; } if (!edges[1]) { - up_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->sps->ctb_width]]; + up_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->ps.sps->ctb_width]]; horiz_edge[0] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb, y_ctb - 1)) || up_tile_edge; } if (!edges[3]) { - bottom_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs + s->sps->ctb_width]]; + bottom_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs + s->ps.sps->ctb_width]]; horiz_edge[1] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb, y_ctb + 1)) || bottom_tile_edge; } if (!edges[0] && !edges[1]) { @@ -304,16 +304,16 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y) } } - for (c_idx = 0; c_idx < (s->sps->chroma_format_idc ? 3 : 1); c_idx++) { - int x0 = x >> s->sps->hshift[c_idx]; - int y0 = y >> s->sps->vshift[c_idx]; + for (c_idx = 0; c_idx < (s->ps.sps->chroma_format_idc ? 3 : 1); c_idx++) { + int x0 = x >> s->ps.sps->hshift[c_idx]; + int y0 = y >> s->ps.sps->vshift[c_idx]; int stride_src = s->frame->linesize[c_idx]; - int ctb_size_h = (1 << (s->sps->log2_ctb_size)) >> s->sps->hshift[c_idx]; - int ctb_size_v = (1 << (s->sps->log2_ctb_size)) >> s->sps->vshift[c_idx]; - int width = FFMIN(ctb_size_h, (s->sps->width >> s->sps->hshift[c_idx]) - x0); - int height = FFMIN(ctb_size_v, (s->sps->height >> s->sps->vshift[c_idx]) - y0); + int ctb_size_h = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->hshift[c_idx]; + int ctb_size_v = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->vshift[c_idx]; + int width = FFMIN(ctb_size_h, (s->ps.sps->width >> s->ps.sps->hshift[c_idx]) - x0); + int height = FFMIN(ctb_size_v, (s->ps.sps->height >> s->ps.sps->vshift[c_idx]) - y0); int tab = sao_tab[(FFALIGN(width, 8) >> 3) - 1]; - uint8_t *src = &s->frame->data[c_idx][y0 * stride_src + (x0 << s->sps->pixel_shift)]; + uint8_t *src = &s->frame->data[c_idx][y0 * stride_src + (x0 << s->ps.sps->pixel_shift)]; int stride_dst; uint8_t *dst; @@ -321,11 +321,11 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y) case SAO_BAND: copy_CTB_to_hv(s, src, stride_src, x0, y0, width, height, c_idx, x_ctb, y_ctb); - if (s->pps->transquant_bypass_enable_flag || - (s->sps->pcm.loop_filter_disable_flag && s->sps->pcm_enabled_flag)) { + if (s->ps.pps->transquant_bypass_enable_flag || + (s->ps.sps->pcm.loop_filter_disable_flag && s->ps.sps->pcm_enabled_flag)) { dst = lc->edge_emu_buffer; stride_dst = 2*MAX_PB_SIZE; - copy_CTB(dst, src, width << s->sps->pixel_shift, height, stride_dst, stride_src); + copy_CTB(dst, src, width << s->ps.sps->pixel_shift, height, stride_dst, stride_src); s->hevcdsp.sao_band_filter[tab](src, dst, stride_src, stride_dst, sao->offset_val[c_idx], sao->band_position[c_idx], width, height); @@ -340,13 +340,13 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y) break; case SAO_EDGE: { - int w = s->sps->width >> s->sps->hshift[c_idx]; - int h = s->sps->height >> s->sps->vshift[c_idx]; + int w = s->ps.sps->width >> s->ps.sps->hshift[c_idx]; + int h = s->ps.sps->height >> s->ps.sps->vshift[c_idx]; int left_edge = edges[0]; int top_edge = edges[1]; int right_edge = edges[2]; int bottom_edge = edges[3]; - int sh = s->sps->pixel_shift; + int sh = s->ps.sps->pixel_shift; int left_pixels, right_pixels; stride_dst = 2*MAX_PB_SIZE + FF_INPUT_BUFFER_PADDING_SIZE; @@ -455,7 +455,7 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y) static int get_pcm(HEVCContext *s, int x, int y) { - int log2_min_pu_size = s->sps->log2_min_pu_size; + int log2_min_pu_size = s->ps.sps->log2_min_pu_size; int x_pu, y_pu; if (x < 0 || y < 0) @@ -464,9 +464,9 @@ static int get_pcm(HEVCContext *s, int x, int y) x_pu = x >> log2_min_pu_size; y_pu = y >> log2_min_pu_size; - if (x_pu >= s->sps->min_pu_width || y_pu >= s->sps->min_pu_height) + if (x_pu >= s->ps.sps->min_pu_width || y_pu >= s->ps.sps->min_pu_height) return 2; - return s->is_pcm[y_pu * s->sps->min_pu_width + x_pu]; + return s->is_pcm[y_pu * s->ps.sps->min_pu_width + x_pu]; } #define TC_CALC(qp, bs) \ @@ -483,18 +483,18 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) uint8_t no_p[2] = { 0 }; uint8_t no_q[2] = { 0 }; - int log2_ctb_size = s->sps->log2_ctb_size; + int log2_ctb_size = s->ps.sps->log2_ctb_size; int x_end, x_end2, y_end; int ctb_size = 1 << log2_ctb_size; int ctb = (x0 >> log2_ctb_size) + - (y0 >> log2_ctb_size) * s->sps->ctb_width; + (y0 >> log2_ctb_size) * s->ps.sps->ctb_width; int cur_tc_offset = s->deblock[ctb].tc_offset; int cur_beta_offset = s->deblock[ctb].beta_offset; int left_tc_offset, left_beta_offset; int tc_offset, beta_offset; - int pcmf = (s->sps->pcm_enabled_flag && - s->sps->pcm.loop_filter_disable_flag) || - s->pps->transquant_bypass_enable_flag; + int pcmf = (s->ps.sps->pcm_enabled_flag && + s->ps.sps->pcm.loop_filter_disable_flag) || + s->ps.pps->transquant_bypass_enable_flag; if (x0) { left_tc_offset = s->deblock[ctb - 1].tc_offset; @@ -505,17 +505,17 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) } x_end = x0 + ctb_size; - if (x_end > s->sps->width) - x_end = s->sps->width; + if (x_end > s->ps.sps->width) + x_end = s->ps.sps->width; y_end = y0 + ctb_size; - if (y_end > s->sps->height) - y_end = s->sps->height; + if (y_end > s->ps.sps->height) + y_end = s->ps.sps->height; tc_offset = cur_tc_offset; beta_offset = cur_beta_offset; x_end2 = x_end; - if (x_end2 != s->sps->width) + if (x_end2 != s->ps.sps->width) x_end2 -= 8; for (y = y0; y < y_end; y += 8) { // vertical filtering luma @@ -529,7 +529,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) tc[0] = bs0 ? TC_CALC(qp, bs0) : 0; tc[1] = bs1 ? TC_CALC(qp, bs1) : 0; - src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)]; + src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->ps.sps->pixel_shift)]; if (pcmf) { no_p[0] = get_pcm(s, x - 1, y); no_p[1] = get_pcm(s, x - 1, y + 4); @@ -561,7 +561,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) beta = betatable[av_clip(qp + beta_offset, 0, MAX_QP)]; tc[0] = bs0 ? TC_CALC(qp, bs0) : 0; tc[1] = bs1 ? TC_CALC(qp, bs1) : 0; - src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)]; + src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->ps.sps->pixel_shift)]; if (pcmf) { no_p[0] = get_pcm(s, x, y - 1); no_p[1] = get_pcm(s, x + 4, y - 1); @@ -578,10 +578,10 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) } } - if (s->sps->chroma_format_idc) { + if (s->ps.sps->chroma_format_idc) { for (chroma = 1; chroma <= 2; chroma++) { - int h = 1 << s->sps->hshift[chroma]; - int v = 1 << s->sps->vshift[chroma]; + int h = 1 << s->ps.sps->hshift[chroma]; + int v = 1 << s->ps.sps->vshift[chroma]; // vertical filtering chroma for (y = y0; y < y_end; y += (8 * v)) { @@ -595,7 +595,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) c_tc[0] = (bs0 == 2) ? chroma_tc(s, qp0, chroma, tc_offset) : 0; c_tc[1] = (bs1 == 2) ? chroma_tc(s, qp1, chroma, tc_offset) : 0; - src = &s->frame->data[chroma][(y >> s->sps->vshift[chroma]) * s->frame->linesize[chroma] + ((x >> s->sps->hshift[chroma]) << s->sps->pixel_shift)]; + src = &s->frame->data[chroma][(y >> s->ps.sps->vshift[chroma]) * s->frame->linesize[chroma] + ((x >> s->ps.sps->hshift[chroma]) << s->ps.sps->pixel_shift)]; if (pcmf) { no_p[0] = get_pcm(s, x - 1, y); no_p[1] = get_pcm(s, x - 1, y + (4 * v)); @@ -617,7 +617,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) // horizontal filtering chroma tc_offset = x0 ? left_tc_offset : cur_tc_offset; x_end2 = x_end; - if (x_end != s->sps->width) + if (x_end != s->ps.sps->width) x_end2 = x_end - 8 * h; for (x = x0 ? x0 - 8 * h : 0; x < x_end2; x += (8 * h)) { const int bs0 = s->horizontal_bs[( x + y * s->bs_width) >> 2]; @@ -628,7 +628,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) c_tc[0] = bs0 == 2 ? chroma_tc(s, qp0, chroma, tc_offset) : 0; c_tc[1] = bs1 == 2 ? chroma_tc(s, qp1, chroma, cur_tc_offset) : 0; - src = &s->frame->data[chroma][(y >> s->sps->vshift[1]) * s->frame->linesize[chroma] + ((x >> s->sps->hshift[1]) << s->sps->pixel_shift)]; + src = &s->frame->data[chroma][(y >> s->ps.sps->vshift[1]) * s->frame->linesize[chroma] + ((x >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)]; if (pcmf) { no_p[0] = get_pcm(s, x, y - 1); no_p[1] = get_pcm(s, x + (4 * h), y - 1); @@ -717,10 +717,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, { HEVCLocalContext *lc = s->HEVClc; MvField *tab_mvf = s->ref->tab_mvf; - int log2_min_pu_size = s->sps->log2_min_pu_size; - int log2_min_tu_size = s->sps->log2_min_tb_size; - int min_pu_width = s->sps->min_pu_width; - int min_tu_width = s->sps->min_tb_width; + int log2_min_pu_size = s->ps.sps->log2_min_pu_size; + int log2_min_tu_size = s->ps.sps->log2_min_tb_size; + int min_pu_width = s->ps.sps->min_pu_width; + int min_tu_width = s->ps.sps->min_tb_width; int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width + (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA; int boundary_upper, boundary_left; @@ -730,10 +730,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, if (boundary_upper && ((!s->sh.slice_loop_filter_across_slices_enabled_flag && lc->boundary_flags & BOUNDARY_UPPER_SLICE && - (y0 % (1 << s->sps->log2_ctb_size)) == 0) || - (!s->pps->loop_filter_across_tiles_enabled_flag && + (y0 % (1 << s->ps.sps->log2_ctb_size)) == 0) || + (!s->ps.pps->loop_filter_across_tiles_enabled_flag && lc->boundary_flags & BOUNDARY_UPPER_TILE && - (y0 % (1 << s->sps->log2_ctb_size)) == 0))) + (y0 % (1 << s->ps.sps->log2_ctb_size)) == 0))) boundary_upper = 0; if (boundary_upper) { @@ -768,10 +768,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, if (boundary_left && ((!s->sh.slice_loop_filter_across_slices_enabled_flag && lc->boundary_flags & BOUNDARY_LEFT_SLICE && - (x0 % (1 << s->sps->log2_ctb_size)) == 0) || - (!s->pps->loop_filter_across_tiles_enabled_flag && + (x0 % (1 << s->ps.sps->log2_ctb_size)) == 0) || + (!s->ps.pps->loop_filter_across_tiles_enabled_flag && lc->boundary_flags & BOUNDARY_LEFT_TILE && - (x0 % (1 << s->sps->log2_ctb_size)) == 0))) + (x0 % (1 << s->ps.sps->log2_ctb_size)) == 0))) boundary_left = 0; if (boundary_left) { @@ -842,10 +842,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) { - int x_end = x >= s->sps->width - ctb_size; + int x_end = x >= s->ps.sps->width - ctb_size; deblocking_filter_CTB(s, x, y); - if (s->sps->sao_enabled) { - int y_end = y >= s->sps->height - ctb_size; + if (s->ps.sps->sao_enabled) { + int y_end = y >= s->ps.sps->height - ctb_size; if (y && x) sao_filter_CTB(s, x - ctb_size, y - ctb_size); if (x && y_end) @@ -866,8 +866,8 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size) { - int x_end = x_ctb >= s->sps->width - ctb_size; - int y_end = y_ctb >= s->sps->height - ctb_size; + int x_end = x_ctb >= s->ps.sps->width - ctb_size; + int y_end = y_ctb >= s->ps.sps->height - ctb_size; if (y_ctb && x_ctb) ff_hevc_hls_filter(s, x_ctb - ctb_size, y_ctb - ctb_size, ctb_size); if (y_ctb && x_end) |