30 if (avctx->
width & 1) {
49 const AVFrame *pic,
int *got_packet)
51 int aligned_width = ((avctx->
width + 47) / 48) * 48;
52 int stride = aligned_width * 8 / 3;
53 int line_padding = stride - ((avctx->
width * 8 + 11) / 12) * 4;
55 const uint16_t *
y = (
const uint16_t*)pic->
data[0];
56 const uint16_t *
u = (
const uint16_t*)pic->
data[1];
57 const uint16_t *
v = (
const uint16_t*)pic->
data[2];
65 #define CLIP(v) av_clip(v, 4, 1019)
67 #define WRITE_PIXELS(a, b, c) \
70 val |= (CLIP(*b++) << 10) | \
72 bytestream2_put_le32u(&p, val); \
75 for (h = 0; h < avctx->
height; h++) {
77 for (w = 0; w < avctx->
width - 5; w += 6) {
83 if (w < avctx->
width - 1) {
87 if (w == avctx->
width - 2)
88 bytestream2_put_le32u(&p, val);
89 if (w < avctx->
width - 3) {
90 val |= (
CLIP(*
u++) << 10) | (
CLIP(*y++) << 20);
91 bytestream2_put_le32u(&p, val);
93 val =
CLIP(*v++) | (
CLIP(*y++) << 10);
94 bytestream2_put_le32u(&p, val);
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
const char const char void * val
static av_always_inline void bytestream2_set_buffer(PutByteContext *p, const uint8_t c, unsigned int size)
This structure describes decoded (raw) audio or video data.
#define AV_LOG_WARNING
Something somehow does not look correct.
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
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...
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
if((e=av_dict_get(options,"", NULL, AV_DICT_IGNORE_SUFFIX)))
#define WRITE_PIXELS(a, b, c)
const char * name
Name of the codec implementation.
static av_cold int encode_init(AVCodecContext *avctx)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#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. ...
Libavcodec external API header.
AVPixelFormat
Pixel format.
int flags
A combination of AV_PKT_FLAG values.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
static av_cold int encode_close(AVCodecContext *avctx)
int AC3_NAME() encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
main external API structure.
AVFrame * coded_frame
the picture in the bitstream
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
common internal api header.
#define AV_PIX_FMT_YUV422P10
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.