Commit 8ce1c853 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

VideoDecoderShim: mark transformation constants static

The constants are used outside the scope they're defined in, which means
unless they're marked 'static', their lifetime has ended and the compiler
is free to reuse their stack slot. Marking them static means they're always
alive, and also removes the need to copy them to the stack.

Re-using the stack slot for some part of these was causing the red channel
to disappear during chromoting when compiling with Clang without
-fmerge-all-constants.

Bug: 835506
Change-Id: I6bddbf531979fecf78c80c0f96afda8ea0d05e33
Reviewed-on: https://chromium-review.googlesource.com/1035323Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarRaymes Khoury <raymes@chromium.org>
Commit-Queue: Raymes Khoury <raymes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554935}
parent 1310ba0e
...@@ -365,13 +365,13 @@ void VideoDecoderShim::YUVConverter::Convert( ...@@ -365,13 +365,13 @@ void VideoDecoderShim::YUVConverter::Convert(
// numbers that are used in the transformation from YUV to RGB color values. // numbers that are used in the transformation from YUV to RGB color values.
// They are taken from the following webpage: // They are taken from the following webpage:
// http://www.fourcc.org/fccyvrgb.php // http://www.fourcc.org/fccyvrgb.php
const float yuv_to_rgb_rec601[9] = { static const float yuv_to_rgb_rec601[9] = {
1.164f, 1.164f, 1.164f, 0.0f, -.391f, 2.018f, 1.596f, -.813f, 0.0f, 1.164f, 1.164f, 1.164f, 0.0f, -.391f, 2.018f, 1.596f, -.813f, 0.0f,
}; };
const float yuv_to_rgb_jpeg[9] = { static const float yuv_to_rgb_jpeg[9] = {
1.f, 1.f, 1.f, 0.0f, -.34414f, 1.772f, 1.402f, -.71414f, 0.0f, 1.f, 1.f, 1.f, 0.0f, -.34414f, 1.772f, 1.402f, -.71414f, 0.0f,
}; };
const float yuv_to_rgb_rec709[9] = { static const float yuv_to_rgb_rec709[9] = {
1.164f, 1.164f, 1.164f, 0.0f, -0.213f, 2.112f, 1.793f, -0.533f, 0.0f, 1.164f, 1.164f, 1.164f, 0.0f, -0.213f, 2.112f, 1.793f, -0.533f, 0.0f,
}; };
...@@ -381,11 +381,11 @@ void VideoDecoderShim::YUVConverter::Convert( ...@@ -381,11 +381,11 @@ void VideoDecoderShim::YUVConverter::Convert(
// Y - 16 : Gives 16 values of head and footroom for overshooting // Y - 16 : Gives 16 values of head and footroom for overshooting
// U - 128 : Turns unsigned U into signed U [-128,127] // U - 128 : Turns unsigned U into signed U [-128,127]
// V - 128 : Turns unsigned V into signed V [-128,127] // V - 128 : Turns unsigned V into signed V [-128,127]
const float yuv_adjust_constrained[3] = { static const float yuv_adjust_constrained[3] = {
-0.0625f, -0.5f, -0.5f, -0.0625f, -0.5f, -0.5f,
}; };
// Same as above, but without the head and footroom. // Same as above, but without the head and footroom.
const float yuv_adjust_full[3] = { static const float yuv_adjust_full[3] = {
0.0f, -0.5f, -0.5f, 0.0f, -0.5f, -0.5f,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment