linux/drivers/media/platform/verisilicon/hantro_jpeg.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) Collabora, Ltd.
 *
 * Based on GSPCA and CODA drivers:
 * Copyright (C) Jean-Francois Moine (http://moinejf.free.fr)
 * Copyright (C) 2014 Philipp Zabel, Pengutronix
 */

#include <linux/align.h>
#include <linux/build_bug.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <media/v4l2-jpeg.h>
#include "hantro_jpeg.h"
#include "hantro.h"

#define LUMA_QUANT_OFF
#define CHROMA_QUANT_OFF
#define HEIGHT_OFF
#define WIDTH_OFF

#define HUFF_LUMA_DC_OFF
#define HUFF_LUMA_AC_OFF
#define HUFF_CHROMA_DC_OFF
#define HUFF_CHROMA_AC_OFF

static const u32 hw_reorder[] =;

/* For simplicity, we keep a pre-formatted JPEG header,
 * and we'll use fixed offsets to change the width, height
 * quantization tables, etc.
 */
static const unsigned char hantro_jpeg_header[] =;

/*
 * JPEG_HEADER_SIZE is used in other parts of the driver in lieu of
 * "sizeof(hantro_jpeg_header)". The two must be equal.
 */
static_assert();

/*
 * hantro_jpeg_header is padded with a COM segment, so that the payload
 * of the SOS segment (the entropy-encoded image scan), which should
 * trail the whole header, is 8-byte aligned for the hardware to write
 * to directly.
 */
static_assert();

static unsigned char jpeg_scale_qp(const unsigned char qp, int scale)
{}

static void
jpeg_scale_quant_table(unsigned char *file_q_tab,
		       unsigned char *reordered_q_tab,
		       const unsigned char *tab, int scale)
{}

static void jpeg_set_quality(struct hantro_jpeg_ctx *ctx)
{}

void hantro_jpeg_header_assemble(struct hantro_jpeg_ctx *ctx)
{}