Lines Matching +full:10918 +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0+
6 * Copyright (C) Jean-Francois Moine (http://moinejf.free.fr)
27 /* Default tables from JPEG ITU-T.81
28 * (ISO/IEC 10918-1) Annex K, tables K.1 and K.2
53 0, 1, 8, 16, 9, 2, 3, 10,
64 0, 8, 16, 24, 1, 9, 17, 25,
141 /* For simplicity, we keep a pre-formatted JPEG header,
149 /* JFIF-APP0 */
268 * of the SOS segment (the entropy-encoded image scan), which should
269 * trail the whole header, is 8-byte aligned for the hardware to write
273 "Hantro JPEG header size needs to be 8-byte aligned.");
281 temp = 1; in jpeg_scale_qp()
309 * Non-linear scaling factor: in jpeg_set_quality()
310 * [5,50] -> [1000..100], [51,100] -> [98..0] in jpeg_set_quality()
312 if (ctx->quality < 50) in jpeg_set_quality()
313 scale = 5000 / ctx->quality; in jpeg_set_quality()
315 scale = 200 - 2 * ctx->quality; in jpeg_set_quality()
319 BUILD_BUG_ON(ARRAY_SIZE(ctx->hw_luma_qtable) != JPEG_QUANT_SIZE); in jpeg_set_quality()
320 BUILD_BUG_ON(ARRAY_SIZE(ctx->hw_chroma_qtable) != JPEG_QUANT_SIZE); in jpeg_set_quality()
322 jpeg_scale_quant_table(ctx->buffer + LUMA_QUANT_OFF, in jpeg_set_quality()
323 ctx->hw_luma_qtable, luma_q_table, scale); in jpeg_set_quality()
324 jpeg_scale_quant_table(ctx->buffer + CHROMA_QUANT_OFF, in jpeg_set_quality()
325 ctx->hw_chroma_qtable, chroma_q_table, scale); in jpeg_set_quality()
330 char *buf = ctx->buffer; in hantro_jpeg_header_assemble()
335 buf[HEIGHT_OFF + 0] = ctx->height >> 8; in hantro_jpeg_header_assemble()
336 buf[HEIGHT_OFF + 1] = ctx->height; in hantro_jpeg_header_assemble()
337 buf[WIDTH_OFF + 0] = ctx->width >> 8; in hantro_jpeg_header_assemble()
338 buf[WIDTH_OFF + 1] = ctx->width; in hantro_jpeg_header_assemble()