#include "libyuv/mjpeg_decoder.h"
#ifdef HAVE_JPEG
#include <assert.h>
#if !defined(__pnacl__) && !defined(__CLR_VER) && !defined(COVERAGE_ENABLED)
#include <setjmp.h>
#define HAVE_SETJMP
#if defined(_MSC_VER)
#pragma warning(disable : 4324)
#endif
#endif
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <jpeglib.h>
#ifdef __cplusplus
}
#endif
#include "libyuv/planar_functions.h"
namespace libyuv {
#ifdef HAVE_SETJMP
struct SetJmpErrorMgr { … };
#endif
const int MJpegDecoder::kColorSpaceUnknown = …;
const int MJpegDecoder::kColorSpaceGrayscale = …;
const int MJpegDecoder::kColorSpaceRgb = …;
const int MJpegDecoder::kColorSpaceYCbCr = …;
const int MJpegDecoder::kColorSpaceCMYK = …;
const int MJpegDecoder::kColorSpaceYCCK = …;
boolean fill_input_buffer(jpeg_decompress_struct* cinfo);
void init_source(jpeg_decompress_struct* cinfo);
void skip_input_data(jpeg_decompress_struct* cinfo, long num_bytes);
void term_source(jpeg_decompress_struct* cinfo);
void ErrorHandler(jpeg_common_struct* cinfo);
void OutputHandler(jpeg_common_struct* cinfo);
MJpegDecoder::MJpegDecoder()
: … { … }
MJpegDecoder::~MJpegDecoder() { … }
LIBYUV_BOOL MJpegDecoder::LoadFrame(const uint8_t* src, size_t src_len) { … }
static int DivideAndRoundUp(int numerator, int denominator) { … }
static int DivideAndRoundDown(int numerator, int denominator) { … }
int MJpegDecoder::GetWidth() { … }
int MJpegDecoder::GetHeight() { … }
int MJpegDecoder::GetColorSpace() { … }
int MJpegDecoder::GetNumComponents() { … }
int MJpegDecoder::GetHorizSampFactor(int component) { … }
int MJpegDecoder::GetVertSampFactor(int component) { … }
int MJpegDecoder::GetHorizSubSampFactor(int component) { … }
int MJpegDecoder::GetVertSubSampFactor(int component) { … }
int MJpegDecoder::GetImageScanlinesPerImcuRow() { … }
int MJpegDecoder::GetComponentScanlinesPerImcuRow(int component) { … }
int MJpegDecoder::GetComponentWidth(int component) { … }
int MJpegDecoder::GetComponentHeight(int component) { … }
int MJpegDecoder::GetComponentStride(int component) { … }
int MJpegDecoder::GetComponentSize(int component) { … }
LIBYUV_BOOL MJpegDecoder::UnloadFrame() { … }
LIBYUV_BOOL MJpegDecoder::DecodeToBuffers(uint8_t** planes,
int dst_width,
int dst_height) { … }
LIBYUV_BOOL MJpegDecoder::DecodeToCallback(CallbackFunction fn,
void* opaque,
int dst_width,
int dst_height) { … }
void init_source(j_decompress_ptr cinfo) { … }
boolean fill_input_buffer(j_decompress_ptr cinfo) { … }
void skip_input_data(j_decompress_ptr cinfo, long num_bytes) { … }
void term_source(j_decompress_ptr cinfo) { … }
#ifdef HAVE_SETJMP
void ErrorHandler(j_common_ptr cinfo) { … }
void OutputHandler(j_common_ptr cinfo) { … }
#endif
void MJpegDecoder::AllocOutputBuffers(int num_outbufs) { … }
void MJpegDecoder::DestroyOutputBuffers() { … }
LIBYUV_BOOL MJpegDecoder::StartDecode() { … }
LIBYUV_BOOL MJpegDecoder::FinishDecode() { … }
void MJpegDecoder::SetScanlinePointers(uint8_t** data) { … }
inline LIBYUV_BOOL MJpegDecoder::DecodeImcuRow() { … }
JpegSubsamplingType MJpegDecoder::JpegSubsamplingTypeHelper(
int* subsample_x,
int* subsample_y,
int number_of_components) { … }
}
#endif