summaryrefslogtreecommitdiff
path: root/vp10/encoder
diff options
context:
space:
mode:
Diffstat (limited to 'vp10/encoder')
-rw-r--r--vp10/encoder/aq_complexity.c1
-rw-r--r--vp10/encoder/aq_cyclicrefresh.c1
-rw-r--r--vp10/encoder/bitstream.c3
-rw-r--r--vp10/encoder/denoiser.c1
-rw-r--r--vp10/encoder/encodeframe.c121
-rw-r--r--vp10/encoder/encodemv.c2
-rw-r--r--vp10/encoder/encoder.c75
-rw-r--r--vp10/encoder/ethread.c13
-rw-r--r--vp10/encoder/extend.c1
-rw-r--r--vp10/encoder/firstpass.c1
-rw-r--r--vp10/encoder/mbgraph.c1
-rw-r--r--vp10/encoder/mcomp.c1
-rw-r--r--vp10/encoder/picklpf.c1
-rw-r--r--vp10/encoder/ratectrl.c1
-rw-r--r--vp10/encoder/rd.c1
-rw-r--r--vp10/encoder/rdopt.c1
-rw-r--r--vp10/encoder/speed_features.c1
-rw-r--r--vp10/encoder/temporal_filter.c1
18 files changed, 58 insertions, 169 deletions
diff --git a/vp10/encoder/aq_complexity.c b/vp10/encoder/aq_complexity.c
index 7ba879df5..0de044cf9 100644
--- a/vp10/encoder/aq_complexity.c
+++ b/vp10/encoder/aq_complexity.c
@@ -16,6 +16,7 @@
#include "vp10/encoder/encodeframe.h"
#include "vp10/common/seg_common.h"
#include "vp10/encoder/segmentation.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_ports/system_state.h"
#define AQ_C_SEGMENTS 5
diff --git a/vp10/encoder/aq_cyclicrefresh.c b/vp10/encoder/aq_cyclicrefresh.c
index a45b230d8..660670cce 100644
--- a/vp10/encoder/aq_cyclicrefresh.c
+++ b/vp10/encoder/aq_cyclicrefresh.c
@@ -15,6 +15,7 @@
#include "vp10/encoder/aq_cyclicrefresh.h"
#include "vp10/encoder/ratectrl.h"
#include "vp10/encoder/segmentation.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_ports/system_state.h"
struct CYCLIC_REFRESH {
diff --git a/vp10/encoder/bitstream.c b/vp10/encoder/bitstream.c
index ef1cf5d25..4ce353159 100644
--- a/vp10/encoder/bitstream.c
+++ b/vp10/encoder/bitstream.c
@@ -14,6 +14,7 @@
#include "vpx/vpx_encoder.h"
#include "vpx_dsp/bitwriter_buffer.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem_ops.h"
#include "vpx_ports/system_state.h"
@@ -996,7 +997,7 @@ static void write_frame_size_with_refs(VP10_COMP *cpi,
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi, ref_frame);
- if (cfg != NULL) {
+ if (cfg != NULL) {
found = cm->width == cfg->y_crop_width &&
cm->height == cfg->y_crop_height;
}
diff --git a/vp10/encoder/denoiser.c b/vp10/encoder/denoiser.c
index 271113a51..e5d8157a4 100644
--- a/vp10/encoder/denoiser.c
+++ b/vp10/encoder/denoiser.c
@@ -11,6 +11,7 @@
#include <assert.h>
#include <limits.h>
#include "./vpx_dsp_rtcd.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_scale/yv12config.h"
#include "vpx/vpx_integer.h"
#include "vp10/common/reconinter.h"
diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c
index 3423c3a18..65e904506 100644
--- a/vp10/encoder/encodeframe.c
+++ b/vp10/encoder/encodeframe.c
@@ -16,6 +16,7 @@
#include "./vpx_dsp_rtcd.h"
#include "./vpx_config.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/vpx_timer.h"
#include "vpx_ports/system_state.h"
@@ -237,19 +238,6 @@ static void set_offsets(VP10_COMP *cpi, const TileInfo *const tile,
xd->tile = *tile;
}
-static void duplicate_mode_info_in_sb(VP10_COMMON *cm, MACROBLOCKD *xd,
- int mi_row, int mi_col,
- BLOCK_SIZE bsize) {
- const int block_width = num_8x8_blocks_wide_lookup[bsize];
- const int block_height = num_8x8_blocks_high_lookup[bsize];
- int i, j;
- for (j = 0; j < block_height; ++j)
- for (i = 0; i < block_width; ++i) {
- if (mi_row + j < cm->mi_rows && mi_col + i < cm->mi_cols)
- xd->mi[j * xd->mi_stride + i] = xd->mi[0];
- }
-}
-
static void set_block_size(VP10_COMP * const cpi,
MACROBLOCK *const x,
MACROBLOCKD *const xd,
@@ -1105,36 +1093,6 @@ void vp10_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
x->e_mbd.plane[i].subsampling_y);
}
-static void set_mode_info_seg_skip(MACROBLOCK *x, TX_MODE tx_mode,
- RD_COST *rd_cost, BLOCK_SIZE bsize) {
- MACROBLOCKD *const xd = &x->e_mbd;
- MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
- INTERP_FILTER filter_ref;
-
- if (xd->up_available)
- filter_ref = xd->mi[-xd->mi_stride]->mbmi.interp_filter;
- else if (xd->left_available)
- filter_ref = xd->mi[-1]->mbmi.interp_filter;
- else
- filter_ref = EIGHTTAP;
-
- mbmi->sb_type = bsize;
- mbmi->mode = ZEROMV;
- mbmi->tx_size = VPXMIN(max_txsize_lookup[bsize],
- tx_mode_to_biggest_tx_size[tx_mode]);
- mbmi->skip = 1;
- mbmi->uv_mode = DC_PRED;
- mbmi->ref_frame[0] = LAST_FRAME;
- mbmi->ref_frame[1] = NONE;
- mbmi->mv[0].as_int = 0;
- mbmi->interp_filter = filter_ref;
-
- xd->mi[0]->bmi[0].as_mv[0].as_int = 0;
- x->skip = 1;
-
- vp10_rd_cost_init(rd_cost);
-}
-
static int set_segment_rdmult(VP10_COMP *const cpi,
MACROBLOCK *const x,
int8_t segment_id) {
@@ -2627,83 +2585,6 @@ static TX_MODE select_tx_mode(const VP10_COMP *cpi, MACROBLOCKD *const xd) {
return cpi->common.tx_mode;
}
-static void fill_mode_info_sb(VP10_COMMON *cm, MACROBLOCK *x,
- int mi_row, int mi_col,
- BLOCK_SIZE bsize,
- PC_TREE *pc_tree) {
- MACROBLOCKD *xd = &x->e_mbd;
- int bsl = b_width_log2_lookup[bsize], hbs = (1 << bsl) / 4;
- PARTITION_TYPE partition = pc_tree->partitioning;
- BLOCK_SIZE subsize = get_subsize(bsize, partition);
-
- assert(bsize >= BLOCK_8X8);
-
- if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
- return;
-
- switch (partition) {
- case PARTITION_NONE:
- set_mode_info_offsets(cm, x, xd, mi_row, mi_col);
- *(xd->mi[0]) = pc_tree->none.mic;
- *(x->mbmi_ext) = pc_tree->none.mbmi_ext;
- duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
- break;
- case PARTITION_VERT:
- set_mode_info_offsets(cm, x, xd, mi_row, mi_col);
- *(xd->mi[0]) = pc_tree->vertical[0].mic;
- *(x->mbmi_ext) = pc_tree->vertical[0].mbmi_ext;
- duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, subsize);
-
- if (mi_col + hbs < cm->mi_cols) {
- set_mode_info_offsets(cm, x, xd, mi_row, mi_col + hbs);
- *(xd->mi[0]) = pc_tree->vertical[1].mic;
- *(x->mbmi_ext) = pc_tree->vertical[1].mbmi_ext;
- duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col + hbs, subsize);
- }
- break;
- case PARTITION_HORZ:
- set_mode_info_offsets(cm, x, xd, mi_row, mi_col);
- *(xd->mi[0]) = pc_tree->horizontal[0].mic;
- *(x->mbmi_ext) = pc_tree->horizontal[0].mbmi_ext;
- duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, subsize);
- if (mi_row + hbs < cm->mi_rows) {
- set_mode_info_offsets(cm, x, xd, mi_row + hbs, mi_col);
- *(xd->mi[0]) = pc_tree->horizontal[1].mic;
- *(x->mbmi_ext) = pc_tree->horizontal[1].mbmi_ext;
- duplicate_mode_info_in_sb(cm, xd, mi_row + hbs, mi_col, subsize);
- }
- break;
- case PARTITION_SPLIT: {
- fill_mode_info_sb(cm, x, mi_row, mi_col, subsize, pc_tree->split[0]);
- fill_mode_info_sb(cm, x, mi_row, mi_col + hbs, subsize,
- pc_tree->split[1]);
- fill_mode_info_sb(cm, x, mi_row + hbs, mi_col, subsize,
- pc_tree->split[2]);
- fill_mode_info_sb(cm, x, mi_row + hbs, mi_col + hbs, subsize,
- pc_tree->split[3]);
- break;
- }
- default:
- break;
- }
-}
-
-// Reset the prediction pixel ready flag recursively.
-static void pred_pixel_ready_reset(PC_TREE *pc_tree, BLOCK_SIZE bsize) {
- pc_tree->none.pred_pixel_ready = 0;
- pc_tree->horizontal[0].pred_pixel_ready = 0;
- pc_tree->horizontal[1].pred_pixel_ready = 0;
- pc_tree->vertical[0].pred_pixel_ready = 0;
- pc_tree->vertical[1].pred_pixel_ready = 0;
-
- if (bsize > BLOCK_8X8) {
- BLOCK_SIZE subsize = get_subsize(bsize, PARTITION_SPLIT);
- int i;
- for (i = 0; i < 4; ++i)
- pred_pixel_ready_reset(pc_tree->split[i], subsize);
- }
-}
-
static int get_skip_encode_frame(const VP10_COMMON *cm, ThreadData *const td) {
unsigned int intra_count = 0, inter_count = 0;
int j;
diff --git a/vp10/encoder/encodemv.c b/vp10/encoder/encodemv.c
index ecd5a3835..f1fe5a78f 100644
--- a/vp10/encoder/encodemv.c
+++ b/vp10/encoder/encodemv.c
@@ -16,6 +16,8 @@
#include "vp10/encoder/cost.h"
#include "vp10/encoder/encodemv.h"
+#include "vpx_dsp/vpx_dsp_common.h"
+
static struct vp10_token mv_joint_encodings[MV_JOINTS];
static struct vp10_token mv_class_encodings[MV_CLASSES];
static struct vp10_token mv_fp_encodings[MV_FP_SIZE];
diff --git a/vp10/encoder/encoder.c b/vp10/encoder/encoder.c
index 56ff0acde..4713549ef 100644
--- a/vp10/encoder/encoder.c
+++ b/vp10/encoder/encoder.c
@@ -51,6 +51,7 @@
#if CONFIG_INTERNAL_STATS
#include "vpx_dsp/ssim.h"
#endif
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_dsp/vpx_filter.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/system_state.h"
@@ -2144,42 +2145,6 @@ typedef struct {
uint32_t samples[4]; // total/y/u/v
} PSNR_STATS;
-static void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
- PSNR_STATS *psnr) {
- static const double peak = 255.0;
- const int widths[3] = {
- a->y_crop_width, a->uv_crop_width, a->uv_crop_width};
- const int heights[3] = {
- a->y_crop_height, a->uv_crop_height, a->uv_crop_height};
- const uint8_t *a_planes[3] = {a->y_buffer, a->u_buffer, a->v_buffer};
- const int a_strides[3] = {a->y_stride, a->uv_stride, a->uv_stride};
- const uint8_t *b_planes[3] = {b->y_buffer, b->u_buffer, b->v_buffer};
- const int b_strides[3] = {b->y_stride, b->uv_stride, b->uv_stride};
- int i;
- uint64_t total_sse = 0;
- uint32_t total_samples = 0;
-
- for (i = 0; i < 3; ++i) {
- const int w = widths[i];
- const int h = heights[i];
- const uint32_t samples = w * h;
- const uint64_t sse = get_sse(a_planes[i], a_strides[i],
- b_planes[i], b_strides[i],
- w, h);
- psnr->sse[1 + i] = sse;
- psnr->samples[1 + i] = samples;
- psnr->psnr[1 + i] = vpx_sse_to_psnr(samples, peak, (double)sse);
-
- total_sse += sse;
- total_samples += samples;
- }
-
- psnr->sse[0] = total_sse;
- psnr->samples[0] = total_samples;
- psnr->psnr[0] = vpx_sse_to_psnr((double)total_samples, peak,
- (double)total_sse);
-}
-
#if CONFIG_VP9_HIGHBITDEPTH
static void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
const YV12_BUFFER_CONFIG *b,
@@ -2232,6 +2197,44 @@ static void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
psnr->psnr[0] = vpx_sse_to_psnr((double)total_samples, peak,
(double)total_sse);
}
+
+#else // !CONFIG_VP9_HIGHBITDEPTH
+
+static void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
+ PSNR_STATS *psnr) {
+ static const double peak = 255.0;
+ const int widths[3] = {
+ a->y_crop_width, a->uv_crop_width, a->uv_crop_width};
+ const int heights[3] = {
+ a->y_crop_height, a->uv_crop_height, a->uv_crop_height};
+ const uint8_t *a_planes[3] = {a->y_buffer, a->u_buffer, a->v_buffer};
+ const int a_strides[3] = {a->y_stride, a->uv_stride, a->uv_stride};
+ const uint8_t *b_planes[3] = {b->y_buffer, b->u_buffer, b->v_buffer};
+ const int b_strides[3] = {b->y_stride, b->uv_stride, b->uv_stride};
+ int i;
+ uint64_t total_sse = 0;
+ uint32_t total_samples = 0;
+
+ for (i = 0; i < 3; ++i) {
+ const int w = widths[i];
+ const int h = heights[i];
+ const uint32_t samples = w * h;
+ const uint64_t sse = get_sse(a_planes[i], a_strides[i],
+ b_planes[i], b_strides[i],
+ w, h);
+ psnr->sse[1 + i] = sse;
+ psnr->samples[1 + i] = samples;
+ psnr->psnr[1 + i] = vpx_sse_to_psnr(samples, peak, (double)sse);
+
+ total_sse += sse;
+ total_samples += samples;
+ }
+
+ psnr->sse[0] = total_sse;
+ psnr->samples[0] = total_samples;
+ psnr->psnr[0] = vpx_sse_to_psnr((double)total_samples, peak,
+ (double)total_sse);
+}
#endif // CONFIG_VP9_HIGHBITDEPTH
static void generate_psnr_packet(VP10_COMP *cpi) {
diff --git a/vp10/encoder/ethread.c b/vp10/encoder/ethread.c
index 671020a7f..ea491058a 100644
--- a/vp10/encoder/ethread.c
+++ b/vp10/encoder/ethread.c
@@ -11,6 +11,7 @@
#include "vp10/encoder/encodeframe.h"
#include "vp10/encoder/encoder.h"
#include "vp10/encoder/ethread.h"
+#include "vpx_dsp/vpx_dsp_common.h"
static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) {
int i, j, k, l, m, n;
@@ -51,18 +52,6 @@ static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) {
return 0;
}
-static int get_max_tile_cols(VP10_COMP *cpi) {
- const int aligned_width = ALIGN_POWER_OF_TWO(cpi->oxcf.width, MI_SIZE_LOG2);
- int mi_cols = aligned_width >> MI_SIZE_LOG2;
- int min_log2_tile_cols, max_log2_tile_cols;
- int log2_tile_cols;
-
- vp10_get_tile_n_bits(mi_cols, &min_log2_tile_cols, &max_log2_tile_cols);
- log2_tile_cols = clamp(cpi->oxcf.tile_columns,
- min_log2_tile_cols, max_log2_tile_cols);
- return (1 << log2_tile_cols);
-}
-
void vp10_encode_tiles_mt(VP10_COMP *cpi) {
VP10_COMMON *const cm = &cpi->common;
const int tile_cols = 1 << cm->log2_tile_cols;
diff --git a/vp10/encoder/extend.c b/vp10/encoder/extend.c
index ffd992f25..4c8ce3b57 100644
--- a/vp10/encoder/extend.c
+++ b/vp10/encoder/extend.c
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
diff --git a/vp10/encoder/firstpass.c b/vp10/encoder/firstpass.c
index f61b5d513..63c42cd09 100644
--- a/vp10/encoder/firstpass.c
+++ b/vp10/encoder/firstpass.c
@@ -15,6 +15,7 @@
#include "./vpx_dsp_rtcd.h"
#include "./vpx_scale_rtcd.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/system_state.h"
diff --git a/vp10/encoder/mbgraph.c b/vp10/encoder/mbgraph.c
index 02ba0e57e..1ba6e10fd 100644
--- a/vp10/encoder/mbgraph.c
+++ b/vp10/encoder/mbgraph.c
@@ -13,6 +13,7 @@
#include "./vp10_rtcd.h"
#include "./vpx_dsp_rtcd.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/system_state.h"
#include "vp10/encoder/segmentation.h"
diff --git a/vp10/encoder/mcomp.c b/vp10/encoder/mcomp.c
index 1cfe4712f..d6ab00fdc 100644
--- a/vp10/encoder/mcomp.c
+++ b/vp10/encoder/mcomp.c
@@ -15,6 +15,7 @@
#include "./vpx_config.h"
#include "./vpx_dsp_rtcd.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
diff --git a/vp10/encoder/picklpf.c b/vp10/encoder/picklpf.c
index ff0f3878c..045e03d1d 100644
--- a/vp10/encoder/picklpf.c
+++ b/vp10/encoder/picklpf.c
@@ -13,6 +13,7 @@
#include "./vpx_scale_rtcd.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
diff --git a/vp10/encoder/ratectrl.c b/vp10/encoder/ratectrl.c
index 702e32382..d4c25c048 100644
--- a/vp10/encoder/ratectrl.c
+++ b/vp10/encoder/ratectrl.c
@@ -15,6 +15,7 @@
#include <stdlib.h>
#include <string.h>
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/system_state.h"
diff --git a/vp10/encoder/rd.c b/vp10/encoder/rd.c
index 00e7a9493..bc5e1ae4f 100644
--- a/vp10/encoder/rd.c
+++ b/vp10/encoder/rd.c
@@ -14,6 +14,7 @@
#include "./vp10_rtcd.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/bitops.h"
#include "vpx_ports/mem.h"
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c
index 90a7aa3f5..24d359ec4 100644
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -14,6 +14,7 @@
#include "./vp10_rtcd.h"
#include "./vpx_dsp_rtcd.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/system_state.h"
diff --git a/vp10/encoder/speed_features.c b/vp10/encoder/speed_features.c
index 9d7ad80b2..156c4eac2 100644
--- a/vp10/encoder/speed_features.c
+++ b/vp10/encoder/speed_features.c
@@ -14,6 +14,7 @@
#include "vp10/encoder/speed_features.h"
#include "vp10/encoder/rdopt.h"
+#include "vpx_dsp/vpx_dsp_common.h"
// Intra only frames, golden frames (except alt ref overlays) and
// alt ref frames tend to be coded at a higher than ambient quality
diff --git a/vp10/encoder/temporal_filter.c b/vp10/encoder/temporal_filter.c
index 8e221db65..5278d3b73 100644
--- a/vp10/encoder/temporal_filter.c
+++ b/vp10/encoder/temporal_filter.c
@@ -23,6 +23,7 @@
#include "vp10/encoder/ratectrl.h"
#include "vp10/encoder/segmentation.h"
#include "vp10/encoder/temporal_filter.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/vpx_timer.h"