1// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto2";
6package media.fuzzing;
7
8message JpegComponent {
9  optional uint32 id = 1;
10  optional uint32 horizontal_sampling_factor = 2;
11  optional uint32 vertical_sampling_factor = 3;
12  optional uint32 quantization_table_selector = 4;
13}
14
15message JpegFrameHeader {
16  optional uint32 visible_width = 1;
17  optional uint32 visible_height = 2;
18  optional uint32 coded_width = 3;
19  optional uint32 coded_height = 4;
20  repeated JpegComponent components = 5;
21}
22
23message JpegHuffmanTable {
24  optional bool valid = 1;
25  optional bytes code_length = 2;
26  optional bytes code_value = 3;
27}
28
29message JpegQuantizationTable {
30  optional bool valid = 1;
31  optional bytes value = 2;
32}
33
34message JpegScanHeader {
35  message Component {
36    optional uint32 component_selector = 1;
37    optional uint32 dc_selector = 2;
38    optional uint32 ac_selector = 3;
39  }
40  repeated Component components = 1;
41}
42
43message JpegParseResult {
44  optional JpegFrameHeader frame_header = 1;
45  repeated JpegHuffmanTable dc_table = 2;
46  repeated JpegHuffmanTable ac_table = 3;
47  repeated JpegQuantizationTable q_table = 4;
48  optional uint32 restart_interval = 5;
49  optional JpegScanHeader scan = 6;
50  optional bytes data = 7;
51  optional uint32 image_size = 8;
52}
53
54enum VARTFormat {
55  INVALID = 0;
56  YUV420 = 1;
57  YUV422 = 2;
58  YUV444 = 3;
59  YUV411 = 4;
60  YUV400 = 5;
61  YUV420_10 = 6;
62  YUV422_10 = 7;
63  YUV444_10 = 8;
64  YUV420_12 = 9;
65  YUV422_12 = 10;
66  YUV444_12 = 11;
67  RGB16 = 12;
68  RGB32 = 13;
69  RGBP = 14;
70  RGB32_10 = 15;
71  PROTECTED = 16;
72}
73
74message JpegImageList {
75  message JpegImage {
76    optional VARTFormat picture_va_rt_format = 1 [default = INVALID];
77    optional int32 surface_coded_width = 2;
78    optional int32 surface_coded_height = 3;
79    optional int32 surface_visible_width = 4;
80    optional int32 surface_visible_height = 5;
81    optional JpegParseResult parse_result = 6;
82  }
83  repeated JpegImage images = 1;
84}
85