prettyprinting cosmetics
Originally committed as revision 19767 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
bbb0bdd533
commit
d87d5025aa
@ -32,15 +32,16 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
|
if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
avctx->pix_fmt = PIX_FMT_YUV422P16;
|
avctx->pix_fmt = PIX_FMT_YUV422P16;
|
||||||
avctx->bits_per_raw_sample = 10;
|
avctx->bits_per_raw_sample = 10;
|
||||||
|
|
||||||
avctx->coded_frame = avcodec_alloc_frame();
|
avctx->coded_frame = avcodec_alloc_frame();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
|
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||||
|
AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
int h, w;
|
int h, w;
|
||||||
AVFrame *pic = avctx->coded_frame;
|
AVFrame *pic = avctx->coded_frame;
|
||||||
@ -67,9 +68,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
|||||||
pic->pict_type = FF_I_TYPE;
|
pic->pict_type = FF_I_TYPE;
|
||||||
pic->key_frame = 1;
|
pic->key_frame = 1;
|
||||||
|
|
||||||
#define READ_PIXELS(a, b, c) \
|
#define READ_PIXELS(a, b, c) \
|
||||||
do { \
|
do { \
|
||||||
val = le2me_32(*src++); \
|
val = le2me_32(*src++); \
|
||||||
*a++ = val << 6; \
|
*a++ = val << 6; \
|
||||||
*b++ = (val >> 4) & 0xFFC0; \
|
*b++ = (val >> 4) & 0xFFC0; \
|
||||||
*c++ = (val >> 14) & 0xFFC0; \
|
*c++ = (val >> 14) & 0xFFC0; \
|
||||||
@ -100,9 +101,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
|||||||
}
|
}
|
||||||
|
|
||||||
psrc += stride;
|
psrc += stride;
|
||||||
y += pic->linesize[0]/2 - avctx->width;
|
y += pic->linesize[0] / 2 - avctx->width;
|
||||||
u += pic->linesize[1]/2 - avctx->width/2;
|
u += pic->linesize[1] / 2 - avctx->width / 2;
|
||||||
v += pic->linesize[2]/2 - avctx->width/2;
|
v += pic->linesize[2] / 2 - avctx->width / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
*data_size = sizeof(AVFrame);
|
*data_size = sizeof(AVFrame);
|
||||||
|
@ -48,7 +48,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
|
static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
|
||||||
|
int buf_size, void *data)
|
||||||
{
|
{
|
||||||
const AVFrame *pic = data;
|
const AVFrame *pic = data;
|
||||||
int aligned_width = ((avctx->width + 47) / 48) * 48;
|
int aligned_width = ((avctx->width + 47) / 48) * 48;
|
||||||
@ -101,9 +102,9 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
|
|||||||
pdst += stride;
|
pdst += stride;
|
||||||
memset(p, 0, pdst - p);
|
memset(p, 0, pdst - p);
|
||||||
p = pdst;
|
p = pdst;
|
||||||
y += pic->linesize[0]/2 - avctx->width;
|
y += pic->linesize[0] / 2 - avctx->width;
|
||||||
u += pic->linesize[1]/2 - avctx->width/2;
|
u += pic->linesize[1] / 2 - avctx->width / 2;
|
||||||
v += pic->linesize[2]/2 - avctx->width/2;
|
v += pic->linesize[2] / 2 - avctx->width / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return p - buf;
|
return p - buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user