Lines Matching defs:oxcf

222     lc->starting_buffer_level            = cpi->oxcf.starting_buffer_level;
223 lc->optimal_buffer_level = cpi->oxcf.optimal_buffer_level;
224 lc->maximum_buffer_size = cpi->oxcf.maximum_buffer_size;
225 lc->starting_buffer_level_in_ms = cpi->oxcf.starting_buffer_level_in_ms;
226 lc->optimal_buffer_level_in_ms = cpi->oxcf.optimal_buffer_level_in_ms;
227 lc->maximum_buffer_size_in_ms = cpi->oxcf.maximum_buffer_size_in_ms;
261 cpi->oxcf.target_bandwidth = lc->target_bandwidth;
262 cpi->oxcf.starting_buffer_level = lc->starting_buffer_level;
263 cpi->oxcf.optimal_buffer_level = lc->optimal_buffer_level;
264 cpi->oxcf.maximum_buffer_size = lc->maximum_buffer_size;
265 cpi->oxcf.starting_buffer_level_in_ms = lc->starting_buffer_level_in_ms;
266 cpi->oxcf.optimal_buffer_level_in_ms = lc->optimal_buffer_level_in_ms;
267 cpi->oxcf.maximum_buffer_size_in_ms = lc->maximum_buffer_size_in_ms;
302 VP8_CONFIG *oxcf,
308 lc->framerate = cpi->output_framerate / cpi->oxcf.rate_decimator[layer];
309 lc->target_bandwidth = cpi->oxcf.target_bitrate[layer] * 1000;
311 lc->starting_buffer_level_in_ms = oxcf->starting_buffer_level;
312 lc->optimal_buffer_level_in_ms = oxcf->optimal_buffer_level;
313 lc->maximum_buffer_size_in_ms = oxcf->maximum_buffer_size;
316 rescale((int)(oxcf->starting_buffer_level),
319 if (oxcf->optimal_buffer_level == 0)
323 rescale((int)(oxcf->optimal_buffer_level),
326 if (oxcf->maximum_buffer_size == 0)
330 rescale((int)(oxcf->maximum_buffer_size),
336 (int)((cpi->oxcf.target_bitrate[layer] -
337 cpi->oxcf.target_bitrate[layer-1]) * 1000 /
340 lc->active_worst_quality = cpi->oxcf.worst_allowed_q;
341 lc->active_best_quality = cpi->oxcf.best_allowed_q;
342 lc->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
362 VP8_CONFIG *oxcf,
367 const int curr_num_layers = cpi->oxcf.number_of_layers;
380 init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate);
387 lc->buffer_level = cpi->oxcf.starting_buffer_level_in_ms *
388 cpi->oxcf.target_bitrate[i];
394 // We need to treat the 1 layer case separately: oxcf.target_bitrate[i]
400 lc->target_bandwidth = cpi->oxcf.target_bandwidth;
401 lc->buffer_level = cpi->oxcf.starting_buffer_level_in_ms *
407 cpi->oxcf.rate_decimator[i];
653 if(cpi->oxcf.Mode == MODE_REALTIME)
952 if (cpi->oxcf.encode_breakout > 2000)
953 min = cpi->oxcf.encode_breakout;
1108 int width = (cpi->oxcf.Width + 15) & ~15;
1109 int height = (cpi->oxcf.Height + 15) & ~15;
1112 cpi->lookahead = vp8_lookahead_init(cpi->oxcf.Width, cpi->oxcf.Height,
1113 cpi->oxcf.lag_in_frames);
1248 if (cpi->oxcf.multi_threaded > 1)
1292 cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth /
1296 cpi->oxcf.two_pass_vbrmin_section / 100);
1308 if (cpi->oxcf.play_alternate && cpi->oxcf.lag_in_frames)
1310 if (cpi->max_gf_interval > cpi->oxcf.lag_in_frames - 1)
1311 cpi->max_gf_interval = cpi->oxcf.lag_in_frames - 1;
1313 if (cpi->twopass.static_scene_max_gf_interval > cpi->oxcf.lag_in_frames - 1)
1314 cpi->twopass.static_scene_max_gf_interval = cpi->oxcf.lag_in_frames - 1;
1322 static void init_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
1326 cpi->oxcf = *oxcf;
1331 cm->version = oxcf->Version;
1340 cpi->framerate = (double)(oxcf->timebase.den) /
1341 (double)(oxcf->timebase.num);
1349 vp8_change_config(cpi, oxcf);
1352 cpi->active_worst_quality = cpi->oxcf.worst_allowed_q;
1353 cpi->active_best_quality = cpi->oxcf.best_allowed_q;
1354 cpi->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
1357 cpi->buffer_level = cpi->oxcf.starting_buffer_level;
1358 cpi->bits_off_target = cpi->oxcf.starting_buffer_level;
1369 if (cpi->oxcf.number_of_layers > 1)
1374 for (i=0; i<cpi->oxcf.number_of_layers; i++)
1376 init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate);
1378 cpi->oxcf.rate_decimator[i];
1396 VP8_CONFIG *oxcf = &cpi->oxcf;
1399 if (oxcf->number_of_layers > 1)
1404 assert(oxcf->number_of_layers <= VPX_TS_MAX_LAYERS);
1405 for (i=0; i<oxcf->number_of_layers; i++)
1410 cpi->ref_framerate / oxcf->rate_decimator[i];
1411 lc->target_bandwidth = oxcf->target_bitrate[i] * 1000;
1414 (int)oxcf->starting_buffer_level_in_ms,
1417 if (oxcf->optimal_buffer_level == 0)
1421 (int)oxcf->optimal_buffer_level_in_ms,
1424 if (oxcf->maximum_buffer_size == 0)
1428 (int)oxcf->maximum_buffer_size_in_ms,
1434 (int)((oxcf->target_bitrate[i] -
1435 oxcf->target_bitrate[i-1]) * 1000 /
1443 void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
1451 if (!oxcf)
1463 if (cm->version != oxcf->Version)
1465 cm->version = oxcf->Version;
1469 last_w = cpi->oxcf.Width;
1470 last_h = cpi->oxcf.Height;
1471 prev_number_of_layers = cpi->oxcf.number_of_layers;
1473 cpi->oxcf = *oxcf;
1475 switch (cpi->oxcf.Mode)
1482 if (cpi->oxcf.cpu_used < -16)
1484 cpi->oxcf.cpu_used = -16;
1487 if (cpi->oxcf.cpu_used > 16)
1488 cpi->oxcf.cpu_used = 16;
1496 if (cpi->oxcf.cpu_used < -5)
1498 cpi->oxcf.cpu_used = -5;
1501 if (cpi->oxcf.cpu_used > 5)
1502 cpi->oxcf.cpu_used = 5;
1519 if (cpi->oxcf.cpu_used < -5)
1521 cpi->oxcf.cpu_used = -5;
1524 if (cpi->oxcf.cpu_used > 5)
1525 cpi->oxcf.cpu_used = 5;
1537 cpi->oxcf.worst_allowed_q = q_trans[oxcf->worst_allowed_q];
1538 cpi->oxcf.best_allowed_q = q_trans[oxcf->best_allowed_q];
1539 cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level];
1541 if (oxcf->fixed_q >= 0)
1543 if (oxcf->worst_allowed_q < 0)
1544 cpi->oxcf.fixed_q = q_trans[0];
1546 cpi->oxcf.fixed_q = q_trans[oxcf->worst_allowed_q];
1548 if (oxcf->alt_q < 0)
1549 cpi->oxcf.alt_q = q_trans[0];
1551 cpi->oxcf.alt_q = q_trans[oxcf->alt_q];
1553 if (oxcf->key_q < 0)
1554 cpi->oxcf.key_q = q_trans[0];
1556 cpi->oxcf.key_q = q_trans[oxcf->key_q];
1558 if (oxcf->gold_q < 0)
1559 cpi->oxcf.gold_q = q_trans[0];
1561 cpi->oxcf.gold_q = q_trans[oxcf->gold_q];
1566 cpi->oxcf.alt_freq ? cpi->oxcf.alt_freq : DEFAULT_GF_INTERVAL;
1575 cpi->oxcf.token_partitions = 3;
1578 if (cpi->oxcf.token_partitions >= 0 && cpi->oxcf.token_partitions <= 3)
1580 (TOKEN_PARTITION) cpi->oxcf.token_partitions;
1588 cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
1592 if (cpi->oxcf.fixed_q > MAXQ)
1593 cpi->oxcf.fixed_q = MAXQ;
1596 if (cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK)
1598 cpi->oxcf.starting_buffer_level = 60000;
1599 cpi->oxcf.optimal_buffer_level = 60000;
1600 cpi->oxcf.maximum_buffer_size = 240000;
1601 cpi->oxcf.starting_buffer_level_in_ms = 60000;
1602 cpi->oxcf.optimal_buffer_level_in_ms = 60000;
1603 cpi->oxcf.maximum_buffer_size_in_ms = 240000;
1607 cpi->oxcf.target_bandwidth *= 1000;
1609 cpi->oxcf.starting_buffer_level =
1610 rescale((int)cpi->oxcf.starting_buffer_level,
1611 cpi->oxcf.target_bandwidth, 1000);
1614 if (cpi->oxcf.optimal_buffer_level == 0)
1615 cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
1617 cpi->oxcf.optimal_buffer_level =
1618 rescale((int)cpi->oxcf.optimal_buffer_level,
1619 cpi->oxcf.target_bandwidth, 1000);
1621 if (cpi->oxcf.maximum_buffer_size == 0)
1622 cpi->oxcf.maximum_buffer_size = cpi->oxcf.target_bandwidth / 8;
1624 cpi->oxcf.maximum_buffer_size =
1625 rescale((int)cpi->oxcf.maximum_buffer_size,
1626 cpi->oxcf.target_bandwidth, 1000);
1629 if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) {
1630 cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
1638 cpi->worst_quality = cpi->oxcf.worst_allowed_q;
1639 cpi->best_quality = cpi->oxcf.best_allowed_q;
1642 if (cpi->active_worst_quality > cpi->oxcf.worst_allowed_q)
1644 cpi->active_worst_quality = cpi->oxcf.worst_allowed_q;
1647 else if (cpi->active_worst_quality < cpi->oxcf.best_allowed_q)
1649 cpi->active_worst_quality = cpi->oxcf.best_allowed_q;
1651 if (cpi->active_best_quality < cpi->oxcf.best_allowed_q)
1653 cpi->active_best_quality = cpi->oxcf.best_allowed_q;
1656 else if (cpi->active_best_quality > cpi->oxcf.worst_allowed_q)
1658 cpi->active_best_quality = cpi->oxcf.worst_allowed_q;
1661 cpi->buffered_mode = cpi->oxcf.optimal_buffer_level > 0;
1663 cpi->cq_target_quality = cpi->oxcf.cq_level;
1666 cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode;
1668 cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
1673 if (cpi->oxcf.number_of_layers != prev_number_of_layers)
1678 reset_temporal_layer_change(cpi, oxcf, prev_number_of_layers);
1681 cm->Width = cpi->oxcf.Width;
1682 cm->Height = cpi->oxcf.Height;
1691 if (cpi->oxcf.Sharpness > 7)
1692 cpi->oxcf.Sharpness = 7;
1694 cm->sharpness_level = cpi->oxcf.Sharpness;
1705 cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs;
1706 cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs;
1709 if (last_w != cpi->oxcf.Width || last_h != cpi->oxcf.Height)
1723 if (cpi->oxcf.fixed_q >= 0)
1725 cpi->last_q[0] = cpi->oxcf.fixed_q;
1726 cpi->last_q[1] = cpi->oxcf.fixed_q;
1729 cpi->Speed = cpi->oxcf.cpu_used;
1732 if (cpi->oxcf.lag_in_frames == 0)
1734 cpi->oxcf.allow_lag = 0;
1737 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS)
1738 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS;
1745 if (cpi->oxcf.noise_sensitivity)
1749 int width = (cpi->oxcf.Width + 15) & ~15;
1750 int height = (cpi->oxcf.Height + 15) & ~15;
1784 struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
1813 init_config(cpi, oxcf);
1873 cpi->cyclic_refresh_mode_enabled = cpi->oxcf.error_resilient_mode;
1894 cpi->key_frame_frequency = cpi->oxcf.key_freq;
1941 cpi->ni_av_qi = cpi->oxcf.worst_allowed_q;
1967 cpi->output_pkt_list = oxcf->output_pkt_list;
1978 int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
1980 cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf;
2094 if (cpi->oxcf.mr_encoder_id > 0)
2162 if (cpi->oxcf.number_of_layers > 1)
2168 for (i=0; i<(int)cpi->oxcf.number_of_layers; i++)
2215 if (cpi->oxcf.number_of_layers > 1)
2221 for (i=0; i<(int)cpi->oxcf.number_of_layers; i++)
2254 fprintf(f, "minq:%d -maxq:%d skiptrue:skipfalse = %d:%d\n", cpi->oxcf.best_allowed_q, cpi->oxcf.worst_allowed_q, skiptruecount, skipfalsecount);
2690 if (cpi->oxcf.allow_spatial_resampling && (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER))
2699 if (cpi->buffer_level < (cpi->oxcf.resample_down_water_mark * cpi->oxcf.optimal_buffer_level / 100))
2705 else if (cpi->buffer_level > (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100))
2714 new_width = ((hs - 1) + (cpi->oxcf.Width * hr)) / hs;
2715 new_height = ((vs - 1) + (cpi->oxcf.Height * vr)) / vs;
2825 if (cpi->oxcf.fixed_q >= 0 &&
2826 cpi->oxcf.play_alternate && !cpi->common.refresh_alt_ref_frame)
2892 if (cpi->oxcf.number_of_layers == 1)
3064 else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY)
3074 else if ( (q > cpi->oxcf.cq_level) &&
3076 (cpi->active_best_quality > cpi->oxcf.cq_level))
3079 cpi->active_best_quality = cpi->oxcf.cq_level;
3217 if (cpi->oxcf.noise_sensitivity)
3342 int drop_mark = (int)(cpi->oxcf.drop_frames_water_mark *
3343 cpi->oxcf.optimal_buffer_level / 100);
3420 (cpi->oxcf.auto_key && (cpi->frames_since_key % cpi->key_frame_frequency == 0)))
3430 if (cpi->oxcf.mr_encoder_id)
3433 = (LOWER_RES_FRAME_INFO*)cpi->oxcf.mr_low_res_mode_info;
3558 if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size)
3559 cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
3576 if (cpi->oxcf.number_of_layers > 1)
3583 for (i=cpi->current_layer+1; i<cpi->oxcf.number_of_layers; i++)
3622 if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) &&
3623 (cpi->buffer_level >= cpi->oxcf.optimal_buffer_level) && cpi->buffered_mode)
3632 if (cpi->buffer_level < cpi->oxcf.maximum_buffer_size)
3635 ((cpi->oxcf.maximum_buffer_size -
3636 cpi->oxcf.optimal_buffer_level) /
3642 cpi->oxcf.optimal_buffer_level) /
3690 else if (cpi->oxcf.number_of_layers==1 &&
3704 if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
3720 if ( cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY )
3737 if ((cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
3745 cpi->active_best_quality = cpi->oxcf.cq_level;
3754 if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
3759 if (cpi->buffer_level >= cpi->oxcf.maximum_buffer_size)
3762 else if (cpi->buffer_level > cpi->oxcf.optimal_buffer_level)
3765 (((cpi->buffer_level - cpi->oxcf.optimal_buffer_level) * 128)
3766 / (cpi->oxcf.maximum_buffer_size -
3767 cpi->oxcf.optimal_buffer_level));
3778 else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY)
3809 else if ((cpi->oxcf.number_of_layers == 1) && ((cm->refresh_alt_ref_frame ||
3847 if (cpi->oxcf.noise_sensitivity > 0)
3852 switch (cpi->oxcf.noise_sensitivity)
3957 if (cpi->oxcf.number_of_layers == 1 && cpi->is_src_frame_alt_ref)
3999 if(cpi->oxcf.error_resilient_mode)
4002 if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS)
4038 if (cpi->pass != 2 && cpi->oxcf.auto_key && cm->frame_type != KEY_FRAME
4083 if (((cpi->pass != 2) || (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)) &&
4259 if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
4335 if(!cpi->oxcf.mr_encoder_id && cm->show_frame)
4394 if (cpi->oxcf.number_of_layers == 1)
4412 if (!cpi->oxcf.error_resilient_mode && cm->refresh_golden_frame)
4435 if (cpi->oxcf.error_resilient_mode)
4467 if (cpi->oxcf.number_of_layers > 1)
4470 for (i=cpi->current_layer+1; i<cpi->oxcf.number_of_layers; i++)
4491 if ((cm->frame_type != KEY_FRAME) && ((cpi->oxcf.number_of_layers > 1) ||
4542 if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size)
4543 cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
4562 if (cpi->oxcf.number_of_layers > 1)
4566 for (i=cpi->current_layer+1; i<cpi->oxcf.number_of_layers; i++)
4641 (cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
4662 (cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
4735 if (!cpi->oxcf.error_resilient_mode)
4737 if (cpi->oxcf.play_alternate && cm->refresh_alt_ref_frame && (cm->frame_type != KEY_FRAME))
4813 double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth
4814 *cpi->oxcf.two_pass_vbrmin_section / 100);
4850 if (sd->y_width != cpi->oxcf.Width || sd->y_height != cpi->oxcf.Height)
4852 assert(cpi->oxcf.lag_in_frames < 2);
4929 if (cpi->oxcf.error_resilient_mode == 0 &&
4930 cpi->oxcf.play_alternate &&
4938 if (cpi->oxcf.arnr_max_frames > 0)
5070 if (cpi->oxcf.number_of_layers > 1)
5075 assert(cpi->oxcf.number_of_layers <= VPX_TS_MAX_LAYERS);
5076 for (i=0; i<cpi->oxcf.number_of_layers; i++)
5080 cpi->oxcf.rate_decimator[i];
5091 if (cpi->oxcf.number_of_layers > 1)
5098 layer = cpi->oxcf.layer_id[
5099 cpi->temporal_pattern_counter % cpi->oxcf.periodicity];
5247 if (cpi->oxcf.number_of_layers > 1)
5335 if (cpi->oxcf.number_of_layers > 1)
5340 i<cpi->oxcf.number_of_layers; i++)
5363 if (cpi->oxcf.number_of_layers > 1)
5368 i<cpi->oxcf.number_of_layers; i++)
5393 if (cpi->common.frame_type != 0 && cpi->common.base_qindex == cpi->oxcf.worst_allowed_q)