diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2013-12-05 16:23:09 -0800 |
---|---|---|
committer | Dmitry Kovalev <dkovalev@google.com> | 2013-12-05 16:23:09 -0800 |
commit | 0d4b8d7e432400334a954bfb0c5a45d905506b7c (patch) | |
tree | bff991548546a8273ac2dae8dac586557c691b5a /vp9/common | |
parent | 3eb0170ea6a12492ec70f54f4cea5e41ac0c2c1b (diff) | |
download | libvpx-0d4b8d7e432400334a954bfb0c5a45d905506b7c.tar libvpx-0d4b8d7e432400334a954bfb0c5a45d905506b7c.tar.gz libvpx-0d4b8d7e432400334a954bfb0c5a45d905506b7c.tar.bz2 libvpx-0d4b8d7e432400334a954bfb0c5a45d905506b7c.zip |
Renaming constants.
NUM_YV12_BUFFERS => FRAME_BUFFERS
ALLOWED_REFS_PER_FRAME => REFS_PER_FRAME
NUM_REF_FRAMES_LOG2 => REF_FRAMES_LOG2
NUM_REF_FRAMES => REF_FRAMES
NUM_FRAME_CONTEXTS_LOG2 => FRAME_CONTEXTS_LOG2
NUM_FRAME_CONTEXTS => FRAME_CONTEXTS
Change-Id: I4e1ada08f25d8fa30fdf03aebe1b1c9df0f87e63
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_alloccommon.c | 10 | ||||
-rw-r--r-- | vp9/common/vp9_entropymode.c | 2 | ||||
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 32 | ||||
-rw-r--r-- | vp9/common/vp9_reconinter.c | 2 |
4 files changed, 23 insertions, 23 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c index f495c29f3..0bf208a04 100644 --- a/vp9/common/vp9_alloccommon.c +++ b/vp9/common/vp9_alloccommon.c @@ -34,7 +34,7 @@ void vp9_update_mode_info_border(VP9_COMMON *cm, MODE_INFO *mi) { void vp9_free_frame_buffers(VP9_COMMON *cm) { int i; - for (i = 0; i < NUM_YV12_BUFFERS; i++) + for (i = 0; i < FRAME_BUFFERS; i++) vp9_free_frame_buffer(&cm->yv12_fb[i]); vp9_free_frame_buffer(&cm->post_proc_buffer); @@ -141,20 +141,20 @@ int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) { vp9_free_frame_buffers(cm); - for (i = 0; i < NUM_YV12_BUFFERS; i++) { + for (i = 0; i < FRAME_BUFFERS; i++) { cm->fb_idx_ref_cnt[i] = 0; if (vp9_alloc_frame_buffer(&cm->yv12_fb[i], width, height, ss_x, ss_y, VP9BORDERINPIXELS) < 0) goto fail; } - cm->new_fb_idx = NUM_YV12_BUFFERS - 1; + cm->new_fb_idx = FRAME_BUFFERS - 1; cm->fb_idx_ref_cnt[cm->new_fb_idx] = 1; - for (i = 0; i < ALLOWED_REFS_PER_FRAME; i++) + for (i = 0; i < REFS_PER_FRAME; i++) cm->active_ref_idx[i] = i; - for (i = 0; i < NUM_REF_FRAMES; i++) { + for (i = 0; i < REF_FRAMES; i++) { cm->ref_frame_map[i] = i; cm->fb_idx_ref_cnt[i] = 1; } diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index 265242129..036927b36 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -459,7 +459,7 @@ void vp9_setup_past_independence(VP9_COMMON *cm) { if (cm->frame_type == KEY_FRAME || cm->error_resilient_mode || cm->reset_frame_context == 3) { // Reset all frame contexts. - for (i = 0; i < NUM_FRAME_CONTEXTS; ++i) + for (i = 0; i < FRAME_CONTEXTS; ++i) cm->frame_contexts[i] = cm->fc; } else if (cm->reset_frame_context == 2) { // Reset only the frame context specified in the frame header. diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 2c410669a..0fd1e3d99 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -25,18 +25,18 @@ #include "vp9/common/vp9_postproc.h" #endif -#define ALLOWED_REFS_PER_FRAME 3 +#define REFS_PER_FRAME 3 -#define NUM_REF_FRAMES_LOG2 3 -#define NUM_REF_FRAMES (1 << NUM_REF_FRAMES_LOG2) +#define REF_FRAMES_LOG2 3 +#define REF_FRAMES (1 << REF_FRAMES_LOG2) // 1 scratch frame for the new frame, 3 for scaled references on the encoder // TODO(jkoleszar): These 3 extra references could probably come from the // normal reference pool. -#define NUM_YV12_BUFFERS (NUM_REF_FRAMES + 4) +#define FRAME_BUFFERS (REF_FRAMES + 4) -#define NUM_FRAME_CONTEXTS_LOG2 2 -#define NUM_FRAME_CONTEXTS (1 << NUM_FRAME_CONTEXTS_LOG2) +#define FRAME_CONTEXTS_LOG2 2 +#define FRAME_CONTEXTS (1 << FRAME_CONTEXTS_LOG2) extern const struct { PARTITION_CONTEXT above; @@ -113,17 +113,17 @@ typedef struct VP9Common { YV12_BUFFER_CONFIG *frame_to_show; - YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS]; - int fb_idx_ref_cnt[NUM_YV12_BUFFERS]; /* reference counts */ - int ref_frame_map[NUM_REF_FRAMES]; /* maps fb_idx to reference slot */ + YV12_BUFFER_CONFIG yv12_fb[FRAME_BUFFERS]; + int fb_idx_ref_cnt[FRAME_BUFFERS]; /* reference counts */ + int ref_frame_map[REF_FRAMES]; /* maps fb_idx to reference slot */ // TODO(jkoleszar): could expand active_ref_idx to 4, with 0 as intra, and // roll new_fb_idx into it. - // Each frame can reference ALLOWED_REFS_PER_FRAME buffers - int active_ref_idx[ALLOWED_REFS_PER_FRAME]; - struct scale_factors active_ref_scale[ALLOWED_REFS_PER_FRAME]; - struct scale_factors_common active_ref_scale_comm[ALLOWED_REFS_PER_FRAME]; + // Each frame can reference REFS_PER_FRAME buffers + int active_ref_idx[REFS_PER_FRAME]; + struct scale_factors active_ref_scale[REFS_PER_FRAME]; + struct scale_factors_common active_ref_scale_comm[REFS_PER_FRAME]; int new_fb_idx; YV12_BUFFER_CONFIG post_proc_buffer; @@ -198,7 +198,7 @@ typedef struct VP9Common { REFERENCE_MODE comp_pred_mode; FRAME_CONTEXT fc; /* this frame entropy */ - FRAME_CONTEXT frame_contexts[NUM_FRAME_CONTEXTS]; + FRAME_CONTEXT frame_contexts[FRAME_CONTEXTS]; unsigned int frame_context_idx; /* Context to use/update */ FRAME_COUNTS counts; @@ -228,11 +228,11 @@ static YV12_BUFFER_CONFIG *get_frame_new_buffer(VP9_COMMON *cm) { static int get_free_fb(VP9_COMMON *cm) { int i; - for (i = 0; i < NUM_YV12_BUFFERS; i++) + for (i = 0; i < FRAME_BUFFERS; i++) if (cm->fb_idx_ref_cnt[i] == 0) break; - assert(i < NUM_YV12_BUFFERS); + assert(i < FRAME_BUFFERS); cm->fb_idx_ref_cnt[i] = 1; return i; } diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c index 6e54cf3fd..e8247679c 100644 --- a/vp9/common/vp9_reconinter.c +++ b/vp9/common/vp9_reconinter.c @@ -288,7 +288,7 @@ void vp9_setup_scale_factors(VP9_COMMON *cm, int i) { const int ref = cm->active_ref_idx[i]; struct scale_factors *const sf = &cm->active_ref_scale[i]; struct scale_factors_common *const sfc = &cm->active_ref_scale_comm[i]; - if (ref >= NUM_YV12_BUFFERS) { + if (ref >= FRAME_BUFFERS) { vp9_zero(*sf); vp9_zero(*sfc); } else { |