Add some consts to vp9_calc_ss_err().

Also change its wrongly named dest parameter to reference.

Change-Id: Ide142dead31c9ccda1f09a48b221284369783fb7
This commit is contained in:
Alex Converse 2014-01-24 14:21:39 -08:00
Родитель 6a457ef794
Коммит ea283a6272
4 изменённых файлов: 13 добавлений и 10 удалений

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

@ -3872,24 +3872,25 @@ void vp9_set_svc(VP9_PTR comp, int use_svc) {
return;
}
int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest) {
int vp9_calc_ss_err(const YV12_BUFFER_CONFIG *source,
const YV12_BUFFER_CONFIG *reference) {
int i, j;
int total = 0;
uint8_t *src = source->y_buffer;
uint8_t *dst = dest->y_buffer;
const uint8_t *src = source->y_buffer;
const uint8_t *ref = reference->y_buffer;
// Loop through the Y plane raw and reconstruction data summing
// (square differences)
for (i = 0; i < source->y_height; i += 16) {
for (j = 0; j < source->y_width; j += 16) {
unsigned int sse;
total += vp9_mse16x16(src + j, source->y_stride, dst + j, dest->y_stride,
&sse);
total += vp9_mse16x16(src + j, source->y_stride,
ref + j, reference->y_stride, &sse);
}
src += 16 * source->y_stride;
dst += 16 * dest->y_stride;
ref += 16 * reference->y_stride;
}
return total;

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

@ -811,7 +811,8 @@ void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x);
void vp9_set_speed_features(VP9_COMP *cpi);
int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest);
int vp9_calc_ss_err(const YV12_BUFFER_CONFIG *source,
const YV12_BUFFER_CONFIG *reference);
void vp9_alloc_compressor_data(VP9_COMP *cpi);

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

@ -34,7 +34,7 @@ static int get_max_filter_level(VP9_COMP *cpi, int base_qindex) {
void vp9_set_alt_lf_level(VP9_COMP *cpi, int filt_val) {
}
static void search_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
static void search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
int partial) {
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
VP9_COMMON *const cm = &cpi->common;
@ -128,7 +128,8 @@ static void search_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
lf->filter_level = filt_best;
}
void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int method) {
void vp9_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
int method) {
VP9_COMMON *const cm = &cpi->common;
struct loopfilter *const lf = &cm->lf;

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

@ -21,7 +21,7 @@ struct VP9_COMP;
void vp9_set_alt_lf_level(struct VP9_COMP *cpi, int filt_val);
void vp9_pick_filter_level(struct yv12_buffer_config *sd,
void vp9_pick_filter_level(const struct yv12_buffer_config *sd,
struct VP9_COMP *cpi, int method);
#ifdef __cplusplus
} // extern "C"