Various fixups to resolve issues when building vp9-preview under the more stringent
checks placed on the experimental branch.
Change-Id: I21749de83552e1e75c799003f849e6a0f1a35b07
--- /dev/null
+@TEMPLATE decoder_tmpl.c
+Decode With Partial Drops Example
+=========================
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
+This is an example utility which drops a series of frames (or parts of frames),
+as specified on the command line. This is useful for observing the error
+recovery features of the codec.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_INCLUDES
+#include <time.h>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_INCLUDES
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELPERS
+struct parsed_header
+{
+ char key_frame;
+ int version;
+ char show_frame;
+ int first_part_size;
+};
+
+int next_packet(struct parsed_header* hdr, int pos, int length, int mtu)
+{
+ int size = 0;
+ int remaining = length - pos;
+ /* Uncompressed part is 3 bytes for P frames and 10 bytes for I frames */
+ int uncomp_part_size = (hdr->key_frame ? 10 : 3);
+ /* number of bytes yet to send from header and the first partition */
+ int remainFirst = uncomp_part_size + hdr->first_part_size - pos;
+ if (remainFirst > 0)
+ {
+ if (remainFirst <= mtu)
+ {
+ size = remainFirst;
+ }
+ else
+ {
+ size = mtu;
+ }
+
+ return size;
+ }
+
+ /* second partition; just slot it up according to MTU */
+ if (remaining <= mtu)
+ {
+ size = remaining;
+ return size;
+ }
+ return mtu;
+}
+
+void throw_packets(unsigned char* frame, int* size, int loss_rate,
+ int* thrown, int* kept)
+{
+ unsigned char loss_frame[256*1024];
+ int pkg_size = 1;
+ int pos = 0;
+ int loss_pos = 0;
+ struct parsed_header hdr;
+ unsigned int tmp;
+ int mtu = 1500;
+
+ if (*size < 3)
+ {
+ return;
+ }
+ putc('|', stdout);
+ /* parse uncompressed 3 bytes */
+ tmp = (frame[2] << 16) | (frame[1] << 8) | frame[0];
+ hdr.key_frame = !(tmp & 0x1); /* inverse logic */
+ hdr.version = (tmp >> 1) & 0x7;
+ hdr.show_frame = (tmp >> 4) & 0x1;
+ hdr.first_part_size = (tmp >> 5) & 0x7FFFF;
+
+ /* don't drop key frames */
+ if (hdr.key_frame)
+ {
+ int i;
+ *kept = *size/mtu + ((*size % mtu > 0) ? 1 : 0); /* approximate */
+ for (i=0; i < *kept; i++)
+ putc('.', stdout);
+ return;
+ }
+
+ while ((pkg_size = next_packet(&hdr, pos, *size, mtu)) > 0)
+ {
+ int loss_event = ((rand() + 1.0)/(RAND_MAX + 1.0) < loss_rate/100.0);
+ if (*thrown == 0 && !loss_event)
+ {
+ memcpy(loss_frame + loss_pos, frame + pos, pkg_size);
+ loss_pos += pkg_size;
+ (*kept)++;
+ putc('.', stdout);
+ }
+ else
+ {
+ (*thrown)++;
+ putc('X', stdout);
+ }
+ pos += pkg_size;
+ }
+ memcpy(frame, loss_frame, loss_pos);
+ memset(frame + loss_pos, 0, *size - loss_pos);
+ *size = loss_pos;
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELPERS
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
+/* Initialize codec */
+flags = VPX_CODEC_USE_ERROR_CONCEALMENT;
+res = vpx_codec_dec_init(&codec, interface, &dec_cfg, flags);
+if(res)
+ die_codec(&codec, "Failed to initialize decoder");
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
+
+Usage
+-----
+This example adds a single argument to the `simple_decoder` example,
+which specifies the range or pattern of frames to drop. The parameter is
+parsed as follows:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
+if(argc < 4 || argc > 6)
+ die("Usage: %s <infile> <outfile> [-t <num threads>] <N-M|N/M|L,S>\n",
+ argv[0]);
+{
+ char *nptr;
+ int arg_num = 3;
+ if (argc == 6 && strncmp(argv[arg_num++], "-t", 2) == 0)
+ dec_cfg.threads = strtol(argv[arg_num++], NULL, 0);
+ n = strtol(argv[arg_num], &nptr, 0);
+ mode = (*nptr == '\0' || *nptr == ',') ? 2 : (*nptr == '-') ? 1 : 0;
+
+ m = strtol(nptr+1, NULL, 0);
+ if((!n && !m) || (*nptr != '-' && *nptr != '/' &&
+ *nptr != '\0' && *nptr != ','))
+ die("Couldn't parse pattern %s\n", argv[3]);
+}
+seed = (m > 0) ? m : (unsigned int)time(NULL);
+srand(seed);thrown_frame = 0;
+printf("Seed: %u\n", seed);
+printf("Threads: %d\n", dec_cfg.threads);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
+
+
+Dropping A Range Of Frames
+--------------------------
+To drop a range of frames, specify the starting frame and the ending
+frame to drop, separated by a dash. The following command will drop
+frames 5 through 10 (base 1).
+
+ $ ./decode_with_partial_drops in.ivf out.i420 5-10
+
+
+Dropping A Pattern Of Frames
+----------------------------
+To drop a pattern of frames, specify the number of frames to drop and
+the number of frames after which to repeat the pattern, separated by
+a forward-slash. The following command will drop 3 of 7 frames.
+Specifically, it will decode 4 frames, then drop 3 frames, and then
+repeat.
+
+ $ ./decode_with_partial_drops in.ivf out.i420 3/7
+
+Dropping Random Parts Of Frames
+-------------------------------
+A third argument tuple is available to split the frame into 1500 bytes pieces
+and randomly drop pieces rather than frames. The frame will be split at
+partition boundaries where possible. The following example will seed the RNG
+with the seed 123 and drop approximately 5% of the pieces. Pieces which
+are depending on an already dropped piece will also be dropped.
+
+ $ ./decode_with_partial_drops in.ivf out.i420 5,123
+
+
+Extra Variables
+---------------
+This example maintains the pattern passed on the command line in the
+`n`, `m`, and `is_range` variables:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_VARS
+int n, m, mode;
+unsigned int seed;
+int thrown=0, kept=0;
+int thrown_frame=0, kept_frame=0;
+vpx_codec_dec_cfg_t dec_cfg = {0};
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_VARS
+
+
+Making The Drop Decision
+------------------------
+The example decides whether to drop the frame based on the current
+frame number, immediately before decoding the frame.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
+/* Decide whether to throw parts of the frame or the whole frame
+ depending on the drop mode */
+thrown_frame = 0;
+kept_frame = 0;
+switch (mode)
+{
+case 0:
+ if (m - (frame_cnt-1)%m <= n)
+ {
+ frame_sz = 0;
+ }
+ break;
+case 1:
+ if (frame_cnt >= n && frame_cnt <= m)
+ {
+ frame_sz = 0;
+ }
+ break;
+case 2:
+ throw_packets(frame, &frame_sz, n, &thrown_frame, &kept_frame);
+ break;
+default: break;
+}
+if (mode < 2)
+{
+ if (frame_sz == 0)
+ {
+ putc('X', stdout);
+ thrown_frame++;
+ }
+ else
+ {
+ putc('.', stdout);
+ kept_frame++;
+ }
+}
+thrown += thrown_frame;
+kept += kept_frame;
+fflush(stdout);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
CODEC_SRCS-$(BUILD_LIBVPX) += vpx/vpx_integer.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/asm_offsets.h
+CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
+CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_timer.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem.h
CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
endif
-CODEC_SRCS=$(filter-out %_offsets.c,\
- $(filter-out %_test.cc,$(call enabled,CODEC_SRCS)))
+CODEC_SRCS=$(call enabled,CODEC_SRCS)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS)
define libvpx_symlink_template
$(1): $(2)
@echo " [LN] $(2) $$@"
+ $(qexec)mkdir -p $$(dir $$@)
$(qexec)ln -sf $(2) $$@
endef
$(BUILD_PFX)$(LIBVPX_SO)))
$(eval $(call libvpx_symlink_template,\
$(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
- $(DIST_DIR)/$(LIBSUBDIR)/$(LIBVPX_SO)))
+ $(LIBVPX_SO)))
INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBVPX_SO_SYMLINKS)
# These tests require both the encoder and decoder to be built.
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),yesyes)
LIBVPX_TEST_SRCS-yes += vp9_boolcoder_test.cc
+
+# IDCT test currently depends on FDCT function
+LIBVPX_TEST_SRCS-yes += idct8x8_test.cc
endif
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct4x4_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc
#LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct16x16_test.cc
-LIBVPX_TEST_SRCS-yes += idct8x8_test.cc
-LIBVPX_TEST_SRCS-yes += variance_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_test.cc
endif # VP9
*/
#include <string>
#include "vpx_config.h"
-#if ARCH_X86 || ARCH_X86_64
extern "C" {
+#if ARCH_X86 || ARCH_X86_64
#include "vpx_ports/x86.h"
+#endif
#if CONFIG_VP8
extern void vp8_rtcd();
#endif
extern void vp9_rtcd();
#endif
}
-#endif
#include "third_party/googletest/src/include/gtest/gtest.h"
static void append_gtest_filter(const char *str) {
append_gtest_filter(":-SSE4_1/*");
#endif
+#if !CONFIG_SHARED
+ /* Shared library builds don't support whitebox tests that exercise internal symbols. */
#if CONFIG_VP8
vp8_rtcd();
#endif
#if CONFIG_VP9
vp9_rtcd();
+#endif
#endif
return RUN_ALL_TESTS();
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9_rtcd.h"
#include "vp9/common/vp9_subpixel.h"
#include "vp9/common/vp9_loopfilter.h"
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_blockd.h"
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_onyxc_int.h"
void vpx_log(const char *format, ...);
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_scale/yv12config.h"
#include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_treecoder.h"
**************************************************************************/
#include <assert.h>
#include <math.h>
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/common/vp9_blockd.h"
#ifndef VP9_COMMON_VP9_INVTRANS_H_
#define VP9_COMMON_VP9_INVTRANS_H_
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_blockd.h"
extern void vp9_inverse_transform_b_4x4(MACROBLOCKD *xd, int block, int pitch);
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_scale/yv12config.h"
#include "vp9/common/vp9_postproc.h"
#include "vp9/common/vp9_textblit.h"
(0.071*(float)(t & 0xff)) + 128)
/* global constants */
-#if CONFIG_POSTPROC_VISUALIZER
+#if 0 && CONFIG_POSTPROC_VISUALIZER
static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = {
{ RGB_TO_YUV(0x98FB98) }, /* PaleGreen */
{ RGB_TO_YUV(0x00FF00) }, /* Green */
oci->post_proc_buffer.y_stride);
}
-#if CONFIG_POSTPROC_VISUALIZER
+#if 0 && CONFIG_POSTPROC_VISUALIZER
if (flags & VP9D_DEBUG_TXT_FRAME_INFO) {
char message[512];
sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d",
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9_rtcd.h"
#include "vp9/common/vp9_blockd.h"
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_reconinter.h"
*/
#include <stdio.h>
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9_rtcd.h"
#include "vp9/common/vp9_reconintra.h"
#include "vpx_mem/vpx_mem.h"
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_reconintra.h"
#include "vp9_rtcd.h"
#
# post proc
#
+if [ "$CONFIG_POSTPROC" = "yes" ]; then
prototype void vp9_mbpost_proc_down "unsigned char *dst, int pitch, int rows, int cols, int flimit"
specialize vp9_mbpost_proc_down mmx sse2
vp9_mbpost_proc_down_sse2=vp9_mbpost_proc_down_xmm
prototype void vp9_plane_add_noise "unsigned char *Start, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int Width, unsigned int Height, int Pitch"
specialize vp9_plane_add_noise mmx sse2
vp9_plane_add_noise_sse2=vp9_plane_add_noise_wmt
+fi
prototype void vp9_blend_mb_inner "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride"
specialize vp9_blend_mb_inner
#ifndef VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
#define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#if ARCH_X86 || ARCH_X86_64
void vpx_reset_mmx_state(void);
#define vp9_clear_system_state() vpx_reset_mmx_state()
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_ports/mem.h"
#include "vp9/common/vp9_subpixel.h"
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_blockd.h"
#define VP9_DECODER_VP9_DBOOLHUFF_H_
#include <stddef.h>
#include <limits.h>
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_ports/mem.h"
#include "vpx/vpx_integer.h"
mb_col = 0;
for (sb_col = 0; sb_col < sb_cols; sb_col++) {
+#if CONFIG_SUPERBLOCKS
MODE_INFO *mi = xd->mode_info_context;
-#if CONFIG_SUPERBLOCKS
mi->mbmi.encoded_as_sb = vp9_read(bc, pc->sb_coded);
#endif
xd->mb_index = i;
+#if CONFIG_SUPERBLOCKS
mi = xd->mode_info_context;
+#endif
if ((mb_row >= pc->mb_rows) || (mb_col >= pc->mb_cols)) {
// MB lies outside frame, skip on to next
mb_row += dy;
#ifndef VP9_DECODER_VP9_ONYXD_INT_H_
#define VP9_DECODER_VP9_ONYXD_INT_H_
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_onyxd.h"
#include "vp9/decoder/vp9_treereader.h"
#include "vp9/common/vp9_onyxc_int.h"
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/decoder/vp9_dequantize.h"
#include "vp9/decoder/x86/vp9_idct_mmx.h"
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/decoder/vp9_dequantize.h"
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_ports/x86.h"
#include "vp9/decoder/vp9_onyxd_int.h"
for (i = 0; i < 4; i++) {
MB_MODE_INFO *mi;
MV_REFERENCE_FRAME rf;
- MV_REFERENCE_FRAME sec_ref_frame;
MB_PREDICTION_MODE mode;
int segment_id, skip_coeff;
mi = &m->mbmi;
rf = mi->ref_frame;
- sec_ref_frame = mi->second_ref_frame;
mode = mi->mode;
segment_id = mi->segment_id;
if (mi->second_ref_frame > 0) {
#if CONFIG_NEW_MVREF
unsigned int best_index;
- sec_ref_frame = mi->second_ref_frame;
+ MV_REFERENCE_FRAME sec_ref_frame = mi->second_ref_frame;
/*
best_index =
#include <assert.h>
#include <math.h>
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/common/vp9_blockd.h"
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/encoder/vp9_encodeframe.h"
#include "vp9/encoder/vp9_encodemb.h"
#include "vp9/encoder/vp9_encodemv.h"
VP9_COMMON *cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO * mbmi = &xd->mode_info_context->mbmi;
- unsigned char *segment_id = &mbmi->segment_id;
- int seg_ref_active;
unsigned char ref_pred_flag;
x->skip = 0;
vp9_update_zbin_extra(cpi, x);
- seg_ref_active = vp9_segfeature_active(xd, *segment_id, SEG_LVL_REF_FRAME);
-
// SET VARIOUS PREDICTION FLAGS
// Did the chosen reference frame match its predicted value.
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9_rtcd.h"
#include "vp9/encoder/vp9_quantize.h"
#include "vp9/common/vp9_reconintra.h"
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/encoder/vp9_encodemb.h"
#include "vp9/common/vp9_reconinter.h"
#include "vp9/encoder/vp9_quantize.h"
#ifndef VP9_ENCODER_VP9_ENCODEMB_H_
#define VP9_ENCODER_VP9_ENCODEMB_H_
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/encoder/vp9_block.h"
typedef struct {
static long long estimate_modemvcost(VP9_COMP *cpi,
FIRSTPASS_STATS *fpstats) {
+#if 0
int mv_cost;
int mode_cost;
// return mv_cost + mode_cost;
// TODO PGW Fix overhead costs for extended Q range
+#endif
return 0;
}
FIRSTPASS_STATS this_frame;
FIRSTPASS_STATS this_frame_copy;
- double this_frame_error;
double this_frame_intra_error;
double this_frame_coded_error;
- FIRSTPASS_STATS *start_pos;
-
int overhead_bits;
if (!cpi->twopass.stats_in) {
if (EOF == input_stats(cpi, &this_frame))
return;
- this_frame_error = this_frame.ssim_weighted_pred_err;
this_frame_intra_error = this_frame.intra_error;
this_frame_coded_error = this_frame.coded_error;
- start_pos = cpi->twopass.stats_in;
-
// keyframe and section processing !
if (cpi->twopass.frames_to_key == 0) {
// Define next KF group and assign bits to it
BLOCKD *d = &xd->block[0];
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16];
unsigned int best_err;
- int step_param, further_steps;
+ int step_param;
int tmp_col_min = x->mv_col_min;
int tmp_col_max = x->mv_col_max;
// Further step/diamond searches as necessary
if (cpi->Speed < 8) {
step_param = cpi->sf.first_step + ((cpi->Speed > 5) ? 1 : 0);
- further_steps = (cpi->sf.max_step_search_steps - 1) - step_param;
} else {
step_param = cpi->sf.first_step + 2;
- further_steps = 0;
}
vp9_clamp_mv_min_max(x, ref_mv);
#include "vp9/encoder/vp9_onyx_int.h"
#include "vp9/encoder/vp9_mcomp.h"
#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include <stdio.h>
#include <limits.h>
#include <math.h>
double x3, double x2, double x, double c) {
int i;
double minqtarget;
- double thisq;
minqtarget = ((x3 * maxq * maxq * maxq) +
(x2 * maxq * maxq) +
minqtarget = maxq;
for (i = 0; i < QINDEX_RANGE; i++) {
- thisq = vp9_convert_qindex_to_q(i);
if (minqtarget <= vp9_convert_qindex_to_q(i))
return i;
}
int Loop = FALSE;
int loop_count;
- int this_q;
- int last_zbin_oq;
int q_low;
int q_high;
int overshoot_seen = FALSE;
int undershoot_seen = FALSE;
- int loop_size_estimate = 0;
-
SPEED_FEATURES *sf = &cpi->sf;
#if RESET_FOREACH_FILTER
int q_low0;
int zbin_oq_high0;
int zbin_oq_low0 = 0;
int Q0;
+ int last_zbin_oq;
int last_zbin_oq0;
int active_best_quality0;
int active_worst_quality0;
// Determine initial Q to try
Q = vp9_regulate_q(cpi, cpi->this_frame_target);
}
+#if RESET_FOREACH_FILTER
last_zbin_oq = cpi->zbin_over_quant;
+#endif
// Set highest allowed value for Zbin over quant
if (cm->frame_type == KEY_FRAME)
vp9_clear_system_state(); // __asm emms;
vp9_set_quantizer(cpi, Q);
- this_q = Q;
if (loop_count == 0) {
// Loop = ((Q != last_q) || (last_zbin_oq != cpi->zbin_over_quant)) ? TRUE : FALSE;
Loop = ((Q != last_q)) ? TRUE : FALSE;
+#if RESET_FOREACH_FILTER
last_zbin_oq = cpi->zbin_over_quant;
+#endif
} else
Loop = FALSE;
* needed in motion search besides loopfilter */
cm->last_frame_type = cm->frame_type;
- // Keep a copy of the size estimate used in the loop
- loop_size_estimate = cpi->projected_frame_size;
-
// Update rate control heuristics
cpi->total_byte_count += (*size);
cpi->projected_frame_size = (*size) << 3;
"%6d %5d %5d %5d %8d %8.2f %10d %10.3f"
"%10.3f %8d %10d %10d %10d\n",
cpi->common.current_video_frame, cpi->this_frame_target,
- cpi->projected_frame_size, loop_size_estimate,
+ cpi->projected_frame_size, 0, //loop_size_estimate,
(cpi->projected_frame_size - cpi->this_frame_target),
(int)cpi->total_target_vs_actual,
(cpi->oxcf.starting_buffer_level - cpi->bits_off_target),
"%8d %10d %10d %10d\n",
cpi->common.current_video_frame,
cpi->this_frame_target, cpi->projected_frame_size,
- loop_size_estimate,
+ 0, //loop_size_estimate,
(cpi->projected_frame_size - cpi->this_frame_target),
(int)cpi->total_target_vs_actual,
(cpi->oxcf.starting_buffer_level - cpi->bits_off_target),
#define VP9_ENCODER_VP9_ONYX_INT_H_
#include <stdio.h>
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9/common/vp9_onyx.h"
#include "vp9/encoder/vp9_treewriter.h"
#include "vp9/encoder/vp9_tokenize.h"
unsigned char *src_y, *dst_y;
int yheight;
int ystride;
- int border;
int yoffset;
int linestocopy;
- border = src_ybc->border;
yheight = src_ybc->y_height;
ystride = src_ybc->y_stride;
int *skippable,
int64_t txfm_cache[NB_TXFM_MODES]) {
MB_PREDICTION_MODE mode;
- TX_SIZE txfm_size;
+ TX_SIZE txfm_size = 0;
MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected);
#if CONFIG_COMP_INTRA_PRED
MB_PREDICTION_MODE mode2;
int mode16x16;
int mode8x8[2][4];
int dist;
- int modeuv, modeuv8x8, uv_intra_skippable, uv_intra_skippable_8x8;
+ int modeuv, uv_intra_skippable, uv_intra_skippable_8x8;
int y_intra16x16_skippable = 0;
int64_t txfm_cache[NB_TXFM_MODES];
TX_SIZE txfm_size_16x16;
if (cpi->common.txfm_mode != ONLY_4X4) {
rd_pick_intra_mbuv_mode_8x8(cpi, x, &rateuv8x8, &rateuv8x8_tokenonly,
&distuv8x8, &uv_intra_skippable_8x8);
- modeuv8x8 = mbmi->uv_mode;
} else {
uv_intra_skippable_8x8 = uv_intra_skippable;
rateuv8x8 = rateuv;
distuv8x8 = distuv;
rateuv8x8_tokenonly = rateuv_tokenonly;
- modeuv8x8 = modeuv;
}
// current macroblock under rate-distortion optimization test loop
#include <stdlib.h>
#include "vp9/common/vp9_sadmxn.h"
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx/vpx_integer.h"
unsigned int vp9_sad32x32_c(const unsigned char *src_ptr,
) {
MACROBLOCK *x = &cpi->mb;
int step_param;
- int further_steps;
int sadpb = x->sadperbit16;
int bestsme = INT_MAX;
if (cpi->Speed < 8) {
step_param = cpi->sf.first_step +
((cpi->Speed > 5) ? 1 : 0);
- further_steps =
- (cpi->sf.max_step_search_steps - 1) - step_param;
} else {
step_param = cpi->sf.first_step + 2;
- further_steps = 0;
}
/*cpi->sf.search_method == HEX*/
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vpx_ports/x86.h"
#include "vp9/encoder/vp9_variance.h"
#include "vp9/encoder/vp9_onyx_int.h"
VP9_COMMON_SRCS-yes += common/vp9_blockd.c
VP9_COMMON_SRCS-yes += common/vp9_coefupdateprobs.h
VP9_COMMON_SRCS-yes += common/vp9_debugmodes.c
+VP9_COMMON_SRCS-yes += common/vp9_default_coef_probs.h
VP9_COMMON_SRCS-yes += common/vp9_entropy.c
VP9_COMMON_SRCS-yes += common/vp9_entropymode.c
VP9_COMMON_SRCS-yes += common/vp9_entropymv.c
VP9_COMMON_SRCS-yes += common/vp9_subpixel.h
VP9_COMMON_SRCS-yes += common/vp9_swapyv12buffer.h
VP9_COMMON_SRCS-yes += common/vp9_systemdependent.h
+VP9_COMMON_SRCS-yes += common/vp9_textblit.h
VP9_COMMON_SRCS-yes += common/vp9_treecoder.h
VP9_COMMON_SRCS-yes += common/vp9_invtrans.c
VP9_COMMON_SRCS-yes += common/vp9_loopfilter.c
VP9_CX_SRCS-yes += encoder/vp9_boolhuff.c
VP9_CX_SRCS-yes += encoder/vp9_dct.c
VP9_CX_SRCS-yes += encoder/vp9_encodeframe.c
+VP9_CX_SRCS-yes += encoder/vp9_encodeframe.h
VP9_CX_SRCS-yes += encoder/vp9_encodeintra.c
VP9_CX_SRCS-yes += encoder/vp9_encodemb.c
VP9_CX_SRCS-yes += encoder/vp9_encodemv.c
VP9_CX_SRCS-yes += encoder/vp9_modecosts.c
VP9_CX_SRCS-yes += encoder/vp9_onyx_if.c
VP9_CX_SRCS-yes += encoder/vp9_picklpf.c
+VP9_CX_SRCS-yes += encoder/vp9_picklpf.h
VP9_CX_SRCS-yes += encoder/vp9_psnr.c
VP9_CX_SRCS-yes += encoder/vp9_quantize.c
VP9_CX_SRCS-yes += encoder/vp9_ratectrl.c
VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_variance_impl_mmx.asm
VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_sad_mmx.asm
VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_dct_mmx.asm
+VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_dct_mmx.h
VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_subtract_mmx.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct_sse2.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_variance_sse2.c
VP9_DX_SRCS-yes += decoder/vp9_dboolhuff.c
VP9_DX_SRCS-yes += decoder/vp9_decodemv.c
VP9_DX_SRCS-yes += decoder/vp9_decodframe.c
+VP9_DX_SRCS-yes += decoder/vp9_decodframe.h
VP9_DX_SRCS-yes += decoder/vp9_dequantize.c
VP9_DX_SRCS-yes += decoder/vp9_detokenize.c
VP9_DX_SRCS-yes += decoder/vp9_dboolhuff.h
#ifndef __VPX_MEM_INTRNL_H__
#define __VPX_MEM_INTRNL_H__
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#ifndef CONFIG_MEM_MANAGER
# if defined(VXWORKS)
in the memory_tracker struct as well as calls to create/destroy/lock/unlock
the mutex in vpx_memory_tracker_init/Destroy and memory_tracker_lock_mutex/unlock_mutex
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#if defined(__uClinux__)
# include <lddk.h>
#elif defined(__linux__) /* end __ANDROID__ */
-#elif defined(__linux__) /* end __ANDROID__ */
#include <stdio.h>
int arm_cpu_caps(void) {
SCALE_SRCS-yes += generic/yv12config.c
SCALE_SRCS-yes += generic/yv12extend.c
SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += generic/gen_scalers.c
+SCALE_SRCS-yes += vpx_scale_asm_offsets.c
SCALE_SRCS-yes += vpx_scale_rtcd.c
+SCALE_SRCS-yes += vpx_scale_rtcd.sh
#neon
SCALE_SRCS-$(HAVE_NEON) += arm/neon/vp8_vpxyv12_copyframe_func_neon$(ASM)
#include <limits.h>
#include <assert.h>
#include "vpx/vpx_encoder.h"
+#if CONFIG_DECODERS
#include "vpx/vpx_decoder.h"
+#endif
#if USE_POSIX_MMAP
#include <sys/types.h>
#include <sys/stat.h>
ctx_exit_on_error(&stream->encoder, "Failed to control codec");
}
+#if CONFIG_DECODERS
if (global->test_decode) {
int width, height;
stream->ref_enc.frame_type = VP8_LAST_FRAME;
stream->ref_dec.frame_type = VP8_LAST_FRAME;
}
+#endif
}
stream->nbytes += pkt->data.raw.sz;
*got_data = 1;
+#if CONFIG_DECODERS
if (global->test_decode) {
vpx_codec_decode(&stream->decoder, pkt->data.frame.buf,
pkt->data.frame.sz, NULL, 0);
ctx_exit_on_error(&stream->decoder, "Failed to decode frame");
}
+#endif
break;
case VPX_CODEC_STATS_PKT:
stream->frames_out++;