mips*) enable mips;;
esac
+ # PIC is probably what we want when building shared libs
+ enabled shared && soft_enable pic
+
# Handle darwin variants
case ${toolchain} in
*-darwin8-gcc)
enabled gcov &&
check_add_cflags -fprofile-arcs -ftest-coverage &&
check_add_ldflags -fprofile-arcs -ftest-coverage
- enabled optimizations && check_add_cflags -O3
- if enabled rvct; then
- enabled optimizations && check_add_cflags -Otime
+ if enabled optimizations; then
+ enabled rvct && check_add_cflags -Otime
+ enabled small && check_add_cflags -O2 || check_add_cflags -O3
fi
# Position Independant Code (PIC) support, for building relocatable
${toggle_realtime_only} enable this option while building for real-time encoding
${toggle_runtime_cpu_detect} runtime cpu detection
${toggle_shared} shared library support
+ ${toggle_small} favor smaller size over speed
${toggle_arm_asm_detok} assembly version of the detokenizer (ARM platforms only)
Codecs:
spatial_resampling
realtime_only
shared
+ small
arm_asm_detok
experimental
spatial_resampling
realtime_only
shared
+ small
arm_asm_detok
experimental
"
// variable for threading
#if CONFIG_MULTITHREAD
int mt_baseline_filter_level[MAX_MB_SEGMENTS];
+ int sync_range;
int *mt_current_mb_col; // Each row remembers its already decoded column.
unsigned char **mt_yabove_row; // mb_rows x width
int mb_row;
int num_part = 1 << pbi->common.multi_token_partition;
volatile int *last_row_current_mb_col;
+ int nsync = pbi->sync_range;
for (mb_row = ithread+1; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1))
{
for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
{
- if ((mb_col & 7) == 0)
+ if ((mb_col & (nsync-1)) == 0)
{
- while (mb_col > (*last_row_current_mb_col - 8) && *last_row_current_mb_col != pc->mb_cols - 1)
+ while (mb_col > (*last_row_current_mb_col - nsync) && *last_row_current_mb_col != pc->mb_cols - 1)
{
x86_pause_hint();
thread_sleep(0);
if ((width & 0xf) != 0)
width += 16 - (width & 0xf);
+ if (width < 640) pbi->sync_range = 1;
+ else if (width <= 1280) pbi->sync_range = 8;
+ else if (width <= 2560) pbi->sync_range =16;
+ else pbi->sync_range = 32;
+
uv_width = width >>1;
// Allocate an int for each mb row.
int num_part = 1 << pbi->common.multi_token_partition;
int i, j;
volatile int *last_row_current_mb_col = NULL;
+ int nsync = pbi->sync_range;
int filter_level;
loop_filter_info *lfi = pc->lf_info;
for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
{
- if ( mb_row > 0 && (mb_col & 7) == 0){
- while (mb_col > (*last_row_current_mb_col - 8) && *last_row_current_mb_col != pc->mb_cols - 1)
+ if ( mb_row > 0 && (mb_col & (nsync-1)) == 0){
+ while (mb_col > (*last_row_current_mb_col - nsync) && *last_row_current_mb_col != pc->mb_cols - 1)
{
x86_pause_hint();
thread_sleep(0);
data vpx_codec_vp8_dx_algo
+text vpx_codec_vp8_dx
data vpx_codec_vp8_cx_algo
+text vpx_codec_vp8_cx
VP8_COMMON_SRCS-yes += common/reconinter.c
VP8_COMMON_SRCS-yes += common/reconintra.c
VP8_COMMON_SRCS-yes += common/reconintra4x4.c
-VP8_COMMON_SRCS-yes += common/reconintra_mt.h
-VP8_COMMON_SRCS-yes += common/reconintra_mt.c
VP8_COMMON_SRCS-yes += common/setupintrarecon.c
VP8_COMMON_SRCS-yes += common/swapyv12buffer.c
VP8_COMMON_SRCS-yes += common/textblit.c
#ifndef VERSION_STRING
#define VERSION_STRING
#endif
-vpx_codec_iface_t vpx_codec_vp8_cx_algo =
+CODEC_INTERFACE(vpx_codec_vp8_cx) =
{
"WebM Project VP8 Encoder" VERSION_STRING,
VPX_CODEC_INTERNAL_ABI_VERSION,
#ifndef VERSION_STRING
#define VERSION_STRING
#endif
-vpx_codec_iface_t vpx_codec_vp8_dx_algo =
+CODEC_INTERFACE(vpx_codec_vp8_dx) =
{
"WebM Project VP8 Decoder" VERSION_STRING,
VPX_CODEC_INTERNAL_ABI_VERSION,
VP8_DX_SRCS-yes += decoder/onyxd_if.c
VP8_DX_SRCS-yes += decoder/threading.c
VP8_DX_SRCS-yes += decoder/idct_blk.c
+VP8_DX_SRCS-$(CONFIG_MULTITHREAD) += decoder/reconintra_mt.h
+VP8_DX_SRCS-$(CONFIG_MULTITHREAD) += decoder/reconintra_mt.c
VP8_DX_SRCS-yes := $(filter-out $(VP8_DX_SRCS_REMOVE-yes),$(VP8_DX_SRCS-yes))
#define RECAST(id, x) id##__convert(x)
+/* CODEC_INTERFACE convenience macro
+ *
+ * By convention, each codec interface is a struct with extern linkage, where
+ * the symbol is suffixed with _algo. A getter function is also defined to
+ * return a pointer to the struct, since in some cases it's easier to work
+ * with text symbols than data symbols (see issue #169). This function has
+ * the same name as the struct, less the _algo suffix. The CODEC_INTERFACE
+ * macro is provided to define this getter function automatically.
+ */
+#define CODEC_INTERFACE(id)\
+vpx_codec_iface_t* id(void) { return &id##_algo; }\
+vpx_codec_iface_t id##_algo
+
+
/* Internal Utility Functions
*
* The following functions are indended to be used inside algorithms as
* This interface provides the capability to encode raw VP8 streams, as would
* be found in AVI files.
*/
-extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
+extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
+extern vpx_codec_iface_t* vpx_codec_vp8_cx(void);
#if CONFIG_EXPERIMENTAL
* This interface provides the capability to decode raw VP8 streams, as would
* be found in AVI files and other non-Flash uses.
*/
-extern vpx_codec_iface_t vpx_codec_vp8_dx_algo;
+extern vpx_codec_iface_t vpx_codec_vp8_dx_algo;
+extern vpx_codec_iface_t* vpx_codec_vp8_dx(void);
/* Include controls common to both the encoder and decoder */
#include "vp8.h"