ref: 4cf68be17abad8738613f220b708a29a5288b0ff
parent: 2149f214d58a87ff7bb1f6fb2e6b2e6a50bde9c3
parent: 1582ac851fc6b39549c8a57237b0619c7bcf4fcc
author: hkuang <hkuang@google.com>
date: Wed Apr 1 13:07:58 EDT 2015
Merge "Fix 10-bit video decode failure with --frame-parallel mode."
--- a/test/vp9_frame_parallel_test.cc
+++ b/test/vp9_frame_parallel_test.cc
@@ -29,7 +29,7 @@
#if CONFIG_WEBM_IO
-struct FileList {
+struct PauseFileList {
const char *name;
// md5 sum for decoded frames which does not include skipped frames.
const char *expected_md5;
@@ -39,7 +39,8 @@
// Decodes |filename| with |num_threads|. Pause at the specified frame_num,
// seek to next key frame and then continue decoding until the end. Return
// the md5 of the decoded frames which does not include skipped frames.
-string DecodeFile(const string &filename, int num_threads, int pause_num) {
+string DecodeFileWithPause(const string &filename, int num_threads,
+ int pause_num) {
libvpx_test::WebMVideoSource video(filename);
video.Init();
int in_frames = 0;
@@ -92,12 +93,12 @@
return string(md5.Get());
}
-void DecodeFiles(const FileList files[]) {
- for (const FileList *iter = files; iter->name != NULL; ++iter) {
+void DecodeFilesWithPause(const PauseFileList files[]) {
+ for (const PauseFileList *iter = files; iter->name != NULL; ++iter) {
SCOPED_TRACE(iter->name);
for (int t = 2; t <= 8; ++t) {
EXPECT_EQ(iter->expected_md5,
- DecodeFile(iter->name, t, iter->pause_frame_num))
+ DecodeFileWithPause(iter->name, t, iter->pause_frame_num))
<< "threads = " << t;
}
}
@@ -106,19 +107,19 @@
TEST(VP9MultiThreadedFrameParallel, PauseSeekResume) {
// vp90-2-07-frame_parallel-1.webm is a 40 frame video file with
// one key frame for every ten frames.
- static const FileList files[] = {
+ static const PauseFileList files[] = {
{ "vp90-2-07-frame_parallel-1.webm",
- "6ea7c3875d67252e7caf2bc6e75b36b1", 6},
+ "6ea7c3875d67252e7caf2bc6e75b36b1", 6 },
{ "vp90-2-07-frame_parallel-1.webm",
- "4bb634160c7356a8d7d4299b6dc83a45", 12},
+ "4bb634160c7356a8d7d4299b6dc83a45", 12 },
{ "vp90-2-07-frame_parallel-1.webm",
- "89772591e6ef461f9fa754f916c78ed8", 26},
- { NULL, NULL, 0},
+ "89772591e6ef461f9fa754f916c78ed8", 26 },
+ { NULL, NULL, 0 },
};
- DecodeFiles(files);
+ DecodeFilesWithPause(files);
}
-struct InvalidFileList {
+struct FileList {
const char *name;
// md5 sum for decoded frames which does not include corrupted frames.
const char *expected_md5;
@@ -128,8 +129,8 @@
// Decodes |filename| with |num_threads|. Return the md5 of the decoded
// frames which does not include corrupted frames.
-string DecodeInvalidFile(const string &filename, int num_threads,
- int expected_frame_count) {
+string DecodeFile(const string &filename, int num_threads,
+ int expected_frame_count) {
libvpx_test::WebMVideoSource video(filename);
video.Init();
@@ -173,12 +174,12 @@
return string(md5.Get());
}
-void DecodeInvalidFiles(const InvalidFileList files[]) {
- for (const InvalidFileList *iter = files; iter->name != NULL; ++iter) {
+void DecodeFiles(const FileList files[]) {
+ for (const FileList *iter = files; iter->name != NULL; ++iter) {
SCOPED_TRACE(iter->name);
for (int t = 2; t <= 8; ++t) {
EXPECT_EQ(iter->expected_md5,
- DecodeInvalidFile(iter->name, t, iter->expected_frame_count))
+ DecodeFile(iter->name, t, iter->expected_frame_count))
<< "threads = " << t;
}
}
@@ -185,25 +186,35 @@
}
TEST(VP9MultiThreadedFrameParallel, InvalidFileTest) {
- static const InvalidFileList files[] = {
+ static const FileList files[] = {
// invalid-vp90-2-07-frame_parallel-1.webm is a 40 frame video file with
// one key frame for every ten frames. The 11th frame has corrupted data.
{ "invalid-vp90-2-07-frame_parallel-1.webm",
- "0549d0f45f60deaef8eb708e6c0eb6cb", 30},
+ "0549d0f45f60deaef8eb708e6c0eb6cb", 30 },
// invalid-vp90-2-07-frame_parallel-2.webm is a 40 frame video file with
// one key frame for every ten frames. The 1st and 31st frames have
// corrupted data.
{ "invalid-vp90-2-07-frame_parallel-2.webm",
- "6a1f3cf6f9e7a364212fadb9580d525e", 20},
+ "6a1f3cf6f9e7a364212fadb9580d525e", 20 },
// invalid-vp90-2-07-frame_parallel-3.webm is a 40 frame video file with
// one key frame for every ten frames. The 5th and 13th frames have
// corrupted data.
{ "invalid-vp90-2-07-frame_parallel-3.webm",
- "8256544308de926b0681e04685b98677", 27},
- { NULL, NULL, 0},
+ "8256544308de926b0681e04685b98677", 27 },
+ { NULL, NULL, 0 },
};
- DecodeInvalidFiles(files);
+ DecodeFiles(files);
}
+TEST(VP9MultiThreadedFrameParallel, ValidFileTest) {
+ static const FileList files[] = {
+#if CONFIG_VP9_HIGHBITDEPTH
+ { "vp92-2-20-10bit-yuv420.webm",
+ "a16b99df180c584e8db2ffeda987d293", 10 },
+#endif
+ { NULL, NULL, 0 },
+ };
+ DecodeFiles(files);
+}
#endif // CONFIG_WEBM_IO
} // namespace
--- a/vp9/decoder/vp9_dthread.c
+++ b/vp9/decoder/vp9_dthread.c
@@ -155,6 +155,10 @@
dst_worker_data->pbi->need_resync = src_worker_data->pbi->need_resync;
vp9_frameworker_unlock_stats(src_worker);
+ dst_cm->bit_depth = src_cm->bit_depth;
+#if CONFIG_VP9_HIGHBITDEPTH
+ dst_cm->use_highbitdepth = src_cm->use_highbitdepth;
+#endif
dst_cm->prev_frame = src_cm->show_existing_frame ?
src_cm->prev_frame : src_cm->cur_frame;
dst_cm->last_width = !src_cm->show_existing_frame ?