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
58 58
59// Reference frames (section 6.10.24).59// Reference frames (section 6.10.24).
60enum {60enum {
61 AV1_REF_FRAME_NONE = -1,
61 AV1_REF_FRAME_INTRA = 0,62 AV1_REF_FRAME_INTRA = 0,
62 AV1_REF_FRAME_LAST = 1,63 AV1_REF_FRAME_LAST = 1,
63 AV1_REF_FRAME_LAST2 = 2,64 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
360 int i, j;360 int i, j;
361 361
362 for (i = 0; i < AV1_REFS_PER_FRAME; i++)362 for (i = 0; i < AV1_REFS_PER_FRAME; i++)
363 ref_frame_idx[i] = -1;363 ref_frame_idx[i] = AV1_REF_FRAME_NONE;
364 ref_frame_idx[AV1_REF_FRAME_LAST - AV1_REF_FRAME_LAST] = current->last_frame_idx;364 ref_frame_idx[AV1_REF_FRAME_LAST - AV1_REF_FRAME_LAST] = current->last_frame_idx;
365 ref_frame_idx[AV1_REF_FRAME_GOLDEN - AV1_REF_FRAME_LAST] = current->golden_frame_idx;365 ref_frame_idx[AV1_REF_FRAME_GOLDEN - AV1_REF_FRAME_LAST] = current->golden_frame_idx;
366 366
@@ -378,7 +378,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw, · 11 unmodified lines
378 latest_order_hint = shifted_order_hints[current->last_frame_idx];378 latest_order_hint = shifted_order_hints[current->last_frame_idx];
379 earliest_order_hint = shifted_order_hints[current->golden_frame_idx];379 earliest_order_hint = shifted_order_hints[current->golden_frame_idx];
380 380
381 ref = -1;381 ref = AV1_REF_FRAME_NONE;
382 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {382 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
383 int hint = shifted_order_hints[i];383 int hint = shifted_order_hints[i];
384 if (!used_frame[i] && hint >= cur_frame_hint &&384 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
392 used_frame[ref] = 1;392 used_frame[ref] = 1;
393 }393 }
394 394
395 ref = -1;395 ref = AV1_REF_FRAME_NONE;
396 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {396 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
397 int hint = shifted_order_hints[i];397 int hint = shifted_order_hints[i];
398 if (!used_frame[i] && hint >= cur_frame_hint &&398 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
406 used_frame[ref] = 1;406 used_frame[ref] = 1;
407 }407 }
408 408
409 ref = -1;409 ref = AV1_REF_FRAME_NONE;
410 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {410 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
411 int hint = shifted_order_hints[i];411 int hint = shifted_order_hints[i];
412 if (!used_frame[i] && hint >= cur_frame_hint &&412 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
423 for (i = 0; i < AV1_REFS_PER_FRAME - 2; i++) {423 for (i = 0; i < AV1_REFS_PER_FRAME - 2; i++) {
424 int ref_frame = ref_frame_list[i];424 int ref_frame = ref_frame_list[i];
425 if (ref_frame_idx[ref_frame - AV1_REF_FRAME_LAST] < 0 ) {425 if (ref_frame_idx[ref_frame - AV1_REF_FRAME_LAST] < 0 ) {
426 ref = -1;426 ref = AV1_REF_FRAME_NONE;
427 for (j = 0; j < AV1_NUM_REF_FRAMES; j++) {427 for (j = 0; j < AV1_NUM_REF_FRAMES; j++) {
428 int hint = shifted_order_hints[j];428 int hint = shifted_order_hints[j];
429 if (!used_frame[j] && hint < cur_frame_hint &&429 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
439 }439 }
440 }440 }
441 441
442 ref = -1;442 ref = AV1_REF_FRAME_NONE;
443 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {443 for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
444 int hint = shifted_order_hints[i];444 int hint = shifted_order_hints[i];
445 if (ref < 0 || hint < earliest_order_hint) {445 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