Commit bb65be98 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Reusing existing mem_{get, put}_be32() functions.

Change-Id: Iba128039534e16a6e0a8cfe7e58306c4655e9f0d
parent 3bb2ae5c
...@@ -164,6 +164,8 @@ endif ...@@ -164,6 +164,8 @@ endif
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops_aligned.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h
CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "./vpx_scale_rtcd.h" #include "./vpx_scale_rtcd.h"
#include "vpx_mem/vpx_mem.h" #include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem_ops.h"
#include "vpx_scale/vpx_scale.h" #include "vpx_scale/vpx_scale.h"
#include "vp9/common/vp9_alloccommon.h" #include "vp9/common/vp9_alloccommon.h"
...@@ -39,10 +40,6 @@ ...@@ -39,10 +40,6 @@
#include "vp9/decoder/vp9_reader.h" #include "vp9/decoder/vp9_reader.h"
#include "vp9/decoder/vp9_thread.h" #include "vp9/decoder/vp9_thread.h"
static int read_be32(const uint8_t *p) {
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}
static int is_compound_reference_allowed(const VP9_COMMON *cm) { static int is_compound_reference_allowed(const VP9_COMMON *cm) {
int i; int i;
for (i = 1; i < REFS_PER_FRAME; ++i) for (i = 1; i < REFS_PER_FRAME; ++i)
...@@ -837,7 +834,7 @@ static size_t get_tile(const uint8_t *const data_end, ...@@ -837,7 +834,7 @@ static size_t get_tile(const uint8_t *const data_end,
vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME, vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME,
"Truncated packet or corrupt tile length"); "Truncated packet or corrupt tile length");
size = read_be32(*data); size = mem_get_be32(*data);
*data += 4; *data += 4;
if (size > (size_t)(data_end - *data)) if (size > (size_t)(data_end - *data))
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "vpx/vpx_encoder.h" #include "vpx/vpx_encoder.h"
#include "vpx_mem/vpx_mem.h" #include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem_ops.h"
#include "vp9/common/vp9_entropymode.h" #include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_entropymv.h" #include "vp9/common/vp9_entropymv.h"
...@@ -61,13 +62,6 @@ static void write_inter_mode(vp9_writer *w, MB_PREDICTION_MODE mode, ...@@ -61,13 +62,6 @@ static void write_inter_mode(vp9_writer *w, MB_PREDICTION_MODE mode,
&inter_mode_encodings[INTER_OFFSET(mode)]); &inter_mode_encodings[INTER_OFFSET(mode)]);
} }
static INLINE void write_be32(uint8_t *p, int value) {
p[0] = value >> 24;
p[1] = value >> 16;
p[2] = value >> 8;
p[3] = value;
}
void vp9_encode_unsigned_max(struct vp9_write_bit_buffer *wb, void vp9_encode_unsigned_max(struct vp9_write_bit_buffer *wb,
int data, int max) { int data, int max) {
vp9_wb_write_literal(wb, data, get_unsigned_bits(max)); vp9_wb_write_literal(wb, data, get_unsigned_bits(max));
...@@ -1007,7 +1001,7 @@ static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) { ...@@ -1007,7 +1001,7 @@ static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) {
vp9_stop_encode(&residual_bc); vp9_stop_encode(&residual_bc);
if (tile_col < tile_cols - 1 || tile_row < tile_rows - 1) { if (tile_col < tile_cols - 1 || tile_row < tile_rows - 1) {
// size of this tile // size of this tile
write_be32(data_ptr + total_size, residual_bc.pos); mem_put_be32(data_ptr + total_size, residual_bc.pos);
total_size += 4; total_size += 4;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment