mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 17:16:12 +00:00
0741d70e20
Update libvpx to e67d45d4ce92468ba193288b59093fef0a502662 * * * Bug 1178215 - Bump clobber for libvpx file renames. r=me --HG-- rename : media/libvpx/vp8/common/x86/variance_impl_mmx.asm => media/libvpx/vp8/common/x86/vp8_variance_impl_mmx.asm rename : media/libvpx/vp8/common/x86/variance_mmx.c => media/libvpx/vp8/common/x86/vp8_variance_mmx.c rename : media/libvpx/vp8/common/x86/variance_sse2.c => media/libvpx/vp8/common/x86/vp8_variance_sse2.c rename : media/libvpx/vp9/common/arm/neon/vp9_avg_neon.c => media/libvpx/vp9/common/arm/neon/vp9_convolve_avg_neon.c rename : media/libvpx/vp9/common/arm/neon/vp9_avg_neon_asm.asm => media/libvpx/vp9/common/arm/neon/vp9_convolve_avg_neon_asm.asm rename : media/libvpx/vp9/encoder/x86/vp9_dct32x32_avx2.c => media/libvpx/vp9/encoder/x86/vp9_dct32x32_avx2_impl.h rename : media/libvpx/vp9/encoder/x86/vp9_dct32x32_sse2.c => media/libvpx/vp9/encoder/x86/vp9_dct32x32_sse2_impl.h rename : media/libvpx/vp9/encoder/x86/vp9_dct_impl_sse2.c => media/libvpx/vp9/encoder/x86/vp9_dct_sse2_impl.h rename : media/libvpx/vp9/encoder/arm/neon/vp9_sad4d_neon.c => media/libvpx/vpx_dsp/arm/sad4d_neon.c rename : media/libvpx/vp8/common/arm/armv6/vp8_sad16x16_armv6.asm => media/libvpx/vpx_dsp/arm/sad_media.asm rename : media/libvpx/vp9/encoder/arm/neon/vp9_sad_neon.c => media/libvpx/vpx_dsp/arm/sad_neon.c rename : media/libvpx/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm => media/libvpx/vpx_dsp/arm/variance_media.asm rename : media/libvpx/vp9/encoder/vp9_sad.c => media/libvpx/vpx_dsp/sad.c rename : media/libvpx/vp9/encoder/x86/vp9_highbd_sad4d_sse2.asm => media/libvpx/vpx_dsp/x86/highbd_sad4d_sse2.asm rename : media/libvpx/vp9/encoder/x86/vp9_highbd_sad_sse2.asm => media/libvpx/vpx_dsp/x86/highbd_sad_sse2.asm rename : media/libvpx/vp9/encoder/x86/vp9_highbd_variance_impl_sse2.asm => media/libvpx/vpx_dsp/x86/highbd_variance_impl_sse2.asm rename : media/libvpx/vp9/encoder/x86/vp9_sad4d_intrin_avx2.c => media/libvpx/vpx_dsp/x86/sad4d_avx2.c rename : media/libvpx/vp9/encoder/x86/vp9_sad4d_sse2.asm => media/libvpx/vpx_dsp/x86/sad4d_sse2.asm rename : media/libvpx/vp9/encoder/x86/vp9_sad_intrin_avx2.c => media/libvpx/vpx_dsp/x86/sad_avx2.c rename : media/libvpx/vp8/common/x86/sad_mmx.asm => media/libvpx/vpx_dsp/x86/sad_mmx.asm rename : media/libvpx/vp9/encoder/x86/vp9_sad_sse2.asm => media/libvpx/vpx_dsp/x86/sad_sse2.asm rename : media/libvpx/vp9/encoder/x86/vp9_sad_sse3.asm => media/libvpx/vpx_dsp/x86/sad_sse3.asm rename : media/libvpx/vp9/encoder/x86/vp9_sad_sse4.asm => media/libvpx/vpx_dsp/x86/sad_sse4.asm rename : media/libvpx/vp9/encoder/x86/vp9_sad_ssse3.asm => media/libvpx/vpx_dsp/x86/sad_ssse3.asm rename : media/libvpx/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c => media/libvpx/vpx_dsp/x86/variance_impl_avx2.c rename : media/libvpx/vp8/common/x86/variance_impl_mmx.asm => media/libvpx/vpx_dsp/x86/variance_impl_mmx.asm
123 lines
3.5 KiB
C
123 lines
3.5 KiB
C
/*
|
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
/**
|
|
* SvcContext - input parameters and state to encode a multi-layered
|
|
* spatial SVC frame
|
|
*/
|
|
|
|
#ifndef VPX_SVC_CONTEXT_H_
|
|
#define VPX_SVC_CONTEXT_H_
|
|
|
|
#include "./vp8cx.h"
|
|
#include "./vpx_encoder.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum SVC_LOG_LEVEL {
|
|
SVC_LOG_ERROR,
|
|
SVC_LOG_INFO,
|
|
SVC_LOG_DEBUG
|
|
} SVC_LOG_LEVEL;
|
|
|
|
typedef struct {
|
|
// public interface to svc_command options
|
|
int spatial_layers; // number of spatial layers
|
|
int temporal_layers; // number of temporal layers
|
|
int temporal_layering_mode;
|
|
SVC_LOG_LEVEL log_level; // amount of information to display
|
|
int log_print; // when set, printf log messages instead of returning the
|
|
// message with svc_get_message
|
|
int output_rc_stat; // for outputting rc stats
|
|
int speed; // speed setting for codec
|
|
int threads;
|
|
// private storage for vpx_svc_encode
|
|
void *internal;
|
|
} SvcContext;
|
|
|
|
#define OPTION_BUFFER_SIZE 1024
|
|
#define COMPONENTS 4 // psnr & sse statistics maintained for total, y, u, v
|
|
|
|
typedef struct SvcInternal {
|
|
char options[OPTION_BUFFER_SIZE]; // set by vpx_svc_set_options
|
|
|
|
// values extracted from option, quantizers
|
|
vpx_svc_extra_cfg_t svc_params;
|
|
int enable_auto_alt_ref[VPX_SS_MAX_LAYERS];
|
|
int bitrates[VPX_SS_MAX_LAYERS];
|
|
|
|
// accumulated statistics
|
|
double psnr_sum[VPX_SS_MAX_LAYERS][COMPONENTS]; // total/Y/U/V
|
|
uint64_t sse_sum[VPX_SS_MAX_LAYERS][COMPONENTS];
|
|
uint32_t bytes_sum[VPX_SS_MAX_LAYERS];
|
|
|
|
// codec encoding values
|
|
int width; // width of highest layer
|
|
int height; // height of highest layer
|
|
int kf_dist; // distance between keyframes
|
|
|
|
// state variables
|
|
int psnr_pkt_received;
|
|
int layer;
|
|
int use_multiple_frame_contexts;
|
|
|
|
char message_buffer[2048];
|
|
vpx_codec_ctx_t *codec_ctx;
|
|
} SvcInternal_t;
|
|
|
|
/**
|
|
* Set SVC options
|
|
* options are supplied as a single string separated by spaces
|
|
* Format: encoding-mode=<i|ip|alt-ip|gf>
|
|
* layers=<layer_count>
|
|
* scaling-factors=<n1>/<d1>,<n2>/<d2>,...
|
|
* quantizers=<q1>,<q2>,...
|
|
*/
|
|
vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options);
|
|
|
|
/**
|
|
* initialize SVC encoding
|
|
*/
|
|
vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx,
|
|
vpx_codec_ctx_t *codec_ctx,
|
|
vpx_codec_iface_t *iface,
|
|
vpx_codec_enc_cfg_t *cfg);
|
|
/**
|
|
* encode a frame of video with multiple layers
|
|
*/
|
|
vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx,
|
|
vpx_codec_ctx_t *codec_ctx,
|
|
struct vpx_image *rawimg,
|
|
vpx_codec_pts_t pts,
|
|
int64_t duration, int deadline);
|
|
|
|
/**
|
|
* finished with svc encoding, release allocated resources
|
|
*/
|
|
void vpx_svc_release(SvcContext *svc_ctx);
|
|
|
|
/**
|
|
* dump accumulated statistics and reset accumulated values
|
|
*/
|
|
const char *vpx_svc_dump_statistics(SvcContext *svc_ctx);
|
|
|
|
/**
|
|
* get status message from previous encode
|
|
*/
|
|
const char *vpx_svc_get_message(const SvcContext *svc_ctx);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // VPX_SVC_CONTEXT_H_
|