aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2024-03-17 19:31:17 +0100
committerLynne <dev@lynne.ee>2024-03-25 08:54:18 +0100
commit998aa66a10546be207d5dfc1a4a76bc2ce9ea07c (patch)
tree031b8c4ff8f5fb065d584f49845e4d83d40840e1
parentcafb4c554845332eeb33284cf6498049997dc67e (diff)
downloadffmpeg-998aa66a10546be207d5dfc1a4a76bc2ce9ea07c.tar.gz
av1dec: add AV1_REF_FRAME_NONE
-rw-r--r--libavcodec/av1.h1
-rw-r--r--libavcodec/cbs_av1_syntax_template.c12
2 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/av1.h b/libavcodec/av1.h
index 8704bc41c1..94e88f8484 100644
--- a/libavcodec/av1.h
+++ b/libavcodec/av1.h
@@ -58,6 +58,7 @@ enum {
// Reference frames (section 6.10.24).
enum {
+ AV1_REF_FRAME_NONE = -1,
AV1_REF_FRAME_INTRA = 0,
AV1_REF_FRAME_LAST = 1,
AV1_REF_FRAME_LAST2 = 2,
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 2979c5d98f..3f4b13a177 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -360,7 +360,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
int i, j;
for (i = 0; i < AV1_REFS_PER_FRAME; i++)
- ref_frame_idx[i] = -1;
+ ref_frame_idx[i] = AV1_REF_FRAME_NONE;
ref_frame_idx[AV1_REF_FRAME_LAST - AV1_REF_FRAME_LAST] = current->last_frame_idx;
ref_frame_idx[AV1_REF_FRAME_GOLDEN - AV1_REF_FRAME_LAST] = current->golden_frame_idx;
@@ -378,7 +378,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
latest_order_hint = shifted_order_hints[current->last_frame_idx];
earliest_order_hint = shifted_order_hints[current->golden_frame_idx];
- ref = -1;
+ ref = AV1_REF_FRAME_NONE;
for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
int hint = shifted_order_hints[i];
if (!used_frame[i] && hint >= cur_frame_hint &&
@@ -392,7 +392,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
used_frame[ref] = 1;
}
- ref = -1;
+ ref = AV1_REF_FRAME_NONE;
for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
int hint = shifted_order_hints[i];
if (!used_frame[i] && hint >= cur_frame_hint &&
@@ -406,7 +406,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
used_frame[ref] = 1;
}
- ref = -1;
+ ref = AV1_REF_FRAME_NONE;
for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
int hint = shifted_order_hints[i];
if (!used_frame[i] && hint >= cur_frame_hint &&
@@ -423,7 +423,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
for (i = 0; i < AV1_REFS_PER_FRAME - 2; i++) {
int ref_frame = ref_frame_list[i];
if (ref_frame_idx[ref_frame - AV1_REF_FRAME_LAST] < 0 ) {
- ref = -1;
+ ref = AV1_REF_FRAME_NONE;
for (j = 0; j < AV1_NUM_REF_FRAMES; j++) {
int hint = shifted_order_hints[j];
if (!used_frame[j] && hint < cur_frame_hint &&
@@ -439,7 +439,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
}
}
- ref = -1;
+ ref = AV1_REF_FRAME_NONE;
for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
int hint = shifted_order_hints[i];
if (ref < 0 || hint < earliest_order_hint) {