]> granicus.if.org Git - libvpx/commitdiff
Add FRAME_INFO into VP9_COMP
authorangiebird <angiebird@google.com>
Wed, 9 Oct 2019 21:42:57 +0000 (14:42 -0700)
committerangiebird <angiebird@google.com>
Thu, 10 Oct 2019 22:44:51 +0000 (15:44 -0700)
Change-Id: Ibc804f2420113010013c04dc005b02dfebdfda8a

vp9/common/vp9_onyxc_int.h
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h

index 94c9b3f268f3d3e8f314ba9bdd7bbf6c998472c4..f3942a8f070f6511ec19247254996b6ba0d627f3 100644 (file)
@@ -254,6 +254,34 @@ typedef struct VP9Common {
   int lf_row;
 } VP9_COMMON;
 
+typedef struct {
+  int frame_width;
+  int frame_height;
+  int render_frame_width;
+  int render_frame_height;
+  int mi_rows;
+  int mi_cols;
+  int mb_rows;
+  int mb_cols;
+  int num_mbs;
+  vpx_bit_depth_t bit_depth;
+} FRAME_INFO;
+
+static INLINE void init_frame_info(FRAME_INFO *frame_info,
+                                   const VP9_COMMON *cm) {
+  frame_info->frame_width = cm->width;
+  frame_info->frame_height = cm->height;
+  frame_info->render_frame_width = cm->render_width;
+  frame_info->render_frame_height = cm->render_height;
+  frame_info->mi_cols = cm->mi_cols;
+  frame_info->mi_rows = cm->mi_rows;
+  frame_info->mb_cols = cm->mb_cols;
+  frame_info->mb_rows = cm->mb_rows;
+  frame_info->num_mbs = cm->MBs;
+  frame_info->bit_depth = cm->bit_depth;
+  // TODO(angiebird): Figure out how to get subsampling_x/y here
+}
+
 static INLINE YV12_BUFFER_CONFIG *get_buf_frame(VP9_COMMON *cm, int index) {
   if (index < 0 || index >= FRAME_BUFFERS) return NULL;
   if (cm->error.error_code != VPX_CODEC_OK) return NULL;
index af81d9b7254ca051271c7fbbee470bcd6c4d8e21..e7cfc82f7e2c389d31c6d3820b625bcb0c851118 100644 (file)
@@ -2196,6 +2196,8 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
   cpi->force_update_segmentation = 0;
 
   init_config(cpi, oxcf);
+  init_frame_info(&cpi->frame_info, cm);
+
   vp9_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc);
 
   cm->current_video_frame = 0;
index e49bf9a06503e9e6a52229d6a000975b11b1763c..b0ea921ba61345b9dfa39bc71f829feb36ed8b4e 100644 (file)
@@ -514,6 +514,7 @@ typedef struct KMEANS_DATA {
 } KMEANS_DATA;
 
 typedef struct VP9_COMP {
+  FRAME_INFO frame_info;
   QUANTS quants;
   ThreadData td;
   MB_MODE_INFO_EXT *mbmi_ext_base;