ADST_ADST = 3 // ADST in both directions
} TX_TYPE;
+typedef enum {
+ UNKNOWN = 0,
+ BT_601 = 1, // YUV
+ BT_709 = 2, // YUV
+ SMPTE_170 = 3, // YUV
+ SMPTE_240 = 4, // YUV
+ RESERVED_1 = 5,
+ RESERVED_2 = 6,
+ SRGB = 7 // RGB
+} COLOR_SPACE;
+
#endif // VP9_COMMON_VP9_ENUMS_H_
DECLARE_ALIGNED(16, int16_t, a_dequant[QINDEX_RANGE][8]);
#endif
+ COLOR_SPACE color_space;
+
int width;
int height;
int display_width;
cm->error_resilient_mode = vp9_rb_read_bit(rb);
if (cm->frame_type == KEY_FRAME) {
- int csp;
-
check_sync_code(cm, rb);
- csp = vp9_rb_read_literal(rb, 3); // colorspace
- if (csp != 7) { // != sRGB
+ cm->color_space = vp9_rb_read_literal(rb, 3); // colorspace
+ if (cm->color_space != SRGB) {
vp9_rb_read_bit(rb); // [16,235] (including xvycc) vs [0,255] range
if (cm->version == 1) {
cm->subsampling_x = vp9_rb_read_bit(rb);
vp9_wb_write_bit(wb, cm->error_resilient_mode);
if (cm->frame_type == KEY_FRAME) {
+ const COLOR_SPACE cs = UNKNOWN;
write_sync_code(wb);
- // colorspaces
- // 000 - Unknown
- // 001 - BT.601
- // 010 - BT.709
- // 011 - SMPTE-170
- // 100 - SMPTE-240
- // 101 - Reserved
- // 110 - Reserved
- // 111 - sRGB (RGB)
- vp9_wb_write_literal(wb, 0, 3);
- if (1 /* colorspace != sRGB */) {
+ vp9_wb_write_literal(wb, cs, 3);
+ if (cs != SRGB) {
vp9_wb_write_bit(wb, 0); // 0: [16, 235] (i.e. xvYCC), 1: [0, 255]
if (cm->version == 1) {
vp9_wb_write_bit(wb, cm->subsampling_x);