decouple spatial-svc from encoder abi
this is only meant for testing. along with --enable-experimental --enable-spatial-svc require VPX_TEST_SPATIAL_SVC to be defined rather than bumping the encoder ABI. Change-Id: I7f34d9f60300fa31ccf22e1a4aa619392c391b2e
This commit is contained in:
parent
392e0188f6
commit
5044779e77
@ -558,11 +558,7 @@ int main(int argc, char **argv) {
|
||||
#if VP8_ROI_MAP
|
||||
vpx_roi_map_t roi;
|
||||
#endif
|
||||
#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
|
||||
vpx_svc_layer_id_t layer_id = { 0, 0 };
|
||||
#else
|
||||
vpx_svc_layer_id_t layer_id = { 0 };
|
||||
#endif
|
||||
const VpxInterface *encoder = NULL;
|
||||
FILE *infile = NULL;
|
||||
struct RateControlMetrics rc;
|
||||
@ -814,10 +810,8 @@ int main(int argc, char **argv) {
|
||||
struct vpx_usec_timer timer;
|
||||
vpx_codec_iter_t iter = NULL;
|
||||
const vpx_codec_cx_pkt_t *pkt;
|
||||
#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
|
||||
// Update the temporal layer_id. No spatial layers in this test.
|
||||
layer_id.spatial_layer_id = 0;
|
||||
#endif
|
||||
layer_id.temporal_layer_id =
|
||||
cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
|
||||
if (strncmp(encoder->name, "vp9", 3) == 0) {
|
||||
|
@ -1288,8 +1288,7 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
|
||||
|
||||
cx_data += size;
|
||||
cx_data_sz -= size;
|
||||
#if VPX_ENCODER_ABI_VERSION > (6 + VPX_CODEC_ABI_VERSION)
|
||||
#if CONFIG_SPATIAL_SVC
|
||||
#if CONFIG_SPATIAL_SVC && defined(VPX_TEST_SPATIAL_SVC)
|
||||
if (cpi->use_svc && !ctx->output_cx_pkt_cb.output_cx_pkt) {
|
||||
vpx_codec_cx_pkt_t pkt_sizes, pkt_psnr;
|
||||
int sl;
|
||||
@ -1309,7 +1308,6 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
|
||||
|
||||
vpx_codec_pkt_list_add(&ctx->pkt_list.head, &pkt_psnr);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (is_one_pass_cbr_svc(cpi) &&
|
||||
(cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)) {
|
||||
|
@ -559,8 +559,7 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
|
||||
iter = NULL;
|
||||
while ((cx_pkt = vpx_codec_get_cx_data(codec_ctx, &iter))) {
|
||||
switch (cx_pkt->kind) {
|
||||
#if VPX_ENCODER_ABI_VERSION > (6 + VPX_CODEC_ABI_VERSION)
|
||||
#if CONFIG_SPATIAL_SVC
|
||||
#if CONFIG_SPATIAL_SVC && defined(VPX_TEST_SPATIAL_SVC)
|
||||
case VPX_CODEC_SPATIAL_SVC_LAYER_PSNR: {
|
||||
int i;
|
||||
for (i = 0; i < svc_ctx->spatial_layers; ++i) {
|
||||
@ -594,10 +593,9 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
|
||||
si->bytes_sum[i] += cx_pkt->data.layer_sizes[i];
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
case VPX_CODEC_PSNR_PKT: {
|
||||
#if VPX_ENCODER_ABI_VERSION > (6 + VPX_CODEC_ABI_VERSION)
|
||||
#if CONFIG_SPATIAL_SVC && defined(VPX_TEST_SPATIAL_SVC)
|
||||
int j;
|
||||
svc_log(svc_ctx, SVC_LOG_DEBUG,
|
||||
"frame: %d, layer: %d, PSNR(Total/Y/U/V): "
|
||||
|
@ -154,9 +154,8 @@ enum vpx_codec_cx_pkt_kind {
|
||||
VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
|
||||
VPX_CODEC_FPMB_STATS_PKT, /**< first pass mb statistics for this frame */
|
||||
VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
|
||||
// Spatial SVC is still experimental and may be removed before the next ABI
|
||||
// bump.
|
||||
#if VPX_ENCODER_ABI_VERSION > (6 + VPX_CODEC_ABI_VERSION)
|
||||
// Spatial SVC is still experimental and may be removed.
|
||||
#if defined(VPX_TEST_SPATIAL_SVC)
|
||||
VPX_CODEC_SPATIAL_SVC_LAYER_SIZES, /**< Sizes for each layer in this frame*/
|
||||
VPX_CODEC_SPATIAL_SVC_LAYER_PSNR, /**< PSNR for each layer in this frame*/
|
||||
#endif
|
||||
@ -192,9 +191,8 @@ typedef struct vpx_codec_cx_pkt {
|
||||
double psnr[4]; /**< PSNR, total/y/u/v */
|
||||
} psnr; /**< data for PSNR packet */
|
||||
vpx_fixed_buf_t raw; /**< data for arbitrary packets */
|
||||
// Spatial SVC is still experimental and may be removed before the next
|
||||
// ABI bump.
|
||||
#if VPX_ENCODER_ABI_VERSION > (6 + VPX_CODEC_ABI_VERSION)
|
||||
// Spatial SVC is still experimental and may be removed.
|
||||
#if defined(VPX_TEST_SPATIAL_SVC)
|
||||
size_t layer_sizes[VPX_SS_MAX_LAYERS];
|
||||
struct vpx_psnr_pkt layer_psnr[VPX_SS_MAX_LAYERS];
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user