////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2016-2017,2019-2021 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file camxjpegproperty.h
/// @brief Define Qualcomm Technologies, Inc. JPEG proprietary data for holding internal properties/events
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CAMXJPEGPROPERTY_H
#define CAMXJPEGPROPERTY_H

#include "camxdefs.h"

CAMX_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Describes Common JPEG data structures
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#define MAX_OUTPUT_BUF 30

/// @brief Structure JPEG encoder output buffer offsets Info
struct JpegDestBuffInfo
{
    uintptr_t bsBuffOffsets[MAX_OUTPUT_BUF]; ///< Encoded chunk offsets
    uint32_t  bsBuffSizes[MAX_OUTPUT_BUF];   ///< Encoded chunk sizes
    uint32_t  nBsBuff;                       ///< No of encoded chunks
};

/// @brief JPEG Encoder orientation type
enum class JPEGEncRotationType
{
    JPEGE0          = 0,            ///< Rotation angle 0
    JPEGE90         = 90,           ///< Rotation angle 90
    JPEGE180        = 180,          ///< Rotation angle 180
    JPEGE270        = 270,          ///< Rotation angle 270
    JPEGENOROTATION = 0xFFFF,       ///< Rotation not handled by JPEG Encoder
};

/// @brief Structure JPEG encoder output Info
struct EncoderOutInfo
{
    INT32               bufferFilledSize; ///< size filled by JPEG encoder
    UINT16              restartInterval;  ///< restart marker interval (filled by JPEG SW encoder only)
    JPEGEncRotationType rotationAngle;    ///< Angle of rotation passed to JPEGSW
    JpegDestBuffInfo    imgOffsetsInfo;   ///< JPEGSW encoder output buffer offsets Info
    UINT32              width;            ///< JPEG output width
    UINT32              height;           ///< JPEG output height
};

/// @brief Structure JPEG DMA output Info
struct DMAOutInfo
{
    UINT32 width;    ///< Thumbnail width
    UINT32 height;   ///< Thumbnail height
    UINT32 stride;   ///< Thumbnail stride
    UINT32 scanline; ///< Thumbnail scanline
};
CAMX_NAMESPACE_END

#endif // CAMXJPEGPROPERTY_H
