50 return value + (value >> 10);
60 int buf_size = avpkt->
size;
67 int magic_num, endian;
69 int w, h,
stride, bits_per_color, descriptor, elements, target_packet_size, source_packet_size;
71 unsigned int rgbBuffer;
73 if (avpkt->
size <= 1634) {
83 if (magic_num ==
AV_RL32(
"SDPX")) {
85 }
else if (magic_num ==
AV_RB32(
"SDPX")) {
92 offset =
read32(&buf, endian);
93 if (avpkt->
size <= offset) {
98 buf = avpkt->
data + 0x304;
109 bits_per_color = buf[0];
115 switch (descriptor) {
127 switch (bits_per_color) {
134 source_packet_size = elements;
135 target_packet_size = elements;
139 target_packet_size = 6;
140 source_packet_size = 4;
149 target_packet_size = 6;
150 source_packet_size = elements * 2;
169 buf = avpkt->
data + offset;
174 if (source_packet_size*avctx->
width*avctx->
height > buf_end - buf) {
178 switch (bits_per_color) {
180 for (x = 0; x < avctx->
height; x++) {
181 uint16_t *dst = (uint16_t*)ptr;
182 for (y = 0; y < avctx->
width; y++) {
183 rgbBuffer =
read32(&buf, endian);
195 if (source_packet_size == target_packet_size) {
196 for (x = 0; x < avctx->
height; x++) {
197 memcpy(ptr, buf, target_packet_size*avctx->
width);
199 buf += source_packet_size*avctx->
width;
202 for (x = 0; x < avctx->
height; x++) {
204 for (y = 0; y < avctx->
width; y++) {
205 memcpy(dst, buf, target_packet_size);
206 dst += target_packet_size;
207 buf += source_packet_size;
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
This structure describes decoded (raw) audio or video data.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
packed RGB 8:8:8, 24bpp, RGBRGB...
AVFrame * coded_frame
the picture in the bitstream
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int decode_end(AVCodecContext *avctx)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
static unsigned int read32(const uint8_t **ptr, int is_big)
static int init(AVCodecParserContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
struct DPXContext DPXContext
static unsigned make_16bit(unsigned value)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
int width
picture width / height.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
Get a buffer for a frame.
static av_cold int decode_init(AVCodecContext *avctx)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
#define AVERROR_INVALIDDATA
This structure stores compressed data.