/* * jquanti-neon.c - sample data conversion and quantization (Arm Neon) * * Copyright (C) 2020-2021, Arm Limited. All Rights Reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution.
*/
/* After downsampling, the resulting sample values are in the range [0, 255], * but the Discrete Cosine Transform (DCT) operates on values centered around * 0. * * To prepare sample values for the DCT, load samples into a DCT workspace, * subtracting CENTERJSAMPLE (128). The samples, now in the range [-128, 127], * are also widened from 8- to 16-bit. * * The equivalent scalar C function convsamp() can be found in jcdctmgr.c.
*/
/* After the DCT, the resulting array of coefficient values needs to be divided * by an array of quantization values. * * To avoid a slow division operation, the DCT coefficients are multiplied by * the (scaled) reciprocals of the quantization values and then right-shifted. * * The equivalent scalar C function quantize() can be found in jcdctmgr.c.
*/
/* Since VSHR only supports an immediate as its second argument, negate the * shift value and shift left.
*/
row0 = vreinterpretq_s16_u16(vshlq_u16(vreinterpretq_u16_s16(row0),
vnegq_s16(shift0)));
row1 = vreinterpretq_s16_u16(vshlq_u16(vreinterpretq_u16_s16(row1),
vnegq_s16(shift1)));
row2 = vreinterpretq_s16_u16(vshlq_u16(vreinterpretq_u16_s16(row2),
vnegq_s16(shift2)));
row3 = vreinterpretq_s16_u16(vshlq_u16(vreinterpretq_u16_s16(row3),
vnegq_s16(shift3)));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.