Permalink
Browse files

Add simd optimizations for high bit depth

  • Loading branch information...
1 parent 9789051 commit d0e5d08277fc7ff15622bd46fd0d82771f79ad3e Arild Fuldseth (arilfuld) committed with Thomas Davies Nov 4, 2016
View
@@ -24,6 +24,7 @@ COMMON_SOURCES = \
common/intra_prediction.c \
common/inter_prediction.c \
common/common_kernels.c \
+ common/common_kernels_hbd.c \
common/snr.c \
common/snr_hbd.c \
common/simd.c \
@@ -45,6 +46,7 @@ ENCODER_SOURCES = \
enc/strings.c \
enc/write_bits.c \
enc/enc_kernels.c \
+ enc/enc_kernels_hbd.c \
enc/rc.c \
enc/encode_block_hbd.c \
enc/encode_frame_hbd.c \
@@ -77,6 +79,10 @@ $(ENCODER_PROGRAM): $(ENCODER_OBJECTS)
$(DECODER_PROGRAM): $(DECODER_OBJECTS)
$(CC) -o $@ $(DECODER_OBJECTS) $(LDFLAGS)
+common/common_kernels_gen.c: common/common_kernels.c scripts/lbd_to_hbd.sh
+ scripts/lbd_to_hbd.sh common/common_kernels.c common/common_kernels_gen.c
+enc/enc_kernels_gen.c: enc/enc_kernels.c scripts/lbd_to_hbd.sh
+ scripts/lbd_to_hbd.sh enc/enc_kernels.c enc/enc_kernels_gen.c
# Build object files. In addition, track header dependencies.
%.o: %.c
@@ -24,6 +24,7 @@
<ClCompile Include="..\..\common\common_frame.c" />
<ClCompile Include="..\..\common\common_frame_hbd.c" />
<ClCompile Include="..\..\common\common_kernels.c" />
+ <ClCompile Include="..\..\common\common_kernels_hbd.c" />
<ClCompile Include="..\..\common\common_tables.c" />
<ClCompile Include="..\..\common\inter_prediction.c" />
<ClCompile Include="..\..\common\inter_prediction_hbd.c" />
@@ -24,6 +24,7 @@
<ClCompile Include="..\..\common\common_frame.c" />
<ClCompile Include="..\..\common\common_frame_hbd.c" />
<ClCompile Include="..\..\common\common_kernels.c" />
+ <ClCompile Include="..\..\common\common_kernels_hbd.c" />
<ClCompile Include="..\..\common\common_tables.c" />
<ClCompile Include="..\..\common\inter_prediction.c" />
<ClCompile Include="..\..\common\inter_prediction_hbd.c" />
@@ -42,6 +43,7 @@
<ClCompile Include="..\..\enc\encode_frame_hbd.c" />
<ClCompile Include="..\..\enc\encode_tables.c" />
<ClCompile Include="..\..\enc\enc_kernels.c" />
+ <ClCompile Include="..\..\enc\enc_kernels_hbd.c" />
<ClCompile Include="..\..\enc\mainenc.c" />
<ClCompile Include="..\..\enc\putbits.c" />
<ClCompile Include="..\..\enc\putvlc.c" />
@@ -26,5 +26,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SAMPLE uint16_t
#define TEMPLATE(name) name##_hbd
+#define HBD
#include "common_block.c"
@@ -756,10 +756,10 @@ void TEMPLATE(clpf_frame)(yuv_frame_t *dst, yuv_frame_t *rec, yuv_frame_t *org,
int filter = deblock_data[index].mode != MODE_SKIP;
if (filter) {
- if (use_simd && sizeof(SAMPLE) == 1) {
- clpf_block_simd((uint8_t *)rec->y, (uint8_t *)dst->y, stride_y, xpos, ypos, bs, bs, width, height, strength);
- clpf_block_simd((uint8_t *)rec->u, (uint8_t *)dst->u, stride_c, xpos >> rec->sub, ypos >> rec->sub, bs >> rec->sub, bs >> rec->sub, width >> rec->sub, height >> rec->sub, strength);
- clpf_block_simd((uint8_t *)rec->v, (uint8_t *)dst->v, stride_c, xpos >> rec->sub, ypos >> rec->sub, bs >> rec->sub, bs >> rec->sub, width >> rec->sub, height >> rec->sub, strength);
+ if (use_simd) {
+ TEMPLATE(clpf_block_simd)(rec->y, dst->y, stride_y, xpos, ypos, bs, bs, width, height, strength);
+ TEMPLATE(clpf_block_simd)(rec->u, dst->u, stride_c, xpos >> rec->sub, ypos >> rec->sub, bs >> rec->sub, bs >> rec->sub, width >> rec->sub, height >> rec->sub, strength);
+ TEMPLATE(clpf_block_simd)(rec->v, dst->v, stride_c, xpos >> rec->sub, ypos >> rec->sub, bs >> rec->sub, bs >> rec->sub, width >> rec->sub, height >> rec->sub, strength);
} else {
TEMPLATE(clpf_block)(rec->y, dst->y, stride_y, xpos, ypos, bs, bs, width, height, strength);
TEMPLATE(clpf_block)(rec->u, dst->u, stride_c, xpos >> rec->sub, ypos >> rec->sub, bs >> rec->sub, bs >> rec->sub, width >> rec->sub, height >> rec->sub, strength);
@@ -26,5 +26,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SAMPLE uint16_t
#define TEMPLATE(name) name##_hbd
+#define HBD
#include "common_frame.c"
Oops, something went wrong.

0 comments on commit d0e5d08

Please sign in to comment.