-#include <string.h>
-#include <assert.h>
-
+#include <Eigen/Core>
#include <Eigen/LU>
+#include <GL/glew.h>
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
-#include "ycbcr_input.h"
+#include "effect_util.h"
#include "util.h"
-#include "opengl.h"
+#include "ycbcr_input.h"
using namespace Eigen;
heights[1] = height / ycbcr_format.chroma_subsampling_y;
heights[2] = height / ycbcr_format.chroma_subsampling_y;
+ pixel_data[0] = pixel_data[1] = pixel_data[2] = NULL;
+
register_int("needs_mipmaps", &needs_mipmaps);
}
coeff[1] = 0.7152;
coeff[2] = 0.0722;
break;
+
+ case YCBCR_REC_2020:
+ // Rec. 2020, page 4.
+ coeff[0] = 0.2627;
+ coeff[1] = 0.6780;
+ coeff[2] = 0.0593;
+ break;
+
default:
assert(false);
}
scale[1] = 1.0;
scale[2] = 1.0;
} else {
- // Rec. 601, page 4; Rec. 709, page 19.
+ // Rec. 601, page 4; Rec. 709, page 19; Rec. 2020, page 4.
offset[0] = 16.0 / 255.0;
offset[1] = 128.0 / 255.0;
offset[2] = 128.0 / 255.0;
scale[0], scale[1], scale[2]);
frag_shader += buf;
- float chroma_offset_x = compute_chroma_offset(
- ycbcr_format.chroma_x_position, ycbcr_format.chroma_subsampling_x, widths[1]);
- float chroma_offset_y = compute_chroma_offset(
- ycbcr_format.chroma_y_position, ycbcr_format.chroma_subsampling_y, heights[1]);
- sprintf(buf, "const vec2 PREFIX(chroma_offset) = vec2(%.8f, %.8f);\n",
- chroma_offset_x, chroma_offset_y);
+ float cb_offset_x = compute_chroma_offset(
+ ycbcr_format.cb_x_position, ycbcr_format.chroma_subsampling_x, widths[1]);
+ float cb_offset_y = compute_chroma_offset(
+ ycbcr_format.cb_y_position, ycbcr_format.chroma_subsampling_y, heights[1]);
+ sprintf(buf, "const vec2 PREFIX(cb_offset) = vec2(%.8f, %.8f);\n",
+ cb_offset_x, cb_offset_y);
+ frag_shader += buf;
+
+ float cr_offset_x = compute_chroma_offset(
+ ycbcr_format.cr_x_position, ycbcr_format.chroma_subsampling_x, widths[2]);
+ float cr_offset_y = compute_chroma_offset(
+ ycbcr_format.cr_y_position, ycbcr_format.chroma_subsampling_y, heights[2]);
+ sprintf(buf, "const vec2 PREFIX(cr_offset) = vec2(%.8f, %.8f);\n",
+ cr_offset_x, cr_offset_y);
frag_shader += buf;
frag_shader += read_file("ycbcr_input.frag");