33 int buf_size = avpkt->
size;
36 int i, j, n, linesize, h, upgrade = 0;
38 int components, sample_len, ret;
84 n = (avctx->
width + 7) >> 3;
93 for (i=0; i<avctx->
height; i++) {
96 for(j=0; j<avctx->
width * components; j++){
113 for (i = 0; i < avctx->
height; i++) {
116 else if (upgrade == 1) {
117 unsigned int j, f = (255 * 128 + s->
maxval / 2) / s->
maxval;
118 for (j = 0; j < n; j++)
120 }
else if (upgrade == 2) {
121 unsigned int j, v, f = (65535 * 32768 + s->
maxval / 2) / s->
maxval;
122 for (j = 0; j < n / 2; j++) {
124 ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
136 unsigned char *ptr1, *ptr2;
145 for (i = 0; i < avctx->
height; i++) {
154 for (i = 0; i < h; i++) {
166 uint16_t *ptr1, *ptr2;
167 const int f = (65535 * 32768 + s->
maxval / 2) / s->
maxval;
170 n = avctx->
width * 2;
175 for (i = 0; i < avctx->
height; i++) {
176 for (j = 0; j < n / 2; j++) {
178 ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
183 ptr1 = (uint16_t*)p->
data[1];
184 ptr2 = (uint16_t*)p->
data[2];
187 for (i = 0; i < h; i++) {
188 for (j = 0; j < n / 2; j++) {
190 ptr1[j] = (v * f + 16384) >> 15;
194 for (j = 0; j < n / 2; j++) {
196 ptr2[j] = (v * f + 16384) >> 15;
210 for (i = 0; i < avctx->
height; i++) {
213 for (j = 0; j < avctx->
width; j++) {
218 ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b;
230 #if CONFIG_PGM_DECODER
242 #if CONFIG_PGMYUV_DECODER
254 #if CONFIG_PPM_DECODER
266 #if CONFIG_PBM_DECODER
278 #if CONFIG_PAM_DECODER
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
packed RGB 8:8:8, 24bpp, RGBRGB...
int maxval
maximum value of a pixel
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
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 big...
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
Libavcodec external API header.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
if(ac->has_optimized_func)
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext *const s)
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
static int pnm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
uint8_t * bytestream_start
Y , 16bpp, little-endian.
#define AV_PIX_FMT_YUV420P16
int key_frame
1 -> keyframe, 0-> not
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.