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];
67 #define CLIP(v) av_clip(v, 4, 1019) 69 #define WRITE_PIXELS(a, b, c) \ 72 val |= (CLIP(*b++) << 10) | \ 74 bytestream2_put_le32u(&p, val); \ 77 for (h = 0; h < avctx->
height; h++) {
79 for (w = 0; w < avctx->
width - 5; w += 6) {
85 if (w < avctx->
width - 1) {
89 if (w == avctx->
width - 2)
90 bytestream2_put_le32u(&p, val);
92 if (w < avctx->
width - 3) {
93 val |= (
CLIP(*u++) << 10) | (
CLIP(*y++) << 20);
94 bytestream2_put_le32u(&p, val);
96 val =
CLIP(*v++) | (
CLIP(*y++) << 10);
97 bytestream2_put_le32u(&p, 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 * coded_frame
the picture in the bitstream
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define WRITE_PIXELS(a, b, c)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
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. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
int flags
A combination of AV_PKT_FLAG values.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
static av_cold int encode_close(AVCodecContext *avctx)
if(ac->has_optimized_func)
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
main external API structure.
#define AV_PIX_FMT_YUV422P10
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
AVPixelFormat
Pixel format.
This structure stores compressed data.