Merge "vp9 svc: Enable different speed setting for each spatial layer."
This commit is contained in:
commit
462a7c9f0a
@ -795,7 +795,9 @@ TEST_P(DatarateTestVP9Large, DenoiserOffOn) {
|
||||
class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
||||
public:
|
||||
DatarateOnePassCbrSvc() : EncoderTest(GET_PARAM(0)) {}
|
||||
DatarateOnePassCbrSvc() : EncoderTest(GET_PARAM(0)) {
|
||||
memset(&svc_params_, 0, sizeof(svc_params_));
|
||||
}
|
||||
virtual ~DatarateOnePassCbrSvc() {}
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
@ -824,6 +826,10 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
||||
svc_params_.max_quantizers[i] = 63;
|
||||
svc_params_.min_quantizers[i] = 0;
|
||||
}
|
||||
svc_params_.speed_per_layer[0] = 5;
|
||||
for (i = 1; i < VPX_SS_MAX_LAYERS; ++i) {
|
||||
svc_params_.speed_per_layer[i] = 7;
|
||||
}
|
||||
encoder->Control(VP9E_SET_SVC, 1);
|
||||
encoder->Control(VP9E_SET_SVC_PARAMETERS, &svc_params_);
|
||||
encoder->Control(VP8E_SET_CPUUSED, speed_setting_);
|
||||
|
@ -135,7 +135,7 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
|
||||
CHECK_MEM_ERROR(cm, lc->consec_zero_mv,
|
||||
vpx_malloc(consec_zero_mv_size));
|
||||
memset(lc->consec_zero_mv, 0, consec_zero_mv_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,6 +293,11 @@ void vp9_restore_layer_context(VP9_COMP *const cpi) {
|
||||
cpi->twopass = lc->twopass;
|
||||
cpi->oxcf.target_bandwidth = lc->target_bandwidth;
|
||||
cpi->alt_ref_source = lc->alt_ref_source;
|
||||
// Check if it is one_pass_cbr_svc mode and lc->speed > 0 (real-time mode
|
||||
// does not use speed = 0).
|
||||
if (is_one_pass_cbr_svc(cpi) && lc->speed > 0) {
|
||||
cpi->oxcf.speed = lc->speed;
|
||||
}
|
||||
// Reset the frames_since_key and frames_to_key counters to their values
|
||||
// before the layer restore. Keep these defined for the stream (not layer).
|
||||
if (cpi->svc.number_temporal_layers > 1 ||
|
||||
|
@ -46,6 +46,7 @@ typedef struct {
|
||||
signed char *map;
|
||||
uint8_t *last_coded_q_map;
|
||||
uint8_t *consec_zero_mv;
|
||||
uint8_t speed;
|
||||
} LAYER_CONTEXT;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1437,6 +1437,7 @@ static vpx_codec_err_t ctrl_set_svc_parameters(vpx_codec_alg_priv_t *ctx,
|
||||
lc->min_q = params->min_quantizers[layer];
|
||||
lc->scaling_factor_num = params->scaling_factor_num[sl];
|
||||
lc->scaling_factor_den = params->scaling_factor_den[sl];
|
||||
lc->speed = params->speed_per_layer[sl];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,9 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
|
||||
for (sl = 0; sl < VPX_SS_MAX_LAYERS; ++sl) {
|
||||
si->svc_params.scaling_factor_num[sl] = DEFAULT_SCALE_FACTORS_NUM[sl];
|
||||
si->svc_params.scaling_factor_den[sl] = DEFAULT_SCALE_FACTORS_DEN[sl];
|
||||
si->svc_params.speed_per_layer[sl] = svc_ctx->speed;
|
||||
}
|
||||
|
||||
for (tl = 0; tl < svc_ctx->temporal_layers; ++tl) {
|
||||
for (sl = 0; sl < svc_ctx->spatial_layers; ++sl) {
|
||||
i = sl * svc_ctx->temporal_layers + tl;
|
||||
|
@ -715,6 +715,7 @@ typedef struct vpx_svc_parameters {
|
||||
int min_quantizers[VPX_MAX_LAYERS]; /**< Min Q for each layer */
|
||||
int scaling_factor_num[VPX_MAX_LAYERS]; /**< Scaling factor-numerator */
|
||||
int scaling_factor_den[VPX_MAX_LAYERS]; /**< Scaling factor-denominator */
|
||||
int speed_per_layer[VPX_MAX_LAYERS]; /**< Speed setting for each sl */
|
||||
int temporal_layering_mode; /**< Temporal layering mode */
|
||||
} vpx_svc_extra_cfg_t;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user