Home | History | Annotate | Download | only in encoder

Lines Matching refs: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)
1452 if (!oxcf)
1464 if (cm->version != oxcf->Version)
1466 cm->version = oxcf->Version;
1470 last_w = cpi->oxcf.Width;
1471 last_h = cpi->oxcf.Height;
1472 prev_number_of_layers = cpi->oxcf.number_of_layers;
1474 cpi->oxcf = *oxcf;
1476 switch (cpi->oxcf.Mode)
1483 if (cpi->oxcf.cpu_used < -16)
1485 cpi->oxcf.cpu_used = -16;
1488 if (cpi->oxcf.cpu_used > 16)
1489 cpi->oxcf.cpu_used = 16;
1497 if (cpi->oxcf.cpu_used < -5)
1499 cpi->oxcf.cpu_used = -5;
1502 if (cpi->oxcf.cpu_used > 5)
1503 cpi->oxcf.cpu_used = 5;
1520 if (cpi->oxcf.cpu_used < -5)
1522 cpi->oxcf.cpu_used = -5;
1525 if (cpi->oxcf.cpu_used > 5)
1526 oxcf.cpu_used = 5;
1538 cpi->oxcf.worst_allowed_q = q_trans[oxcf->worst_allowed_q];
1539 cpi->oxcf.best_allowed_q = q_trans[oxcf->best_allowed_q];
1540 cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level];
1542 if (oxcf->fixed_q >= 0)
1544 if (oxcf->worst_allowed_q < 0)
1545 cpi->oxcf.fixed_q = q_trans[0];
1547 cpi->oxcf.fixed_q = q_trans[oxcf->worst_allowed_q];
1549 if (oxcf->alt_q < 0)
1550 cpi->oxcf.alt_q = q_trans[0];
1552 cpi->oxcf.alt_q = q_trans[oxcf->alt_q];
1554 if (oxcf->key_q < 0)
1555 cpi->oxcf.key_q = q_trans[0];
1557 cpi->oxcf.key_q = q_trans[oxcf->key_q];
1559 if (oxcf->gold_q < 0)
1560 cpi->oxcf.gold_q = q_trans[0];
1562 cpi->oxcf.gold_q = q_trans[oxcf->gold_q];
1567 cpi->oxcf.alt_freq ? cpi->oxcf.alt_freq : DEFAULT_GF_INTERVAL;
1576 cpi->oxcf.token_partitions = 3;
1579 if (cpi->oxcf.token_partitions >= 0 && cpi->oxcf.token_partitions <= 3)
1581 (TOKEN_PARTITION) cpi->oxcf.token_partitions;
1589 cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
1593 if (cpi->oxcf.fixed_q > MAXQ)
1594 cpi->oxcf.fixed_q = MAXQ;
1597 if (cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK)
1599 cpi->oxcf.starting_buffer_level = 60000;
1600 cpi->oxcf.optimal_buffer_level = 60000;
1601 cpi->oxcf.maximum_buffer_size = 240000;
1602 cpi->oxcf.starting_buffer_level_in_ms = 60000;
1603 cpi->oxcf.optimal_buffer_level_in_ms = 60000;
1604 cpi->oxcf.maximum_buffer_size_in_ms = 240000;
1608 cpi->oxcf.target_bandwidth *= 1000;
1610 cpi->oxcf.starting_buffer_level =
1611 rescale((int)cpi->oxcf.starting_buffer_level,
1612 cpi->oxcf.target_bandwidth, 1000);
1615 if (cpi->oxcf.optimal_buffer_level == 0)
1616 cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
1618 cpi->oxcf.optimal_buffer_level =
1619 rescale((int)cpi->oxcf.optimal_buffer_level,
1620 cpi->oxcf.target_bandwidth, 1000);
1622 if (cpi->oxcf.maximum_buffer_size == 0)
1623 cpi->oxcf.maximum_buffer_size = cpi->oxcf.target_bandwidth / 8;
1625 cpi->oxcf.maximum_buffer_size =
1626 rescale((int)cpi->oxcf.maximum_buffer_size,
1627 cpi->oxcf.target_bandwidth, 1000);
1630 if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) {
1631 cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
1639 cpi->worst_quality = cpi->oxcf.worst_allowed_q;
1640 cpi->best_quality = cpi->oxcf.best_allowed_q;
1643 if (cpi->active_worst_quality > cpi->oxcf.worst_allowed_q)
1645 cpi->active_worst_quality = cpi->oxcf.worst_allowed_q;
1648 else if (cpi->active_worst_quality < cpi->oxcf.best_allowed_q)
1650 cpi->active_worst_quality = cpi->oxcf.best_allowed_q;
1652 if (cpi->active_best_quality < cpi->oxcf.best_allowed_q)
1654 cpi->active_best_quality = cpi->oxcf.best_allowed_q;
1657 else if (cpi->active_best_quality > cpi->oxcf.worst_allowed_q)
1659 cpi->active_best_quality = cpi->oxcf.worst_allowed_q;
1662 cpi->buffered_mode = cpi->oxcf.optimal_buffer_level > 0;
1664 cpi->cq_target_quality = cpi->oxcf.cq_level;
1667 cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode;
1669 cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
1674 if (cpi->oxcf.number_of_layers != prev_number_of_layers)
1679 reset_temporal_layer_change(cpi, oxcf, prev_number_of_layers);
1682 cm->Width = cpi->oxcf.Width;
1683 cm->Height = cpi->oxcf.Height;
1692 if (cpi->oxcf.Sharpness > 7)
1693 cpi->oxcf.Sharpness = 7;
1695 cm->sharpness_level = cpi->oxcf.Sharpness;
1706 cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs;
1707 cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs;
1710 if (last_w != cpi->oxcf.Width || last_h != cpi->oxcf.Height)
1724 if (cpi->oxcf.fixed_q >= 0)
1726 cpi->last_q[0] = cpi->oxcf.fixed_q;
1727 cpi->last_q[1] = cpi->oxcf.fixed_q;
1730 cpi->Speed = cpi->oxcf.cpu_used;
1733 if (cpi->oxcf.lag_in_frames == 0)
1735 cpi->oxcf.allow_lag = 0;
1738 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS)
1739 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS;
1746 if (cpi->oxcf.noise_sensitivity)
1750 int width = (cpi->oxcf.Width + 15) & ~15;
1751 int height = (cpi->oxcf.Height + 15) & ~15;
1785 struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
1814 init_config(cpi, oxcf);
1874 cpi->cyclic_refresh_mode_enabled = cpi->oxcf.error_resilient_mode;
1895 cpi->key_frame_frequency = cpi->oxcf.key_freq;
1942 cpi->ni_av_qi = cpi->oxcf.worst_allowed_q;
1968 cpi->output_pkt_list = oxcf->output_pkt_list;
1979 int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
1981 cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf;
2095 if (cpi->oxcf.mr_encoder_id > 0)
2163 if (cpi->oxcf.number_of_layers > 1)
2169 for (i=0; i<(int)cpi->oxcf.number_of_layers; i++)
2216 if (cpi->oxcf.number_of_layers > 1)
2222 for (i=0; i<(int)cpi->oxcf.number_of_layers; i++)
2255 fprintf(f, "minq:%d -maxq:%d skiptrue:skipfalse = %d:%d\n", cpi->oxcf.best_allowed_q, cpi->oxcf.worst_allowed_q, skiptruecount, skipfalsecount);
2691 if (cpi->oxcf.allow_spatial_resampling && (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER))
2700 if (cpi->buffer_level < (cpi->oxcf.resample_down_water_mark * cpi->oxcf.optimal_buffer_level / 100))
2706 else if (cpi->buffer_level > (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100))
2715 new_width = ((hs - 1) + (cpi->oxcf.Width * hr)) / hs;
2716 new_height = ((vs - 1) + (cpi->oxcf.Height * vr)) / vs;
2826 if (cpi->oxcf.fixed_q >= 0 &&
2827 cpi->oxcf.play_alternate && !cpi->common.refresh_alt_ref_frame)
2893 if (cpi->oxcf.number_of_layers == 1)
3065 else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY)
3075 else if ( (q > cpi->oxcf.cq_level) &&
3077 (cpi->active_best_quality > cpi->oxcf.cq_level))
3080 cpi->active_best_quality = cpi->oxcf.cq_level;
3218 if (cpi->oxcf.noise_sensitivity)
3343 int drop_mark = (int)(cpi->oxcf.drop_frames_water_mark *
3344 cpi->oxcf.optimal_buffer_level / 100);
3421 (cpi->oxcf.auto_key && (cpi->frames_since_key % cpi->key_frame_frequency == 0)))
3431 if (cpi->oxcf.mr_encoder_id)
3434 = (LOWER_RES_FRAME_INFO*)cpi->oxcf.mr_low_res_mode_info;
3559 if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size)
3560 cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
3577 if (cpi->oxcf.number_of_layers > 1)
3584 for (i=cpi->current_layer+1; i<cpi->oxcf.number_of_layers; i++)
3623 if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) &&
3624 (cpi->buffer_level >= cpi->oxcf.optimal_buffer_level) && cpi->buffered_mode)
3633 if (cpi->buffer_level < cpi->oxcf.maximum_buffer_size)
3636 ((cpi->oxcf.maximum_buffer_size -
3637 cpi->oxcf.optimal_buffer_level) /
3643 cpi->oxcf.optimal_buffer_level) /
3691 else if (cpi->oxcf.number_of_layers==1 &&
3705 if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
3721 if ( cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY )
3738 if ((cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
3746 cpi->active_best_quality = cpi->oxcf.cq_level;
3755 if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
3760 if (cpi->buffer_level >= cpi->oxcf.maximum_buffer_size)
3763 else if (cpi->buffer_level > cpi->oxcf.optimal_buffer_level)
3766 (((cpi->buffer_level - cpi->oxcf.optimal_buffer_level) * 128)
3767 / (cpi->oxcf.maximum_buffer_size -
3768 cpi->oxcf.optimal_buffer_level));
3779 else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY)
3810 else if ((cpi->oxcf.number_of_layers == 1) && ((cm->refresh_alt_ref_frame ||
3848 if (cpi->oxcf.noise_sensitivity > 0)
3853 switch (cpi->oxcf.noise_sensitivity)
3958 if (cpi->oxcf.number_of_layers == 1 && cpi->is_src_frame_alt_ref)
4000 if(cpi->oxcf.error_resilient_mode)
4003 if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS)
4039 if (cpi->pass != 2 && cpi->oxcf.auto_key && cm->frame_type != KEY_FRAME
4084 if (((cpi->pass != 2) || (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)) &&
4260 if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
4336 if(!cpi->oxcf.mr_encoder_id && cm->show_frame)
4395 if (cpi->oxcf.number_of_layers == 1)
4413 if (!cpi->oxcf.error_resilient_mode && cm->refresh_golden_frame)
4436 if (cpi->oxcf.error_resilient_mode)
4468 if (cpi->oxcf.number_of_layers > 1)
4471 for (i=cpi->current_layer+1; i<cpi->oxcf.number_of_layers; i++)
4492 if ((cm->frame_type != KEY_FRAME) && ((cpi->oxcf.number_of_layers > 1) ||
4543 if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size)
4544 cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
4563 if (cpi->oxcf.number_of_layers > 1)
4567 for (i=cpi->current_layer+1; i<cpi->oxcf.number_of_layers; i++)
4642 (cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
4663 (cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
4736 if (!cpi->oxcf.error_resilient_mode)
4738 if (cpi->oxcf.play_alternate && cm->refresh_alt_ref_frame && (cm->frame_type != KEY_FRAME))
4814 double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth
4815 *cpi->oxcf.two_pass_vbrmin_section / 100);
4851 if (sd->y_width != cpi->oxcf.Width || sd->y_height != cpi->oxcf.Height)
4853 assert(cpi->oxcf.lag_in_frames < 2);
4930 if (cpi->oxcf.error_resilient_mode == 0 &&
4931 cpi->oxcf.play_alternate &&
4939 if (cpi->oxcf.arnr_max_frames > 0)
5071 if (cpi->oxcf.number_of_layers > 1)
5076 assert(cpi->oxcf.number_of_layers <= VPX_TS_MAX_LAYERS);
5077 for (i=0; i<cpi->oxcf.number_of_layers; i++)
5081 cpi->oxcf.rate_decimator[i];
5092 if (cpi->oxcf.number_of_layers > 1)
5099 layer = cpi->oxcf.layer_id[
5100 cpi->temporal_pattern_counter % cpi->oxcf.periodicity];
5248 if (cpi->oxcf.number_of_layers > 1)
5336 if (cpi->oxcf.number_of_layers > 1)
5341 i<cpi->oxcf.number_of_layers; i++)
5364 if (cpi->oxcf.number_of_layers > 1)
5369 i<cpi->oxcf.number_of_layers; i++)
5394 if (cpi->common.frame_type != 0 && cpi->common.base_qindex == cpi->oxcf.worst_allowed_q)