History

av1dec: add AV1_REF_FRAME_NONE

Lynne committed 2 years ago

Commit 998aa661 parent cafb4c52 files · +7 −6Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/av1.h +1 −0
  2. libavcodec/cbs_av1_syntax_template.c +6 −6
libavcodec/av1.h+1−0
@@ -58,6 +58,7 @@ enum { · 57 unmodified lines
5858
5959 // Reference frames (section 6.10.24).
6060 enum {
61+ AV1_REF_FRAME_NONE = -1,
6162 AV1_REF_FRAME_INTRA = 0,
6263 AV1_REF_FRAME_LAST = 1,
6364 AV1_REF_FRAME_LAST2 = 2,
libavcodec/cbs_av1_syntax_template.c+6−6
@@ -360,7 +360,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, · 359 unmodified lines
360360 int i, j;
361361
362362 for (i = 0; i < AV1_REFS_PER_FRAME; i++)
363− ref_frame_idx[i] = -1;
363+ ref_frame_idx[i] = AV1_REF_FRAME_NONE;
364364 ref_frame_idx[AV1_REF_FRAME_LAST - AV1_REF_FRAME_LAST] = current->last_frame_idx;
365365 ref_frame_idx[AV1_REF_FRAME_GOLDEN - AV1_REF_FRAME_LAST] = current->golden_frame_idx;
366366
@@ -378,7 +378,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, · 11 unmodified lines
378378 latest_order_hint = shifted_order_hints[current->last_frame_idx];
379379 earliest_order_hint = shifted_order_hints[current->golden_frame_idx];
380380
381− ref = -1;
381+ ref = AV1_REF_FRAME_NONE;
382382 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
383383 int hint = shifted_order_hints[i];
384384 if (!used_frame[i] && hint >= cur_frame_hint &&
@@ -392,7 +392,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, · 7 unmodified lines
392392 used_frame[ref] = 1;
393393 }
394394
395− ref = -1;
395+ ref = AV1_REF_FRAME_NONE;
396396 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
397397 int hint = shifted_order_hints[i];
398398 if (!used_frame[i] && hint >= cur_frame_hint &&
@@ -406,7 +406,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, · 7 unmodified lines
406406 used_frame[ref] = 1;
407407 }
408408
409− ref = -1;
409+ ref = AV1_REF_FRAME_NONE;
410410 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
411411 int hint = shifted_order_hints[i];
412412 if (!used_frame[i] && hint >= cur_frame_hint &&
@@ -423,7 +423,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, · 10 unmodified lines
423423 for (i = 0; i < AV1_REFS_PER_FRAME - 2; i++) {
424424 int ref_frame = ref_frame_list[i];
425425 if (ref_frame_idx[ref_frame - AV1_REF_FRAME_LAST] < 0 ) {
426− ref = -1;
426+ ref = AV1_REF_FRAME_NONE;
427427 for (j = 0; j < AV1_NUM_REF_FRAMES; j++) {
428428 int hint = shifted_order_hints[j];
429429 if (!used_frame[j] && hint < cur_frame_hint &&
@@ -439,7 +439,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, · 9 unmodified lines
439439 }
440440 }
441441
442− ref = -1;
442+ ref = AV1_REF_FRAME_NONE;
443443 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
444444 int hint = shifted_order_hints[i];
445445 if (ref < 0 || hint < earliest_order_hint) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t