Commit ce328b85 authored by Scott LaVarnway's avatar Scott LaVarnway Committed by Gerrit Code Review
Browse files

Merge changes Ifb450710,I61c4a132

* changes:
  Eliminated reconintra_mt.c
  Eliminated vp8mt_build_intra_predictors_mbuv_s
parents aab70f4d bcba86e2
......@@ -136,21 +136,21 @@ void vp8_build_intra_predictors_mby_c(MACROBLOCKD *x)
}
}
void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x,
unsigned char * yabove_row,
unsigned char * yleft,
int left_stride,
unsigned char * ypred_ptr)
{
unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride;
unsigned char yleft_col[16];
unsigned char ytop_left = yabove_row[-1];
unsigned char *ypred_ptr = x->predictor;
int r, c, i;
int y_stride = x->dst.y_stride;
ypred_ptr = x->dst.y_buffer; /*x->predictor;*/
for (i = 0; i < 16; i++)
{
yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
yleft_col[i] = yleft[i* left_stride];
}
/* for Y */
......@@ -400,24 +400,27 @@ void vp8_build_intra_predictors_mbuv_c(MACROBLOCKD *x)
}
}
void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x)
void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
unsigned char * uabove_row,
unsigned char * vabove_row,
unsigned char * uleft,
unsigned char * vleft,
int left_stride,
unsigned char * upred_ptr,
unsigned char * vpred_ptr)
{
unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride;
unsigned char uleft_col[16];
unsigned char uleft_col[8];
unsigned char utop_left = uabove_row[-1];
unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride;
unsigned char vleft_col[20];
unsigned char vleft_col[8];
unsigned char vtop_left = vabove_row[-1];
unsigned char *upred_ptr = x->dst.u_buffer; /*&x->predictor[256];*/
unsigned char *vpred_ptr = x->dst.v_buffer; /*&x->predictor[320];*/
int uv_stride = x->dst.uv_stride;
int i, j;
for (i = 0; i < 8; i++)
{
uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
uleft_col[i] = uleft [i* left_stride];
vleft_col[i] = vleft [i* left_stride];
}
switch (x->mode_info_context->mbmi.uv_mode)
......
......@@ -13,20 +13,19 @@
#include "vpx_rtcd.h"
#include "blockd.h"
void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
int b_mode,
unsigned char *dst, int dst_stride)
void vp8_intra4x4_predict_d_c(unsigned char *Above,
unsigned char *yleft, int left_stride,
int b_mode,
unsigned char *dst, int dst_stride,
unsigned char top_left)
{
int i, r, c;
unsigned char *Above = src - src_stride;
unsigned char Left[4];
unsigned char top_left = Above[-1];
Left[0] = src[-1];
Left[1] = src[-1 + src_stride];
Left[2] = src[-1 + 2 * src_stride];
Left[3] = src[-1 + 3 * src_stride];
Left[0] = yleft[0];
Left[1] = yleft[left_stride];
Left[2] = yleft[2 * left_stride];
Left[3] = yleft[3 * left_stride];
switch (b_mode)
{
......@@ -295,24 +294,15 @@ void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
}
}
/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
* to the right prediction have filled in pixels to use.
*/
void vp8_intra_prediction_down_copy(MACROBLOCKD *x)
void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
int b_mode,
unsigned char *dst, int dst_stride)
{
int dst_stride = x->dst.y_stride;
unsigned char *above_right = x->dst.y_buffer - dst_stride + 16;
unsigned int *src_ptr = (unsigned int *)above_right;
unsigned int *dst_ptr0 = (unsigned int *)(above_right + 4 * dst_stride);
unsigned int *dst_ptr1 = (unsigned int *)(above_right + 8 * dst_stride);
unsigned int *dst_ptr2 = (unsigned int *)(above_right + 12 * dst_stride);
unsigned char *Above = src - src_stride;
*dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr;
vp8_intra4x4_predict_d_c(Above,
src - 1, src_stride,
b_mode,
dst, dst_stride,
Above[-1]);
}
......@@ -11,9 +11,22 @@
#ifndef __INC_RECONINTRA4x4_H
#define __INC_RECONINTRA4x4_H
#include "vp8/common/blockd.h"
struct macroblockd;
static void intra_prediction_down_copy(MACROBLOCKD *xd,
unsigned char *above_right_src)
{
int dst_stride = xd->dst.y_stride;
unsigned char *above_right_dst = xd->dst.y_buffer - dst_stride + 16;
extern void vp8_intra_prediction_down_copy(struct macroblockd *x);
unsigned int *src_ptr = (unsigned int *)above_right_src;
unsigned int *dst_ptr0 = (unsigned int *)(above_right_dst + 4 * dst_stride);
unsigned int *dst_ptr1 = (unsigned int *)(above_right_dst + 8 * dst_stride);
unsigned int *dst_ptr2 = (unsigned int *)(above_right_dst + 12 * dst_stride);
*dst_ptr0 = *src_ptr;
*dst_ptr1 = *src_ptr;
*dst_ptr2 = *src_ptr;
}
#endif
......@@ -125,14 +125,14 @@ vp8_copy_mem8x4_media=vp8_copy_mem8x4_v6
prototype void vp8_build_intra_predictors_mby "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby sse2 ssse3 neon
prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby_s sse2 ssse3 neon
prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr"
#TODO: fix assembly --- specialize vp8_build_intra_predictors_mby_s sse2 ssse3 neon
prototype void vp8_build_intra_predictors_mbuv "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv sse2 ssse3
prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv_s sse2 ssse3
prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr"
#TODO: fix assembly --- specialize vp8_build_intra_predictors_mbuv_s sse2 ssse3
prototype void vp8_intra4x4_predict "unsigned char *src, int src_stride, int b_mode, unsigned char *dst, int dst_stride"
specialize vp8_intra4x4_predict media
......
......@@ -156,11 +156,21 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
/* do prediction */
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
vp8_build_intra_predictors_mbuv_s(xd);
vp8_build_intra_predictors_mbuv_s(xd,
xd->dst.u_buffer - xd->dst.uv_stride,
xd->dst.v_buffer - xd->dst.uv_stride,
xd->dst.u_buffer - 1,
xd->dst.v_buffer - 1,
xd->dst.uv_stride,
xd->dst.u_buffer, xd->dst.v_buffer);
if (mode != B_PRED)
{
vp8_build_intra_predictors_mby_s(xd);
vp8_build_intra_predictors_mby_s(xd,
xd->dst.y_buffer - xd->dst.y_stride,
xd->dst.y_buffer - 1,
xd->dst.y_stride,
xd->dst.y_buffer);
}
else
{
......@@ -172,16 +182,28 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
if(xd->mode_info_context->mbmi.mb_skip_coeff)
vpx_memset(xd->eobs, 0, 25);
vp8_intra_prediction_down_copy(xd);
intra_prediction_down_copy(xd, xd->dst.y_buffer - dst_stride + 16);
for (i = 0; i < 16; i++)
{
BLOCKD *b = &xd->block[i];
int b_mode = xd->mode_info_context->bmi[i].as_mode;
vp8_intra4x4_predict (base_dst + b->offset, dst_stride, b_mode,
base_dst + b->offset, dst_stride );
unsigned char *yabove;
unsigned char *yleft;
int left_stride;
unsigned char top_left;
yabove = base_dst + b->offset - dst_stride;
yleft = base_dst + b->offset - 1;
left_stride = dst_stride;
top_left = yabove[-1];
// vp8_intra4x4_predict (base_dst + b->offset, dst_stride, b_mode,
// base_dst + b->offset, dst_stride );
vp8_intra4x4_predict_d_c(yabove, yleft, left_stride,
b_mode,
base_dst + b->offset, dst_stride,
top_left);
if (xd->eobs[i])
{
......
This diff is collapsed.
/*
* 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 __INC_RECONINTRA_MT_H
#define __INC_RECONINTRA_MT_H
/* reconintra functions used in multi-threaded decoder */
#if CONFIG_MULTITHREAD
extern void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col);
extern void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col);
extern void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col);
extern void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col);
extern void vp8mt_predict_intra4x4(VP8D_COMP *pbi, MACROBLOCKD *x, int b_mode, unsigned char *predictor, int stride, int mb_row, int mb_col, int num);
extern void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col);
#endif
#endif
......@@ -22,8 +22,8 @@
#include "vp8/common/extend.h"
#include "vpx_ports/vpx_timer.h"
#include "detokenize.h"
#include "vp8/common/reconintra4x4.h"
#include "vp8/common/reconinter.h"
#include "reconintra_mt.h"
#if CONFIG_ERROR_CONCEALMENT
#include "error_concealment.h"
#endif
......@@ -85,7 +85,6 @@ static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_D
static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col)
{
int eobtotal = 0;
int throw_residual = 0;
int i;
......@@ -95,31 +94,11 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int m
}
else if (!vp8dx_bool_error(xd->current_bc))
{
int eobtotal;
eobtotal = vp8_decode_mb_tokens(pbi, xd);
}
eobtotal |= (xd->mode_info_context->mbmi.mode == B_PRED ||
xd->mode_info_context->mbmi.mode == SPLITMV);
if (!eobtotal && !vp8dx_bool_error(xd->current_bc))
{
/* Special case: Force the loopfilter to skip when eobtotal and
* mb_skip_coeff are zero.
* */
xd->mode_info_context->mbmi.mb_skip_coeff = 1;
/*mt_skip_recon_mb(pbi, xd, mb_row, mb_col);*/
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
vp8mt_build_intra_predictors_mbuv_s(pbi, xd, mb_row, mb_col);
vp8mt_build_intra_predictors_mby_s(pbi, xd, mb_row, mb_col);
}
else
{
vp8_build_inter16x16_predictors_mb(xd, xd->dst.y_buffer,
xd->dst.u_buffer, xd->dst.v_buffer,
xd->dst.y_stride, xd->dst.uv_stride);
}
return;
/* Special case: Force the loopfilter to skip when eobtotal is zero */
xd->mode_info_context->mbmi.mb_skip_coeff = (eobtotal==0);
}
if (xd->segmentation_enabled)
......@@ -128,14 +107,58 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int m
/* do prediction */
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{
vp8mt_build_intra_predictors_mbuv_s(pbi, xd, mb_row, mb_col);
if (pbi->common.filter_level)
{
unsigned char *uabove_row;
unsigned char *vabove_row;
unsigned char * uleft_col;
unsigned char * vleft_col;
uabove_row = pbi->mt_uabove_row[mb_row] + mb_col*8 +16;
vabove_row = pbi->mt_vabove_row[mb_row] + mb_col*8 +16;
uleft_col = pbi->mt_uleft_col[mb_row];
vleft_col = pbi->mt_vleft_col[mb_row];
vp8_build_intra_predictors_mbuv_s(xd, uabove_row,
vabove_row,
uleft_col,
vleft_col,
1,
xd->dst.u_buffer, xd->dst.v_buffer);
if (xd->mode_info_context->mbmi.mode != B_PRED)
{
unsigned char *yabove_row;
unsigned char *yleft_col;
yabove_row = pbi->mt_yabove_row[mb_row] + mb_col*16 +32;
yleft_col = pbi->mt_yleft_col[mb_row];
if (xd->mode_info_context->mbmi.mode != B_PRED)
vp8_build_intra_predictors_mby_s(xd,
yabove_row,
yleft_col,
1,
xd->dst.y_buffer);
}
}
else
{
vp8mt_build_intra_predictors_mby_s(pbi, xd, mb_row, mb_col);
} else {
vp8mt_intra_prediction_down_copy(pbi, xd, mb_row, mb_col);
vp8_build_intra_predictors_mbuv_s(xd,
xd->dst.u_buffer - xd->dst.uv_stride,
xd->dst.v_buffer - xd->dst.uv_stride,
xd->dst.u_buffer - 1,
xd->dst.v_buffer - 1,
xd->dst.uv_stride,
xd->dst.u_buffer, xd->dst.v_buffer);
if (xd->mode_info_context->mbmi.mode != B_PRED)
{
vp8_build_intra_predictors_mby_s(xd,
xd->dst.y_buffer - xd->dst.y_stride,
xd->dst.y_buffer - 1,
xd->dst.y_stride,
xd->dst.y_buffer);
}
}
}
else
{
......@@ -170,14 +193,51 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int m
short *DQC = xd->dequant_y1;
int dst_stride = xd->dst.y_stride;
unsigned char *base_dst = xd->dst.y_buffer;
unsigned char *above_right_src;
if (pbi->common.filter_level)
above_right_src = pbi->mt_yabove_row[mb_row] + mb_col*16 + 32 +16;
else
above_right_src = xd->dst.y_buffer - dst_stride + 16;
intra_prediction_down_copy(xd, above_right_src);
for (i = 0; i < 16; i++)
{
BLOCKD *b = &xd->block[i];
int b_mode = xd->mode_info_context->bmi[i].as_mode;
unsigned char *yabove;
unsigned char *yleft;
int left_stride;
unsigned char top_left;
/*Caution: For some b_mode, it needs 8 pixels (4 above + 4 above-right).*/
if (i < 4 && pbi->common.filter_level)
yabove = pbi->mt_yabove_row[mb_row] + mb_col*16 + i*4 + 32;
else
yabove = base_dst + b->offset - dst_stride;
if (i%4==0 && pbi->common.filter_level)
{
yleft = pbi->mt_yleft_col[mb_row] + i;
left_stride = 1;
}
else
{
yleft = base_dst + b->offset - 1;
left_stride = dst_stride;
}
if ((i==4 || i==8 || i==12) && pbi->common.filter_level)
top_left = pbi->mt_yleft_col[mb_row][i-1];
else
top_left = yabove[-1];
vp8mt_predict_intra4x4(pbi, xd, b_mode, base_dst + b->offset,
dst_stride, mb_row, mb_col, i);
vp8_intra4x4_predict_d_c(yabove, yleft, left_stride,
b_mode,
base_dst + b->offset, dst_stride,
top_left);
if (xd->eobs[i] )
{
......
......@@ -82,8 +82,8 @@ void vp8_encode_intra4x4mby(MACROBLOCK *mb)
{
int i;
MACROBLOCKD *x = &mb->e_mbd;
vp8_intra_prediction_down_copy(x);
MACROBLOCKD *xd = &mb->e_mbd;
intra_prediction_down_copy(xd, xd->dst.y_buffer - xd->dst.y_stride + 16);
for (i = 0; i < 16; i++)
vp8_encode_intra4x4block(mb, i);
......@@ -95,7 +95,11 @@ void vp8_encode_intra16x16mby(MACROBLOCK *x)
BLOCK *b = &x->block[0];
MACROBLOCKD *xd = &x->e_mbd;
vp8_build_intra_predictors_mby_s(&x->e_mbd);
vp8_build_intra_predictors_mby_s(xd,
xd->dst.y_buffer - xd->dst.y_stride,
xd->dst.y_buffer - 1,
xd->dst.y_stride,
xd->dst.y_buffer);
vp8_subtract_mby(x->src_diff, *(b->base_src),
b->src_stride, xd->dst.y_buffer, xd->dst.y_stride);
......@@ -112,7 +116,12 @@ void vp8_encode_intra16x16mbuv(MACROBLOCK *x)
{
MACROBLOCKD *xd = &x->e_mbd;
vp8_build_intra_predictors_mbuv_s(&x->e_mbd);
vp8_build_intra_predictors_mbuv_s(xd, xd->dst.u_buffer - xd->dst.uv_stride,
xd->dst.v_buffer - xd->dst.uv_stride,
xd->dst.u_buffer - 1,
xd->dst.v_buffer - 1,
xd->dst.uv_stride,
xd->dst.u_buffer, xd->dst.v_buffer);
vp8_subtract_mbuv(x->src_diff, x->src.u_buffer,
x->src.v_buffer, x->src.uv_stride, xd->dst.u_buffer,
......
......@@ -184,7 +184,7 @@ static int pick_intra4x4mby_modes
int distortion = 0;
unsigned int *bmode_costs;
vp8_intra_prediction_down_copy(xd);
intra_prediction_down_copy(xd, xd->dst.y_buffer - xd->dst.y_stride + 16);
bmode_costs = mb->inter_bmode_costs;
......
......@@ -701,7 +701,7 @@ static int rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate,
ta = (ENTROPY_CONTEXT *)&t_above;
tl = (ENTROPY_CONTEXT *)&t_left;
vp8_intra_prediction_down_copy(xd);
intra_prediction_down_copy(xd, xd->dst.y_buffer - xd->dst.y_stride + 16);
bmode_costs = mb->inter_bmode_costs;
......
......@@ -60,7 +60,5 @@ VP8_DX_SRCS-yes += decoder/onyxd_int.h
VP8_DX_SRCS-yes += decoder/treereader.h
VP8_DX_SRCS-yes += decoder/onyxd_if.c
VP8_DX_SRCS-$(CONFIG_MULTITHREAD) += decoder/threading.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))
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