avcodec/hevc_refs: Constify ff_hevc_get_ref_list()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-06-29 16:49:24 +02:00
parent 5f176bbc9a
commit c34e3920f2
4 changed files with 18 additions and 17 deletions

View File

@ -645,8 +645,8 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
}
}
static int boundary_strength(HEVCContext *s, MvField *curr, MvField *neigh,
RefPicList *neigh_refPicList)
static int boundary_strength(const HEVCContext *s, const MvField *curr, const MvField *neigh,
const RefPicList *neigh_refPicList)
{
if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) {
// same L0 and L1
@ -734,7 +734,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
boundary_upper = 0;
if (boundary_upper) {
RefPicList *rpl_top = (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ?
const RefPicList *rpl_top = (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ?
ff_hevc_get_ref_list(s, s->ref, x0, y0 - 1) :
s->ref->refPicList;
int yp_pu = (y0 - 1) >> log2_min_pu_size;
@ -772,7 +772,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
boundary_left = 0;
if (boundary_left) {
RefPicList *rpl_left = (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ?
const RefPicList *rpl_left = (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ?
ff_hevc_get_ref_list(s, s->ref, x0 - 1, y0) :
s->ref->refPicList;
int xp_pu = (x0 - 1) >> log2_min_pu_size;

View File

@ -113,7 +113,7 @@ static av_always_inline int compare_mv_ref_idx(struct MvField A, struct MvField
return 0;
}
static av_always_inline void mv_scale(Mv *dst, Mv *src, int td, int tb)
static av_always_inline void mv_scale(Mv *dst, const Mv *src, int td, int tb)
{
int tx, scale_factor;
@ -127,10 +127,10 @@ static av_always_inline void mv_scale(Mv *dst, Mv *src, int td, int tb)
(scale_factor * src->y < 0)) >> 8);
}
static int check_mvset(Mv *mvLXCol, Mv *mvCol,
static int check_mvset(Mv *mvLXCol, const Mv *mvCol,
int colPic, int poc,
RefPicList *refPicList, int X, int refIdxLx,
RefPicList *refPicList_col, int listCol, int refidxCol)
const RefPicList *refPicList, int X, int refIdxLx,
const RefPicList *refPicList_col, int listCol, int refidxCol)
{
int cur_lt = refPicList[X].isLongTerm[refIdxLx];
int col_lt = refPicList_col[listCol].isLongTerm[refidxCol];
@ -163,7 +163,7 @@ static int check_mvset(Mv *mvLXCol, Mv *mvCol,
// derive the motion vectors section 8.5.3.1.8
static int derive_temporal_colocated_mvs(HEVCContext *s, MvField temp_col,
int refIdxLx, Mv *mvLXCol, int X,
int colPic, RefPicList *refPicList_col)
int colPic, const RefPicList *refPicList_col)
{
RefPicList *refPicList = s->ref->refPicList;

View File

@ -55,13 +55,14 @@ void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
}
}
RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *ref, int x0, int y0)
const RefPicList *ff_hevc_get_ref_list(const HEVCContext *s,
const HEVCFrame *ref, int x0, int y0)
{
int x_cb = x0 >> s->ps.sps->log2_ctb_size;
int y_cb = y0 >> s->ps.sps->log2_ctb_size;
int pic_width_cb = s->ps.sps->ctb_width;
int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb];
return (RefPicList *)ref->rpl_tab[ctb_addr_ts];
return &ref->rpl_tab[ctb_addr_ts]->refPicList[0];
}
void ff_hevc_clear_refs(HEVCContext *s)

View File

@ -584,7 +584,7 @@ void ff_hevc_clear_refs(HEVCContext *s);
*/
void ff_hevc_flush_dpb(HEVCContext *s);
RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *frame,
const RefPicList *ff_hevc_get_ref_list(const HEVCContext *s, const HEVCFrame *frame,
int x0, int y0);
/**