31 int with_pal_size, contains_pal,
size,
stride, padding, y;
34 if (par->
height <= 0 || min_stride <= 0 || expected_stride <= 0 ||
35 min_stride > (INT_MAX - 1024) / par->
height ||
39 with_pal_size = min_stride * par->
height + 1024;
40 contains_pal = bpc == 8 &&
pkt->
size == with_pal_size;
43 padding = expected_stride -
FFMIN(expected_stride,
stride);
62 for (y = 0; y<par->
height; y++) {
64 memset(new_pkt->
data + y*expected_stride + expected_stride - padding, 0, padding);
68 return 1 + contains_pal;
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
common internal API header
int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecParameters *par, int expected_stride)
Reshuffles the lines to use the user specified stride.
This struct describes the properties of an encoded stream.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
This structure stores compressed data.