From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 05/18] avcodec/hevc_refs: Constify ff_hevc_get_ref_list()
Date: Fri, 1 Jul 2022 00:29:36 +0200
Message-ID: <DB6PR0101MB22143D54CD671D53342F7AE48FBA9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <DB6PR0101MB2214B28F90001024D646E62B8FBA9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
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 a4cea2284d..271a55df2f 100644
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@ -587,8 +587,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.
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-06-30 22:30 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 21:48 [FFmpeg-devel] [PATCH v2 01/18] avcodec/pthread_slice: Don't reinitialise initialised mutex Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 02/18] fate/hevc: add clip for persistent_rice_adaptation_enabled_flag Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 03/18] avcodec/hevcdec: Don't initialize HEVCContexts twice Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 04/18] avcodec/hevcdec: Add pointers to logctx and parent ctx to HEVCLocalCtx Andreas Rheinhardt
2022-06-30 22:29 ` Andreas Rheinhardt [this message]
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 06/18] avcodec/hevc_cabac: Don't cast const away unnecessarily Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 07/18] avcodec/hevc_mvs: Pass HEVCLocalContext when slice-threading Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 08/18] avcodec/hevc_filter: " Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 09/18] avcodec/hevcdec: Add stat_coeffs to HEVCABACState Andreas Rheinhardt
2022-07-02 8:34 ` Anton Khirnov
2022-07-02 10:40 ` Andreas Rheinhardt
2022-07-02 11:31 ` Andreas Rheinhardt
2022-07-02 11:43 ` Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 10/18] avcodec/hevc_cabac: Pass HEVCLocalContext when slice-threading Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 11/18] avcodec/hevcpred: " Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 12/18] avcodec/hevcdec: " Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 13/18] avcodec/hevcdec: Pass HEVCLocalContext** via execute2 Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 14/18] avcodec/hevcdec: Don't allocate redundant HEVCContexts Andreas Rheinhardt
2022-07-01 21:25 ` Michael Niedermayer
2022-07-02 6:32 ` Andreas Rheinhardt
2022-07-05 22:24 ` Michael Niedermayer
2022-07-06 8:21 ` Andreas Rheinhardt
2022-07-23 5:44 ` Andreas Rheinhardt
2022-07-23 14:38 ` Michael Niedermayer
2022-07-23 21:42 ` Andreas Rheinhardt
2022-07-24 21:23 ` Michael Niedermayer
2022-07-24 21:26 ` Andreas Rheinhardt
2022-07-25 19:44 ` Michael Niedermayer
2022-07-25 19:58 ` Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 15/18] avcodec/hevcdec: Check allocation Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 16/18] avcodec/pthread_slice: Combine allocating and zeroing entries Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 17/18] avcodec/pthread_slice: Reuse buffer if possible Andreas Rheinhardt
2022-07-01 11:33 ` Paul B Mahol
2022-07-01 13:21 ` Tomas Härdin
2022-07-22 20:04 ` Andreas Rheinhardt
2022-06-30 22:29 ` [FFmpeg-devel] [PATCH 18/18] avcodec/hevcdec: Move allocation after error checks Andreas Rheinhardt
2022-07-01 13:30 ` [FFmpeg-devel] [PATCH v2 01/18] avcodec/pthread_slice: Don't reinitialise initialised mutex Tomas Härdin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB6PR0101MB22143D54CD671D53342F7AE48FBA9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git