Add -DNDEBUG when config option debug is disabled

For gcc, when libvpx config option debug is disabled, added the
flag -DNDEBUG to disable the assertions in libvpx for some speedup.

Change-Id: Ifcb7b9e8ef5cbe5d07a24407b53b9a2923f596ee
This commit is contained in:
Yunqing Wang 2014-07-15 16:18:34 -07:00
parent f932e15210
commit 765485cab2
5 changed files with 13 additions and 6 deletions

View File

@ -1222,7 +1222,12 @@ EOF
fi
fi
enabled debug && check_add_cflags -g && check_add_ldflags -g
if enabled debug; then
check_add_cflags -g && check_add_ldflags -g
else
check_add_cflags -DNDEBUG
fi
enabled gprof && check_add_cflags -pg && check_add_ldflags -pg
enabled gcov &&
check_add_cflags -fprofile-arcs -ftest-coverage &&

View File

@ -1405,7 +1405,7 @@ static void update_layer_contexts (VP8_COMP *cpi)
double prev_layer_framerate=0;
assert(oxcf->number_of_layers <= VPX_TS_MAX_LAYERS);
for (i=0; i<oxcf->number_of_layers; i++)
for (i = 0; i < oxcf->number_of_layers && i < VPX_TS_MAX_LAYERS; ++i)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
@ -5037,7 +5037,8 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
/* Update frame rates for each layer */
assert(cpi->oxcf.number_of_layers <= VPX_TS_MAX_LAYERS);
for (i=0; i<cpi->oxcf.number_of_layers; i++)
for (i = 0; i < cpi->oxcf.number_of_layers &&
i < VPX_TS_MAX_LAYERS; ++i)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
lc->framerate = cpi->ref_framerate /

View File

@ -194,7 +194,7 @@ static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block,
int eob) {
struct macroblockd_plane *const pd = &xd->plane[plane];
if (eob > 0) {
TX_TYPE tx_type;
TX_TYPE tx_type = DCT_DCT;
int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
if (xd->lossless) {
tx_type = DCT_DCT;

View File

@ -260,6 +260,8 @@ typedef enum {
static void tree_to_node(void *data, BLOCK_SIZE bsize, variance_node *node) {
int i;
node->part_variances = NULL;
vpx_memset(node->split, 0, sizeof(node->split));
switch (bsize) {
case BLOCK_64X64: {
v64x64 *vt = (v64x64 *) data;

View File

@ -3019,7 +3019,6 @@ int64_t vp9_rd_pick_inter_mode_sb_seg_skip(VP9_COMP *cpi, MACROBLOCK *x,
RD_OPT *const rd_opt = &cpi->rd;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const struct segmentation *const seg = &cm->seg;
unsigned char segment_id = mbmi->segment_id;
const int comp_pred = 0;
int i;
@ -3045,7 +3044,7 @@ int64_t vp9_rd_pick_inter_mode_sb_seg_skip(VP9_COMP *cpi, MACROBLOCK *x,
*returnrate = INT_MAX;
assert(vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP));
assert(vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP));
mbmi->mode = ZEROMV;
mbmi->uv_mode = DC_PRED;