vp9_recon_wrapper_sse2.c 3.84 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
/*
 *  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.
 */

11
#include "./vpx_config.h"
12
#include "vpx_mem/vpx_mem.h"
13
#include "vp9/common/vp9_blockd.h"
14
15

#define build_intra_predictors_mbuv_prototype(sym) \
John Koleszar's avatar
John Koleszar committed
16
17
  void sym(unsigned char *dst, int dst_stride, \
           const unsigned char *src, int src_stride)
18
typedef build_intra_predictors_mbuv_prototype((*build_intra_pred_mbuv_fn_t));
19

20
21
22
23
24
25
26
27
28
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_dc_mmx2);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_dctop_mmx2);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_dcleft_mmx2);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_dc128_mmx);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_ho_mmx2);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_ho_ssse3);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_ve_mmx);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_tm_sse2);
extern build_intra_predictors_mbuv_prototype(vp9_intra_pred_uv_tm_ssse3);
29

30
31
32
33
34
35
static void build_intra_predictors_mbuv_x86(MACROBLOCKD *xd,
                                            unsigned char *dst_u,
                                            unsigned char *dst_v,
                                            int dst_stride,
                                            build_intra_pred_mbuv_fn_t tm_fn,
                                            build_intra_pred_mbuv_fn_t ho_fn) {
Paul Wilkins's avatar
Paul Wilkins committed
36
  int mode = xd->mode_info_context->mbmi.uv_mode;
37
  build_intra_pred_mbuv_fn_t fn;
Paul Wilkins's avatar
Paul Wilkins committed
38
  int src_stride = xd->dst.uv_stride;
39

John Koleszar's avatar
John Koleszar committed
40
41
  switch (mode) {
    case  V_PRED:
42
      fn = vp9_intra_pred_uv_ve_mmx;
John Koleszar's avatar
John Koleszar committed
43
44
      break;
    case  H_PRED:
45
      fn = ho_fn;
John Koleszar's avatar
John Koleszar committed
46
47
      break;
    case TM_PRED:
48
      fn = tm_fn;
John Koleszar's avatar
John Koleszar committed
49
50
      break;
    case DC_PRED:
Paul Wilkins's avatar
Paul Wilkins committed
51
52
      if (xd->up_available) {
        if (xd->left_available) {
53
          fn = vp9_intra_pred_uv_dc_mmx2;
John Koleszar's avatar
John Koleszar committed
54
55
          break;
        } else {
56
          fn = vp9_intra_pred_uv_dctop_mmx2;
John Koleszar's avatar
John Koleszar committed
57
58
          break;
        }
Paul Wilkins's avatar
Paul Wilkins committed
59
      } else if (xd->left_available) {
60
        fn = vp9_intra_pred_uv_dcleft_mmx2;
John Koleszar's avatar
John Koleszar committed
61
62
        break;
      } else {
63
        fn = vp9_intra_pred_uv_dc128_mmx;
John Koleszar's avatar
John Koleszar committed
64
65
66
67
68
69
        break;
      }
      break;
    default:
      return;
  }
70

Paul Wilkins's avatar
Paul Wilkins committed
71
72
  fn(dst_u, dst_stride, xd->dst.u_buffer, src_stride);
  fn(dst_v, dst_stride, xd->dst.v_buffer, src_stride);
73
74
}

75
void vp9_build_intra_predictors_mbuv_sse2(MACROBLOCKD *xd) {
76
77
78
79
  build_intra_predictors_mbuv_x86(xd, &xd->predictor[256],
                                  &xd->predictor[320], 8,
                                  vp9_intra_pred_uv_tm_sse2,
                                  vp9_intra_pred_uv_ho_mmx2);
80
81
}

82
void vp9_build_intra_predictors_mbuv_ssse3(MACROBLOCKD *xd) {
83
84
85
86
  build_intra_predictors_mbuv_x86(xd, &xd->predictor[256],
                                  &xd->predictor[320], 8,
                                  vp9_intra_pred_uv_tm_ssse3,
                                  vp9_intra_pred_uv_ho_ssse3);
87
88
}

89
void vp9_build_intra_predictors_mbuv_s_sse2(MACROBLOCKD *xd) {
90
91
92
93
  build_intra_predictors_mbuv_x86(xd, xd->dst.u_buffer,
                                  xd->dst.v_buffer, xd->dst.uv_stride,
                                  vp9_intra_pred_uv_tm_sse2,
                                  vp9_intra_pred_uv_ho_mmx2);
94
95
}

96
void vp9_build_intra_predictors_mbuv_s_ssse3(MACROBLOCKD *xd) {
97
98
99
100
  build_intra_predictors_mbuv_x86(xd, xd->dst.u_buffer,
                                  xd->dst.v_buffer, xd->dst.uv_stride,
                                  vp9_intra_pred_uv_tm_ssse3,
                                  vp9_intra_pred_uv_ho_ssse3);
101
}