• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2019 The WebM project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef VPX_VP9_SIMPLE_ENCODE_H_
12 #define VPX_VP9_SIMPLE_ENCODE_H_
13 
14 #include <cstddef>
15 #include <cstdint>
16 #include <cstdio>
17 #include <memory>
18 #include <vector>
19 
20 namespace vp9 {
21 
22 enum StatusCode {
23   StatusOk = 0,
24   StatusError,
25 };
26 
27 // TODO(angiebird): Add description for each frame type.
28 enum FrameType {
29   kFrameTypeKey = 0,
30   kFrameTypeInter = 1,
31   kFrameTypeAltRef = 2,
32   kFrameTypeOverlay = 3,
33   kFrameTypeGolden = 4,
34 };
35 
36 // TODO(angiebird): Add description for each reference frame type.
37 // This enum numbers have to be contiguous and start from zero except
38 // kNoneRefFrame.
39 enum RefFrameType {
40   kRefFrameTypeLast = 0,
41   kRefFrameTypePast = 1,
42   kRefFrameTypeFuture = 2,
43   kRefFrameTypeMax = 3,
44   kRefFrameTypeNone = -1,
45 };
46 
47 enum GopMapFlag {
48   kGopMapFlagStart =
49       1 << 0,  // Indicate this location is the start of a group of pictures.
50   kGopMapFlagUseAltRef =
51       1 << 1,  // Indicate this group of pictures will use an alt ref. Only set
52                // this flag when kGopMapFlagStart is set.
53 };
54 
55 // The frame is split to 4x4 blocks.
56 // This structure contains the information of each 4x4 block.
57 struct PartitionInfo {
58   int row;           // row pixel offset of current 4x4 block
59   int column;        // column pixel offset of current 4x4 block
60   int row_start;     // row pixel offset of the start of the prediction block
61   int column_start;  // column pixel offset of the start of the prediction block
62   int width;         // prediction block width
63   int height;        // prediction block height
64 };
65 
66 constexpr int kMotionVectorSubPixelPrecision = 8;
67 constexpr int kMotionVectorFullPixelPrecision = 1;
68 
69 // In the first pass. The frame is split to 16x16 blocks.
70 // This structure contains the information of each 16x16 block.
71 // In the second pass. The frame is split to 4x4 blocks.
72 // This structure contains the information of each 4x4 block.
73 struct MotionVectorInfo {
74   // Number of valid motion vectors, always 0 if this block is in the key frame.
75   // For inter frames, it could be 1 or 2.
76   int mv_count;
77   // The reference frame for motion vectors. If the second motion vector does
78   // not exist (mv_count = 1), the reference frame is kNoneRefFrame.
79   // Otherwise, the reference frame is either kRefFrameTypeLast, or
80   // kRefFrameTypePast, or kRefFrameTypeFuture.
81   RefFrameType ref_frame[2];
82   // The row offset of motion vectors in the unit of pixel.
83   // If the second motion vector does not exist, the value is 0.
84   double mv_row[2];
85   // The column offset of motion vectors in the unit of pixel.
86   // If the second motion vector does not exist, the value is 0.
87   double mv_column[2];
88 };
89 
90 // Accumulated tpl stats of all blocks in one frame.
91 // For each frame, the tpl stats are computed per 32x32 block.
92 struct TplStatsInfo {
93   // Intra complexity: the sum of absolute transform difference (SATD) of
94   // intra predicted residuals.
95   int64_t intra_cost;
96   // Inter complexity: the SATD of inter predicted residuals.
97   int64_t inter_cost;
98   // Motion compensated information flow. It measures how much information
99   // is propagated from the current frame to other frames.
100   int64_t mc_flow;
101   // Motion compensated dependency cost. It equals to its own intra_cost
102   // plus the mc_flow.
103   int64_t mc_dep_cost;
104   // Motion compensated reference cost.
105   int64_t mc_ref_cost;
106 };
107 
108 struct RefFrameInfo {
109   int coding_indexes[kRefFrameTypeMax];
110 
111   // Indicate whether the reference frames are available or not.
112   // When the reference frame type is not valid, it means either the to-be-coded
113   // frame is a key frame or the reference frame already appears in other
114   // reference frame type. vp9 always keeps three types of reference frame
115   // available.  However, the duplicated reference frames will not be
116   // chosen by the encoder. The priorities of choosing reference frames are
117   // kRefFrameTypeLast > kRefFrameTypePast > kRefFrameTypeFuture.
118   // For example, if kRefFrameTypeLast and kRefFrameTypePast both point to the
119   // same frame, kRefFrameTypePast will be set to invalid.
120   // 1: the ref frame type is available 0: the ref frame type is not available
121   int valid_list[kRefFrameTypeMax];
122 };
123 
124 bool operator==(const RefFrameInfo &a, const RefFrameInfo &b);
125 
126 struct EncodeFrameInfo {
127   int show_idx;
128 
129   // Each show or no show frame is assigned with a coding index based on its
130   // coding order (starting from zero) in the coding process of the entire
131   // video. The coding index for each frame is unique.
132   int coding_index;
133   RefFrameInfo ref_frame_info;
134   FrameType frame_type;
135 };
136 
137 // This structure is a copy of vp9 |nmv_component_counts|.
138 struct NewMotionvectorComponentCounts {
139   std::vector<unsigned int> sign;
140   std::vector<unsigned int> classes;
141   std::vector<unsigned int> class0;
142   std::vector<std::vector<unsigned int>> bits;
143   std::vector<std::vector<unsigned int>> class0_fp;
144   std::vector<unsigned int> fp;
145   std::vector<unsigned int> class0_hp;
146   std::vector<unsigned int> hp;
147 };
148 
149 // This structure is a copy of vp9 |nmv_context_counts|.
150 struct NewMotionVectorContextCounts {
151   std::vector<unsigned int> joints;
152   std::vector<NewMotionvectorComponentCounts> comps;
153 };
154 
155 using UintArray2D = std::vector<std::vector<unsigned int>>;
156 using UintArray3D = std::vector<std::vector<std::vector<unsigned int>>>;
157 using UintArray5D = std::vector<
158     std::vector<std::vector<std::vector<std::vector<unsigned int>>>>>;
159 using UintArray6D = std::vector<std::vector<
160     std::vector<std::vector<std::vector<std::vector<unsigned int>>>>>>;
161 
162 // This structure is a copy of vp9 |tx_counts|.
163 struct TransformSizeCounts {
164   // Transform size found in blocks of partition size 32x32.
165   // First dimension: transform size contexts (2).
166   // Second dimension: transform size type (3: 32x32, 16x16, 8x8)
167   UintArray2D p32x32;
168   // Transform size found in blocks of partition size 16x16.
169   // First dimension: transform size contexts (2).
170   // Second dimension: transform size type (2: 16x16, 8x8)
171   UintArray2D p16x16;
172   // Transform size found in blocks of partition size 8x8.
173   // First dimension: transform size contexts (2).
174   // Second dimension: transform size type (1: 8x8)
175   UintArray2D p8x8;
176   // Overall transform size count.
177   std::vector<unsigned int> tx_totals;
178 };
179 
180 // This structure is a copy of vp9 |FRAME_COUNTS|.
181 struct FrameCounts {
182   // Intra prediction mode for luma plane. First dimension: block size (4).
183   // Second dimension: intra prediction mode (10).
184   UintArray2D y_mode;
185   // Intra prediction mode for chroma plane. First and second dimension:
186   // intra prediction mode (10).
187   UintArray2D uv_mode;
188   // Partition type. First dimension: partition contexts (16).
189   // Second dimension: partition type (4).
190   UintArray2D partition;
191   // Transform coefficient.
192   UintArray6D coef;
193   // End of block (the position of the last non-zero transform coefficient)
194   UintArray5D eob_branch;
195   // Interpolation filter type. First dimension: switchable filter contexts (4).
196   // Second dimension: filter types (3).
197   UintArray2D switchable_interp;
198   // Inter prediction mode (the motion vector type).
199   // First dimension: inter mode contexts (7).
200   // Second dimension: mode type (4).
201   UintArray2D inter_mode;
202   // Block is intra or inter predicted. First dimension: contexts (4).
203   // Second dimension: type (0 for intra, 1 for inter).
204   UintArray2D intra_inter;
205   // Block is compound predicted (predicted from average of two blocks).
206   // First dimension: contexts (5).
207   // Second dimension: type (0 for single, 1 for compound prediction).
208   UintArray2D comp_inter;
209   // Type of the reference frame. Only one reference frame.
210   // First dimension: context (5). Second dimension: context (2).
211   // Third dimension: count (2).
212   UintArray3D single_ref;
213   // Type of the two reference frames.
214   // First dimension: context (5). Second dimension: count (2).
215   UintArray2D comp_ref;
216   // Block skips transform and quantization, uses prediction as reconstruction.
217   // First dimension: contexts (3). Second dimension: type (0 not skip, 1 skip).
218   UintArray2D skip;
219   // Transform size.
220   TransformSizeCounts tx;
221   // New motion vector.
222   NewMotionVectorContextCounts mv;
223 };
224 
225 struct ImageBuffer {
226   // The image data is stored in raster order,
227   // i.e. image[plane][r][c] =
228   // plane_buffer[plane][r * plane_width[plane] + plane_height[plane]].
229   std::unique_ptr<unsigned char[]> plane_buffer[3];
230   int plane_width[3];
231   int plane_height[3];
232 };
233 
234 void output_image_buffer(const ImageBuffer &image_buffer, std::FILE *out_file);
235 
236 struct EncodeFrameResult {
237   int show_idx;
238   FrameType frame_type;
239   int coding_idx;
240   RefFrameInfo ref_frame_info;
241   size_t coding_data_bit_size;
242   size_t coding_data_byte_size;
243   // The EncodeFrame will allocate a buffer, write the coding data into the
244   // buffer and give the ownership of the buffer to coding_data.
245   std::unique_ptr<unsigned char[]> coding_data;
246   double psnr;
247   uint64_t sse;
248   int quantize_index;
249   FrameCounts frame_counts;
250   int num_rows_4x4;  // number of row units, in size of 4.
251   int num_cols_4x4;  // number of column units, in size of 4.
252   // A vector of the partition information of the frame.
253   // The number of elements is |num_rows_4x4| * |num_cols_4x4|.
254   // The frame is divided 4x4 blocks of |num_rows_4x4| rows and
255   // |num_cols_4x4| columns.
256   // Each 4x4 block contains the current pixel position (|row|, |column|),
257   // the start pixel position of the partition (|row_start|, |column_start|),
258   // and the |width|, |height| of the partition.
259   // The current pixel position can be the same as the start pixel position
260   // if the 4x4 block is the top-left block in the partition. Otherwise, they
261   // are different.
262   // Within the same partition, all 4x4 blocks have the same |row_start|,
263   // |column_start|, |width| and |height|.
264   // For example, if the frame is partitioned to a 32x32 block,
265   // starting at (0, 0). Then, there're 64 4x4 blocks within this partition.
266   // They all have the same |row_start|, |column_start|, |width|, |height|,
267   // which can be used to figure out the start of the current partition and
268   // the start of the next partition block.
269   // Horizontal next: |column_start| + |width|,
270   // Vertical next: |row_start| + |height|.
271   std::vector<PartitionInfo> partition_info;
272   // A vector of the motion vector information of the frame.
273   // The number of elements is |num_rows_4x4| * |num_cols_4x4|.
274   // The frame is divided into 4x4 blocks of |num_rows_4x4| rows and
275   // |num_cols_4x4| columns.
276   // Each 4x4 block contains 0 motion vector if this is an intra predicted
277   // frame (for example, the key frame). If the frame is inter predicted,
278   // each 4x4 block contains either 1 or 2 motion vectors.
279   // Similar to partition info, all 4x4 blocks inside the same partition block
280   // share the same motion vector information.
281   std::vector<MotionVectorInfo> motion_vector_info;
282   // A vector of the tpl stats information.
283   // The tpl stats measure the complexity of a frame, as well as the
284   // information propagated along the motion trajectory between frames, in
285   // the reference frame structure.
286   // The tpl stats could be used as a more accurate spatial and temporal
287   // complexity measure in addition to the first pass stats.
288   // The vector contains tpl stats for all show frames in a GOP.
289   // The tpl stats stored in the vector is according to the encoding order.
290   // For example, suppose there are N show frames for the current GOP.
291   // Then tpl_stats_info[0] stores the information of the first frame to be
292   // encoded for this GOP, i.e, the AltRef frame.
293   std::vector<TplStatsInfo> tpl_stats_info;
294   ImageBuffer coded_frame;
295 
296   // recode_count, q_index_history and rate_history are only available when
297   // EncodeFrameWithTargetFrameBits() is used.
298   int recode_count;
299   std::vector<int> q_index_history;
300   std::vector<int> rate_history;
301 };
302 
303 struct GroupOfPicture {
304   // This list will be updated internally in StartEncode() and
305   // EncodeFrame()/EncodeFrameWithQuantizeIndex().
306   // In EncodeFrame()/EncodeFrameWithQuantizeIndex(), the update will only be
307   // triggered when the coded frame is the last one in the previous group of
308   // pictures.
309   std::vector<EncodeFrameInfo> encode_frame_list;
310 
311   // Indicates the index of the next coding frame in encode_frame_list.
312   // In other words, EncodeFrameInfo of the next coding frame can be
313   // obtained with encode_frame_list[next_encode_frame_index].
314   // Internally, next_encode_frame_index will be set to zero after the last
315   // frame of the group of pictures is coded. Otherwise, next_encode_frame_index
316   // will be increased after each EncodeFrame()/EncodeFrameWithQuantizeIndex()
317   // call.
318   int next_encode_frame_index;
319 
320   // Number of show frames in this group of pictures.
321   int show_frame_count;
322 
323   // The show index/timestamp of the earliest show frame in the group of
324   // pictures.
325   int start_show_index;
326 
327   // The coding index of the first coding frame in the group of pictures.
328   int start_coding_index;
329 
330   // Indicates whether this group of pictures starts with a key frame.
331   int first_is_key_frame;
332 
333   // Indicates whether this group of pictures uses an alt ref.
334   int use_alt_ref;
335 
336   // Indicates whether previous group of pictures used an alt ref.
337   int last_gop_use_alt_ref;
338 };
339 
340 class SimpleEncode {
341  public:
342   // When outfile_path is set, the encoder will output the bitstream in ivf
343   // format.
344   SimpleEncode(int frame_width, int frame_height, int frame_rate_num,
345                int frame_rate_den, int target_bitrate, int num_frames,
346                const char *infile_path, const char *outfile_path = nullptr);
347   ~SimpleEncode();
348   SimpleEncode(SimpleEncode &) = delete;
349   SimpleEncode &operator=(const SimpleEncode &) = delete;
350 
351   // Adjusts the encoder's coding speed.
352   // If this function is not called, the encoder will use default encode_speed
353   // 0. Call this function before ComputeFirstPassStats() if needed.
354   // The encode_speed is equivalent to --cpu-used of the vpxenc command.
355   // The encode_speed's range should be [0, 9].
356   // Setting the encode_speed to a higher level will yield faster coding
357   // at the cost of lower compression efficiency.
358   void SetEncodeSpeed(int encode_speed);
359 
360   // Set encoder config
361   // The following configs in VP9EncoderConfig are allowed to change in this
362   // function. See https://ffmpeg.org/ffmpeg-codecs.html#libvpx for each
363   // config's meaning.
364   // Configs in VP9EncoderConfig:          Equivalent configs in ffmpeg:
365   // 1  key_freq                           -g
366   // 2  two_pass_vbrmin_section            -minrate * 100LL / bit_rate
367   // 3  two_pass_vbrmax_section            -maxrate * 100LL / bit_rate
368   // 4  under_shoot_pct                    -undershoot-pct
369   // 5  over_shoot_pct                     -overshoot-pct
370   // 6  max_threads                        -threads
371   // 7  frame_parallel_decoding_mode       -frame-parallel
372   // 8  tile_column                        -tile-columns
373   // 9  arnr_max_frames                    -arnr-maxframes
374   // 10 arnr_strength                      -arnr-strength
375   // 11 lag_in_frames                      -rc_lookahead
376   // 12 encode_breakout                    -static-thresh
377   // 13 enable_tpl_model                   -enable-tpl
378   // 14 enable_auto_arf                    -auto-alt-ref
379   // 15 rc_mode
380   //    Possible Settings:
381   //      0 - Variable Bit Rate (VPX_VBR)  -b:v <bit_rate>
382   //      1 - Constant Bit Rate (VPX_CBR)  -b:v <bit_rate> -minrate <bit_rate>
383   //                                        -maxrate <bit_rate>
384   //        two_pass_vbrmin_section == 100   i.e. bit_rate == minrate == maxrate
385   //        two_pass_vbrmax_section == 100
386   //      2 - Constrained Quality (VPX_CQ) -crf <cq_level> -b:v bit_rate
387   //      3 - Constant Quality (VPX_Q)     -crf <cq_level> -b:v 0
388   //    See https://trac.ffmpeg.org/wiki/Encode/VP9 for more details.
389   // 16 cq_level                          see rc_mode for details.
390   StatusCode SetEncodeConfig(const char *name, const char *value);
391 
392   // A debug function that dumps configs from VP9EncoderConfig
393   // pass = 1: first pass, pass = 2: second pass
394   // fp: file pointer for dumping config
395   StatusCode DumpEncodeConfigs(int pass, FILE *fp);
396 
397   // Makes encoder compute the first pass stats and store it at
398   // impl_ptr_->first_pass_stats. key_frame_map_ is also computed based on the
399   // first pass stats.
400   void ComputeFirstPassStats();
401 
402   // Outputs the first pass stats represented by a 2-D vector.
403   // One can use the frame index at first dimension to retrieve the stats for
404   // each video frame. The stats of each video frame is a vector of 25 double
405   // values. For details, please check FIRSTPASS_STATS in vp9_firstpass.h
406   std::vector<std::vector<double>> ObserveFirstPassStats();
407 
408   // Outputs the first pass motion vectors represented by a 2-D vector.
409   // One can use the frame index at first dimension to retrieve the mvs for
410   // each video frame. The frame is divided into 16x16 blocks. The number of
411   // elements is round_up(|num_rows_4x4| / 4) * round_up(|num_cols_4x4| / 4).
412   std::vector<std::vector<MotionVectorInfo>> ObserveFirstPassMotionVectors();
413 
414   // Ouputs a copy of key_frame_map_, a binary vector with size equal to the
415   // number of show frames in the video. For each entry in the vector, 1
416   // indicates the position is a key frame and 0 indicates it's not a key frame.
417   // This function should be called after ComputeFirstPassStats()
418   std::vector<int> ObserveKeyFrameMap() const;
419 
420   // Sets group of pictures map for coding the entire video.
421   // Each entry in the gop_map corresponds to a show frame in the video.
422   // Therefore, the size of gop_map should equal to the number of show frames in
423   // the entire video.
424   // If a given entry's kGopMapFlagStart is set, it means this is the start of a
425   // gop. Once kGopMapFlagStart is set, one can set kGopMapFlagUseAltRef to
426   // indicate whether this gop use altref.
427   // If a given entry is zero, it means it's in the middle of a gop.
428   // This function should be called only once after ComputeFirstPassStats(),
429   // before StartEncode().
430   // This API will check and modify the gop_map to satisfy the following
431   // constraints.
432   // 1) Each key frame position should be at the start of a gop.
433   // 2) The last gop should not use an alt ref.
434   void SetExternalGroupOfPicturesMap(int *gop_map, int gop_map_size);
435 
436   // Observe the group of pictures map set through
437   // SetExternalGroupOfPicturesMap(). This function should be called after
438   // SetExternalGroupOfPicturesMap().
439   std::vector<int> ObserveExternalGroupOfPicturesMap();
440 
441   // Initializes the encoder for actual encoding.
442   // This function should be called after ComputeFirstPassStats().
443   void StartEncode();
444 
445   // Frees the encoder.
446   // This function should be called after StartEncode() or EncodeFrame().
447   void EndEncode();
448 
449   // The key frame group size includes one key frame plus the number of
450   // following inter frames. Note that the key frame group size only counts the
451   // show frames. The number of no show frames like alternate refereces are not
452   // counted.
453   int GetKeyFrameGroupSize() const;
454 
455   // Provides the group of pictures that the next coding frame is in.
456   // Only call this function between StartEncode() and EndEncode()
457   GroupOfPicture ObserveGroupOfPicture() const;
458 
459   // Gets encode_frame_info for the next coding frame.
460   // Only call this function between StartEncode() and EndEncode()
461   EncodeFrameInfo GetNextEncodeFrameInfo() const;
462 
463   // Encodes a frame
464   // This function should be called after StartEncode() and before EndEncode().
465   void EncodeFrame(EncodeFrameResult *encode_frame_result);
466 
467   // Encodes a frame with a specific quantize index.
468   // This function should be called after StartEncode() and before EndEncode().
469   void EncodeFrameWithQuantizeIndex(EncodeFrameResult *encode_frame_result,
470                                     int quantize_index);
471 
472   // Encode a frame with target frame bits usage.
473   // The encoder will find a quantize index to make the actual frame bits usage
474   // match the target. EncodeFrameWithTargetFrameBits() will recode the frame
475   // up to 7 times to find a q_index to make the actual_frame_bits satisfy the
476   // following inequality. |actual_frame_bits - target_frame_bits| * 100 /
477   // target_frame_bits
478   // <= percent_diff.
479   void EncodeFrameWithTargetFrameBits(EncodeFrameResult *encode_frame_result,
480                                       int target_frame_bits,
481                                       double percent_diff);
482 
483   // Gets the number of coding frames for the video. The coding frames include
484   // show frame and no show frame.
485   // This function should be called after ComputeFirstPassStats().
486   int GetCodingFrameNum() const;
487 
488   // Gets the total number of pixels of YUV planes per frame.
489   uint64_t GetFramePixelCount() const;
490 
491  private:
492   // Compute the key frame locations of the video based on first pass stats.
493   // The results are returned as a binary vector with 1s indicating keyframes
494   // and 0s indicating non keyframes.
495   // It has to be called after impl_ptr_->first_pass_stats is computed.
496   std::vector<int> ComputeKeyFrameMap() const;
497 
498   // Updates key_frame_group_size_, reset key_frame_group_index_ and init
499   // ref_frame_info_.
500   void UpdateKeyFrameGroup(int key_frame_show_index);
501 
502   // Update key_frame_group_index_.
503   void PostUpdateKeyFrameGroupIndex(FrameType frame_type);
504 
505   void PostUpdateState(const EncodeFrameResult &encode_frame_result);
506 
507   class EncodeImpl;
508 
509   int frame_width_;   // frame width in pixels.
510   int frame_height_;  // frame height in pixels.
511   int frame_rate_num_;
512   int frame_rate_den_;
513   int target_bitrate_;
514   int num_frames_;
515   int encode_speed_;
516 
517   std::FILE *in_file_;
518   std::FILE *out_file_;
519   std::unique_ptr<EncodeImpl> impl_ptr_;
520 
521   std::vector<int> key_frame_map_;
522   std::vector<int> gop_map_;
523   GroupOfPicture group_of_picture_;
524 
525   // The key frame group size includes one key frame plus the number of
526   // following inter frames. Note that the key frame group size only counts the
527   // show frames. The number of no show frames like alternate references are not
528   // counted.
529   int key_frame_group_size_;
530 
531   // The index for the to-be-coded show frame in the key frame group.
532   int key_frame_group_index_;
533 
534   // Each show or no show frame is assigned with a coding index based on its
535   // coding order (starting from zero) in the coding process of the entire
536   // video. The coding index of the to-be-coded frame.
537   int frame_coding_index_;
538 
539   // Number of show frames we have coded so far.
540   int show_frame_count_;
541 
542   // TODO(angiebird): Do we need to reset ref_frames_info_ when the next key
543   // frame appears?
544   // Reference frames info of the to-be-coded frame.
545   RefFrameInfo ref_frame_info_;
546 
547   // A 2-D vector of motion vector information of the frame collected
548   // from the first pass. The first dimension is the frame index.
549   // Each frame is divided into 16x16 blocks. The number of elements is
550   // round_up(|num_rows_4x4| / 4) * round_up(|num_cols_4x4| / 4).
551   // Each 16x16 block contains 0 motion vector if this is an intra predicted
552   // frame (for example, the key frame). If the frame is inter predicted,
553   // each 16x16 block contains either 1 or 2 motion vectors.
554   // The first motion vector is always from the LAST_FRAME.
555   // The second motion vector is always from the GOLDEN_FRAME.
556   std::vector<std::vector<MotionVectorInfo>> fp_motion_vector_info_;
557 };
558 
559 }  // namespace vp9
560 
561 #endif  // VPX_VP9_SIMPLE_ENCODE_H_
562