}
static void update_mode_info_in_image( VP8_COMMON *cpi, MODE_INFO *mi )
{
- int stride = cpi->mode_info_stride;
- int rows = cpi->mb_rows;
- int cols = cpi->mb_cols;
int i, j;
// For each in image mode_info element set the in image flag to 1
void vp8_default_coef_probs(VP8_COMMON *pc)
{
- int h;
vpx_memcpy(pc->fc.coef_probs, default_coef_probs,
sizeof(default_coef_probs));
void vp8_short_ihaar2x2_c(short *input, short *output, int pitch)
{
- int i, x;
+ int i;
short *ip = input; //0,1, 4, 8
short *op = output;
for (i = 0; i < 16; i++)
#include "vp8/common/onyxc_int.h"
#define MAX_REGIONS 24000
+#ifndef NULL
#define NULL 0
+#endif
#define min_mbs_in_region 3
*/
#include "vp8/common/pred_common.h"
+#include "vp8/common/seg_common.h"
// TBD prediction functions for various bitstream signals
MACROBLOCKD *const xd = & pbi->mb;
const unsigned char *data = (const unsigned char *)pbi->Source;
const unsigned char *data_end = data + pbi->source_sz;
- ptrdiff_t first_partition_length_in_bytes;
+ ptrdiff_t first_partition_length_in_bytes = 0;
int mb_row;
- int i, j, k, l;
+ int i, j;
int corrupt_tokens = 0;
/* start with no corruption of current frame */
#include "vpx/vpx_encoder.h"
#include "vpx_mem/vpx_mem.h"
#include "bitstream.h"
+#include "segmentation.h"
#include "vp8/common/seg_common.h"
#include "vp8/common/pred_common.h"
int k = 0;
do
{
+#ifdef ENTROPY_STATS
int t;
+#endif
#if CONFIG_EXPANDED_COEF_CONTEXT
if (k >=3 && ((i == 0 && j == 1) || (i > 0 && j == 0)))
continue;
/* calc probs and branch cts for this frame only */
//vp8_prob new_p [ENTROPY_NODES];
//unsigned int branch_ct [ENTROPY_NODES] [2];
+#ifdef ENTROPY_STATS
int t = 0; /* token/prob index */
+#endif
#if CONFIG_EXPANDED_COEF_CONTEXT
if (k >=3 && ((i == 0 && j == 1) || (i > 0 && j == 0)))
continue;
# define pack_tokens(a,b,c) pack_tokens_c(a,b,c)
#endif
#endif
+
+void update_skip_probs(VP8_COMP *cpi);
MACROBLOCKD *xd,
TOKENEXTRA **tp )
{
- int i, j;
+ int i;
int map_index;
int mb_row, mb_col;
int recon_yoffset, recon_uvoffset;
if (cpi->sf.RD)
{
int frame_type, pred_type;
- int redo = 0;
int single_diff, comp_diff, hybrid_diff;
/*
{
VP8_COMMON *cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
- int intra_error = 0;
- int rate;
- int distortion;
unsigned char *segment_id = &xd->mode_info_context->mbmi.segment_id;
int seg_ref_active;
unsigned char ref_pred_flag;
{
int i;
- MACROBLOCKD *x = &mb->e_mbd;
#if 0
+ MACROBLOCKD *x = &mb->e_mbd;
// Intra modes requiring top-right MB reconstructed data have been disabled
vp8_intra_prediction_down_copy(x);
#endif
{
int b;
int type;
- int has_2nd_order;
ENTROPY_CONTEXT_PLANES t_above, t_left;
ENTROPY_CONTEXT *ta;
#define POW1 (double)cpi->oxcf.two_pass_vbrbias/100.0
#define POW2 (double)cpi->oxcf.two_pass_vbrbias/100.0
-static int vscale_lookup[7] = {0, 1, 1, 2, 2, 3, 3};
-static int hscale_lookup[7] = {0, 0, 1, 1, 2, 2, 3};
-
static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame);
static int select_cq_level( int qindex )
double sr_correction;
double err_per_mb = section_err / num_mbs;
double err_correction_factor;
- double corr_high;
double speed_correction = 1.0;
- double inter_pct = (fpstats->pcnt_inter / fpstats->count);
- double intra_pct = 1.0 - inter_pct;
int overhead_bits_per_mb;
if (section_target_bandwitdh <= 0)
double err_correction_factor;
double sr_err_diff;
double sr_correction;
- double corr_high;
double speed_correction = 1.0;
double clip_iiratio;
double clip_iifactor;
- double inter_pct = (fpstats->pcnt_inter / fpstats->count);
- double intra_pct = 1.0 - inter_pct;
int overhead_bits_per_mb;
{
double prediction_decay_rate;
double second_ref_decay;
- double motion_decay;
- double motion_pct = next_frame->pcnt_motion;
double mb_sr_err_diff;
// Initial basis is the % mbs inter coded
FIRSTPASS_STATS next_frame;
FIRSTPASS_STATS *start_pos;
int i;
- double r;
double boost_score = 0.0;
double old_boost_score = 0.0;
double gf_group_err = 0.0;
{
int kf_boost = boost_score;
int allocation_chunks;
- int Counter = cpi->twopass.frames_to_key;
int alt_kf_bits;
- YV12_BUFFER_CONFIG *lst_yv12 = &cpi->common.yv12_fb[cpi->common.lst_fb_idx];
if ( kf_boost < 300 )
{
x->fc.uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
vp8_cost_tokens(c->mb.intra_uv_mode_cost[0],
x->kf_uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
- vp8_cost_tokens(c->mb.i8x8_mode_costs,
+ vp8_cost_tokens((int *)c->mb.i8x8_mode_costs,
x->fc.i8x8_mode_prob,vp8_i8x8_mode_tree);
-
}
#include "mbgraph.h"
#include "vp8/common/pred_common.h"
#include "vp8/encoder/rdopt.h"
+#include "bitstream.h"
+#include "ratectrl.h"
#if ARCH_ARM
#include "vpx_ports/arm.h"
// write the frame
int i;
- char filename[255];
FILE *fp = fopen("encode_recon.yuv", "a");
for (i = 0; i < frame->y_height; i++)
if (cm->frame_type != KEY_FRAME)
{
#if CONFIG_ENHANCED_INTERP
- double e = 0; //compute_edge_pixel_proportion(cpi->Source);
/* TODO: Decide this more intelligently */
if (sf->search_best_filter)
{
#endif
VP8_COMP *cpi = (VP8_COMP *) ptr;
VP8_COMMON *cm = &cpi->common;
- struct vpx_usec_timer tsctimer;
- struct vpx_usec_timer ticktimer;
struct vpx_usec_timer cmptimer;
YV12_BUFFER_CONFIG *force_src_buffer = NULL;
#define vp8_quantize_mb vp8_quantize_mb_c
#endif
extern prototype_quantize_mb(vp8_quantize_mb);
+void vp8_quantize_mb_8x8(MACROBLOCK *x);
#ifndef vp8_quantize_mbuv
#define vp8_quantize_mbuv vp8_quantize_mbuv_c
#include "vpx_mem/vpx_mem.h"
#include "vp8/common/systemdependent.h"
#include "encodemv.h"
-
+#include "vp8/common/quant_common.h"
#define MIN_BPB_FACTOR 0.005
#define MAX_BPB_FACTOR 50
double vp8_convert_qindex_to_q( int qindex )
{
// Convert the index to a real Q value (scaled down to match old Q values)
- return (double)vp8_ac_yquant( qindex, 0 ) / 4.0;
+ return (double)vp8_ac_yquant( qindex ) / 4.0;
}
int vp8_gfboost_qadjust( int qindex )
static void calc_iframe_target_size(VP8_COMP *cpi)
{
// boost defaults to half second
- int kf_boost;
int target;
// Clear down mmx registers to allow floating point in what follows
static void calc_pframe_target_size(VP8_COMP *cpi)
{
int min_frame_target;
- int Adjustment;
min_frame_target = 0;
extern double vp8_convert_qindex_to_q( int qindex );
extern int vp8_gfboost_qadjust( int qindex );
extern int vp8_bits_per_mb( FRAME_TYPE frame_type, int qindex );
+void vp8_setup_inter_frame(VP8_COMP *cpi);
#endif
MACROBLOCKD *const x = &mb->e_mbd;
BLOCK *const mb_y2 = mb->block + 24;
BLOCKD *const x_y2 = x->block + 24;
- short *Y2DCPtr = mb_y2->src_diff;
int d;
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(
int distortion;
BLOCK *be=x->block + ib;
BLOCKD *b=x->e_mbd.block + ib;
- ENTROPY_CONTEXT ta0, ta1, besta0, besta1;
- ENTROPY_CONTEXT tl0, tl1, bestl0, bestl1;
+ ENTROPY_CONTEXT ta0, ta1, besta0 = 0, besta1 = 0;
+ ENTROPY_CONTEXT tl0, tl1, bestl0 = 0, bestl1 = 0;
/*
}
}
-/*static */void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv)
+void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv)
{
if (x->e_mbd.mode_info_context->mbmi.mode == SPLITMV)
{
int rate2, distortion2;
int uv_intra_rate, uv_intra_distortion, uv_intra_rate_tokenonly;
int uv_intra_skippable = 0;
- int uv_intra_rate_8x8, uv_intra_distortion_8x8, uv_intra_rate_tokenonly_8x8;
+ int uv_intra_rate_8x8 = 0, uv_intra_distortion_8x8 = 0, uv_intra_rate_tokenonly_8x8 = 0;
int uv_intra_skippable_8x8=0;
int rate_y, UNINITIALIZED_IS_SAFE(rate_uv);
int distortion_uv;
//int intermodecost[MAX_MODES];
MB_PREDICTION_MODE uv_intra_mode;
- MB_PREDICTION_MODE uv_intra_mode_8x8;
+ MB_PREDICTION_MODE uv_intra_mode_8x8 = 0;
int_mv mvp;
int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7};
extern void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffset, int near_sadidx[]);
extern void vp8_init_me_luts();
extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv);
+void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv);
#endif
int *Costs, const vp8_prob *, vp8_tree
);
+void vp8_cost_tokens_skip(int *c, const vp8_prob *p, vp8_tree t);
+
#endif