summaryrefslogtreecommitdiffstats
path: root/cc/output
diff options
context:
space:
mode:
authorflackr <flackr@chromium.org>2016-02-05 08:30:01 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-05 16:30:59 +0000
commit7f4c685723ac9316650e8f337c08fa0bc4ffe77b (patch)
treefac30d0c9a8d30db3fd008da34677164a3c3e507 /cc/output
parentfb9b774dbcabd8abaddf3e26e767f1dc740b67c8 (diff)
downloadchromium_src-7f4c685723ac9316650e8f337c08fa0bc4ffe77b.zip
chromium_src-7f4c685723ac9316650e8f337c08fa0bc4ffe77b.tar.gz
chromium_src-7f4c685723ac9316650e8f337c08fa0bc4ffe77b.tar.bz2
Revert of Add support for 9- and 10-bit h264 videos. (patchset #27 of https://codereview.chromium.org/1599533002/ )
Reason for revert: Commit was failing content_browsertests on Mac 10.10: failures: Http/MediaTest.VideoBearHighBitDepthMp4/0 File/MediaTest.VideoBearHighBitDepthMp4/0 First failure: https://build.chromium.org/p/chromium.mac/builders/Mac10.10%20Tests/builds/5222 Original issue's description: > Add support for 9- and 10-bit h264 videos. > > Videos are uploaded to GPU using half-floats if supported, otherwise > they are downshifted to regular 8-bit textures before uploading. No > dithering is done, except for whatever GL_DITHER might do. (Which > is probably nothing.) > > BUG=445071 > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/074c4287f2625860b2a9eb437b97f1f1788f8f4b > Cr-Commit-Position: refs/heads/master@{#373691} TBR=fbarchard@chromium.org,erg@chromium.org,reed@chromium.org,piman@chromium.org,danakj@chromium.org,asvitkine@chromium.org,dalecurtis@chromium.org,nasko@chromium.org,fsamuel@chromium.org BUG=445071 NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1674703002 Cr-Commit-Position: refs/heads/master@{#373824}
Diffstat (limited to 'cc/output')
-rw-r--r--cc/output/gl_renderer.cc14
-rw-r--r--cc/output/renderer_pixeltest.cc112
2 files changed, 28 insertions, 98 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index f76d3e6..67382c0 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2122,23 +2122,13 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
break;
}
- float yuv_to_rgb_multiplied[9];
- float yuv_adjust_with_offset[3];
-
- for (int i = 0; i < 9; ++i)
- yuv_to_rgb_multiplied[i] = yuv_to_rgb[i] * quad->resource_multiplier;
-
- for (int i = 0; i < 3; ++i)
- yuv_adjust_with_offset[i] =
- yuv_adjust[i] / quad->resource_multiplier - quad->resource_offset;
-
// The transform and vertex data are used to figure out the extents that the
// un-antialiased quad should have and which vertex this is and the float
// quad passed in via uniform is the actual geometry that gets used to draw
// it. This is why this centered rect is used and not the original quad_rect.
auto tile_rect = gfx::RectF(quad->rect);
- gl_->UniformMatrix3fv(yuv_matrix_location, 1, 0, yuv_to_rgb_multiplied);
- gl_->Uniform3fv(yuv_adj_location, 1, yuv_adjust_with_offset);
+ gl_->UniformMatrix3fv(yuv_matrix_location, 1, 0, yuv_to_rgb);
+ gl_->Uniform3fv(yuv_adj_location, 1, yuv_adjust);
SetShaderOpacity(quad->shared_quad_state->opacity, alpha_location);
if (!clip_region) {
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
index 7f5bbfd..083bac1 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -267,61 +267,13 @@ void CreateTestYUVVideoDrawQuad_FromVideoFrame(
yuv_quad->SetNew(shared_state, rect, opaque_rect, visible_rect,
ya_tex_coord_rect, uv_tex_coord_rect, ya_tex_size,
uv_tex_size, y_resource, u_resource, v_resource, a_resource,
- color_space, 0.0f, 1.0f);
-}
-
-// Upshift video frame to 10 bit.
-scoped_refptr<media::VideoFrame> CreateHighbitVideoFrame(
- const scoped_refptr<media::VideoFrame>& video_frame) {
- media::VideoPixelFormat format;
- switch (video_frame->format()) {
- case media::PIXEL_FORMAT_I420:
- case media::PIXEL_FORMAT_YV12:
- format = media::PIXEL_FORMAT_YUV420P10;
- break;
- case media::PIXEL_FORMAT_YV16:
- format = media::PIXEL_FORMAT_YUV422P10;
- break;
- case media::PIXEL_FORMAT_YV24:
- format = media::PIXEL_FORMAT_YUV444P10;
- break;
-
- default:
- NOTREACHED();
- return nullptr;
- }
- scoped_refptr<media::VideoFrame> ret = media::VideoFrame::CreateFrame(
- format, video_frame->coded_size(), video_frame->visible_rect(),
- video_frame->natural_size(), video_frame->timestamp());
-
- // Copy all metadata.
- base::DictionaryValue tmp;
- video_frame->metadata()->MergeInternalValuesInto(&tmp);
- ret->metadata()->MergeInternalValuesFrom(tmp);
-
- for (int plane = media::VideoFrame::kYPlane;
- plane <= media::VideoFrame::kVPlane; ++plane) {
- int width = video_frame->row_bytes(plane);
- const uint8_t* src = video_frame->data(plane);
- uint16_t* dst = reinterpret_cast<uint16_t*>(ret->data(plane));
- for (int row = 0; row < video_frame->rows(plane); row++) {
- for (int x = 0; x < width; x++) {
- // Replicate the top bits into the lower bits, this way
- // 0xFF becomes 0x3FF.
- dst[x] = (src[x] << 2) | (src[x] >> 6);
- }
- src += video_frame->stride(plane);
- dst += ret->stride(plane) / 2;
- }
- }
- return ret;
+ color_space);
}
void CreateTestYUVVideoDrawQuad_Striped(
const SharedQuadState* shared_state,
media::VideoPixelFormat format,
bool is_transparent,
- bool highbit,
const gfx::RectF& tex_coord_rect,
RenderPass* render_pass,
VideoResourceUpdater* video_resource_updater,
@@ -356,10 +308,6 @@ void CreateTestYUVVideoDrawQuad_Striped(
}
}
uint8_t alpha_value = is_transparent ? 0 : 128;
-
- if (highbit)
- video_frame = CreateHighbitVideoFrame(video_frame);
-
CreateTestYUVVideoDrawQuad_FromVideoFrame(
shared_state, video_frame, alpha_value, tex_coord_rect, render_pass,
video_resource_updater, rect, visible_rect, resource_provider);
@@ -1032,11 +980,7 @@ class VideoGLRendererPixelTest : public GLRendererPixelTest {
scoped_ptr<VideoResourceUpdater> video_resource_updater_;
};
-class VideoGLRendererPixelHiLoTest
- : public VideoGLRendererPixelTest,
- public ::testing::WithParamInterface<bool> {};
-
-TEST_P(VideoGLRendererPixelHiLoTest, SimpleYUVRect) {
+TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) {
gfx::Rect rect(this->device_viewport_size_);
RenderPassId id(1, 1);
@@ -1045,11 +989,10 @@ TEST_P(VideoGLRendererPixelHiLoTest, SimpleYUVRect) {
SharedQuadState* shared_state =
CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
- bool highbit = GetParam();
- CreateTestYUVVideoDrawQuad_Striped(
- shared_state, media::PIXEL_FORMAT_YV12, false, highbit,
- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(),
- video_resource_updater_.get(), rect, rect, resource_provider_.get());
+ CreateTestYUVVideoDrawQuad_Striped(shared_state, media::PIXEL_FORMAT_YV12,
+ false, gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get(), video_resource_updater_.get(),
+ rect, rect, resource_provider_.get());
RenderPassList pass_list;
pass_list.push_back(std::move(pass));
@@ -1060,7 +1003,7 @@ TEST_P(VideoGLRendererPixelHiLoTest, SimpleYUVRect) {
FuzzyPixelOffByOneComparator(true)));
}
-TEST_P(VideoGLRendererPixelHiLoTest, ClippedYUVRect) {
+TEST_F(VideoGLRendererPixelTest, ClippedYUVRect) {
gfx::Rect viewport(this->device_viewport_size_);
gfx::Rect draw_rect(this->device_viewport_size_.width() * 1.5,
this->device_viewport_size_.height() * 1.5);
@@ -1071,12 +1014,11 @@ TEST_P(VideoGLRendererPixelHiLoTest, ClippedYUVRect) {
SharedQuadState* shared_state =
CreateTestSharedQuadState(gfx::Transform(), viewport, pass.get());
- bool highbit = GetParam();
- CreateTestYUVVideoDrawQuad_Striped(
- shared_state, media::PIXEL_FORMAT_YV12, false, highbit,
- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(),
- video_resource_updater_.get(), draw_rect, viewport,
- resource_provider_.get());
+ CreateTestYUVVideoDrawQuad_Striped(shared_state, media::PIXEL_FORMAT_YV12,
+ false, gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get(), video_resource_updater_.get(),
+ draw_rect, viewport,
+ resource_provider_.get());
RenderPassList pass_list;
pass_list.push_back(std::move(pass));
@@ -1085,7 +1027,7 @@ TEST_P(VideoGLRendererPixelHiLoTest, ClippedYUVRect) {
FuzzyPixelOffByOneComparator(true)));
}
-TEST_F(VideoGLRendererPixelHiLoTest, OffsetYUVRect) {
+TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) {
gfx::Rect rect(this->device_viewport_size_);
RenderPassId id(1, 1);
@@ -1096,7 +1038,7 @@ TEST_F(VideoGLRendererPixelHiLoTest, OffsetYUVRect) {
// Intentionally sets frame format to I420 for testing coverage.
CreateTestYUVVideoDrawQuad_Striped(
- shared_state, media::PIXEL_FORMAT_I420, false, false,
+ shared_state, media::PIXEL_FORMAT_I420, false,
gfx::RectF(0.125f, 0.25f, 0.75f, 0.5f), pass.get(),
video_resource_updater_.get(), rect, rect, resource_provider_.get());
@@ -1104,8 +1046,9 @@ TEST_F(VideoGLRendererPixelHiLoTest, OffsetYUVRect) {
pass_list.push_back(std::move(pass));
EXPECT_TRUE(this->RunPixelTest(
- &pass_list, base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")),
- FuzzyPixelComparator(true, 100.0f, 1.0f, 1.0f, 1, 0)));
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")),
+ FuzzyPixelOffByOneComparator(true)));
}
TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) {
@@ -1133,9 +1076,6 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) {
FuzzyPixelOffByOneComparator(true)));
}
-// First argument (test case prefix) is intentionally left empty.
-INSTANTIATE_TEST_CASE_P(, VideoGLRendererPixelHiLoTest, ::testing::Bool());
-
TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) {
gfx::Rect rect(this->device_viewport_size_);
@@ -1203,7 +1143,7 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) {
FuzzyPixelOffByOneComparator(true)));
}
-TEST_F(VideoGLRendererPixelHiLoTest, SimpleYUVARect) {
+TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) {
gfx::Rect rect(this->device_viewport_size_);
RenderPassId id(1, 1);
@@ -1212,10 +1152,10 @@ TEST_F(VideoGLRendererPixelHiLoTest, SimpleYUVARect) {
SharedQuadState* shared_state =
CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
- CreateTestYUVVideoDrawQuad_Striped(
- shared_state, media::PIXEL_FORMAT_YV12A, false, false,
- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(),
- video_resource_updater_.get(), rect, rect, resource_provider_.get());
+ CreateTestYUVVideoDrawQuad_Striped(shared_state, media::PIXEL_FORMAT_YV12A,
+ false, gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get(), video_resource_updater_.get(),
+ rect, rect, resource_provider_.get());
SolidColorDrawQuad* color_quad =
pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
@@ -1239,10 +1179,10 @@ TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) {
SharedQuadState* shared_state =
CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
- CreateTestYUVVideoDrawQuad_Striped(
- shared_state, media::PIXEL_FORMAT_YV12A, true, false,
- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(),
- video_resource_updater_.get(), rect, rect, resource_provider_.get());
+ CreateTestYUVVideoDrawQuad_Striped(shared_state, media::PIXEL_FORMAT_YV12A,
+ true, gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get(), video_resource_updater_.get(),
+ rect, rect, resource_provider_.get());
SolidColorDrawQuad* color_quad =
pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();