1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-07-11 14:30:22 +02:00

eatgv: cosmetics, reformat

This commit is contained in:
Anton Khirnov
2012-11-21 14:52:54 +01:00
parent ade402804a
commit 4b7598e2fe

View File

@ -50,7 +50,8 @@ typedef struct TgvContext {
int num_blocks_packed; ///< current length of block_codebook int num_blocks_packed; ///< current length of block_codebook
} TgvContext; } TgvContext;
static av_cold int tgv_decode_init(AVCodecContext *avctx){ static av_cold int tgv_decode_init(AVCodecContext *avctx)
{
TgvContext *s = avctx->priv_data; TgvContext *s = avctx->priv_data;
s->avctx = avctx; s->avctx = avctx;
avctx->time_base = (AVRational){1, 15}; avctx->time_base = (AVRational){1, 15};
@ -62,7 +63,9 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx){
* Unpack buffer * Unpack buffer
* @return 0 on success, -1 on critical buffer underflow * @return 0 on success, -1 on critical buffer underflow
*/ */
static int unpack(const uint8_t *src, const uint8_t *src_end, unsigned char *dst, int width, int height) { static int unpack(const uint8_t *src, const uint8_t *src_end,
unsigned char *dst, int width, int height)
{
unsigned char *dst_end = dst + width*height; unsigned char *dst_end = dst + width*height;
int size, size1, size2, offset, run; int size, size1, size2, offset, run;
unsigned char *dst_start = dst; unsigned char *dst_start = dst;
@ -135,7 +138,9 @@ static int unpack(const uint8_t *src, const uint8_t *src_end, unsigned char *dst
* Decode inter-frame * Decode inter-frame
* @return 0 on success, -1 on critical buffer underflow * @return 0 on success, -1 on critical buffer underflow
*/ */
static int tgv_decode_inter(TgvContext * s, const uint8_t *buf, const uint8_t *buf_end){ static int tgv_decode_inter(TgvContext *s, const uint8_t *buf,
const uint8_t *buf_end)
{
int num_mvs; int num_mvs;
int num_blocks_raw; int num_blocks_raw;
int num_blocks_packed; int num_blocks_packed;
@ -213,8 +218,8 @@ static int tgv_decode_inter(TgvContext * s, const uint8_t *buf, const uint8_t *b
int mx = x * 4 + s->mv_codebook[vector][0]; int mx = x * 4 + s->mv_codebook[vector][0];
int my = y * 4 + s->mv_codebook[vector][1]; int my = y * 4 + s->mv_codebook[vector][1];
if ( mx < 0 || mx + 4 > s->avctx->width if (mx < 0 || mx + 4 > s->avctx->width ||
|| my < 0 || my + 4 > s->avctx->height) my < 0 || my + 4 > s->avctx->height)
continue; continue;
src = s->last_frame.data[0] + mx + my * s->last_frame.linesize[0]; src = s->last_frame.data[0] + mx + my * s->last_frame.linesize[0];