Remove vp9_type_aliases.h
Prefer the standard fixed-size integer typedefs.
Change-Id: Iad75582350669e49a8da3b7facb9c259e9514a5b
diff --git a/vp9/common/vp9_filter.c b/vp9/common/vp9_filter.c
index 710b391..9e1f717 100644
--- a/vp9/common/vp9_filter.c
+++ b/vp9/common/vp9_filter.c
@@ -838,13 +838,13 @@
*
* ROUTINE : filter_block2d_bil_first_pass
*
- * INPUTS : UINT8 *src_ptr : Pointer to source block.
- * UINT32 src_stride : Stride of source block.
- * UINT32 height : Block height.
- * UINT32 width : Block width.
- * INT32 *vp9_filter : Array of 2 bi-linear filter taps.
+ * INPUTS : uint8_t *src_ptr : Pointer to source block.
+ * uint32_t src_stride : Stride of source block.
+ * uint32_t height : Block height.
+ * uint32_t width : Block width.
+ * int32_t *vp9_filter : Array of 2 bi-linear filter taps.
*
- * OUTPUTS : INT32 *dst_ptr : Pointer to filtered block.
+ * OUTPUTS : int32_t *dst_ptr : Pointer to filtered block.
*
* RETURNS : void
*
@@ -852,7 +852,7 @@
* in the horizontal direction to produce the filtered output
* block. Used to implement first-pass of 2-D separable filter.
*
- * SPECIAL NOTES : Produces INT32 output to retain precision for next pass.
+ * SPECIAL NOTES : Produces int32_t output to retain precision for next pass.
* Two filter taps should sum to VP9_FILTER_WEIGHT.
*
****************************************************************************/
@@ -883,13 +883,13 @@
*
* ROUTINE : filter_block2d_bil_second_pass
*
- * INPUTS : INT32 *src_ptr : Pointer to source block.
- * UINT32 dst_pitch : Destination block pitch.
- * UINT32 height : Block height.
- * UINT32 width : Block width.
- * INT32 *vp9_filter : Array of 2 bi-linear filter taps.
+ * INPUTS : int32_t *src_ptr : Pointer to source block.
+ * uint32_t dst_pitch : Destination block pitch.
+ * uint32_t height : Block height.
+ * uint32_t width : Block width.
+ * int32_t *vp9_filter : Array of 2 bi-linear filter taps.
*
- * OUTPUTS : UINT16 *dst_ptr : Pointer to filtered block.
+ * OUTPUTS : uint16_t *dst_ptr : Pointer to filtered block.
*
* RETURNS : void
*
@@ -962,15 +962,15 @@
*
* ROUTINE : filter_block2d_bil
*
- * INPUTS : UINT8 *src_ptr : Pointer to source block.
- * UINT32 src_pitch : Stride of source block.
- * UINT32 dst_pitch : Stride of destination block.
- * INT32 *HFilter : Array of 2 horizontal filter taps.
- * INT32 *VFilter : Array of 2 vertical filter taps.
- * INT32 Width : Block width
- * INT32 Height : Block height
+ * INPUTS : uint8_t *src_ptr : Pointer to source block.
+ * uint32_t src_pitch : Stride of source block.
+ * uint32_t dst_pitch : Stride of destination block.
+ * int32_t *HFilter : Array of 2 horizontal filter taps.
+ * int32_t *VFilter : Array of 2 vertical filter taps.
+ * int32_t Width : Block width
+ * int32_t Height : Block height
*
- * OUTPUTS : UINT16 *dst_ptr : Pointer to filtered block.
+ * OUTPUTS : uint16_t *dst_ptr : Pointer to filtered block.
*
* RETURNS : void
*
diff --git a/vp9/common/vp9_onyx.h b/vp9/common/vp9_onyx.h
index a6bd951..0e157f1 100644
--- a/vp9/common/vp9_onyx.h
+++ b/vp9/common/vp9_onyx.h
@@ -20,7 +20,6 @@
#include "vpx/internal/vpx_codec_internal.h"
#include "vpx/vp8cx.h"
#include "vpx_scale/yv12config.h"
-#include "vp9/common/vp9_type_aliases.h"
#include "vp9/common/vp9_ppflags.h"
typedef int *VP9_PTR;
diff --git a/vp9/common/vp9_onyxd.h b/vp9/common/vp9_onyxd.h
index 063e5a8..807676f 100644
--- a/vp9/common/vp9_onyxd.h
+++ b/vp9/common/vp9_onyxd.h
@@ -18,7 +18,6 @@
extern "C"
{
#endif
-#include "vp9/common/vp9_type_aliases.h"
#include "vpx_scale/yv12config.h"
#include "vp9/common/vp9_ppflags.h"
#include "vpx_ports/mem.h"
diff --git a/vp9/common/vp9_pred_common.h b/vp9/common/vp9_pred_common.h
index af6ad7b..71b46af 100644
--- a/vp9/common/vp9_pred_common.h
+++ b/vp9/common/vp9_pred_common.h
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vp9/common/vp9_type_aliases.h"
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_blockd.h"
diff --git a/vp9/common/vp9_seg_common.h b/vp9/common/vp9_seg_common.h
index a9f9b93..c5c2bb0 100644
--- a/vp9/common/vp9_seg_common.h
+++ b/vp9/common/vp9_seg_common.h
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vp9/common/vp9_type_aliases.h"
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_blockd.h"
diff --git a/vp9/common/vp9_subpelvar.h b/vp9/common/vp9_subpelvar.h
index b3c3fcd..79fed55 100644
--- a/vp9/common/vp9_subpelvar.h
+++ b/vp9/common/vp9_subpelvar.h
@@ -43,14 +43,14 @@
*
* ROUTINE : filter_block2d_bil_first_pass
*
- * INPUTS : UINT8 *src_ptr : Pointer to source block.
- * UINT32 src_pixels_per_line : Stride of input block.
- * UINT32 pixel_step : Offset between filter input samples (see notes).
- * UINT32 output_height : Input block height.
- * UINT32 output_width : Input block width.
- * INT32 *vp9_filter : Array of 2 bi-linear filter taps.
+ * INPUTS : uint8_t *src_ptr : Pointer to source block.
+ * uint32_t src_pixels_per_line : Stride of input block.
+ * uint32_t pixel_step : Offset between filter input samples (see notes).
+ * uint32_t output_height : Input block height.
+ * uint32_t output_width : Input block width.
+ * int32_t *vp9_filter : Array of 2 bi-linear filter taps.
*
- * OUTPUTS : INT32 *output_ptr : Pointer to filtered block.
+ * OUTPUTS : int32_t *output_ptr : Pointer to filtered block.
*
* RETURNS : void
*
@@ -59,7 +59,7 @@
* filtered output block. Used to implement first-pass
* of 2-D separable filter.
*
- * SPECIAL NOTES : Produces INT32 output to retain precision for next pass.
+ * SPECIAL NOTES : Produces int32_t output to retain precision for next pass.
* Two filter taps should sum to VP9_FILTER_WEIGHT.
* pixel_step defines whether the filter is applied
* horizontally (pixel_step=1) or vertically (pixel_step=stride).
@@ -95,14 +95,14 @@
*
* ROUTINE : filter_block2d_bil_second_pass
*
- * INPUTS : INT32 *src_ptr : Pointer to source block.
- * UINT32 src_pixels_per_line : Stride of input block.
- * UINT32 pixel_step : Offset between filter input samples (see notes).
- * UINT32 output_height : Input block height.
- * UINT32 output_width : Input block width.
- * INT32 *vp9_filter : Array of 2 bi-linear filter taps.
+ * INPUTS : int32_t *src_ptr : Pointer to source block.
+ * uint32_t src_pixels_per_line : Stride of input block.
+ * uint32_t pixel_step : Offset between filter input samples (see notes).
+ * uint32_t output_height : Input block height.
+ * uint32_t output_width : Input block width.
+ * int32_t *vp9_filter : Array of 2 bi-linear filter taps.
*
- * OUTPUTS : UINT16 *output_ptr : Pointer to filtered block.
+ * OUTPUTS : uint16_t *output_ptr : Pointer to filtered block.
*
* RETURNS : void
*
diff --git a/vp9/common/vp9_type_aliases.h b/vp9/common/vp9_type_aliases.h
deleted file mode 100644
index 110e2d0..0000000
--- a/vp9/common/vp9_type_aliases.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-/****************************************************************************
-*
-* Module Title : vp9_type_aliases.h
-*
-* Description : Standard type aliases
-*
-****************************************************************************/
-#ifndef VP9_COMMON_VP9_TYPE_ALIASES_H_
-#define VP9_COMMON_VP9_TYPE_ALIASES_H_
-
-/****************************************************************************
-* Macros
-****************************************************************************/
-#define EXPORT
-#define IMPORT extern /* Used to declare imported data & routines */
-#define PRIVATE static /* Used to declare & define module-local data */
-#define LOCAL static /* Used to define all persistent routine-local data */
-#define STD_IN_PATH 0 /* Standard input path */
-#define STD_OUT_PATH 1 /* Standard output path */
-#define STD_ERR_PATH 2 /* Standard error path */
-#define STD_IN_FILE stdin /* Standard input file pointer */
-#define STD_OUT_FILE stdout /* Standard output file pointer */
-#define STD_ERR_FILE stderr /* Standard error file pointer */
-#define max_int 0x7FFFFFFF
-
-#define __export
-#define _export
-
-#define CCONV
-
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void *)0)
-#endif
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-/****************************************************************************
-* Typedefs
-****************************************************************************/
-#ifndef TYPE_INT8
-#define TYPE_INT8
-typedef signed char INT8;
-#endif
-
-#ifndef TYPE_INT16
-/*#define TYPE_INT16*/
-typedef signed short INT16;
-#endif
-
-#ifndef TYPE_INT32
-/*#define TYPE_INT32*/
-typedef signed int INT32;
-#endif
-
-#ifndef TYPE_UINT8
-/*#define TYPE_UINT8*/
-typedef unsigned char UINT8;
-#endif
-
-#ifndef TYPE_UINT32
-/*#define TYPE_UINT32*/
-typedef unsigned int UINT32;
-#endif
-
-#ifndef TYPE_UINT16
-/*#define TYPE_UINT16*/
-typedef unsigned short UINT16;
-#endif
-
-#ifndef TYPE_BOOL
-/*#define TYPE_BOOL*/
-typedef int BOOL;
-#endif
-
-typedef unsigned char BOOLEAN;
-
-#ifdef _MSC_VER
-typedef __int64 INT64;
-#ifndef INT64_MAX
-#define INT64_MAX LLONG_MAX
-#endif
-#else
-
-#ifndef TYPE_INT64
-#ifdef _TMS320C6X
-/* for now we only have 40bits */
-typedef long INT64;
-#else
-typedef long long INT64;
-#endif
-#endif
-
-#endif
-
-/* Floating point */
-typedef double FLOAT64;
-typedef float FLOAT32;
-
-#endif
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index 1e3608f..5e5861a 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -9,7 +9,6 @@
*/
-#include "vp9/common/vp9_type_aliases.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/decoder/vp9_onyxd_int.h"
#include "vpx_mem/vpx_mem.h"
@@ -91,7 +90,7 @@
#define WRITE_COEF_CONTINUE(val, token) \
{ \
- qcoeff_ptr[scan[c]] = (INT16) get_signed(br, val); \
+ qcoeff_ptr[scan[c]] = (int16_t) get_signed(br, val); \
INCREMENT_COUNT(token); \
c++; \
continue; \
@@ -100,7 +99,7 @@
#define ADJUST_COEF(prob, bits_count) \
do { \
if (vp9_read(br, prob)) \
- val += (UINT16)(1 << bits_count);\
+ val += (uint16_t)(1 << bits_count);\
} while (0);
static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
@@ -108,7 +107,7 @@
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
PLANE_TYPE type,
TX_TYPE tx_type,
- int seg_eob, INT16 *qcoeff_ptr,
+ int seg_eob, int16_t *qcoeff_ptr,
const int *const scan, TX_SIZE txfm_size,
const int *coef_bands) {
FRAME_CONTEXT *const fc = &dx->common.fc;
diff --git a/vp9/decoder/vp9_onyxd_int.h b/vp9/decoder/vp9_onyxd_int.h
index 4714429..73229ed 100644
--- a/vp9/decoder/vp9_onyxd_int.h
+++ b/vp9/decoder/vp9_onyxd_int.h
@@ -35,22 +35,22 @@
typedef struct {
int const *scan;
int const *scan_8x8;
- UINT8 const *ptr_block2leftabove;
+ uint8_t const *ptr_block2leftabove;
vp9_tree_index const *vp9_coef_tree_ptr;
unsigned char *norm_ptr;
- UINT8 *ptr_coef_bands_x;
- UINT8 *ptr_coef_bands_x_8x8;
+ uint8_t *ptr_coef_bands_x;
+ uint8_t *ptr_coef_bands_x_8x8;
ENTROPY_CONTEXT_PLANES *A;
ENTROPY_CONTEXT_PLANES *L;
- INT16 *qcoeff_start_ptr;
+ int16_t *qcoeff_start_ptr;
vp9_prob const *coef_probs_4x4[BLOCK_TYPES_4X4];
vp9_prob const *coef_probs_8x8[BLOCK_TYPES_8X8];
vp9_prob const *coef_probs_16X16[BLOCK_TYPES_16X16];
- UINT8 eob[25];
+ uint8_t eob[25];
} DETOK;
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 13e1899..37f270e 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1232,7 +1232,7 @@
int still_interval,
double loop_decay_rate,
double last_decay_rate) {
- BOOL trans_to_still = FALSE;
+ int trans_to_still = FALSE;
// Break clause to detect very still sections after motion
// For example a static image after a fade or other transition
@@ -1270,10 +1270,10 @@
// This function detects a flash through the high relative pcnt_second_ref
// score in the frame following a flash frame. The offset passed in should
// reflect this
-static BOOL detect_flash(VP9_COMP *cpi, int offset) {
+static int detect_flash(VP9_COMP *cpi, int offset) {
FIRSTPASS_STATS next_frame;
- BOOL flash_detected = FALSE;
+ int flash_detected = FALSE;
// Read the frame data.
// The return is FALSE (no flash detected) if not a valid frame
@@ -1385,7 +1385,7 @@
double mv_in_out_accumulator = 0.0;
double abs_mv_in_out_accumulator = 0.0;
int arf_boost;
- BOOL flash_detected = FALSE;
+ int flash_detected = FALSE;
// Search forward from the proposed arf/next gf position
for (i = 0; i < f_frames; i++) {
@@ -1542,7 +1542,7 @@
int f_boost = 0;
int b_boost = 0;
- BOOL flash_detected;
+ int flash_detected;
cpi->twopass.gf_group_bits = 0;
@@ -2101,8 +2101,11 @@
}
-static BOOL test_candidate_kf(VP9_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRSTPASS_STATS *this_frame, FIRSTPASS_STATS *next_frame) {
- BOOL is_viable_kf = FALSE;
+static int test_candidate_kf(VP9_COMP *cpi,
+ FIRSTPASS_STATS *last_frame,
+ FIRSTPASS_STATS *this_frame,
+ FIRSTPASS_STATS *next_frame) {
+ int is_viable_kf = FALSE;
// Does the frame satisfy the primary criteria of a key frame
// If so, then examine how well it predicts subsequent frames
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 07a3a04..1c78710 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -118,7 +118,7 @@
extern unsigned __int64 Sectionbits[500];
#endif
#ifdef MODE_STATS
-extern INT64 Sectionbits[500];
+extern int64_t Sectionbits[500];
extern unsigned int y_modes[VP9_YMODES];
extern unsigned int i8x8_modes[VP9_I8X8_MODES];
extern unsigned int uv_modes[VP9_UV_MODES];
@@ -2698,10 +2698,10 @@
// Function to test for conditions that indicate we should loop
// back and recode a frame.
-static BOOL recode_loop_test(VP9_COMP *cpi,
- int high_limit, int low_limit,
- int q, int maxq, int minq) {
- BOOL force_recode = FALSE;
+static int recode_loop_test(VP9_COMP *cpi,
+ int high_limit, int low_limit,
+ int q, int maxq, int minq) {
+ int force_recode = FALSE;
VP9_COMMON *cm = &cpi->common;
// Is frame recode allowed at all
@@ -2941,7 +2941,7 @@
int mcomp_filters = sizeof(mcomp_filters_to_search) /
sizeof(*mcomp_filters_to_search);
int mcomp_filter_index = 0;
- INT64 mcomp_filter_cost[4];
+ int64_t mcomp_filter_cost[4];
// Clear down mmx registers to allow floating point in what follows
vp9_clear_system_state();
@@ -3526,9 +3526,9 @@
if (Loop == FALSE && cm->frame_type != KEY_FRAME && sf->search_best_filter) {
if (mcomp_filter_index < mcomp_filters) {
- INT64 err = vp9_calc_ss_err(cpi->Source,
+ int64_t err = vp9_calc_ss_err(cpi->Source,
&cm->yv12_fb[cm->new_fb_idx]);
- INT64 rate = cpi->projected_frame_size << 8;
+ int64_t rate = cpi->projected_frame_size << 8;
mcomp_filter_cost[mcomp_filter_index] =
(RDCOST(cpi->RDMULT, cpi->RDDIV, rate, err));
mcomp_filter_index++;
@@ -3538,7 +3538,7 @@
Loop = TRUE;
} else {
int f;
- INT64 best_cost = mcomp_filter_cost[0];
+ int64_t best_cost = mcomp_filter_cost[0];
int mcomp_best_filter = mcomp_filters_to_search[0];
for (f = 1; f < mcomp_filters; f++) {
if (mcomp_filter_cost[f] < best_cost) {
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index 2d61381..fb9e3ed 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -582,10 +582,10 @@
t = 0;
do {
- const INT64 x = context_counters[type][band][pt][t];
+ const int64_t x = context_counters[type][band][pt][t];
const int y = (int) x;
- assert(x == (INT64) y); /* no overflow handling yet */
+ assert(x == (int64_t) y); /* no overflow handling yet */
fprintf(f, "%s %d", Comma(t), y);
} while (++t < MAX_ENTROPY_TOKENS);
fprintf(f, "}");
diff --git a/vp9/encoder/vp9_tokenize.h b/vp9/encoder/vp9_tokenize.h
index 17ff9b3..2f90780 100644
--- a/vp9/encoder/vp9_tokenize.h
+++ b/vp9/encoder/vp9_tokenize.h
@@ -29,8 +29,8 @@
unsigned char skip_eob_node;
} TOKENEXTRA;
-typedef INT64 vp9_coeff_accum[COEF_BANDS][PREV_COEF_CONTEXTS]
- [MAX_ENTROPY_TOKENS];
+typedef int64_t vp9_coeff_accum[COEF_BANDS][PREV_COEF_CONTEXTS]
+ [MAX_ENTROPY_TOKENS];
extern int vp9_mby_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block);
extern int vp9_mbuv_is_skippable_4x4(MACROBLOCKD *xd);
diff --git a/vp9/vp9_common.mk b/vp9/vp9_common.mk
index 5d2fe6f..ea1cc09 100644
--- a/vp9/vp9_common.mk
+++ b/vp9/vp9_common.mk
@@ -9,7 +9,6 @@
##
VP9_COMMON_SRCS-yes += vp9_common.mk
-VP9_COMMON_SRCS-yes += common/vp9_type_aliases.h
VP9_COMMON_SRCS-yes += common/vp9_pragmas.h
VP9_COMMON_SRCS-yes += common/vp9_ppflags.h
VP9_COMMON_SRCS-yes += common/vp9_onyx.h