shithub: libvpx

Download patch

ref: 626635c271219b20a9d70f6a1a1dbc6ff9005bc1
parent: 49bc402a9479636d6b75693e421473161de98db4
author: Dmitry Kovalev <dkovalev@google.com>
date: Tue Apr 2 09:34:20 EDT 2013

Lower case names for struct members.

Lower case member names inside VP9D_CONFIG and VP9D_COMP structs.

Change-Id: I75af9ad2d929a35c357207a3fd9ebedddabf79c3

--- a/vp9/common/vp9_loopfilter.c
+++ b/vp9/common/vp9_loopfilter.c
@@ -86,17 +86,16 @@
   loop_filter_info_n *lfi = &cm->lf_info;
   int i;
 
-  /* init limits for given sharpness*/
+  // init limits for given sharpness
   vp9_loop_filter_update_sharpness(lfi, cm->sharpness_level);
   cm->last_sharpness_level = cm->sharpness_level;
 
-  /* init LUT for lvl  and hev thr picking */
+  // init LUT for lvl  and hev thr picking
   lf_init_lut(lfi);
 
-  /* init hev threshold const vectors */
-  for (i = 0; i < 4; i++) {
+  // init hev threshold const vectors
+  for (i = 0; i < 4; i++)
     vpx_memset(lfi->hev_thr[i], i, SIMD_WIDTH);
-  }
 }
 
 void vp9_loop_filter_frame_init(VP9_COMMON *cm,
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -100,7 +100,7 @@
 
     /* all the ac values =; */
     for (i = 1; i < 16; i++) {
-      int rc = vp9_default_zig_zag1d_4x4[i];
+      const int rc = vp9_default_zig_zag1d_4x4[i];
 
       pc->Y1dequant[q][rc] = (int16_t)vp9_ac_yquant(q);
       pc->UVdequant[q][rc] = (int16_t)vp9_ac_uv_quant(q, pc->uvac_delta_q);
@@ -1099,8 +1099,8 @@
                                 const unsigned char *cx_data,
                                 BOOL_DECODER* const bool_decoder) {
   VP9_COMMON *pc = &pbi->common;
-  const unsigned char *user_data_end = pbi->Source + pbi->source_sz;
-  const unsigned char *partition = cx_data;
+  const uint8_t *user_data_end = pbi->source + pbi->source_sz;
+  const uint8_t *partition = cx_data;
   ptrdiff_t bytes_left = user_data_end - partition;
   ptrdiff_t partition_size = bytes_left;
 
@@ -1644,11 +1644,11 @@
   }
 }
 
-int vp9_decode_frame(VP9D_COMP *pbi, const unsigned char **p_data_end) {
+int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
   BOOL_DECODER header_bc, residual_bc;
   VP9_COMMON *const pc = &pbi->common;
   MACROBLOCKD *const xd  = &pbi->mb;
-  const uint8_t *data = (const uint8_t *)pbi->Source;
+  const uint8_t *data = pbi->source;
   const uint8_t *data_end = data + pbi->source_sz;
   ptrdiff_t first_partition_length_in_bytes = 0;
   int i, corrupt_tokens = 0;
--- a/vp9/decoder/vp9_onyxd.h
+++ b/vp9/decoder/vp9_onyxd.h
@@ -11,54 +11,56 @@
 #ifndef VP9_COMMON_VP9_ONYXD_H_
 #define VP9_COMMON_VP9_ONYXD_H_
 
-/* Create/destroy static data structures. */
 #ifdef __cplusplus
 extern "C" {
 #endif
+
 #include "vpx_scale/yv12config.h"
 #include "vp9/common/vp9_ppflags.h"
-#include "vpx_ports/mem.h"
 #include "vpx/vpx_codec.h"
 
-  typedef void   *VP9D_PTR;
-  typedef struct {
-    int     Width;
-    int     Height;
-    int     Version;
-    int     postprocess;
-    int     max_threads;
-    int     inv_tile_order;
-    int     input_partition;
-  } VP9D_CONFIG;
-  typedef enum {
-    VP9_LAST_FLAG = 1,
-    VP9_GOLD_FLAG = 2,
-    VP9_ALT_FLAG = 4
-  } VP9_REFFRAME;
+typedef void *VP9D_PTR;
 
-  void vp9_initialize_dec(void);
+typedef struct {
+  int width;
+  int height;
+  int version;
+  int postprocess;
+  int max_threads;
+  int inv_tile_order;
+  int input_partition;
+} VP9D_CONFIG;
 
-  int vp9_receive_compressed_data(VP9D_PTR comp, unsigned long size,
-                                  const unsigned char **dest,
-                                  int64_t time_stamp);
+typedef enum {
+  VP9_LAST_FLAG = 1,
+  VP9_GOLD_FLAG = 2,
+  VP9_ALT_FLAG = 4
+} VP9_REFFRAME;
 
-  int vp9_get_raw_frame(VP9D_PTR comp, YV12_BUFFER_CONFIG *sd,
-                        int64_t *time_stamp, int64_t *time_end_stamp,
-                        vp9_ppflags_t *flags);
+void vp9_initialize_dec();
 
-  vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR comp,
-                                         VP9_REFFRAME ref_frame_flag,
-                                         YV12_BUFFER_CONFIG *sd);
+int vp9_receive_compressed_data(VP9D_PTR comp,
+                                uint64_t size, const uint8_t **dest,
+                                int64_t time_stamp);
 
-  vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR comp,
-                                        VP9_REFFRAME ref_frame_flag,
-                                        YV12_BUFFER_CONFIG *sd);
+int vp9_get_raw_frame(VP9D_PTR comp, YV12_BUFFER_CONFIG *sd,
+                      int64_t *time_stamp, int64_t *time_end_stamp,
+                      vp9_ppflags_t *flags);
 
-  int vp9_get_reference_dec(VP9D_PTR ptr, int index, YV12_BUFFER_CONFIG **fb);
+vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR comp,
+                                       VP9_REFFRAME ref_frame_flag,
+                                       YV12_BUFFER_CONFIG *sd);
 
-  VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf);
+vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR comp,
+                                      VP9_REFFRAME ref_frame_flag,
+                                      YV12_BUFFER_CONFIG *sd);
 
-  void vp9_remove_decompressor(VP9D_PTR comp);
+int vp9_get_reference_dec(VP9D_PTR ptr, int index, YV12_BUFFER_CONFIG **fb);
+
+
+VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf);
+
+void vp9_remove_decompressor(VP9D_PTR comp);
 
 #ifdef __cplusplus
 }
--- a/vp9/decoder/vp9_onyxd_if.c
+++ b/vp9/decoder/vp9_onyxd_if.c
@@ -111,7 +111,7 @@
 }
 
 VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
-  VP9D_COMP *pbi = vpx_memalign(32, sizeof(VP9D_COMP));
+  VP9D_COMP *const pbi = vpx_memalign(32, sizeof(VP9D_COMP));
 
   if (!pbi)
     return NULL;
@@ -121,7 +121,7 @@
   if (setjmp(pbi->common.error.jmp)) {
     pbi->common.error.setjmp = 0;
     vp9_remove_decompressor(pbi);
-    return 0;
+    return NULL;
   }
 
   pbi->common.error.setjmp = 1;
@@ -128,33 +128,30 @@
   vp9_initialize_dec();
 
   vp9_create_common(&pbi->common);
-  pbi->oxcf = *oxcf;
 
+  pbi->oxcf = *oxcf;
   pbi->common.current_video_frame = 0;
   pbi->ready_for_new_data = 1;
 
-  /* vp9_init_de_quantizer() is first called here. Add check in
-   * frame_init_dequantizer() to avoid unnecessary calling of
-   * vp9_init_de_quantizer() for every frame.
-   */
+  // vp9_init_de_quantizer() is first called here. Add check in
+  // frame_init_dequantizer() to avoid unnecessary calling of
+  // vp9_init_de_quantizer() for every frame.
   vp9_init_de_quantizer(pbi);
 
   vp9_loop_filter_init(&pbi->common);
 
   pbi->common.error.setjmp = 0;
-
   pbi->decoded_key_frame = 0;
 
-  return (VP9D_PTR) pbi;
+  return pbi;
 }
 
 void vp9_remove_decompressor(VP9D_PTR ptr) {
-  VP9D_COMP *pbi = (VP9D_COMP *) ptr;
+  VP9D_COMP *const pbi = (VP9D_COMP *)ptr;
 
   if (!pbi)
     return;
 
-  // Delete segmentation map
   if (pbi->common.last_frame_seg_map)
     vpx_free(pbi->common.last_frame_seg_map);
 
@@ -273,24 +270,23 @@
     pbi->common.active_ref_idx[ref_index] = INT_MAX;
 }
 
-int vp9_receive_compressed_data(VP9D_PTR ptr, unsigned long size,
-                                const unsigned char **psource,
+int vp9_receive_compressed_data(VP9D_PTR ptr,
+                                uint64_t size, const uint8_t **psource,
                                 int64_t time_stamp) {
   VP9D_COMP *pbi = (VP9D_COMP *) ptr;
   VP9_COMMON *cm = &pbi->common;
-  const unsigned char *source = *psource;
+  const uint8_t *source = *psource;
   int retcode = 0;
 
   /*if(pbi->ready_for_new_data == 0)
       return -1;*/
 
-  if (ptr == 0) {
+  if (ptr == 0)
     return -1;
-  }
 
   pbi->common.error.error_code = VPX_CODEC_OK;
 
-  pbi->Source = source;
+  pbi->source = source;
   pbi->source_sz = size;
 
   if (pbi->source_sz == 0) {
@@ -325,6 +321,7 @@
 
     if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0)
       cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
+
     return -1;
   }
 
--- a/vp9/decoder/vp9_onyxd_int.h
+++ b/vp9/decoder/vp9_onyxd_int.h
@@ -25,13 +25,12 @@
 
   VP9D_CONFIG oxcf;
 
+  const uint8_t *source;
+  uint32_t source_sz;
 
-  const unsigned char *Source;
-  unsigned int   source_sz;
-
   vp9_reader *mbc;
   int64_t last_time_stamp;
-  int   ready_for_new_data;
+  int ready_for_new_data;
 
   int refresh_frame_flags;
   vp9_prob prob_skip_false;
@@ -42,7 +41,7 @@
   int initial_height;
 } VP9D_COMP;
 
-int vp9_decode_frame(VP9D_COMP *cpi, const unsigned char **p_data_end);
+int vp9_decode_frame(VP9D_COMP *cpi, const uint8_t **p_data_end);
 
 
 #if CONFIG_DEBUG
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -329,9 +329,9 @@
 
       vp9_initialize_dec();
 
-      oxcf.Width = ctx->si.w;
-      oxcf.Height = ctx->si.h;
-      oxcf.Version = 9;
+      oxcf.width = ctx->si.w;
+      oxcf.height = ctx->si.h;
+      oxcf.version = 9;
       oxcf.postprocess = 0;
       oxcf.max_threads = ctx->cfg.threads;
       oxcf.inv_tile_order = ctx->invert_tile_order;