Merge "Initializing intra modes without vpx_once()."

This commit is contained in:
Dmitry Kovalev 2014-09-05 12:03:36 -07:00 committed by Gerrit Code Review
commit 54bec0971f
4 changed files with 31 additions and 31 deletions

View File

@ -9,11 +9,9 @@
*/
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/vpx_once.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_onyxc_int.h"
@ -292,32 +290,32 @@ intra_pred_allsizes(dc)
typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
const uint8_t *above, const uint8_t *left);
static intra_pred_fn pred[INTRA_MODES][4];
static intra_pred_fn dc_pred[2][2][4];
static intra_pred_fn pred[INTRA_MODES][TX_SIZES];
static intra_pred_fn dc_pred[2][2][TX_SIZES];
static void init_intra_pred_fn_ptrs(void) {
#define intra_pred_allsizes(l, type) \
l[0] = vp9_##type##_predictor_4x4; \
l[1] = vp9_##type##_predictor_8x8; \
l[2] = vp9_##type##_predictor_16x16; \
l[3] = vp9_##type##_predictor_32x32
void vp9_init_intra_predictors() {
#define INIT_ALL_SIZES(p, type) \
p[TX_4X4] = vp9_##type##_predictor_4x4; \
p[TX_8X8] = vp9_##type##_predictor_8x8; \
p[TX_16X16] = vp9_##type##_predictor_16x16; \
p[TX_32X32] = vp9_##type##_predictor_32x32
intra_pred_allsizes(pred[V_PRED], v);
intra_pred_allsizes(pred[H_PRED], h);
intra_pred_allsizes(pred[D207_PRED], d207);
intra_pred_allsizes(pred[D45_PRED], d45);
intra_pred_allsizes(pred[D63_PRED], d63);
intra_pred_allsizes(pred[D117_PRED], d117);
intra_pred_allsizes(pred[D135_PRED], d135);
intra_pred_allsizes(pred[D153_PRED], d153);
intra_pred_allsizes(pred[TM_PRED], tm);
INIT_ALL_SIZES(pred[V_PRED], v);
INIT_ALL_SIZES(pred[H_PRED], h);
INIT_ALL_SIZES(pred[D207_PRED], d207);
INIT_ALL_SIZES(pred[D45_PRED], d45);
INIT_ALL_SIZES(pred[D63_PRED], d63);
INIT_ALL_SIZES(pred[D117_PRED], d117);
INIT_ALL_SIZES(pred[D135_PRED], d135);
INIT_ALL_SIZES(pred[D153_PRED], d153);
INIT_ALL_SIZES(pred[TM_PRED], tm);
intra_pred_allsizes(dc_pred[0][0], dc_128);
intra_pred_allsizes(dc_pred[0][1], dc_top);
intra_pred_allsizes(dc_pred[1][0], dc_left);
intra_pred_allsizes(dc_pred[1][1], dc);
INIT_ALL_SIZES(dc_pred[0][0], dc_128);
INIT_ALL_SIZES(dc_pred[0][1], dc_top);
INIT_ALL_SIZES(dc_pred[1][0], dc_left);
INIT_ALL_SIZES(dc_pred[1][1], dc);
#undef intra_pred_allsizes
#undef INIT_ALL_SIZES
}
static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
@ -343,8 +341,6 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
// 129 G H .. S T T T T T
// ..
once(init_intra_pred_fn_ptrs);
// Get current frame pointer, width and height.
if (plane == 0) {
frame_width = xd->cur_buf->y_width;

View File

@ -18,6 +18,8 @@
extern "C" {
#endif
void vp9_init_intra_predictors();
void vp9_predict_intra_block(const MACROBLOCKD *xd, int block_idx, int bwl_in,
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride,

View File

@ -25,6 +25,7 @@
#include "vp9/common/vp9_postproc.h"
#endif
#include "vp9/common/vp9_quant_common.h"
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/decoder/vp9_decodeframe.h"
@ -36,7 +37,9 @@ static void initialize_dec() {
static int init_done = 0;
if (!init_done) {
vp9_rtcd();
vp9_init_neighbors();
vp9_init_intra_predictors();
init_done = 1;
}
}
@ -59,8 +62,6 @@ VP9Decoder *vp9_decoder_create() {
cm->error.setjmp = 1;
initialize_dec();
vp9_rtcd();
// Initialize the references to not point to any frame buffers.
vpx_memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map));

View File

@ -24,6 +24,7 @@
#include "vp9/common/vp9_postproc.h"
#endif
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/common/vp9_tile_common.h"
@ -142,7 +143,9 @@ void vp9_initialize_enc() {
static int init_done = 0;
if (!init_done) {
vp9_rtcd();
vp9_init_neighbors();
vp9_init_intra_predictors();
vp9_coef_tree_initialize();
vp9_tokenize_initialize();
vp9_init_me_luts();
@ -753,8 +756,6 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) {
cm->error.setjmp = 1;
vp9_rtcd();
cpi->use_svc = 0;
init_config(cpi, oxcf);