| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #include "vpx_config.h" | 12 #include "vpx_config.h" |
| 13 #include "vp8_rtcd.h" | 13 #include "vp8_rtcd.h" |
| 14 #include "vpx_ports/x86.h" | 14 #include "vpx_ports/x86.h" |
| 15 #include "vpx_mem/vpx_mem.h" | 15 #include "vpx_mem/vpx_mem.h" |
| 16 #include "vp8/encoder/block.h" | 16 #include "vp8/encoder/block.h" |
| 17 #include "vp8/common/entropy.h" /* vp8_default_inv_zig_zag */ | 17 #include "vp8/common/entropy.h" /* vp8_default_inv_zig_zag */ |
| 18 | 18 |
| 19 #include <mmintrin.h> /* MMX */ | 19 #include <mmintrin.h> /* MMX */ |
| 20 #include <xmmintrin.h> /* SSE */ | 20 #include <xmmintrin.h> /* SSE */ |
| 21 #include <emmintrin.h> /* SSE2 */ | 21 #include <emmintrin.h> /* SSE2 */ |
| 22 | 22 |
| 23 #define SELECT_EOB(i, z) \ | 23 #define SELECT_EOB(i, z) \ |
| 24 do { \ | 24 do { \ |
| 25 __label__ select_eob_end; \ | |
| 26 short boost = *zbin_boost_ptr; \ | 25 short boost = *zbin_boost_ptr; \ |
| 27 int cmp = (x[z] < boost) | (y[z] == 0); \ | 26 int cmp = (x[z] < boost) | (y[z] == 0); \ |
| 28 zbin_boost_ptr++; \ | 27 zbin_boost_ptr++; \ |
| 29 if (cmp) \ | 28 if (cmp) \ |
| 30 goto select_eob_end; \ | 29 goto select_eob_end_##i; \ |
| 31 qcoeff_ptr[z] = y[z]; \ | 30 qcoeff_ptr[z] = y[z]; \ |
| 32 eob = i; \ | 31 eob = i; \ |
| 33 zbin_boost_ptr = b->zrun_zbin_boost; \ | 32 zbin_boost_ptr = b->zrun_zbin_boost; \ |
| 34 select_eob_end:; \ | 33 select_eob_end_##i:; \ |
| 35 } while (0) | 34 } while (0) |
| 36 | 35 |
| 37 void vp8_regular_quantize_b_sse2(BLOCK *b, BLOCKD *d) | 36 void vp8_regular_quantize_b_sse2(BLOCK *b, BLOCKD *d) |
| 38 { | 37 { |
| 39 char eob = 0; | 38 char eob = 0; |
| 40 short *zbin_boost_ptr = b->zrun_zbin_boost; | 39 short *zbin_boost_ptr = b->zrun_zbin_boost; |
| 41 short *qcoeff_ptr = d->qcoeff; | 40 short *qcoeff_ptr = d->qcoeff; |
| 42 DECLARE_ALIGNED_ARRAY(16, short, x, 16); | 41 DECLARE_ALIGNED_ARRAY(16, short, x, 16); |
| 43 DECLARE_ALIGNED_ARRAY(16, short, y, 16); | 42 DECLARE_ALIGNED_ARRAY(16, short, y, 16); |
| 44 | 43 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 220 |
| 222 x0 = _mm_max_epi16(x0, x1); | 221 x0 = _mm_max_epi16(x0, x1); |
| 223 | 222 |
| 224 /* okay, just 2! */ | 223 /* okay, just 2! */ |
| 225 x1 = _mm_shufflelo_epi16(x0, 0x1); // 0b00000001 | 224 x1 = _mm_shufflelo_epi16(x0, 0x1); // 0b00000001 |
| 226 | 225 |
| 227 x0 = _mm_max_epi16(x0, x1); | 226 x0 = _mm_max_epi16(x0, x1); |
| 228 | 227 |
| 229 *d->eob = 0xFF & _mm_cvtsi128_si32(x0); | 228 *d->eob = 0xFF & _mm_cvtsi128_si32(x0); |
| 230 } | 229 } |
| OLD | NEW |