Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 1254953004: Hacking ffvp9 decoder support for profiling. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Supress windows warning Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/test/pipeline_integration_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
}
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/test/pipeline_integration_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698