~ppsspp/ppsspp/ffmpeg

« back to all changes in this revision

Viewing changes to libavcodec/sgienc.c

  • Committer: Henrik Rydgård
  • Date: 2014-01-03 10:44:32 UTC
  • Revision ID: git-v1:87c6c126784b1718bfa448ecf2e6a9fef781eb4e
Update our ffmpeg snapshot to a clone of the official repository.

This is because Maxim's at3plus support has been officially merged!

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        av_log(avctx, AV_LOG_ERROR, "SGI does not support resolutions above 65535x65535\n");
35
35
        return -1;
36
36
    }
 
37
    avctx->coded_frame = av_frame_alloc();
 
38
    if (!avctx->coded_frame)
 
39
        return AVERROR(ENOMEM);
37
40
 
38
41
    return 0;
39
42
}
41
44
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
42
45
                        const AVFrame *frame, int *got_packet)
43
46
{
44
 
    AVFrame * const p = (AVFrame *)frame;
 
47
    const AVFrame * const p = frame;
45
48
    uint8_t *offsettab, *lengthtab, *in_buf, *encode_buf, *buf;
46
49
    int x, y, z, length, tablesize, ret;
47
50
    unsigned int width, height, depth, dimension, bytes_per_channel, pixmax, put_be;
48
51
    unsigned char *end_buf;
49
52
 
50
 
    p->pict_type = AV_PICTURE_TYPE_I;
51
 
    p->key_frame = 1;
 
53
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 
54
    avctx->coded_frame->key_frame = 1;
52
55
 
53
56
    width  = avctx->width;
54
57
    height = avctx->height;
199
202
    return 0;
200
203
}
201
204
 
 
205
static av_cold int encode_close(AVCodecContext *avctx)
 
206
{
 
207
    av_frame_free(&avctx->coded_frame);
 
208
    return 0;
 
209
}
 
210
 
202
211
AVCodec ff_sgi_encoder = {
203
212
    .name           = "sgi",
204
213
    .long_name      = NULL_IF_CONFIG_SMALL("SGI image"),
206
215
    .id             = AV_CODEC_ID_SGI,
207
216
    .init           = encode_init,
208
217
    .encode2        = encode_frame,
 
218
    .close          = encode_close,
209
219
    .pix_fmts       = (const enum AVPixelFormat[]){
210
220
        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
211
221
        AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE,