38 const uint8_t *buf,
int buf_size)
45 if (buf_size < 8 ||
AV_RL32(buf) !=
MKTAG(
'I',
'I',
'U', 0))
49 if (ifd < 8 || ifd + 2 > buf_size)
53 int n =
FFMIN(
AV_RL16(buf + ifd), (buf_size - ifd - 2) / 12);
54 for (
int i = 0;
i < n;
i++) {
55 const uint8_t *e = buf + ifd + 2 + 12*
i;
60 case 0x02:
width = v;
break;
61 case 0x03:
height = v;
break;
62 case 0x09: cfa = v;
break;
63 case 0x0A: bpp = v;
break;
67 if (
width > 0 &&
height > 0 && cfa >= 1 && cfa <= 4) {
70 s->format = cfa_fmts[cfa - 1];
72 if (bpp >= 8 && bpp <= 16)
78 const uint8_t **poutbuf,
int *poutbuf_size,
79 const uint8_t *buf,
int buf_size)
90 if (buf_size >= 8 &&
AV_RL32(buf) ==
MKTAG(
'I',
'I',
'U', 0))
96 for (
int i = 0;
i < buf_size;
i++) {
117 *poutbuf_size = buf_size;
static double val(void *priv, double ch)
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static av_cold void close(AVCodecParserContext *s)
#define PARSER_FLAG_COMPLETE_FRAMES
#define i(width, name, range_min, range_max)
common internal and external API header
static struct @346255127015250356166251341105367306144006377143 state
@ AV_PICTURE_TYPE_I
Intra.
#define MKTAG(a, b, c, d)
#define MKBETAG(a, b, c, d)
av_cold void ff_parse_close(AVCodecParserContext *s)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define PARSER_CODEC_LIST(...)
const FFCodecParser ff_rw2_parser
#define AV_PIX_FMT_BAYER_GRBG16
#define AV_PIX_FMT_BAYER_BGGR16
#define AV_PIX_FMT_BAYER_RGGB16
AVPixelFormat
Pixel format.
#define AV_PIX_FMT_BAYER_GBRG16
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
static int rw2_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static void rw2_set_params(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
main external API structure.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
uint32_t state
contains the last few bytes in MSB order