OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 } | 1048 } |
1049 } | 1049 } |
1050 | 1050 |
1051 static void write_bitdepth_colorspace_sampling( | 1051 static void write_bitdepth_colorspace_sampling( |
1052 VP9_COMMON *const cm, struct vp9_write_bit_buffer *wb) { | 1052 VP9_COMMON *const cm, struct vp9_write_bit_buffer *wb) { |
1053 if (cm->profile >= PROFILE_2) { | 1053 if (cm->profile >= PROFILE_2) { |
1054 assert(cm->bit_depth > VPX_BITS_8); | 1054 assert(cm->bit_depth > VPX_BITS_8); |
1055 vp9_wb_write_bit(wb, cm->bit_depth == VPX_BITS_10 ? 0 : 1); | 1055 vp9_wb_write_bit(wb, cm->bit_depth == VPX_BITS_10 ? 0 : 1); |
1056 } | 1056 } |
1057 vp9_wb_write_literal(wb, cm->color_space, 3); | 1057 vp9_wb_write_literal(wb, cm->color_space, 3); |
1058 if (cm->color_space != SRGB) { | 1058 if (cm->color_space != VPX_CS_SRGB) { |
1059 vp9_wb_write_bit(wb, 0); // 0: [16, 235] (i.e. xvYCC), 1: [0, 255] | 1059 vp9_wb_write_bit(wb, 0); // 0: [16, 235] (i.e. xvYCC), 1: [0, 255] |
1060 if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { | 1060 if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { |
1061 assert(cm->subsampling_x != 1 || cm->subsampling_y != 1); | 1061 assert(cm->subsampling_x != 1 || cm->subsampling_y != 1); |
1062 vp9_wb_write_bit(wb, cm->subsampling_x); | 1062 vp9_wb_write_bit(wb, cm->subsampling_x); |
1063 vp9_wb_write_bit(wb, cm->subsampling_y); | 1063 vp9_wb_write_bit(wb, cm->subsampling_y); |
1064 vp9_wb_write_bit(wb, 0); // unused | 1064 vp9_wb_write_bit(wb, 0); // unused |
1065 } else { | 1065 } else { |
1066 assert(cm->subsampling_x == 1 && cm->subsampling_y == 1); | 1066 assert(cm->subsampling_x == 1 && cm->subsampling_y == 1); |
1067 } | 1067 } |
1068 } else { | 1068 } else { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 | 1240 |
1241 first_part_size = write_compressed_header(cpi, data); | 1241 first_part_size = write_compressed_header(cpi, data); |
1242 data += first_part_size; | 1242 data += first_part_size; |
1243 // TODO(jbb): Figure out what to do if first_part_size > 16 bits. | 1243 // TODO(jbb): Figure out what to do if first_part_size > 16 bits. |
1244 vp9_wb_write_literal(&saved_wb, (int)first_part_size, 16); | 1244 vp9_wb_write_literal(&saved_wb, (int)first_part_size, 16); |
1245 | 1245 |
1246 data += encode_tiles(cpi, data); | 1246 data += encode_tiles(cpi, data); |
1247 | 1247 |
1248 *size = data - dest; | 1248 *size = data - dest; |
1249 } | 1249 } |
OLD | NEW |