Merge "Added rtcd support vp8_sad16x3 and vp8_sad3x16" into experimental
This commit is contained in:
commit
12c1b180f8
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
#include "findnearmv.h"
|
||||
#include "vp8/encoder/variance.h"
|
||||
#include "vp8/common/sadmxn.h"
|
||||
#include <limits.h>
|
||||
|
||||
const unsigned char vp8_mbsplit_offset[4][16] = {
|
||||
@ -199,6 +199,23 @@ vp8_prob *vp8_mv_ref_probs(VP8_COMMON *pc,
|
||||
}
|
||||
|
||||
#if CONFIG_NEWBESTREFMV
|
||||
unsigned int vp8_sad3x16_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int max_sad) {
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 3, 16);
|
||||
}
|
||||
unsigned int vp8_sad16x3_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int max_sad) {
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 3);
|
||||
}
|
||||
|
||||
/* check a list of motion vectors by sad score using a number rows of pixels
|
||||
* above and a number cols of pixels in the left to select the one with best
|
||||
* score to use as ref motion vector
|
||||
@ -261,10 +278,10 @@ void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
|
||||
|
||||
sad = 0;
|
||||
if (xd->up_available)
|
||||
sad += vp8_sad16x3_c(above_src, xd->dst.y_stride,
|
||||
sad += vp8_sad16x3(above_src, xd->dst.y_stride,
|
||||
above_ref + offset, ref_y_stride, INT_MAX);
|
||||
if (xd->left_available)
|
||||
sad += vp8_sad3x16_c(left_src, xd->dst.y_stride,
|
||||
sad += vp8_sad3x16(left_src, xd->dst.y_stride,
|
||||
left_ref + offset, ref_y_stride, INT_MAX);
|
||||
// Add the entry to our list and then resort the list on score.
|
||||
sad_scores[i] = sad;
|
||||
|
@ -174,6 +174,15 @@ vp8_loop_filter_simple_bh_sse2=vp8_loop_filter_bhs_sse2
|
||||
vp8_loop_filter_simple_bh_media=vp8_loop_filter_bhs_armv6
|
||||
vp8_loop_filter_simple_bh_neon=vp8_loop_filter_bhs_neon
|
||||
|
||||
#
|
||||
# sad 16x3, 3x16
|
||||
#
|
||||
prototype unsigned int vp8_sad16x3 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
|
||||
specialize vp8_sad16x3
|
||||
|
||||
prototype unsigned int vp8_sad3x16 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
|
||||
specialize vp8_sad3x16
|
||||
|
||||
#
|
||||
# Encoder functions below this point.
|
||||
#
|
||||
|
37
vp8/common/sadmxn.h
Normal file
37
vp8/common/sadmxn.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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_SAD_H
|
||||
#define __INC_SAD_H
|
||||
|
||||
static __inline
|
||||
unsigned int sad_mx_n_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int m,
|
||||
int n) {
|
||||
int r, c;
|
||||
unsigned int sad = 0;
|
||||
|
||||
for (r = 0; r < n; r++) {
|
||||
for (c = 0; c < m; c++) {
|
||||
sad += abs(src_ptr[c] - ref_ptr[c]);
|
||||
}
|
||||
|
||||
src_ptr += src_stride;
|
||||
ref_ptr += ref_stride;
|
||||
}
|
||||
|
||||
return sad;
|
||||
}
|
||||
|
||||
#endif
|
@ -10,33 +10,10 @@
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "vp8/common/sadmxn.h"
|
||||
#include "vpx_ports/config.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
|
||||
static __inline
|
||||
unsigned int sad_mx_n_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int m,
|
||||
int n) {
|
||||
|
||||
int r, c;
|
||||
unsigned int sad = 0;
|
||||
|
||||
for (r = 0; r < n; r++) {
|
||||
for (c = 0; c < m; c++) {
|
||||
sad += abs(src_ptr[c] - ref_ptr[c]);
|
||||
}
|
||||
|
||||
src_ptr += src_stride;
|
||||
ref_ptr += ref_stride;
|
||||
}
|
||||
|
||||
return sad;
|
||||
}
|
||||
|
||||
unsigned int vp8_sad32x32_c(const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
@ -97,25 +74,6 @@ unsigned int vp8_sad4x4_c(
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 4, 4);
|
||||
}
|
||||
|
||||
#if CONFIG_NEWBESTREFMV
|
||||
unsigned int vp8_sad3x16_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int max_sad){
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 3, 16);
|
||||
}
|
||||
unsigned int vp8_sad16x3_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int max_sad){
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
void vp8_sad32x32x3_c(const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
|
@ -53,6 +53,7 @@ VP8_COMMON_SRCS-yes += common/reconintra.h
|
||||
VP8_COMMON_SRCS-yes += common/reconintra4x4.h
|
||||
VP8_COMMON_SRCS-yes += common/rtcd.c
|
||||
VP8_COMMON_SRCS-yes += common/rtcd_defs.sh
|
||||
VP8_COMMON_SRCS-yes += common/sadmxn.h
|
||||
VP8_COMMON_SRCS-yes += common/seg_common.h
|
||||
VP8_COMMON_SRCS-yes += common/seg_common.c
|
||||
VP8_COMMON_SRCS-yes += common/setupintrarecon.h
|
||||
|
Loading…
x
Reference in New Issue
Block a user