12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361 |
- /*
- * Copyright (c) 2017 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 <arm_neon.h>
- #include "./vpx_dsp_rtcd.h"
- #include "vpx_dsp/arm/highbd_idct_neon.h"
- #include "vpx_dsp/arm/idct_neon.h"
- #include "vpx_dsp/inv_txfm.h"
- static INLINE int32x4_t dct_const_round_shift_high_4(const int64x2x2_t in) {
- int32x2x2_t t32;
- t32.val[0] = vrshrn_n_s64(in.val[0], DCT_CONST_BITS);
- t32.val[1] = vrshrn_n_s64(in.val[1], DCT_CONST_BITS);
- return vcombine_s32(t32.val[0], t32.val[1]);
- }
- static INLINE void dct_const_round_shift_high_4_dual(
- const int64x2x2_t *const in, int32x4_t *const d0, int32x4_t *const d1) {
- *d0 = dct_const_round_shift_high_4(in[0]);
- *d1 = dct_const_round_shift_high_4(in[1]);
- }
- static INLINE int32x4x2_t
- dct_const_round_shift_high_4x2_int64x2x2(const int64x2x2_t *const in) {
- int32x4x2_t out;
- out.val[0] = dct_const_round_shift_high_4(in[0]);
- out.val[1] = dct_const_round_shift_high_4(in[1]);
- return out;
- }
- static INLINE void dct_const_round_shift_high_4x2x2(const int64x2x2_t *const in,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- *d0 = dct_const_round_shift_high_4x2_int64x2x2(in + 0);
- *d1 = dct_const_round_shift_high_4x2_int64x2x2(in + 2);
- }
- static INLINE void highbd_idct_cospi_2_30(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_2_30_10_22,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s0.val[0]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s0.val[0]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s0.val[1]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s0.val[1]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[2].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[2].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[3].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[3].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_low_s32(cospi_2_30_10_22), 1);
- t[0].val[0] = vmlsl_lane_s32(t[0].val[0], vget_low_s32(s1.val[0]),
- vget_low_s32(cospi_2_30_10_22), 0);
- t[0].val[1] = vmlsl_lane_s32(t[0].val[1], vget_high_s32(s1.val[0]),
- vget_low_s32(cospi_2_30_10_22), 0);
- t[1].val[0] = vmlsl_lane_s32(t[1].val[0], vget_low_s32(s1.val[1]),
- vget_low_s32(cospi_2_30_10_22), 0);
- t[1].val[1] = vmlsl_lane_s32(t[1].val[1], vget_high_s32(s1.val[1]),
- vget_low_s32(cospi_2_30_10_22), 0);
- t[2].val[0] = vmlal_lane_s32(t[2].val[0], vget_low_s32(s0.val[0]),
- vget_low_s32(cospi_2_30_10_22), 0);
- t[2].val[1] = vmlal_lane_s32(t[2].val[1], vget_high_s32(s0.val[0]),
- vget_low_s32(cospi_2_30_10_22), 0);
- t[3].val[0] = vmlal_lane_s32(t[3].val[0], vget_low_s32(s0.val[1]),
- vget_low_s32(cospi_2_30_10_22), 0);
- t[3].val[1] = vmlal_lane_s32(t[3].val[1], vget_high_s32(s0.val[1]),
- vget_low_s32(cospi_2_30_10_22), 0);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_4_28(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_4_12_20N_28,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[2].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[2].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[3].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[3].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 1);
- t[0].val[0] = vmlsl_lane_s32(t[0].val[0], vget_low_s32(s1.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- t[0].val[1] = vmlsl_lane_s32(t[0].val[1], vget_high_s32(s1.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- t[1].val[0] = vmlsl_lane_s32(t[1].val[0], vget_low_s32(s1.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- t[1].val[1] = vmlsl_lane_s32(t[1].val[1], vget_high_s32(s1.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- t[2].val[0] = vmlal_lane_s32(t[2].val[0], vget_low_s32(s0.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- t[2].val[1] = vmlal_lane_s32(t[2].val[1], vget_high_s32(s0.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- t[3].val[0] = vmlal_lane_s32(t[3].val[0], vget_low_s32(s0.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- t[3].val[1] = vmlal_lane_s32(t[3].val[1], vget_high_s32(s0.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 0);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_6_26(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_6_26N_14_18N,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s0.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s0.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s0.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s0.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[2].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[2].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[3].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[3].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 0);
- t[0].val[0] = vmlal_lane_s32(t[0].val[0], vget_low_s32(s1.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- t[0].val[1] = vmlal_lane_s32(t[0].val[1], vget_high_s32(s1.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- t[1].val[0] = vmlal_lane_s32(t[1].val[0], vget_low_s32(s1.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- t[1].val[1] = vmlal_lane_s32(t[1].val[1], vget_high_s32(s1.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- t[2].val[0] = vmlsl_lane_s32(t[2].val[0], vget_low_s32(s0.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- t[2].val[1] = vmlsl_lane_s32(t[2].val[1], vget_high_s32(s0.val[0]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- t[3].val[0] = vmlsl_lane_s32(t[3].val[0], vget_low_s32(s0.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- t[3].val[1] = vmlsl_lane_s32(t[3].val[1], vget_high_s32(s0.val[1]),
- vget_low_s32(cospi_6_26N_14_18N), 1);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_10_22(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_2_30_10_22,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[2].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[2].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[3].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[3].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_2_30_10_22), 1);
- t[0].val[0] = vmlsl_lane_s32(t[0].val[0], vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_2_30_10_22), 0);
- t[0].val[1] = vmlsl_lane_s32(t[0].val[1], vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_2_30_10_22), 0);
- t[1].val[0] = vmlsl_lane_s32(t[1].val[0], vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_2_30_10_22), 0);
- t[1].val[1] = vmlsl_lane_s32(t[1].val[1], vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_2_30_10_22), 0);
- t[2].val[0] = vmlal_lane_s32(t[2].val[0], vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_2_30_10_22), 0);
- t[2].val[1] = vmlal_lane_s32(t[2].val[1], vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_2_30_10_22), 0);
- t[3].val[0] = vmlal_lane_s32(t[3].val[0], vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_2_30_10_22), 0);
- t[3].val[1] = vmlal_lane_s32(t[3].val[1], vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_2_30_10_22), 0);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_12_20(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_4_12_20N_28,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s0.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s0.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s0.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s0.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[2].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[2].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[3].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[3].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_low_s32(cospi_4_12_20N_28), 1);
- t[0].val[0] = vmlal_lane_s32(t[0].val[0], vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- t[0].val[1] = vmlal_lane_s32(t[0].val[1], vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- t[1].val[0] = vmlal_lane_s32(t[1].val[0], vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- t[1].val[1] = vmlal_lane_s32(t[1].val[1], vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- t[2].val[0] = vmlsl_lane_s32(t[2].val[0], vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- t[2].val[1] = vmlsl_lane_s32(t[2].val[1], vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- t[3].val[0] = vmlsl_lane_s32(t[3].val[0], vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- t[3].val[1] = vmlsl_lane_s32(t[3].val[1], vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_4_12_20N_28), 0);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_14_18(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_6_26N_14_18N,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[2].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[2].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[3].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[3].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 0);
- t[0].val[0] = vmlal_lane_s32(t[0].val[0], vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- t[0].val[1] = vmlal_lane_s32(t[0].val[1], vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- t[1].val[0] = vmlal_lane_s32(t[1].val[0], vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- t[1].val[1] = vmlal_lane_s32(t[1].val[1], vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- t[2].val[0] = vmlsl_lane_s32(t[2].val[0], vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- t[2].val[1] = vmlsl_lane_s32(t[2].val[1], vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- t[3].val[0] = vmlsl_lane_s32(t[3].val[0], vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- t[3].val[1] = vmlsl_lane_s32(t[3].val[1], vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_6_26N_14_18N), 1);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_8_24_q_kernel(
- const int32x4x2_t s0, const int32x4x2_t s1, const int32x4_t cospi_0_8_16_24,
- int64x2x2_t *const t) {
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[2].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[2].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[3].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[3].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_0_8_16_24), 1);
- t[0].val[0] = vmlsl_lane_s32(t[0].val[0], vget_low_s32(s1.val[0]),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[0].val[1] = vmlsl_lane_s32(t[0].val[1], vget_high_s32(s1.val[0]),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[1].val[0] = vmlsl_lane_s32(t[1].val[0], vget_low_s32(s1.val[1]),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[1].val[1] = vmlsl_lane_s32(t[1].val[1], vget_high_s32(s1.val[1]),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[2].val[0] = vmlal_lane_s32(t[2].val[0], vget_low_s32(s0.val[0]),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[2].val[1] = vmlal_lane_s32(t[2].val[1], vget_high_s32(s0.val[0]),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[3].val[0] = vmlal_lane_s32(t[3].val[0], vget_low_s32(s0.val[1]),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[3].val[1] = vmlal_lane_s32(t[3].val[1], vget_high_s32(s0.val[1]),
- vget_low_s32(cospi_0_8_16_24), 1);
- }
- static INLINE void highbd_idct_cospi_8_24_d_kernel(
- const int32x4_t s0, const int32x4_t s1, const int32x4_t cospi_0_8_16_24,
- int64x2x2_t *const t) {
- t[0].val[0] =
- vmull_lane_s32(vget_low_s32(s0), vget_high_s32(cospi_0_8_16_24), 1);
- t[0].val[1] =
- vmull_lane_s32(vget_high_s32(s0), vget_high_s32(cospi_0_8_16_24), 1);
- t[1].val[0] =
- vmull_lane_s32(vget_low_s32(s1), vget_high_s32(cospi_0_8_16_24), 1);
- t[1].val[1] =
- vmull_lane_s32(vget_high_s32(s1), vget_high_s32(cospi_0_8_16_24), 1);
- t[0].val[0] = vmlsl_lane_s32(t[0].val[0], vget_low_s32(s1),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[0].val[1] = vmlsl_lane_s32(t[0].val[1], vget_high_s32(s1),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[1].val[0] = vmlal_lane_s32(t[1].val[0], vget_low_s32(s0),
- vget_low_s32(cospi_0_8_16_24), 1);
- t[1].val[1] = vmlal_lane_s32(t[1].val[1], vget_high_s32(s0),
- vget_low_s32(cospi_0_8_16_24), 1);
- }
- static INLINE void highbd_idct_cospi_8_24_q(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_0_8_16_24,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- highbd_idct_cospi_8_24_q_kernel(s0, s1, cospi_0_8_16_24, t);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_8_24_d(const int32x4_t s0,
- const int32x4_t s1,
- const int32x4_t cospi_0_8_16_24,
- int32x4_t *const d0,
- int32x4_t *const d1) {
- int64x2x2_t t[2];
- highbd_idct_cospi_8_24_d_kernel(s0, s1, cospi_0_8_16_24, t);
- dct_const_round_shift_high_4_dual(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_8_24_neg_q(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_0_8_16_24,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[4];
- highbd_idct_cospi_8_24_q_kernel(s0, s1, cospi_0_8_16_24, t);
- t[2].val[0] = vsubq_s64(vdupq_n_s64(0), t[2].val[0]);
- t[2].val[1] = vsubq_s64(vdupq_n_s64(0), t[2].val[1]);
- t[3].val[0] = vsubq_s64(vdupq_n_s64(0), t[3].val[0]);
- t[3].val[1] = vsubq_s64(vdupq_n_s64(0), t[3].val[1]);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_8_24_neg_d(const int32x4_t s0,
- const int32x4_t s1,
- const int32x4_t cospi_0_8_16_24,
- int32x4_t *const d0,
- int32x4_t *const d1) {
- int64x2x2_t t[2];
- highbd_idct_cospi_8_24_d_kernel(s0, s1, cospi_0_8_16_24, t);
- t[1].val[0] = vsubq_s64(vdupq_n_s64(0), t[1].val[0]);
- t[1].val[1] = vsubq_s64(vdupq_n_s64(0), t[1].val[1]);
- dct_const_round_shift_high_4_dual(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_16_16_q(const int32x4x2_t s0,
- const int32x4x2_t s1,
- const int32x4_t cospi_0_8_16_24,
- int32x4x2_t *const d0,
- int32x4x2_t *const d1) {
- int64x2x2_t t[6];
- t[4].val[0] = vmull_lane_s32(vget_low_s32(s1.val[0]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[4].val[1] = vmull_lane_s32(vget_high_s32(s1.val[0]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[5].val[0] = vmull_lane_s32(vget_low_s32(s1.val[1]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[5].val[1] = vmull_lane_s32(vget_high_s32(s1.val[1]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[0].val[0] = vmlsl_lane_s32(t[4].val[0], vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[0].val[1] = vmlsl_lane_s32(t[4].val[1], vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[1].val[0] = vmlsl_lane_s32(t[5].val[0], vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[1].val[1] = vmlsl_lane_s32(t[5].val[1], vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[2].val[0] = vmlal_lane_s32(t[4].val[0], vget_low_s32(s0.val[0]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[2].val[1] = vmlal_lane_s32(t[4].val[1], vget_high_s32(s0.val[0]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[3].val[0] = vmlal_lane_s32(t[5].val[0], vget_low_s32(s0.val[1]),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[3].val[1] = vmlal_lane_s32(t[5].val[1], vget_high_s32(s0.val[1]),
- vget_high_s32(cospi_0_8_16_24), 0);
- dct_const_round_shift_high_4x2x2(t, d0, d1);
- }
- static INLINE void highbd_idct_cospi_16_16_d(const int32x4_t s0,
- const int32x4_t s1,
- const int32x4_t cospi_0_8_16_24,
- int32x4_t *const d0,
- int32x4_t *const d1) {
- int64x2x2_t t[3];
- t[2].val[0] =
- vmull_lane_s32(vget_low_s32(s1), vget_high_s32(cospi_0_8_16_24), 0);
- t[2].val[1] =
- vmull_lane_s32(vget_high_s32(s1), vget_high_s32(cospi_0_8_16_24), 0);
- t[0].val[0] = vmlsl_lane_s32(t[2].val[0], vget_low_s32(s0),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[0].val[1] = vmlsl_lane_s32(t[2].val[1], vget_high_s32(s0),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[1].val[0] = vmlal_lane_s32(t[2].val[0], vget_low_s32(s0),
- vget_high_s32(cospi_0_8_16_24), 0);
- t[1].val[1] = vmlal_lane_s32(t[2].val[1], vget_high_s32(s0),
- vget_high_s32(cospi_0_8_16_24), 0);
- dct_const_round_shift_high_4_dual(t, d0, d1);
- }
- static INLINE void highbd_idct16x16_add_stage7_dual(
- const int32x4x2_t *const step2, int32x4x2_t *const out) {
- out[0].val[0] = vaddq_s32(step2[0].val[0], step2[15].val[0]);
- out[0].val[1] = vaddq_s32(step2[0].val[1], step2[15].val[1]);
- out[1].val[0] = vaddq_s32(step2[1].val[0], step2[14].val[0]);
- out[1].val[1] = vaddq_s32(step2[1].val[1], step2[14].val[1]);
- out[2].val[0] = vaddq_s32(step2[2].val[0], step2[13].val[0]);
- out[2].val[1] = vaddq_s32(step2[2].val[1], step2[13].val[1]);
- out[3].val[0] = vaddq_s32(step2[3].val[0], step2[12].val[0]);
- out[3].val[1] = vaddq_s32(step2[3].val[1], step2[12].val[1]);
- out[4].val[0] = vaddq_s32(step2[4].val[0], step2[11].val[0]);
- out[4].val[1] = vaddq_s32(step2[4].val[1], step2[11].val[1]);
- out[5].val[0] = vaddq_s32(step2[5].val[0], step2[10].val[0]);
- out[5].val[1] = vaddq_s32(step2[5].val[1], step2[10].val[1]);
- out[6].val[0] = vaddq_s32(step2[6].val[0], step2[9].val[0]);
- out[6].val[1] = vaddq_s32(step2[6].val[1], step2[9].val[1]);
- out[7].val[0] = vaddq_s32(step2[7].val[0], step2[8].val[0]);
- out[7].val[1] = vaddq_s32(step2[7].val[1], step2[8].val[1]);
- out[8].val[0] = vsubq_s32(step2[7].val[0], step2[8].val[0]);
- out[8].val[1] = vsubq_s32(step2[7].val[1], step2[8].val[1]);
- out[9].val[0] = vsubq_s32(step2[6].val[0], step2[9].val[0]);
- out[9].val[1] = vsubq_s32(step2[6].val[1], step2[9].val[1]);
- out[10].val[0] = vsubq_s32(step2[5].val[0], step2[10].val[0]);
- out[10].val[1] = vsubq_s32(step2[5].val[1], step2[10].val[1]);
- out[11].val[0] = vsubq_s32(step2[4].val[0], step2[11].val[0]);
- out[11].val[1] = vsubq_s32(step2[4].val[1], step2[11].val[1]);
- out[12].val[0] = vsubq_s32(step2[3].val[0], step2[12].val[0]);
- out[12].val[1] = vsubq_s32(step2[3].val[1], step2[12].val[1]);
- out[13].val[0] = vsubq_s32(step2[2].val[0], step2[13].val[0]);
- out[13].val[1] = vsubq_s32(step2[2].val[1], step2[13].val[1]);
- out[14].val[0] = vsubq_s32(step2[1].val[0], step2[14].val[0]);
- out[14].val[1] = vsubq_s32(step2[1].val[1], step2[14].val[1]);
- out[15].val[0] = vsubq_s32(step2[0].val[0], step2[15].val[0]);
- out[15].val[1] = vsubq_s32(step2[0].val[1], step2[15].val[1]);
- }
- static INLINE void highbd_idct16x16_add_stage7(const int32x4_t *const step2,
- int32x4_t *const out) {
- out[0] = vaddq_s32(step2[0], step2[15]);
- out[1] = vaddq_s32(step2[1], step2[14]);
- out[2] = vaddq_s32(step2[2], step2[13]);
- out[3] = vaddq_s32(step2[3], step2[12]);
- out[4] = vaddq_s32(step2[4], step2[11]);
- out[5] = vaddq_s32(step2[5], step2[10]);
- out[6] = vaddq_s32(step2[6], step2[9]);
- out[7] = vaddq_s32(step2[7], step2[8]);
- out[8] = vsubq_s32(step2[7], step2[8]);
- out[9] = vsubq_s32(step2[6], step2[9]);
- out[10] = vsubq_s32(step2[5], step2[10]);
- out[11] = vsubq_s32(step2[4], step2[11]);
- out[12] = vsubq_s32(step2[3], step2[12]);
- out[13] = vsubq_s32(step2[2], step2[13]);
- out[14] = vsubq_s32(step2[1], step2[14]);
- out[15] = vsubq_s32(step2[0], step2[15]);
- }
- void vpx_highbd_idct16x16_256_add_half1d(const int32_t *input, int32_t *output,
- uint16_t *dest, const int stride,
- const int bd) {
- const int32x4_t cospi_0_8_16_24 = vld1q_s32(kCospi32 + 0);
- const int32x4_t cospi_4_12_20N_28 = vld1q_s32(kCospi32 + 4);
- const int32x4_t cospi_2_30_10_22 = vld1q_s32(kCospi32 + 8);
- const int32x4_t cospi_6_26N_14_18N = vld1q_s32(kCospi32 + 12);
- int32x4x2_t in[16], step1[16], step2[16], out[16];
- // Load input (16x8)
- in[0].val[0] = vld1q_s32(input);
- in[0].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[8].val[0] = vld1q_s32(input);
- in[8].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[1].val[0] = vld1q_s32(input);
- in[1].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[9].val[0] = vld1q_s32(input);
- in[9].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[2].val[0] = vld1q_s32(input);
- in[2].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[10].val[0] = vld1q_s32(input);
- in[10].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[3].val[0] = vld1q_s32(input);
- in[3].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[11].val[0] = vld1q_s32(input);
- in[11].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[4].val[0] = vld1q_s32(input);
- in[4].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[12].val[0] = vld1q_s32(input);
- in[12].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[5].val[0] = vld1q_s32(input);
- in[5].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[13].val[0] = vld1q_s32(input);
- in[13].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[6].val[0] = vld1q_s32(input);
- in[6].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[14].val[0] = vld1q_s32(input);
- in[14].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[7].val[0] = vld1q_s32(input);
- in[7].val[1] = vld1q_s32(input + 4);
- input += 8;
- in[15].val[0] = vld1q_s32(input);
- in[15].val[1] = vld1q_s32(input + 4);
- // Transpose
- transpose_s32_8x8(&in[0], &in[1], &in[2], &in[3], &in[4], &in[5], &in[6],
- &in[7]);
- transpose_s32_8x8(&in[8], &in[9], &in[10], &in[11], &in[12], &in[13], &in[14],
- &in[15]);
- // stage 1
- step1[0] = in[0 / 2];
- step1[1] = in[16 / 2];
- step1[2] = in[8 / 2];
- step1[3] = in[24 / 2];
- step1[4] = in[4 / 2];
- step1[5] = in[20 / 2];
- step1[6] = in[12 / 2];
- step1[7] = in[28 / 2];
- step1[8] = in[2 / 2];
- step1[9] = in[18 / 2];
- step1[10] = in[10 / 2];
- step1[11] = in[26 / 2];
- step1[12] = in[6 / 2];
- step1[13] = in[22 / 2];
- step1[14] = in[14 / 2];
- step1[15] = in[30 / 2];
- // stage 2
- step2[0] = step1[0];
- step2[1] = step1[1];
- step2[2] = step1[2];
- step2[3] = step1[3];
- step2[4] = step1[4];
- step2[5] = step1[5];
- step2[6] = step1[6];
- step2[7] = step1[7];
- highbd_idct_cospi_2_30(step1[8], step1[15], cospi_2_30_10_22, &step2[8],
- &step2[15]);
- highbd_idct_cospi_14_18(step1[9], step1[14], cospi_6_26N_14_18N, &step2[9],
- &step2[14]);
- highbd_idct_cospi_10_22(step1[10], step1[13], cospi_2_30_10_22, &step2[10],
- &step2[13]);
- highbd_idct_cospi_6_26(step1[11], step1[12], cospi_6_26N_14_18N, &step2[11],
- &step2[12]);
- // stage 3
- step1[0] = step2[0];
- step1[1] = step2[1];
- step1[2] = step2[2];
- step1[3] = step2[3];
- highbd_idct_cospi_4_28(step2[4], step2[7], cospi_4_12_20N_28, &step1[4],
- &step1[7]);
- highbd_idct_cospi_12_20(step2[5], step2[6], cospi_4_12_20N_28, &step1[5],
- &step1[6]);
- step1[8].val[0] = vaddq_s32(step2[8].val[0], step2[9].val[0]);
- step1[8].val[1] = vaddq_s32(step2[8].val[1], step2[9].val[1]);
- step1[9].val[0] = vsubq_s32(step2[8].val[0], step2[9].val[0]);
- step1[9].val[1] = vsubq_s32(step2[8].val[1], step2[9].val[1]);
- step1[10].val[0] = vsubq_s32(step2[11].val[0], step2[10].val[0]);
- step1[10].val[1] = vsubq_s32(step2[11].val[1], step2[10].val[1]);
- step1[11].val[0] = vaddq_s32(step2[11].val[0], step2[10].val[0]);
- step1[11].val[1] = vaddq_s32(step2[11].val[1], step2[10].val[1]);
- step1[12].val[0] = vaddq_s32(step2[12].val[0], step2[13].val[0]);
- step1[12].val[1] = vaddq_s32(step2[12].val[1], step2[13].val[1]);
- step1[13].val[0] = vsubq_s32(step2[12].val[0], step2[13].val[0]);
- step1[13].val[1] = vsubq_s32(step2[12].val[1], step2[13].val[1]);
- step1[14].val[0] = vsubq_s32(step2[15].val[0], step2[14].val[0]);
- step1[14].val[1] = vsubq_s32(step2[15].val[1], step2[14].val[1]);
- step1[15].val[0] = vaddq_s32(step2[15].val[0], step2[14].val[0]);
- step1[15].val[1] = vaddq_s32(step2[15].val[1], step2[14].val[1]);
- // stage 4
- highbd_idct_cospi_16_16_q(step1[1], step1[0], cospi_0_8_16_24, &step2[1],
- &step2[0]);
- highbd_idct_cospi_8_24_q(step1[2], step1[3], cospi_0_8_16_24, &step2[2],
- &step2[3]);
- step2[4].val[0] = vaddq_s32(step1[4].val[0], step1[5].val[0]);
- step2[4].val[1] = vaddq_s32(step1[4].val[1], step1[5].val[1]);
- step2[5].val[0] = vsubq_s32(step1[4].val[0], step1[5].val[0]);
- step2[5].val[1] = vsubq_s32(step1[4].val[1], step1[5].val[1]);
- step2[6].val[0] = vsubq_s32(step1[7].val[0], step1[6].val[0]);
- step2[6].val[1] = vsubq_s32(step1[7].val[1], step1[6].val[1]);
- step2[7].val[0] = vaddq_s32(step1[7].val[0], step1[6].val[0]);
- step2[7].val[1] = vaddq_s32(step1[7].val[1], step1[6].val[1]);
- step2[8] = step1[8];
- highbd_idct_cospi_8_24_q(step1[14], step1[9], cospi_0_8_16_24, &step2[9],
- &step2[14]);
- highbd_idct_cospi_8_24_neg_q(step1[13], step1[10], cospi_0_8_16_24,
- &step2[13], &step2[10]);
- step2[11] = step1[11];
- step2[12] = step1[12];
- step2[15] = step1[15];
- // stage 5
- step1[0].val[0] = vaddq_s32(step2[0].val[0], step2[3].val[0]);
- step1[0].val[1] = vaddq_s32(step2[0].val[1], step2[3].val[1]);
- step1[1].val[0] = vaddq_s32(step2[1].val[0], step2[2].val[0]);
- step1[1].val[1] = vaddq_s32(step2[1].val[1], step2[2].val[1]);
- step1[2].val[0] = vsubq_s32(step2[1].val[0], step2[2].val[0]);
- step1[2].val[1] = vsubq_s32(step2[1].val[1], step2[2].val[1]);
- step1[3].val[0] = vsubq_s32(step2[0].val[0], step2[3].val[0]);
- step1[3].val[1] = vsubq_s32(step2[0].val[1], step2[3].val[1]);
- step1[4] = step2[4];
- highbd_idct_cospi_16_16_q(step2[5], step2[6], cospi_0_8_16_24, &step1[5],
- &step1[6]);
- step1[7] = step2[7];
- step1[8].val[0] = vaddq_s32(step2[8].val[0], step2[11].val[0]);
- step1[8].val[1] = vaddq_s32(step2[8].val[1], step2[11].val[1]);
- step1[9].val[0] = vaddq_s32(step2[9].val[0], step2[10].val[0]);
- step1[9].val[1] = vaddq_s32(step2[9].val[1], step2[10].val[1]);
- step1[10].val[0] = vsubq_s32(step2[9].val[0], step2[10].val[0]);
- step1[10].val[1] = vsubq_s32(step2[9].val[1], step2[10].val[1]);
- step1[11].val[0] = vsubq_s32(step2[8].val[0], step2[11].val[0]);
- step1[11].val[1] = vsubq_s32(step2[8].val[1], step2[11].val[1]);
- step1[12].val[0] = vsubq_s32(step2[15].val[0], step2[12].val[0]);
- step1[12].val[1] = vsubq_s32(step2[15].val[1], step2[12].val[1]);
- step1[13].val[0] = vsubq_s32(step2[14].val[0], step2[13].val[0]);
- step1[13].val[1] = vsubq_s32(step2[14].val[1], step2[13].val[1]);
- step1[14].val[0] = vaddq_s32(step2[14].val[0], step2[13].val[0]);
- step1[14].val[1] = vaddq_s32(step2[14].val[1], step2[13].val[1]);
- step1[15].val[0] = vaddq_s32(step2[15].val[0], step2[12].val[0]);
- step1[15].val[1] = vaddq_s32(step2[15].val[1], step2[12].val[1]);
- // stage 6
- step2[0].val[0] = vaddq_s32(step1[0].val[0], step1[7].val[0]);
- step2[0].val[1] = vaddq_s32(step1[0].val[1], step1[7].val[1]);
- step2[1].val[0] = vaddq_s32(step1[1].val[0], step1[6].val[0]);
- step2[1].val[1] = vaddq_s32(step1[1].val[1], step1[6].val[1]);
- step2[2].val[0] = vaddq_s32(step1[2].val[0], step1[5].val[0]);
- step2[2].val[1] = vaddq_s32(step1[2].val[1], step1[5].val[1]);
- step2[3].val[0] = vaddq_s32(step1[3].val[0], step1[4].val[0]);
- step2[3].val[1] = vaddq_s32(step1[3].val[1], step1[4].val[1]);
- step2[4].val[0] = vsubq_s32(step1[3].val[0], step1[4].val[0]);
- step2[4].val[1] = vsubq_s32(step1[3].val[1], step1[4].val[1]);
- step2[5].val[0] = vsubq_s32(step1[2].val[0], step1[5].val[0]);
- step2[5].val[1] = vsubq_s32(step1[2].val[1], step1[5].val[1]);
- step2[6].val[0] = vsubq_s32(step1[1].val[0], step1[6].val[0]);
- step2[6].val[1] = vsubq_s32(step1[1].val[1], step1[6].val[1]);
- step2[7].val[0] = vsubq_s32(step1[0].val[0], step1[7].val[0]);
- step2[7].val[1] = vsubq_s32(step1[0].val[1], step1[7].val[1]);
- highbd_idct_cospi_16_16_q(step1[10], step1[13], cospi_0_8_16_24, &step2[10],
- &step2[13]);
- highbd_idct_cospi_16_16_q(step1[11], step1[12], cospi_0_8_16_24, &step2[11],
- &step2[12]);
- step2[8] = step1[8];
- step2[9] = step1[9];
- step2[14] = step1[14];
- step2[15] = step1[15];
- // stage 7
- highbd_idct16x16_add_stage7_dual(step2, out);
- if (output) {
- highbd_idct16x16_store_pass1(out, output);
- } else {
- highbd_idct16x16_add_store(out, dest, stride, bd);
- }
- }
- static INLINE int32x4x2_t highbd_idct_cospi_lane0_dual(const int32x4x2_t s,
- const int32x2_t coef) {
- int64x2x2_t t[2];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s.val[0]), coef, 0);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s.val[0]), coef, 0);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s.val[1]), coef, 0);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s.val[1]), coef, 0);
- return dct_const_round_shift_high_4x2_int64x2x2(t);
- }
- static INLINE int32x4_t highbd_idct_cospi_lane0(const int32x4_t s,
- const int32x2_t coef) {
- int64x2x2_t t;
- t.val[0] = vmull_lane_s32(vget_low_s32(s), coef, 0);
- t.val[1] = vmull_lane_s32(vget_high_s32(s), coef, 0);
- return dct_const_round_shift_high_4(t);
- }
- static INLINE int32x4x2_t highbd_idct_cospi_lane1_dual(const int32x4x2_t s,
- const int32x2_t coef) {
- int64x2x2_t t[2];
- t[0].val[0] = vmull_lane_s32(vget_low_s32(s.val[0]), coef, 1);
- t[0].val[1] = vmull_lane_s32(vget_high_s32(s.val[0]), coef, 1);
- t[1].val[0] = vmull_lane_s32(vget_low_s32(s.val[1]), coef, 1);
- t[1].val[1] = vmull_lane_s32(vget_high_s32(s.val[1]), coef, 1);
- return dct_const_round_shift_high_4x2_int64x2x2(t);
- }
- static INLINE int32x4_t highbd_idct_cospi_lane1(const int32x4_t s,
- const int32x2_t coef) {
- int64x2x2_t t;
- t.val[0] = vmull_lane_s32(vget_low_s32(s), coef, 1);
- t.val[1] = vmull_lane_s32(vget_high_s32(s), coef, 1);
- return dct_const_round_shift_high_4(t);
- }
- static void vpx_highbd_idct16x16_38_add_half1d(const int32_t *input,
- int32_t *output, uint16_t *dest,
- const int stride, const int bd) {
- const int32x4_t cospi_0_8_16_24 = vld1q_s32(kCospi32 + 0);
- const int32x4_t cospi_4_12_20N_28 = vld1q_s32(kCospi32 + 4);
- const int32x4_t cospi_2_30_10_22 = vld1q_s32(kCospi32 + 8);
- const int32x4_t cospi_6_26N_14_18N = vld1q_s32(kCospi32 + 12);
- int32x4x2_t in[8], step1[16], step2[16], out[16];
- // Load input (8x8)
- in[0].val[0] = vld1q_s32(input);
- in[0].val[1] = vld1q_s32(input + 4);
- input += 16;
- in[1].val[0] = vld1q_s32(input);
- in[1].val[1] = vld1q_s32(input + 4);
- input += 16;
- in[2].val[0] = vld1q_s32(input);
- in[2].val[1] = vld1q_s32(input + 4);
- input += 16;
- in[3].val[0] = vld1q_s32(input);
- in[3].val[1] = vld1q_s32(input + 4);
- input += 16;
- in[4].val[0] = vld1q_s32(input);
- in[4].val[1] = vld1q_s32(input + 4);
- input += 16;
- in[5].val[0] = vld1q_s32(input);
- in[5].val[1] = vld1q_s32(input + 4);
- input += 16;
- in[6].val[0] = vld1q_s32(input);
- in[6].val[1] = vld1q_s32(input + 4);
- input += 16;
- in[7].val[0] = vld1q_s32(input);
- in[7].val[1] = vld1q_s32(input + 4);
- // Transpose
- transpose_s32_8x8(&in[0], &in[1], &in[2], &in[3], &in[4], &in[5], &in[6],
- &in[7]);
- // stage 1
- step1[0] = in[0 / 2];
- step1[2] = in[8 / 2];
- step1[4] = in[4 / 2];
- step1[6] = in[12 / 2];
- step1[8] = in[2 / 2];
- step1[10] = in[10 / 2];
- step1[12] = in[6 / 2];
- step1[14] = in[14 / 2]; // 0 in pass 1
- // stage 2
- step2[0] = step1[0];
- step2[2] = step1[2];
- step2[4] = step1[4];
- step2[6] = step1[6];
- step2[8] =
- highbd_idct_cospi_lane1_dual(step1[8], vget_low_s32(cospi_2_30_10_22));
- step2[9] = highbd_idct_cospi_lane1_dual(step1[14],
- vget_high_s32(cospi_6_26N_14_18N));
- step2[10] =
- highbd_idct_cospi_lane1_dual(step1[10], vget_high_s32(cospi_2_30_10_22));
- step2[11] =
- highbd_idct_cospi_lane1_dual(step1[12], vget_low_s32(cospi_6_26N_14_18N));
- step2[12] =
- highbd_idct_cospi_lane0_dual(step1[12], vget_low_s32(cospi_6_26N_14_18N));
- step2[13] =
- highbd_idct_cospi_lane0_dual(step1[10], vget_high_s32(cospi_2_30_10_22));
- step2[14] = highbd_idct_cospi_lane0_dual(step1[14],
- vget_high_s32(cospi_6_26N_14_18N));
- step2[15] =
- highbd_idct_cospi_lane0_dual(step1[8], vget_low_s32(cospi_2_30_10_22));
- // stage 3
- step1[0] = step2[0];
- step1[2] = step2[2];
- step1[4] =
- highbd_idct_cospi_lane1_dual(step2[4], vget_high_s32(cospi_4_12_20N_28));
- step1[5] =
- highbd_idct_cospi_lane0_dual(step2[6], vget_high_s32(cospi_4_12_20N_28));
- step1[6] =
- highbd_idct_cospi_lane1_dual(step2[6], vget_low_s32(cospi_4_12_20N_28));
- step1[7] =
- highbd_idct_cospi_lane0_dual(step2[4], vget_low_s32(cospi_4_12_20N_28));
- step1[8] = highbd_idct_add_dual(step2[8], step2[9]);
- step1[9] = highbd_idct_sub_dual(step2[8], step2[9]);
- step1[10] = highbd_idct_sub_dual(step2[11], step2[10]);
- step1[11] = highbd_idct_add_dual(step2[11], step2[10]);
- step1[12] = highbd_idct_add_dual(step2[12], step2[13]);
- step1[13] = highbd_idct_sub_dual(step2[12], step2[13]);
- step1[14] = highbd_idct_sub_dual(step2[15], step2[14]);
- step1[15] = highbd_idct_add_dual(step2[15], step2[14]);
- // stage 4
- step2[0] = step2[1] =
- highbd_idct_cospi_lane0_dual(step1[0], vget_high_s32(cospi_0_8_16_24));
- step2[2] =
- highbd_idct_cospi_lane1_dual(step1[2], vget_high_s32(cospi_0_8_16_24));
- step2[3] =
- highbd_idct_cospi_lane1_dual(step1[2], vget_low_s32(cospi_0_8_16_24));
- step2[4] = highbd_idct_add_dual(step1[4], step1[5]);
- step2[5] = highbd_idct_sub_dual(step1[4], step1[5]);
- step2[6] = highbd_idct_sub_dual(step1[7], step1[6]);
- step2[7] = highbd_idct_add_dual(step1[7], step1[6]);
- step2[8] = step1[8];
- highbd_idct_cospi_8_24_q(step1[14], step1[9], cospi_0_8_16_24, &step2[9],
- &step2[14]);
- highbd_idct_cospi_8_24_neg_q(step1[13], step1[10], cospi_0_8_16_24,
- &step2[13], &step2[10]);
- step2[11] = step1[11];
- step2[12] = step1[12];
- step2[15] = step1[15];
- // stage 5
- step1[0] = highbd_idct_add_dual(step2[0], step2[3]);
- step1[1] = highbd_idct_add_dual(step2[1], step2[2]);
- step1[2] = highbd_idct_sub_dual(step2[1], step2[2]);
- step1[3] = highbd_idct_sub_dual(step2[0], step2[3]);
- step1[4] = step2[4];
- highbd_idct_cospi_16_16_q(step2[5], step2[6], cospi_0_8_16_24, &step1[5],
- &step1[6]);
- step1[7] = step2[7];
- step1[8] = highbd_idct_add_dual(step2[8], step2[11]);
- step1[9] = highbd_idct_add_dual(step2[9], step2[10]);
- step1[10] = highbd_idct_sub_dual(step2[9], step2[10]);
- step1[11] = highbd_idct_sub_dual(step2[8], step2[11]);
- step1[12] = highbd_idct_sub_dual(step2[15], step2[12]);
- step1[13] = highbd_idct_sub_dual(step2[14], step2[13]);
- step1[14] = highbd_idct_add_dual(step2[14], step2[13]);
- step1[15] = highbd_idct_add_dual(step2[15], step2[12]);
- // stage 6
- step2[0] = highbd_idct_add_dual(step1[0], step1[7]);
- step2[1] = highbd_idct_add_dual(step1[1], step1[6]);
- step2[2] = highbd_idct_add_dual(step1[2], step1[5]);
- step2[3] = highbd_idct_add_dual(step1[3], step1[4]);
- step2[4] = highbd_idct_sub_dual(step1[3], step1[4]);
- step2[5] = highbd_idct_sub_dual(step1[2], step1[5]);
- step2[6] = highbd_idct_sub_dual(step1[1], step1[6]);
- step2[7] = highbd_idct_sub_dual(step1[0], step1[7]);
- highbd_idct_cospi_16_16_q(step1[10], step1[13], cospi_0_8_16_24, &step2[10],
- &step2[13]);
- highbd_idct_cospi_16_16_q(step1[11], step1[12], cospi_0_8_16_24, &step2[11],
- &step2[12]);
- step2[8] = step1[8];
- step2[9] = step1[9];
- step2[14] = step1[14];
- step2[15] = step1[15];
- // stage 7
- highbd_idct16x16_add_stage7_dual(step2, out);
- if (output) {
- highbd_idct16x16_store_pass1(out, output);
- } else {
- highbd_idct16x16_add_store(out, dest, stride, bd);
- }
- }
- static void highbd_idct16x16_10_add_half1d_pass1(const tran_low_t *input,
- int32_t *output) {
- const int32x4_t cospi_0_8_16_24 = vld1q_s32(kCospi32 + 0);
- const int32x4_t cospi_4_12_20N_28 = vld1q_s32(kCospi32 + 4);
- const int32x4_t cospi_2_30_10_22 = vld1q_s32(kCospi32 + 8);
- const int32x4_t cospi_6_26N_14_18N = vld1q_s32(kCospi32 + 12);
- int32x4_t in[4], step1[16], step2[16], out[16];
- // Load input (4x4)
- in[0] = vld1q_s32(input);
- input += 16;
- in[1] = vld1q_s32(input);
- input += 16;
- in[2] = vld1q_s32(input);
- input += 16;
- in[3] = vld1q_s32(input);
- // Transpose
- transpose_s32_4x4(&in[0], &in[1], &in[2], &in[3]);
- // stage 1
- step1[0] = in[0 / 2];
- step1[4] = in[4 / 2];
- step1[8] = in[2 / 2];
- step1[12] = in[6 / 2];
- // stage 2
- step2[0] = step1[0];
- step2[4] = step1[4];
- step2[8] = highbd_idct_cospi_lane1(step1[8], vget_low_s32(cospi_2_30_10_22));
- step2[11] =
- highbd_idct_cospi_lane1(step1[12], vget_low_s32(cospi_6_26N_14_18N));
- step2[12] =
- highbd_idct_cospi_lane0(step1[12], vget_low_s32(cospi_6_26N_14_18N));
- step2[15] = highbd_idct_cospi_lane0(step1[8], vget_low_s32(cospi_2_30_10_22));
- // stage 3
- step1[0] = step2[0];
- step1[4] =
- highbd_idct_cospi_lane1(step2[4], vget_high_s32(cospi_4_12_20N_28));
- step1[7] = highbd_idct_cospi_lane0(step2[4], vget_low_s32(cospi_4_12_20N_28));
- step1[8] = step2[8];
- step1[9] = step2[8];
- step1[10] = step2[11];
- step1[11] = step2[11];
- step1[12] = step2[12];
- step1[13] = step2[12];
- step1[14] = step2[15];
- step1[15] = step2[15];
- // stage 4
- step2[0] = step2[1] =
- highbd_idct_cospi_lane0(step1[0], vget_high_s32(cospi_0_8_16_24));
- step2[4] = step1[4];
- step2[5] = step1[4];
- step2[6] = step1[7];
- step2[7] = step1[7];
- step2[8] = step1[8];
- highbd_idct_cospi_8_24_d(step1[14], step1[9], cospi_0_8_16_24, &step2[9],
- &step2[14]);
- highbd_idct_cospi_8_24_neg_d(step1[13], step1[10], cospi_0_8_16_24,
- &step2[13], &step2[10]);
- step2[11] = step1[11];
- step2[12] = step1[12];
- step2[15] = step1[15];
- // stage 5
- step1[0] = step2[0];
- step1[1] = step2[1];
- step1[2] = step2[1];
- step1[3] = step2[0];
- step1[4] = step2[4];
- highbd_idct_cospi_16_16_d(step2[5], step2[6], cospi_0_8_16_24, &step1[5],
- &step1[6]);
- step1[7] = step2[7];
- step1[8] = vaddq_s32(step2[8], step2[11]);
- step1[9] = vaddq_s32(step2[9], step2[10]);
- step1[10] = vsubq_s32(step2[9], step2[10]);
- step1[11] = vsubq_s32(step2[8], step2[11]);
- step1[12] = vsubq_s32(step2[15], step2[12]);
- step1[13] = vsubq_s32(step2[14], step2[13]);
- step1[14] = vaddq_s32(step2[14], step2[13]);
- step1[15] = vaddq_s32(step2[15], step2[12]);
- // stage 6
- step2[0] = vaddq_s32(step1[0], step1[7]);
- step2[1] = vaddq_s32(step1[1], step1[6]);
- step2[2] = vaddq_s32(step1[2], step1[5]);
- step2[3] = vaddq_s32(step1[3], step1[4]);
- step2[4] = vsubq_s32(step1[3], step1[4]);
- step2[5] = vsubq_s32(step1[2], step1[5]);
- step2[6] = vsubq_s32(step1[1], step1[6]);
- step2[7] = vsubq_s32(step1[0], step1[7]);
- highbd_idct_cospi_16_16_d(step1[10], step1[13], cospi_0_8_16_24, &step2[10],
- &step2[13]);
- highbd_idct_cospi_16_16_d(step1[11], step1[12], cospi_0_8_16_24, &step2[11],
- &step2[12]);
- step2[8] = step1[8];
- step2[9] = step1[9];
- step2[14] = step1[14];
- step2[15] = step1[15];
- // stage 7
- highbd_idct16x16_add_stage7(step2, out);
- // pass 1: save the result into output
- vst1q_s32(output, out[0]);
- output += 4;
- vst1q_s32(output, out[1]);
- output += 4;
- vst1q_s32(output, out[2]);
- output += 4;
- vst1q_s32(output, out[3]);
- output += 4;
- vst1q_s32(output, out[4]);
- output += 4;
- vst1q_s32(output, out[5]);
- output += 4;
- vst1q_s32(output, out[6]);
- output += 4;
- vst1q_s32(output, out[7]);
- output += 4;
- vst1q_s32(output, out[8]);
- output += 4;
- vst1q_s32(output, out[9]);
- output += 4;
- vst1q_s32(output, out[10]);
- output += 4;
- vst1q_s32(output, out[11]);
- output += 4;
- vst1q_s32(output, out[12]);
- output += 4;
- vst1q_s32(output, out[13]);
- output += 4;
- vst1q_s32(output, out[14]);
- output += 4;
- vst1q_s32(output, out[15]);
- }
- static void highbd_idct16x16_10_add_half1d_pass2(const int32_t *input,
- int32_t *const output,
- uint16_t *const dest,
- const int stride,
- const int bd) {
- const int32x4_t cospi_0_8_16_24 = vld1q_s32(kCospi32 + 0);
- const int32x4_t cospi_4_12_20N_28 = vld1q_s32(kCospi32 + 4);
- const int32x4_t cospi_2_30_10_22 = vld1q_s32(kCospi32 + 8);
- const int32x4_t cospi_6_26N_14_18N = vld1q_s32(kCospi32 + 12);
- int32x4x2_t in[4], step1[16], step2[16], out[16];
- // Load input (4x8)
- in[0].val[0] = vld1q_s32(input);
- input += 4;
- in[0].val[1] = vld1q_s32(input);
- input += 4;
- in[1].val[0] = vld1q_s32(input);
- input += 4;
- in[1].val[1] = vld1q_s32(input);
- input += 4;
- in[2].val[0] = vld1q_s32(input);
- input += 4;
- in[2].val[1] = vld1q_s32(input);
- input += 4;
- in[3].val[0] = vld1q_s32(input);
- input += 4;
- in[3].val[1] = vld1q_s32(input);
- // Transpose
- transpose_s32_4x8(&in[0].val[0], &in[0].val[1], &in[1].val[0], &in[1].val[1],
- &in[2].val[0], &in[2].val[1], &in[3].val[0], &in[3].val[1]);
- // stage 1
- step1[0] = in[0 / 2];
- step1[4] = in[4 / 2];
- step1[8] = in[2 / 2];
- step1[12] = in[6 / 2];
- // stage 2
- step2[0] = step1[0];
- step2[4] = step1[4];
- step2[8] =
- highbd_idct_cospi_lane1_dual(step1[8], vget_low_s32(cospi_2_30_10_22));
- step2[11] =
- highbd_idct_cospi_lane1_dual(step1[12], vget_low_s32(cospi_6_26N_14_18N));
- step2[12] =
- highbd_idct_cospi_lane0_dual(step1[12], vget_low_s32(cospi_6_26N_14_18N));
- step2[15] =
- highbd_idct_cospi_lane0_dual(step1[8], vget_low_s32(cospi_2_30_10_22));
- // stage 3
- step1[0] = step2[0];
- step1[4] =
- highbd_idct_cospi_lane1_dual(step2[4], vget_high_s32(cospi_4_12_20N_28));
- step1[7] =
- highbd_idct_cospi_lane0_dual(step2[4], vget_low_s32(cospi_4_12_20N_28));
- step1[8] = step2[8];
- step1[9] = step2[8];
- step1[10] = step2[11];
- step1[11] = step2[11];
- step1[12] = step2[12];
- step1[13] = step2[12];
- step1[14] = step2[15];
- step1[15] = step2[15];
- // stage 4
- step2[0] = step2[1] =
- highbd_idct_cospi_lane0_dual(step1[0], vget_high_s32(cospi_0_8_16_24));
- step2[4] = step1[4];
- step2[5] = step1[4];
- step2[6] = step1[7];
- step2[7] = step1[7];
- step2[8] = step1[8];
- highbd_idct_cospi_8_24_q(step1[14], step1[9], cospi_0_8_16_24, &step2[9],
- &step2[14]);
- highbd_idct_cospi_8_24_neg_q(step1[13], step1[10], cospi_0_8_16_24,
- &step2[13], &step2[10]);
- step2[11] = step1[11];
- step2[12] = step1[12];
- step2[15] = step1[15];
- // stage 5
- step1[0] = step2[0];
- step1[1] = step2[1];
- step1[2] = step2[1];
- step1[3] = step2[0];
- step1[4] = step2[4];
- highbd_idct_cospi_16_16_q(step2[5], step2[6], cospi_0_8_16_24, &step1[5],
- &step1[6]);
- step1[7] = step2[7];
- step1[8] = highbd_idct_add_dual(step2[8], step2[11]);
- step1[9] = highbd_idct_add_dual(step2[9], step2[10]);
- step1[10] = highbd_idct_sub_dual(step2[9], step2[10]);
- step1[11] = highbd_idct_sub_dual(step2[8], step2[11]);
- step1[12] = highbd_idct_sub_dual(step2[15], step2[12]);
- step1[13] = highbd_idct_sub_dual(step2[14], step2[13]);
- step1[14] = highbd_idct_add_dual(step2[14], step2[13]);
- step1[15] = highbd_idct_add_dual(step2[15], step2[12]);
- // stage 6
- step2[0] = highbd_idct_add_dual(step1[0], step1[7]);
- step2[1] = highbd_idct_add_dual(step1[1], step1[6]);
- step2[2] = highbd_idct_add_dual(step1[2], step1[5]);
- step2[3] = highbd_idct_add_dual(step1[3], step1[4]);
- step2[4] = highbd_idct_sub_dual(step1[3], step1[4]);
- step2[5] = highbd_idct_sub_dual(step1[2], step1[5]);
- step2[6] = highbd_idct_sub_dual(step1[1], step1[6]);
- step2[7] = highbd_idct_sub_dual(step1[0], step1[7]);
- highbd_idct_cospi_16_16_q(step1[10], step1[13], cospi_0_8_16_24, &step2[10],
- &step2[13]);
- highbd_idct_cospi_16_16_q(step1[11], step1[12], cospi_0_8_16_24, &step2[11],
- &step2[12]);
- step2[8] = step1[8];
- step2[9] = step1[9];
- step2[14] = step1[14];
- step2[15] = step1[15];
- // stage 7
- highbd_idct16x16_add_stage7_dual(step2, out);
- if (output) {
- highbd_idct16x16_store_pass1(out, output);
- } else {
- highbd_idct16x16_add_store(out, dest, stride, bd);
- }
- }
- void vpx_highbd_idct16x16_256_add_neon(const tran_low_t *input, uint16_t *dest,
- int stride, int bd) {
- if (bd == 8) {
- int16_t row_idct_output[16 * 16];
- // pass 1
- // Parallel idct on the upper 8 rows
- vpx_idct16x16_256_add_half1d(input, row_idct_output, dest, stride, 1);
- // Parallel idct on the lower 8 rows
- vpx_idct16x16_256_add_half1d(input + 8 * 16, row_idct_output + 8, dest,
- stride, 1);
- // pass 2
- // Parallel idct to get the left 8 columns
- vpx_idct16x16_256_add_half1d(row_idct_output, NULL, dest, stride, 1);
- // Parallel idct to get the right 8 columns
- vpx_idct16x16_256_add_half1d(row_idct_output + 8 * 16, NULL, dest + 8,
- stride, 1);
- } else {
- int32_t row_idct_output[16 * 16];
- // pass 1
- // Parallel idct on the upper 8 rows
- vpx_highbd_idct16x16_256_add_half1d(input, row_idct_output, dest, stride,
- bd);
- // Parallel idct on the lower 8 rows
- vpx_highbd_idct16x16_256_add_half1d(input + 8 * 16, row_idct_output + 8,
- dest, stride, bd);
- // pass 2
- // Parallel idct to get the left 8 columns
- vpx_highbd_idct16x16_256_add_half1d(row_idct_output, NULL, dest, stride,
- bd);
- // Parallel idct to get the right 8 columns
- vpx_highbd_idct16x16_256_add_half1d(row_idct_output + 8 * 16, NULL,
- dest + 8, stride, bd);
- }
- }
- void vpx_highbd_idct16x16_38_add_neon(const tran_low_t *input, uint16_t *dest,
- int stride, int bd) {
- if (bd == 8) {
- int16_t row_idct_output[16 * 16];
- // pass 1
- // Parallel idct on the upper 8 rows
- vpx_idct16x16_38_add_half1d(input, row_idct_output, dest, stride, 1);
- // pass 2
- // Parallel idct to get the left 8 columns
- vpx_idct16x16_38_add_half1d(row_idct_output, NULL, dest, stride, 1);
- // Parallel idct to get the right 8 columns
- vpx_idct16x16_38_add_half1d(row_idct_output + 16 * 8, NULL, dest + 8,
- stride, 1);
- } else {
- int32_t row_idct_output[16 * 16];
- // pass 1
- // Parallel idct on the upper 8 rows
- vpx_highbd_idct16x16_38_add_half1d(input, row_idct_output, dest, stride,
- bd);
- // pass 2
- // Parallel idct to get the left 8 columns
- vpx_highbd_idct16x16_38_add_half1d(row_idct_output, NULL, dest, stride, bd);
- // Parallel idct to get the right 8 columns
- vpx_highbd_idct16x16_38_add_half1d(row_idct_output + 16 * 8, NULL, dest + 8,
- stride, bd);
- }
- }
- void vpx_highbd_idct16x16_10_add_neon(const tran_low_t *input, uint16_t *dest,
- int stride, int bd) {
- if (bd == 8) {
- int16_t row_idct_output[4 * 16];
- // pass 1
- // Parallel idct on the upper 8 rows
- vpx_idct16x16_10_add_half1d_pass1(input, row_idct_output);
- // pass 2
- // Parallel idct to get the left 8 columns
- vpx_idct16x16_10_add_half1d_pass2(row_idct_output, NULL, dest, stride, 1);
- // Parallel idct to get the right 8 columns
- vpx_idct16x16_10_add_half1d_pass2(row_idct_output + 4 * 8, NULL, dest + 8,
- stride, 1);
- } else {
- int32_t row_idct_output[4 * 16];
- // pass 1
- // Parallel idct on the upper 8 rows
- highbd_idct16x16_10_add_half1d_pass1(input, row_idct_output);
- // pass 2
- // Parallel idct to get the left 8 columns
- highbd_idct16x16_10_add_half1d_pass2(row_idct_output, NULL, dest, stride,
- bd);
- // Parallel idct to get the right 8 columns
- highbd_idct16x16_10_add_half1d_pass2(row_idct_output + 4 * 8, NULL,
- dest + 8, stride, bd);
- }
- }
- static INLINE void highbd_idct16x16_1_add_pos_kernel(uint16_t **dest,
- const int stride,
- const int16x8_t res,
- const int16x8_t max) {
- const uint16x8_t a0 = vld1q_u16(*dest + 0);
- const uint16x8_t a1 = vld1q_u16(*dest + 8);
- const int16x8_t b0 = vaddq_s16(res, vreinterpretq_s16_u16(a0));
- const int16x8_t b1 = vaddq_s16(res, vreinterpretq_s16_u16(a1));
- const int16x8_t c0 = vminq_s16(b0, max);
- const int16x8_t c1 = vminq_s16(b1, max);
- vst1q_u16(*dest + 0, vreinterpretq_u16_s16(c0));
- vst1q_u16(*dest + 8, vreinterpretq_u16_s16(c1));
- *dest += stride;
- }
- static INLINE void highbd_idct16x16_1_add_neg_kernel(uint16_t **dest,
- const int stride,
- const int16x8_t res) {
- const uint16x8_t a0 = vld1q_u16(*dest + 0);
- const uint16x8_t a1 = vld1q_u16(*dest + 8);
- const int16x8_t b0 = vaddq_s16(res, vreinterpretq_s16_u16(a0));
- const int16x8_t b1 = vaddq_s16(res, vreinterpretq_s16_u16(a1));
- const uint16x8_t c0 = vqshluq_n_s16(b0, 0);
- const uint16x8_t c1 = vqshluq_n_s16(b1, 0);
- vst1q_u16(*dest + 0, c0);
- vst1q_u16(*dest + 8, c1);
- *dest += stride;
- }
- void vpx_highbd_idct16x16_1_add_neon(const tran_low_t *input, uint16_t *dest,
- int stride, int bd) {
- const tran_low_t out0 = HIGHBD_WRAPLOW(
- dct_const_round_shift(input[0] * (tran_high_t)cospi_16_64), bd);
- const tran_low_t out1 = HIGHBD_WRAPLOW(
- dct_const_round_shift(out0 * (tran_high_t)cospi_16_64), bd);
- const int16_t a1 = ROUND_POWER_OF_TWO(out1, 6);
- const int16x8_t dc = vdupq_n_s16(a1);
- int i;
- if (a1 >= 0) {
- const int16x8_t max = vdupq_n_s16((1 << bd) - 1);
- for (i = 0; i < 4; ++i) {
- highbd_idct16x16_1_add_pos_kernel(&dest, stride, dc, max);
- highbd_idct16x16_1_add_pos_kernel(&dest, stride, dc, max);
- highbd_idct16x16_1_add_pos_kernel(&dest, stride, dc, max);
- highbd_idct16x16_1_add_pos_kernel(&dest, stride, dc, max);
- }
- } else {
- for (i = 0; i < 4; ++i) {
- highbd_idct16x16_1_add_neg_kernel(&dest, stride, dc);
- highbd_idct16x16_1_add_neg_kernel(&dest, stride, dc);
- highbd_idct16x16_1_add_neg_kernel(&dest, stride, dc);
- highbd_idct16x16_1_add_neg_kernel(&dest, stride, dc);
- }
- }
- }
|