| Index: media/filters/vpx_video_decoder.cc
|
| diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
|
| index 2d60d917a43d1855ee1226ac0c74dcf726002e30..423053e2074476c807be7042c539039fa01e0008 100644
|
| --- a/media/filters/vpx_video_decoder.cc
|
| +++ b/media/filters/vpx_video_decoder.cc
|
| @@ -144,6 +144,18 @@ static int GetThreadCount(const VideoDecoderConfig& config) {
|
| return decode_threads;
|
| }
|
|
|
| +static int GetVPXFlags() {
|
| + int flags = 0;
|
| + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
|
| +
|
| + if (cmd_line->HasSwitch(switches::kEnableVpxFrameThreading)) {
|
| + LOG(ERROR) << "Frame threading enabled for libVPX.";
|
| + flags |= VPX_CODEC_USE_FRAME_THREADING;
|
| + }
|
| +
|
| + return flags;
|
| +}
|
| +
|
| static vpx_codec_ctx* InitializeVpxContext(vpx_codec_ctx* context,
|
| const VideoDecoderConfig& config) {
|
| context = new vpx_codec_ctx();
|
| @@ -152,10 +164,13 @@ static vpx_codec_ctx* InitializeVpxContext(vpx_codec_ctx* context,
|
| vpx_config.h = config.coded_size().height();
|
| vpx_config.threads = GetThreadCount(config);
|
|
|
| + LOG(ERROR) << "Configured VPX decoder with thread count:"
|
| + << vpx_config.threads;
|
| +
|
| vpx_codec_err_t status = vpx_codec_dec_init(
|
| context,
|
| config.codec() == kCodecVP9 ? vpx_codec_vp9_dx() : vpx_codec_vp8_dx(),
|
| - &vpx_config, 0 /* flags */);
|
| + &vpx_config, GetVPXFlags());
|
| if (status == VPX_CODEC_OK)
|
| return context;
|
|
|
| @@ -463,7 +478,11 @@ void VpxVideoDecoder::Reset(const base::Closure& closure) {
|
| }
|
|
|
| bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) {
|
| - if (config.codec() != kCodecVP8 && config.codec() != kCodecVP9)
|
| + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
|
| + bool use_ffvp9(cmd_line->HasSwitch(switches::kUseFFVP9));
|
| + bool skip_loop_filter(cmd_line->HasSwitch(switches::kSkipVpxLoopFilter));
|
| +
|
| + if (config.codec() != kCodecVP8 && (config.codec() != kCodecVP9 || use_ffvp9))
|
| return false;
|
|
|
| // These are the combinations of codec-pixel format supported in principle.
|
| @@ -487,6 +506,11 @@ bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) {
|
| if (!vpx_codec_)
|
| return false;
|
|
|
| + if (skip_loop_filter) {
|
| + LOG(ERROR) << "Skipping loop filter (in loop de-blocking) for libVPX.";
|
| + vpx_codec_control_(vpx_codec_, VP9_SET_SKIP_LOOP_FILTER, skip_loop_filter);
|
| + }
|
| +
|
| // Configure VP9 to decode on our buffers to skip a data copy on decoding.
|
| if (config.codec() == kCodecVP9) {
|
| DCHECK_NE(PIXEL_FORMAT_YV12A, config.format());
|
| @@ -514,6 +538,7 @@ bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) {
|
| if (config.format() != PIXEL_FORMAT_YV12A)
|
| return true;
|
|
|
| + LOG(ERROR) << "Using libvpx!!!!!!!!!!!!!!!!!!!!!!";
|
| vpx_codec_alpha_ = InitializeVpxContext(vpx_codec_alpha_, config);
|
| return !!vpx_codec_alpha_;
|
| }
|
|
|