[FFmpeg-cvslog] avcodec/hevc_refs: Constify ff_hevc_get_ref_list()
Andreas Rheinhardt
git at videolan.org
Sat Jul 9 21:41:40 EEST 2022
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Jun 29 16:49:24 2022 +0200| [c34e3920f25791e9bdda3a5829c1fcdb0f37a070] | committer: Andreas Rheinhardt
avcodec/hevc_refs: Constify ff_hevc_get_ref_list()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c34e3920f25791e9bdda3a5829c1fcdb0f37a070
---
libavcodec/hevc_filter.c | 16 ++++++++--------
libavcodec/hevc_mvs.c | 10 +++++-----
libavcodec/hevc_refs.c | 5 +++--
libavcodec/hevcdec.h | 4 ++--
4 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c
index 1ef214b0ff..7b53c66c3b 100644
--- a/libavcodec/hevc_filter.c
+++ b/libavcodec/hevc_filter.c
@@ -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,9 +734,9 @@ 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) ?
- ff_hevc_get_ref_list(s, s->ref, x0, y0 - 1) :
- s->ref->refPicList;
+ 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;
int yq_pu = y0 >> log2_min_pu_size;
int yp_tu = (y0 - 1) >> log2_min_tu_size;
@@ -772,9 +772,9 @@ 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) ?
- ff_hevc_get_ref_list(s, s->ref, x0 - 1, y0) :
- s->ref->refPicList;
+ 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;
int xq_pu = x0 >> log2_min_pu_size;
int xp_tu = (x0 - 1) >> log2_min_tu_size;
diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c
index 7477efcf52..516e4a6b7a 100644
--- a/libavcodec/hevc_mvs.c
+++ b/libavcodec/hevc_mvs.c
@@ -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;
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index fe18ca2b1d..6a70c817b0 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -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)
diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h
index ff2199aa5a..f6acf845ae 100644
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@ -584,8 +584,8 @@ void ff_hevc_clear_refs(HEVCContext *s);
*/
void ff_hevc_flush_dpb(HEVCContext *s);
-RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *frame,
- int x0, int y0);
+const RefPicList *ff_hevc_get_ref_list(const HEVCContext *s, const HEVCFrame *frame,
+ int x0, int y0);
/**
* Construct the reference picture sets for the current frame.
More information about the ffmpeg-cvslog
mailing list