summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-05-07 17:02:38 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-05-07 17:02:38 -0700
commit9cd5406c3206beab15a01ec198ecb4f51e4a84ad (patch)
treefa4a50865d30bd6f9c4605c869cedc32c7fe536b /vp9
parent1ed57a6a6286d371ab00c22dbb9010a8f87de51e (diff)
parentb05247df95cb46be8b51037d0c4b0aa81c4d9450 (diff)
downloadlibvpx-9cd5406c3206beab15a01ec198ecb4f51e4a84ad.tar
libvpx-9cd5406c3206beab15a01ec198ecb4f51e4a84ad.tar.gz
libvpx-9cd5406c3206beab15a01ec198ecb4f51e4a84ad.tar.bz2
libvpx-9cd5406c3206beab15a01ec198ecb4f51e4a84ad.zip
Merge "Removing vp9_swap_yv12_buffer function and corresponding files." into experimental
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_swapyv12buffer.c32
-rw-r--r--vp9/common/vp9_swapyv12buffer.h19
-rw-r--r--vp9/decoder/vp9_onyxd_if.c2
-rw-r--r--vp9/encoder/vp9_firstpass.c29
-rw-r--r--vp9/encoder/vp9_onyx_if.c1
-rw-r--r--vp9/encoder/vp9_temporal_filter.c1
-rw-r--r--vp9/vp9_common.mk2
7 files changed, 17 insertions, 69 deletions
diff --git a/vp9/common/vp9_swapyv12buffer.c b/vp9/common/vp9_swapyv12buffer.c
deleted file mode 100644
index 10c6b4171..000000000
--- a/vp9/common/vp9_swapyv12buffer.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "vp9/common/vp9_swapyv12buffer.h"
-
-void vp9_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame,
- YV12_BUFFER_CONFIG *last_frame) {
- uint8_t *temp;
-
- temp = last_frame->buffer_alloc;
- last_frame->buffer_alloc = new_frame->buffer_alloc;
- new_frame->buffer_alloc = temp;
-
- temp = last_frame->y_buffer;
- last_frame->y_buffer = new_frame->y_buffer;
- new_frame->y_buffer = temp;
-
- temp = last_frame->u_buffer;
- last_frame->u_buffer = new_frame->u_buffer;
- new_frame->u_buffer = temp;
-
- temp = last_frame->v_buffer;
- last_frame->v_buffer = new_frame->v_buffer;
- new_frame->v_buffer = temp;
-}
diff --git a/vp9/common/vp9_swapyv12buffer.h b/vp9/common/vp9_swapyv12buffer.h
deleted file mode 100644
index 2e112069a..000000000
--- a/vp9/common/vp9_swapyv12buffer.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_COMMON_VP9_SWAPYV12BUFFER_H_
-#define VP9_COMMON_VP9_SWAPYV12BUFFER_H_
-
-#include "vpx_scale/yv12config.h"
-
-void vp9_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame,
- YV12_BUFFER_CONFIG *last_frame);
-
-#endif // VP9_COMMON_VP9_SWAPYV12BUFFER_H_
diff --git a/vp9/decoder/vp9_onyxd_if.c b/vp9/decoder/vp9_onyxd_if.c
index 9582e8f42..c0ce311b1 100644
--- a/vp9/decoder/vp9_onyxd_if.c
+++ b/vp9/decoder/vp9_onyxd_if.c
@@ -21,8 +21,6 @@
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_loopfilter.h"
-#include "vp9/common/vp9_swapyv12buffer.h"
-
#include "vp9/common/vp9_quant_common.h"
#include "vpx_scale/vpx_scale.h"
#include "vp9/common/vp9_systemdependent.h"
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index a1898af48..1e25a00a0 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -22,7 +22,7 @@
#include "vp9/common/vp9_extend.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_swapyv12buffer.h"
+#include "vpx_scale/yv12config.h"
#include <stdio.h>
#include "vp9/encoder/vp9_quantize.h"
#include "vp9/encoder/vp9_rdopt.h"
@@ -52,6 +52,12 @@
#define POW1 (double)cpi->oxcf.two_pass_vbrbias/100.0
#define POW2 (double)cpi->oxcf.two_pass_vbrbias/100.0
+static void swap_yv12(YV12_BUFFER_CONFIG *a, YV12_BUFFER_CONFIG *b) {
+ YV12_BUFFER_CONFIG temp = *a;
+ *a = *b;
+ *b = temp;
+}
+
static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame);
static int select_cq_level(int qindex) {
@@ -444,13 +450,13 @@ void vp9_first_pass(VP9_COMP *cpi) {
MACROBLOCKD *const xd = &x->e_mbd;
int recon_yoffset, recon_uvoffset;
- YV12_BUFFER_CONFIG *lst_yv12 =
- &cm->yv12_fb[cm->ref_frame_map[cpi->lst_fb_idx]];
- YV12_BUFFER_CONFIG *new_yv12 = &cm->yv12_fb[cm->new_fb_idx];
- YV12_BUFFER_CONFIG *gld_yv12 =
- &cm->yv12_fb[cm->ref_frame_map[cpi->gld_fb_idx]];
- int recon_y_stride = lst_yv12->y_stride;
- int recon_uv_stride = lst_yv12->uv_stride;
+ const int lst_yv12_idx = cm->ref_frame_map[cpi->lst_fb_idx];
+ const int gld_yv12_idx = cm->ref_frame_map[cpi->gld_fb_idx];
+ YV12_BUFFER_CONFIG *const lst_yv12 = &cm->yv12_fb[lst_yv12_idx];
+ YV12_BUFFER_CONFIG *const new_yv12 = &cm->yv12_fb[cm->new_fb_idx];
+ YV12_BUFFER_CONFIG *const gld_yv12 = &cm->yv12_fb[gld_yv12_idx];
+ const int recon_y_stride = lst_yv12->y_stride;
+ const int recon_uv_stride = lst_yv12->uv_stride;
int64_t intra_error = 0;
int64_t coded_error = 0;
int64_t sr_coded_error = 0;
@@ -772,14 +778,13 @@ void vp9_first_pass(VP9_COMP *cpi) {
cpi->twopass.sr_update_lag++;
// swap frame pointers so last frame refers to the frame we just compressed
- vp9_swap_yv12_buffer(lst_yv12, new_yv12);
+ swap_yv12(lst_yv12, new_yv12);
+
vp8_yv12_extend_frame_borders(lst_yv12);
// Special case for the first frame. Copy into the GF buffer as a second reference.
- if (cm->current_video_frame == 0) {
+ if (cm->current_video_frame == 0)
vp8_yv12_copy_frame(lst_yv12, gld_yv12);
- }
-
// use this to see what the first pass reconstruction looks like
if (0) {
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index ce407ce8e..ce911b4b8 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -32,7 +32,6 @@
#include "vp9/common/vp9_postproc.h"
#endif
#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_swapyv12buffer.h"
#include "vpx_ports/vpx_timer.h"
#include "vp9/common/vp9_seg_common.h"
diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c
index 6bd8b5036..d272cbb8d 100644
--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -26,7 +26,6 @@
#include "vp9/common/vp9_quant_common.h"
#include "vp9/encoder/vp9_segmentation.h"
#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_swapyv12buffer.h"
#include "vpx_ports/vpx_timer.h"
#define ALT_REF_MC_ENABLED 1 // dis/enable MC in AltRef filtering
diff --git a/vp9/vp9_common.mk b/vp9/vp9_common.mk
index a5b33baf7..ace7e6f86 100644
--- a/vp9/vp9_common.mk
+++ b/vp9/vp9_common.mk
@@ -56,7 +56,6 @@ VP9_COMMON_SRCS-yes += common/vp9_sadmxn.h
VP9_COMMON_SRCS-yes += common/vp9_subpelvar.h
VP9_COMMON_SRCS-yes += common/vp9_seg_common.h
VP9_COMMON_SRCS-yes += common/vp9_seg_common.c
-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_tile_common.h
@@ -74,7 +73,6 @@ VP9_COMMON_SRCS-yes += common/vp9_quant_common.c
VP9_COMMON_SRCS-yes += common/vp9_recon.c
VP9_COMMON_SRCS-yes += common/vp9_reconinter.c
VP9_COMMON_SRCS-yes += common/vp9_reconintra.c
-VP9_COMMON_SRCS-yes += common/vp9_swapyv12buffer.c
VP9_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER) += common/vp9_textblit.c
VP9_COMMON_SRCS-yes += common/vp9_treecoder.c
VP9_COMMON_SRCS-$(CONFIG_IMPLICIT_SEGMENTATION) += common/vp9_implicit_segmentation.c