Merge "Remove legacy integer types"

This commit is contained in:
John Koleszar 2011-12-22 13:00:23 -08:00 коммит произвёл Gerrit Code Review
Родитель adb10c47a8 f56918ba9c
Коммит d48ea5a2ab
13 изменённых файлов: 94 добавлений и 238 удалений

Просмотреть файл

@ -21,9 +21,6 @@ void vpx_log(const char *format, ...);
#include "subpixel.h" #include "subpixel.h"
#include "vpx_ports/mem.h" #include "vpx_ports/mem.h"
#define TRUE 1
#define FALSE 0
/*#define DCPRED 1*/ /*#define DCPRED 1*/
#define DCPREDSIMTHRESH 0 #define DCPREDSIMTHRESH 0
#define DCPREDCNTTHRESH 3 #define DCPREDCNTTHRESH 3

Просмотреть файл

@ -18,8 +18,6 @@
#include "vpx_mem/vpx_mem.h" #include "vpx_mem/vpx_mem.h"
#include "common_types.h"
/* Only need this for fixed-size arrays, for structs just assign. */ /* Only need this for fixed-size arrays, for structs just assign. */
#define vp8_copy( Dest, Src) { \ #define vp8_copy( Dest, Src) { \

Просмотреть файл

@ -1,18 +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.
*/
#ifndef __INC_COMMON_TYPES
#define __INC_COMMON_TYPES
#define TRUE 1
#define FALSE 0
#endif

Просмотреть файл

@ -22,7 +22,6 @@ extern "C"
#include "vpx/vp8cx.h" #include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h" #include "vpx/vpx_encoder.h"
#include "vpx_scale/yv12config.h" #include "vpx_scale/yv12config.h"
#include "type_aliases.h"
#include "ppflags.h" #include "ppflags.h"
struct VP8_COMP; struct VP8_COMP;

Просмотреть файл

@ -18,7 +18,6 @@
extern "C" extern "C"
{ {
#endif #endif
#include "type_aliases.h"
#include "vpx_scale/yv12config.h" #include "vpx_scale/yv12config.h"
#include "ppflags.h" #include "ppflags.h"
#include "vpx_ports/mem.h" #include "vpx_ports/mem.h"

Просмотреть файл

@ -1,117 +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 : type_aliases.h
*
* Description : Standard type aliases
*
****************************************************************************/
#ifndef __INC_TYPE_ALIASES_H
#define __INC_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;
#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

Просмотреть файл

@ -15,7 +15,7 @@
#include "vpx_ports/mem.h" #include "vpx_ports/mem.h"
#include "detokenize.h" #include "detokenize.h"
#define BOOL_DATA UINT8 #define BOOL_DATA unsigned char
#define OCB_X PREV_COEF_CONTEXTS * ENTROPY_NODES #define OCB_X PREV_COEF_CONTEXTS * ENTROPY_NODES
DECLARE_ALIGNED(16, static const unsigned char, coef_bands_x[16]) = DECLARE_ALIGNED(16, static const unsigned char, coef_bands_x[16]) =
@ -157,10 +157,10 @@ DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
DECODE_AND_APPLYSIGN(val) \ DECODE_AND_APPLYSIGN(val) \
Prob = coef_probs + (ENTROPY_NODES*2); \ Prob = coef_probs + (ENTROPY_NODES*2); \
if(c < 15){\ if(c < 15){\
qcoeff_ptr [ scan[c] ] = (INT16) v; \ qcoeff_ptr [ scan[c] ] = (int16_t) v; \
++c; \ ++c; \
goto DO_WHILE; }\ goto DO_WHILE; }\
qcoeff_ptr [ 15 ] = (INT16) v; \ qcoeff_ptr [ 15 ] = (int16_t) v; \
goto BLOCK_FINISHED; goto BLOCK_FINISHED;
@ -172,7 +172,7 @@ DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
{\ {\
range = range-split;\ range = range-split;\
value = value-bigsplit;\ value = value-bigsplit;\
val += ((UINT16)1<<bits_count);\ val += ((uint16_t)1<<bits_count);\
}\ }\
else\ else\
{\ {\
@ -340,12 +340,12 @@ ONE_CONTEXT_NODE_0_:
if (c < 15) if (c < 15)
{ {
qcoeff_ptr [ scan[c] ] = (INT16) v; qcoeff_ptr [ scan[c] ] = (int16_t) v;
++c; ++c;
goto DO_WHILE; goto DO_WHILE;
} }
qcoeff_ptr [ 15 ] = (INT16) v; qcoeff_ptr [ 15 ] = (int16_t) v;
BLOCK_FINISHED: BLOCK_FINISHED:
eobs[i] = c; eobs[i] = c;
eobtotal += c; eobtotal += c;

Просмотреть файл

@ -38,7 +38,7 @@ static THREAD_FUNCTION loopfilter_thread(void *p_data)
if (sem_wait(&cpi->h_event_start_lpf) == 0) if (sem_wait(&cpi->h_event_start_lpf) == 0)
{ {
if (cpi->b_multi_threaded == FALSE) // we're shutting down if (cpi->b_multi_threaded == 0) // we're shutting down
break; break;
loopfilter_frame(cpi, cm); loopfilter_frame(cpi, cm);
@ -78,7 +78,7 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
int *segment_counts = mbri->segment_counts; int *segment_counts = mbri->segment_counts;
int *totalrate = &mbri->totalrate; int *totalrate = &mbri->totalrate;
if (cpi->b_multi_threaded == FALSE) // we're shutting down if (cpi->b_multi_threaded == 0) // we're shutting down
break; break;
for (mb_row = ithread + 1; mb_row < cm->mb_rows; mb_row += (cpi->encoding_thread_count + 1)) for (mb_row = ithread + 1; mb_row < cm->mb_rows; mb_row += (cpi->encoding_thread_count + 1))

Просмотреть файл

@ -861,7 +861,7 @@ double bitcost( double prob )
{ {
return -(log( prob ) / log( 2.0 )); return -(log( prob ) / log( 2.0 ));
} }
static long long estimate_modemvcost(VP8_COMP *cpi, static int64_t estimate_modemvcost(VP8_COMP *cpi,
FIRSTPASS_STATS * fpstats) FIRSTPASS_STATS * fpstats)
{ {
int mv_cost; int mv_cost;
@ -1376,7 +1376,7 @@ static int detect_transition_to_still(
double loop_decay_rate, double loop_decay_rate,
double decay_accumulator ) double decay_accumulator )
{ {
BOOL trans_to_still = FALSE; int trans_to_still = 0;
// Break clause to detect very still sections after motion // Break clause to detect very still sections after motion
// For example a static image after a fade or other transition // For example a static image after a fade or other transition
@ -1406,7 +1406,7 @@ static int detect_transition_to_still(
// Only if it does do we signal a transition to still // Only if it does do we signal a transition to still
if ( j == still_interval ) if ( j == still_interval )
trans_to_still = TRUE; trans_to_still = 1;
} }
return trans_to_still; return trans_to_still;
@ -1415,14 +1415,14 @@ static int detect_transition_to_still(
// This function detects a flash through the high relative pcnt_second_ref // 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 // score in the frame following a flash frame. The offset passed in should
// reflect this // reflect this
static BOOL detect_flash( VP8_COMP *cpi, int offset ) static int detect_flash( VP8_COMP *cpi, int offset )
{ {
FIRSTPASS_STATS next_frame; FIRSTPASS_STATS next_frame;
BOOL flash_detected = FALSE; int flash_detected = 0;
// Read the frame data. // Read the frame data.
// The return is FALSE (no flash detected) if not a valid frame // The return is 0 (no flash detected) if not a valid frame
if ( read_frame_stats(cpi, &next_frame, offset) != EOF ) if ( read_frame_stats(cpi, &next_frame, offset) != EOF )
{ {
// What we are looking for here is a situation where there is a // What we are looking for here is a situation where there is a
@ -1433,7 +1433,7 @@ static BOOL detect_flash( VP8_COMP *cpi, int offset )
if ( (next_frame.pcnt_second_ref > next_frame.pcnt_inter) && if ( (next_frame.pcnt_second_ref > next_frame.pcnt_inter) &&
(next_frame.pcnt_second_ref >= 0.5 ) ) (next_frame.pcnt_second_ref >= 0.5 ) )
{ {
flash_detected = TRUE; flash_detected = 1;
/*if (1) /*if (1)
{ {
@ -1548,7 +1548,7 @@ static int calc_arf_boost(
double mv_in_out_accumulator = 0.0; double mv_in_out_accumulator = 0.0;
double abs_mv_in_out_accumulator = 0.0; double abs_mv_in_out_accumulator = 0.0;
double r; double r;
BOOL flash_detected = FALSE; int flash_detected = 0;
// Search forward from the proposed arf/next gf position // Search forward from the proposed arf/next gf position
for ( i = 0; i < f_frames; i++ ) for ( i = 0; i < f_frames; i++ )
@ -1677,7 +1677,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
int alt_boost = 0; int alt_boost = 0;
int f_boost = 0; int f_boost = 0;
int b_boost = 0; int b_boost = 0;
BOOL flash_detected; int flash_detected;
cpi->twopass.gf_group_bits = 0; cpi->twopass.gf_group_bits = 0;
cpi->twopass.gf_decay_rate = 0; cpi->twopass.gf_decay_rate = 0;
@ -1751,7 +1751,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
loop_decay_rate, loop_decay_rate,
decay_accumulator ) ) decay_accumulator ) )
{ {
allow_alt_ref = FALSE; allow_alt_ref = 0;
boost_score = old_boost_score; boost_score = old_boost_score;
break; break;
} }
@ -1923,7 +1923,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
int frames_bwd = cpi->oxcf.arnr_max_frames - 1; int frames_bwd = cpi->oxcf.arnr_max_frames - 1;
int frames_fwd = cpi->oxcf.arnr_max_frames - 1; int frames_fwd = cpi->oxcf.arnr_max_frames - 1;
cpi->source_alt_ref_pending = TRUE; cpi->source_alt_ref_pending = 1;
// For alt ref frames the error score for the end frame of the // For alt ref frames the error score for the end frame of the
// group (the alt ref frame) should not contribute to the group // group (the alt ref frame) should not contribute to the group
@ -1989,13 +1989,13 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
} }
else else
{ {
cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_pending = 0;
cpi->baseline_gf_interval = i; cpi->baseline_gf_interval = i;
} }
} }
else else
{ {
cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_pending = 0;
cpi->baseline_gf_interval = i; cpi->baseline_gf_interval = i;
} }
@ -2341,7 +2341,7 @@ void vp8_second_pass(VP8_COMP *cpi)
cpi->twopass.gf_group_error_left = cpi->twopass.kf_group_error_left; cpi->twopass.gf_group_error_left = cpi->twopass.kf_group_error_left;
cpi->baseline_gf_interval = cpi->twopass.frames_to_key; cpi->baseline_gf_interval = cpi->twopass.frames_to_key;
cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_pending = 0;
} }
} }
@ -2493,9 +2493,9 @@ void vp8_second_pass(VP8_COMP *cpi)
} }
static BOOL test_candidate_kf(VP8_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRSTPASS_STATS *this_frame, FIRSTPASS_STATS *next_frame) static int test_candidate_kf(VP8_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRSTPASS_STATS *this_frame, FIRSTPASS_STATS *next_frame)
{ {
BOOL is_viable_kf = FALSE; int is_viable_kf = 0;
// Does the frame satisfy the primary criteria of a key frame // Does the frame satisfy the primary criteria of a key frame
// If so, then examine how well it predicts subsequent frames // If so, then examine how well it predicts subsequent frames
@ -2569,13 +2569,13 @@ static BOOL test_candidate_kf(VP8_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRST
// If there is tolerable prediction for at least the next 3 frames then break out else discard this pottential key frame and move on // If there is tolerable prediction for at least the next 3 frames then break out else discard this pottential key frame and move on
if (boost_score > 5.0 && (i > 3)) if (boost_score > 5.0 && (i > 3))
is_viable_kf = TRUE; is_viable_kf = 1;
else else
{ {
// Reset the file position // Reset the file position
reset_fpf_position(cpi, start_pos); reset_fpf_position(cpi, start_pos);
is_viable_kf = FALSE; is_viable_kf = 0;
} }
} }
@ -2611,7 +2611,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
cpi->this_key_frame_forced = cpi->next_key_frame_forced; cpi->this_key_frame_forced = cpi->next_key_frame_forced;
// Clear the alt ref active flag as this can never be active on a key frame // Clear the alt ref active flag as this can never be active on a key frame
cpi->source_alt_ref_active = FALSE; cpi->source_alt_ref_active = 0;
// Kf is always a gf so clear frames till next gf counter // Kf is always a gf so clear frames till next gf counter
cpi->frames_till_gf_update_due = 0; cpi->frames_till_gf_update_due = 0;
@ -2727,10 +2727,10 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
// Reset to the start of the group // Reset to the start of the group
reset_fpf_position(cpi, current_pos); reset_fpf_position(cpi, current_pos);
cpi->next_key_frame_forced = TRUE; cpi->next_key_frame_forced = 1;
} }
else else
cpi->next_key_frame_forced = FALSE; cpi->next_key_frame_forced = 0;
// Special case for the last frame of the file // Special case for the last frame of the file
if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end) if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end)
@ -3034,8 +3034,8 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
if (cpi->oxcf.allow_spatial_resampling) if (cpi->oxcf.allow_spatial_resampling)
{ {
int resample_trigger = FALSE; int resample_trigger = 0;
int last_kf_resampled = FALSE; int last_kf_resampled = 0;
int kf_q; int kf_q;
int scale_val = 0; int scale_val = 0;
int hr, hs, vr, vs; int hr, hs, vr, vs;
@ -3053,7 +3053,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
double effective_size_ratio; double effective_size_ratio;
if ((cpi->common.Width != cpi->oxcf.Width) || (cpi->common.Height != cpi->oxcf.Height)) if ((cpi->common.Width != cpi->oxcf.Width) || (cpi->common.Height != cpi->oxcf.Height))
last_kf_resampled = TRUE; last_kf_resampled = 1;
// Set back to unscaled by defaults // Set back to unscaled by defaults
cpi->common.horiz_scale = NORMAL; cpi->common.horiz_scale = NORMAL;
@ -3117,9 +3117,9 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
(last_kf_resampled && (projected_buffer_level < (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100)))) (last_kf_resampled && (projected_buffer_level < (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100))))
//( ((cpi->buffer_level < (cpi->oxcf.resample_down_water_mark * cpi->oxcf.optimal_buffer_level / 100))) && //( ((cpi->buffer_level < (cpi->oxcf.resample_down_water_mark * cpi->oxcf.optimal_buffer_level / 100))) &&
// ((projected_buffer_level < (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100))) )) // ((projected_buffer_level < (cpi->oxcf.resample_up_water_mark * cpi->oxcf.optimal_buffer_level / 100))) ))
resample_trigger = TRUE; resample_trigger = 1;
else else
resample_trigger = FALSE; resample_trigger = 0;
} }
else else
{ {
@ -3129,9 +3129,9 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
if ((last_kf_resampled && (kf_q > cpi->worst_quality)) || // If triggered last time the threshold for triggering again is reduced if ((last_kf_resampled && (kf_q > cpi->worst_quality)) || // If triggered last time the threshold for triggering again is reduced
((kf_q > cpi->worst_quality) && // Projected Q higher than allowed and ... ((kf_q > cpi->worst_quality) && // Projected Q higher than allowed and ...
(over_spend > clip_bits / 20))) // ... Overspend > 5% of total bits (over_spend > clip_bits / 20))) // ... Overspend > 5% of total bits
resample_trigger = TRUE; resample_trigger = 1;
else else
resample_trigger = FALSE; resample_trigger = 0;
} }

Просмотреть файл

@ -1540,7 +1540,7 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
cpi->active_best_quality = cpi->oxcf.worst_allowed_q; cpi->active_best_quality = cpi->oxcf.worst_allowed_q;
} }
cpi->buffered_mode = (cpi->oxcf.optimal_buffer_level > 0) ? TRUE : FALSE; cpi->buffered_mode = (cpi->oxcf.optimal_buffer_level > 0) ? 1 : 0;
cpi->cq_target_quality = cpi->oxcf.cq_level; cpi->cq_target_quality = cpi->oxcf.cq_level;
@ -1759,11 +1759,11 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
cpi->frames_since_key = 8; // Give a sensible default for the first frame. cpi->frames_since_key = 8; // Give a sensible default for the first frame.
cpi->key_frame_frequency = cpi->oxcf.key_freq; cpi->key_frame_frequency = cpi->oxcf.key_freq;
cpi->this_key_frame_forced = FALSE; cpi->this_key_frame_forced = 0;
cpi->next_key_frame_forced = FALSE; cpi->next_key_frame_forced = 0;
cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_pending = 0;
cpi->source_alt_ref_active = FALSE; cpi->source_alt_ref_active = 0;
cpi->common.refresh_alt_ref_frame = 0; cpi->common.refresh_alt_ref_frame = 0;
cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS; cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS;
@ -2609,10 +2609,10 @@ static void update_alt_ref_frame_stats(VP8_COMP *cpi)
cpi->common.frames_since_golden = 0; cpi->common.frames_since_golden = 0;
// Clear the alternate reference update pending flag. // Clear the alternate reference update pending flag.
cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_pending = 0;
// Set the alternate refernce frame active flag // Set the alternate refernce frame active flag
cpi->source_alt_ref_active = TRUE; cpi->source_alt_ref_active = 1;
} }
@ -2675,12 +2675,12 @@ static void update_golden_frame_stats(VP8_COMP *cpi)
if (cpi->oxcf.fixed_q >= 0 && if (cpi->oxcf.fixed_q >= 0 &&
cpi->oxcf.play_alternate && !cpi->common.refresh_alt_ref_frame) cpi->oxcf.play_alternate && !cpi->common.refresh_alt_ref_frame)
{ {
cpi->source_alt_ref_pending = TRUE; cpi->source_alt_ref_pending = 1;
cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
} }
if (!cpi->source_alt_ref_pending) if (!cpi->source_alt_ref_pending)
cpi->source_alt_ref_active = FALSE; cpi->source_alt_ref_active = 0;
// Decrement count down till next gf // Decrement count down till next gf
if (cpi->frames_till_gf_update_due > 0) if (cpi->frames_till_gf_update_due > 0)
@ -2767,12 +2767,12 @@ static int decide_key_frame(VP8_COMP *cpi)
{ {
VP8_COMMON *cm = &cpi->common; VP8_COMMON *cm = &cpi->common;
int code_key_frame = FALSE; int code_key_frame = 0;
cpi->kf_boost = 0; cpi->kf_boost = 0;
if (cpi->Speed > 11) if (cpi->Speed > 11)
return FALSE; return 0;
// Clear down mmx registers // Clear down mmx registers
vp8_clear_system_state(); //__asm emms; vp8_clear_system_state(); //__asm emms;
@ -2814,10 +2814,10 @@ static int decide_key_frame(VP8_COMP *cpi)
&& (change > .25 || change2 > .25)) && (change > .25 || change2 > .25))
{ {
/*(change > 1.4 || change < .75)&& cpi->this_frame_percent_intra > cpi->last_frame_percent_intra + 3*/ /*(change > 1.4 || change < .75)&& cpi->this_frame_percent_intra > cpi->last_frame_percent_intra + 3*/
return TRUE; return 1;
} }
return FALSE; return 0;
} }
@ -2827,7 +2827,7 @@ static int decide_key_frame(VP8_COMP *cpi)
((cpi->this_frame_percent_intra > 95) && ((cpi->this_frame_percent_intra > 95) &&
(cpi->this_frame_percent_intra >= (cpi->last_frame_percent_intra + 5)))) (cpi->this_frame_percent_intra >= (cpi->last_frame_percent_intra + 5))))
{ {
code_key_frame = TRUE; code_key_frame = 1;
} }
// in addition if the following are true and this is not a golden frame then code a key frame // in addition if the following are true and this is not a golden frame then code a key frame
// Note that on golden frames there often seems to be a pop in intra useage anyway hence this // Note that on golden frames there often seems to be a pop in intra useage anyway hence this
@ -2840,7 +2840,7 @@ static int decide_key_frame(VP8_COMP *cpi)
(cpi->this_frame_percent_intra > (cpi->last_frame_percent_intra + 10)))) (cpi->this_frame_percent_intra > (cpi->last_frame_percent_intra + 10))))
{ {
if (!cm->refresh_golden_frame) if (!cm->refresh_golden_frame)
code_key_frame = TRUE; code_key_frame = 1;
} }
return code_key_frame; return code_key_frame;
@ -2896,11 +2896,11 @@ void write_cx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame)
// Function to test for conditions that indeicate we should loop // Function to test for conditions that indeicate we should loop
// back and recode a frame. // back and recode a frame.
static BOOL recode_loop_test( VP8_COMP *cpi, static int recode_loop_test( VP8_COMP *cpi,
int high_limit, int low_limit, int high_limit, int low_limit,
int q, int maxq, int minq ) int q, int maxq, int minq )
{ {
BOOL force_recode = FALSE; int force_recode = 0;
VP8_COMMON *cm = &cpi->common; VP8_COMMON *cm = &cpi->common;
// Is frame recode allowed at all // Is frame recode allowed at all
@ -2916,7 +2916,7 @@ static BOOL recode_loop_test( VP8_COMP *cpi,
if ( ((cpi->projected_frame_size > high_limit) && (q < maxq)) || if ( ((cpi->projected_frame_size > high_limit) && (q < maxq)) ||
((cpi->projected_frame_size < low_limit) && (q > minq)) ) ((cpi->projected_frame_size < low_limit) && (q > minq)) )
{ {
force_recode = TRUE; force_recode = 1;
} }
// Special Constrained quality tests // Special Constrained quality tests
else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY)
@ -2926,14 +2926,14 @@ static BOOL recode_loop_test( VP8_COMP *cpi,
(cpi->projected_frame_size < (cpi->projected_frame_size <
((cpi->this_frame_target * 7) >> 3))) ((cpi->this_frame_target * 7) >> 3)))
{ {
force_recode = TRUE; force_recode = 1;
} }
// Severe undershoot and between auto and user cq level // Severe undershoot and between auto and user cq level
else if ( (q > cpi->oxcf.cq_level) && else if ( (q > cpi->oxcf.cq_level) &&
(cpi->projected_frame_size < cpi->min_frame_bandwidth) && (cpi->projected_frame_size < cpi->min_frame_bandwidth) &&
(cpi->active_best_quality > cpi->oxcf.cq_level)) (cpi->active_best_quality > cpi->oxcf.cq_level))
{ {
force_recode = TRUE; force_recode = 1;
cpi->active_best_quality = cpi->oxcf.cq_level; cpi->active_best_quality = cpi->oxcf.cq_level;
} }
} }
@ -3084,7 +3084,7 @@ static void encode_frame_to_data_rate
int frame_over_shoot_limit; int frame_over_shoot_limit;
int frame_under_shoot_limit; int frame_under_shoot_limit;
int Loop = FALSE; int Loop = 0;
int loop_count; int loop_count;
int this_q; int this_q;
int last_zbin_oq; int last_zbin_oq;
@ -3096,10 +3096,10 @@ static void encode_frame_to_data_rate
int top_index; int top_index;
int bottom_index; int bottom_index;
VP8_COMMON *cm = &cpi->common; VP8_COMMON *cm = &cpi->common;
int active_worst_qchanged = FALSE; int active_worst_qchanged = 0;
int overshoot_seen = FALSE; int overshoot_seen = 0;
int undershoot_seen = FALSE; int undershoot_seen = 0;
int drop_mark = cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100; int drop_mark = cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100;
int drop_mark75 = drop_mark * 2 / 3; int drop_mark75 = drop_mark * 2 / 3;
int drop_mark50 = drop_mark / 4; int drop_mark50 = drop_mark / 4;
@ -3150,12 +3150,12 @@ static void encode_frame_to_data_rate
// Enable or disable mode based tweaking of the zbin // Enable or disable mode based tweaking of the zbin
// For 2 Pass Only used where GF/ARF prediction quality // For 2 Pass Only used where GF/ARF prediction quality
// is above a threshold // is above a threshold
cpi->zbin_mode_boost_enabled = TRUE; cpi->zbin_mode_boost_enabled = 1;
if (cpi->pass == 2) if (cpi->pass == 2)
{ {
if ( cpi->gfu_boost <= 400 ) if ( cpi->gfu_boost <= 400 )
{ {
cpi->zbin_mode_boost_enabled = FALSE; cpi->zbin_mode_boost_enabled = 0;
} }
} }
@ -3196,7 +3196,7 @@ static void encode_frame_to_data_rate
} }
// The alternate reference frame cannot be active for a key frame // The alternate reference frame cannot be active for a key frame
cpi->source_alt_ref_active = FALSE; cpi->source_alt_ref_active = 0;
// Reset the RD threshold multipliers to default of * 1 (128) // Reset the RD threshold multipliers to default of * 1 (128)
for (i = 0; i < MAX_MODES; i++) for (i = 0; i < MAX_MODES; i++)
@ -3708,7 +3708,7 @@ static void encode_frame_to_data_rate
vp8_pick_frame_size(cpi); vp8_pick_frame_size(cpi);
// Clear the Alt reference frame active flag when we have a key frame // Clear the Alt reference frame active flag when we have a key frame
cpi->source_alt_ref_active = FALSE; cpi->source_alt_ref_active = 0;
// Reset the loop filter deltas and segmentation map // Reset the loop filter deltas and segmentation map
setup_features(cpi); setup_features(cpi);
@ -3733,7 +3733,7 @@ static void encode_frame_to_data_rate
q_high = cpi->active_worst_quality; q_high = cpi->active_worst_quality;
loop_count++; loop_count++;
Loop = TRUE; Loop = 1;
continue; continue;
} }
@ -3761,10 +3761,10 @@ static void encode_frame_to_data_rate
} }
// If we have updated the active max Q do not call vp8_update_rate_correction_factors() this loop. // If we have updated the active max Q do not call vp8_update_rate_correction_factors() this loop.
active_worst_qchanged = TRUE; active_worst_qchanged = 1;
} }
else else
active_worst_qchanged = FALSE; active_worst_qchanged = 0;
#if !(CONFIG_REALTIME_ONLY) #if !(CONFIG_REALTIME_ONLY)
// Special case handling for forced key frames // Special case handling for forced key frames
@ -3800,7 +3800,7 @@ static void encode_frame_to_data_rate
else if (Q < q_low) else if (Q < q_low)
Q = q_low; Q = q_low;
Loop = ((Q != last_q)) ? TRUE : FALSE; Loop = ((Q != last_q)) ? 1 : 0;
} }
// Is the projected frame size out of range and are we allowed to attempt to recode. // Is the projected frame size out of range and are we allowed to attempt to recode.
@ -3857,7 +3857,7 @@ static void encode_frame_to_data_rate
} }
} }
overshoot_seen = TRUE; overshoot_seen = 1;
} }
// Frame is too small // Frame is too small
else else
@ -3907,7 +3907,7 @@ static void encode_frame_to_data_rate
} }
} }
undershoot_seen = TRUE; undershoot_seen = 1;
} }
// Clamp Q to upper and lower limits: // Clamp Q to upper and lower limits:
@ -3919,18 +3919,18 @@ static void encode_frame_to_data_rate
// Clamp cpi->zbin_over_quant // Clamp cpi->zbin_over_quant
cpi->zbin_over_quant = (cpi->zbin_over_quant < zbin_oq_low) ? zbin_oq_low : (cpi->zbin_over_quant > zbin_oq_high) ? zbin_oq_high : cpi->zbin_over_quant; cpi->zbin_over_quant = (cpi->zbin_over_quant < zbin_oq_low) ? zbin_oq_low : (cpi->zbin_over_quant > zbin_oq_high) ? zbin_oq_high : cpi->zbin_over_quant;
//Loop = ((Q != last_q) || (last_zbin_oq != cpi->zbin_over_quant)) ? TRUE : FALSE; //Loop = ((Q != last_q) || (last_zbin_oq != cpi->zbin_over_quant)) ? 1 : 0;
Loop = ((Q != last_q)) ? TRUE : FALSE; Loop = ((Q != last_q)) ? 1 : 0;
last_zbin_oq = cpi->zbin_over_quant; last_zbin_oq = cpi->zbin_over_quant;
} }
else else
#endif #endif
Loop = FALSE; Loop = 0;
if (cpi->is_src_frame_alt_ref) if (cpi->is_src_frame_alt_ref)
Loop = FALSE; Loop = 0;
if (Loop == TRUE) if (Loop == 1)
{ {
vp8_restore_coding_context(cpi); vp8_restore_coding_context(cpi);
loop_count++; loop_count++;
@ -3939,7 +3939,7 @@ static void encode_frame_to_data_rate
#endif #endif
} }
} }
while (Loop == TRUE); while (Loop == 1);
#if 0 #if 0
// Experimental code for lagged and one pass // Experimental code for lagged and one pass
@ -4148,7 +4148,7 @@ static void encode_frame_to_data_rate
(cpi->buffer_level < cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100) && (cpi->buffer_level < cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100) &&
(cpi->projected_frame_size > (4 * cpi->this_frame_target))) (cpi->projected_frame_size > (4 * cpi->this_frame_target)))
{ {
cpi->drop_frame = TRUE; cpi->drop_frame = 1;
} }
#endif #endif
@ -4618,7 +4618,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
cm->refresh_golden_frame = 0; cm->refresh_golden_frame = 0;
cm->refresh_last_frame = 0; cm->refresh_last_frame = 0;
cm->show_frame = 0; cm->show_frame = 0;
cpi->source_alt_ref_pending = FALSE; // Clear Pending alt Ref flag. cpi->source_alt_ref_pending = 0; // Clear Pending alt Ref flag.
cpi->is_src_frame_alt_ref = 0; cpi->is_src_frame_alt_ref = 0;
} }
} }

Просмотреть файл

@ -259,7 +259,7 @@ typedef struct
int buffer_level; int buffer_level;
int bits_off_target; int bits_off_target;
long long total_actual_bits; int64_t total_actual_bits;
int total_target_vs_actual; int total_target_vs_actual;
int worst_quality; int worst_quality;
@ -279,7 +279,7 @@ typedef struct
int zbin_over_quant; int zbin_over_quant;
int inter_frame_target; int inter_frame_target;
INT64 total_byte_count; int64_t total_byte_count;
int filter_level; int filter_level;
@ -673,8 +673,8 @@ typedef struct VP8_COMP
unsigned int current_layer; unsigned int current_layer;
LAYER_CONTEXT layer_context[MAX_LAYERS]; LAYER_CONTEXT layer_context[MAX_LAYERS];
long long frames_in_layer[MAX_LAYERS]; int64_t frames_in_layer[MAX_LAYERS];
long long bytes_in_layer[MAX_LAYERS]; int64_t bytes_in_layer[MAX_LAYERS];
double sum_psnr[MAX_LAYERS]; double sum_psnr[MAX_LAYERS];
double sum_psnr_p[MAX_LAYERS]; double sum_psnr_p[MAX_LAYERS];
double total_error2[MAX_LAYERS]; double total_error2[MAX_LAYERS];

Просмотреть файл

@ -332,8 +332,8 @@ void vp8_setup_key_frame(VP8_COMP *cpi)
else else
cpi->frames_till_gf_update_due = cpi->goldfreq; cpi->frames_till_gf_update_due = cpi->goldfreq;
cpi->common.refresh_golden_frame = TRUE; cpi->common.refresh_golden_frame = 1;
cpi->common.refresh_alt_ref_frame = TRUE; cpi->common.refresh_alt_ref_frame = 1;
} }
@ -471,7 +471,7 @@ static void calc_gf_params(VP8_COMP *cpi)
if (cpi->pass != 2) if (cpi->pass != 2)
{ {
// Single Pass lagged mode: TBD // Single Pass lagged mode: TBD
if (FALSE) if (0)
{ {
} }
@ -598,14 +598,14 @@ static void calc_gf_params(VP8_COMP *cpi)
if (cpi->pass != 2) if (cpi->pass != 2)
{ {
// For now Alt ref is not allowed except in 2 pass modes. // For now Alt ref is not allowed except in 2 pass modes.
cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_pending = 0;
/*if ( cpi->oxcf.fixed_q == -1) /*if ( cpi->oxcf.fixed_q == -1)
{ {
if ( cpi->oxcf.play_alternate && (cpi->last_boost > (100 + (AF_THRESH*cpi->frames_till_gf_update_due)) ) ) if ( cpi->oxcf.play_alternate && (cpi->last_boost > (100 + (AF_THRESH*cpi->frames_till_gf_update_due)) ) )
cpi->source_alt_ref_pending = TRUE; cpi->source_alt_ref_pending = 1;
else else
cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_pending = 0;
}*/ }*/
} }
} }
@ -982,7 +982,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
#endif #endif
//vpx_log("Decoder: Drop frame due to bandwidth: %d \n",cpi->buffer_level, cpi->av_per_frame_bandwidth); //vpx_log("Decoder: Drop frame due to bandwidth: %d \n",cpi->buffer_level, cpi->av_per_frame_bandwidth);
cpi->drop_frame = TRUE; cpi->drop_frame = 1;
} }
#if 0 #if 0
@ -990,7 +990,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
else if ((cpi->buffer_level < cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100) && else if ((cpi->buffer_level < cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100) &&
(cpi->drop_count < cpi->max_drop_count) && (cpi->pass == 0)) (cpi->drop_count < cpi->max_drop_count) && (cpi->pass == 0))
{ {
cpi->drop_frame = TRUE; cpi->drop_frame = 1;
} }
#endif #endif
@ -1036,11 +1036,11 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
{ {
// For one pass throw a GF if recent frame intra useage is low or the GF useage is high // For one pass throw a GF if recent frame intra useage is low or the GF useage is high
if ((cpi->pass == 0) && (cpi->this_frame_percent_intra < 15 || gf_frame_useage >= 5)) if ((cpi->pass == 0) && (cpi->this_frame_percent_intra < 15 || gf_frame_useage >= 5))
cpi->common.refresh_golden_frame = TRUE; cpi->common.refresh_golden_frame = 1;
// Two pass GF descision // Two pass GF descision
else if (cpi->pass == 2) else if (cpi->pass == 2)
cpi->common.refresh_golden_frame = TRUE; cpi->common.refresh_golden_frame = 1;
} }
#if 0 #if 0
@ -1058,7 +1058,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
#endif #endif
if (cpi->common.refresh_golden_frame == TRUE) if (cpi->common.refresh_golden_frame == 1)
{ {
#if 0 #if 0
@ -1543,7 +1543,7 @@ int vp8_pick_frame_size(VP8_COMP *cpi)
// Check if we're dropping the frame: // Check if we're dropping the frame:
if (cpi->drop_frame) if (cpi->drop_frame)
{ {
cpi->drop_frame = FALSE; cpi->drop_frame = 0;
cpi->drop_count++; cpi->drop_count++;
return 0; return 0;
} }

Просмотреть файл

@ -9,7 +9,6 @@
## ##
VP8_COMMON_SRCS-yes += vp8_common.mk VP8_COMMON_SRCS-yes += vp8_common.mk
VP8_COMMON_SRCS-yes += common/type_aliases.h
VP8_COMMON_SRCS-yes += common/pragmas.h VP8_COMMON_SRCS-yes += common/pragmas.h
VP8_COMMON_SRCS-yes += common/ppflags.h VP8_COMMON_SRCS-yes += common/ppflags.h
VP8_COMMON_SRCS-yes += common/onyx.h VP8_COMMON_SRCS-yes += common/onyx.h
@ -35,7 +34,6 @@ VP8_COMMON_SRCS-yes += common/idctllm.c
VP8_COMMON_SRCS-yes += common/alloccommon.h VP8_COMMON_SRCS-yes += common/alloccommon.h
VP8_COMMON_SRCS-yes += common/blockd.h VP8_COMMON_SRCS-yes += common/blockd.h
VP8_COMMON_SRCS-yes += common/common.h VP8_COMMON_SRCS-yes += common/common.h
VP8_COMMON_SRCS-yes += common/common_types.h
VP8_COMMON_SRCS-yes += common/entropy.h VP8_COMMON_SRCS-yes += common/entropy.h
VP8_COMMON_SRCS-yes += common/entropymode.h VP8_COMMON_SRCS-yes += common/entropymode.h
VP8_COMMON_SRCS-yes += common/entropymv.h VP8_COMMON_SRCS-yes += common/entropymv.h