Revision 616deed2 libavcodec/libxvidff.c

View differences:

libavcodec/libxvidff.c
44 44
 * Structure for the private Xvid context.
45 45
 * This stores all the private context for the codec.
46 46
 */
47
typedef struct xvid_context {
47
struct xvid_context {
48 48
    void *encoder_handle;          /** Handle for Xvid encoder */
49 49
    int xsize, ysize;              /** Frame size */
50 50
    int vop_flags;                 /** VOP flags for Xvid encoder */
......
58 58
    char *twopassfile;             /** second pass temp file name */
59 59
    unsigned char *intra_matrix;   /** P-Frame Quant Matrix */
60 60
    unsigned char *inter_matrix;   /** I-Frame Quant Matrix */
61
} xvid_context_t;
61
};
62 62

  
63 63
/**
64 64
 * Structure for the private first-pass plugin.
65 65
 */
66
typedef struct xvid_ff_pass1 {
66
struct xvid_ff_pass1 {
67 67
    int     version;                /** Xvid version */
68
    xvid_context_t *context;        /** Pointer to private context */
69
} xvid_ff_pass1_t;
68
    struct xvid_context *context;        /** Pointer to private context */
69
};
70 70

  
71 71
/* Prototypes - See function implementation for details */
72 72
int xvid_strip_vol_header(AVCodecContext *avctx, unsigned char *frame, unsigned int header_len, unsigned int frame_len);
......
84 84
av_cold int ff_xvid_encode_init(AVCodecContext *avctx)  {
85 85
    int xerr, i;
86 86
    int xvid_flags = avctx->flags;
87
    xvid_context_t *x = avctx->priv_data;
87
    struct xvid_context *x = avctx->priv_data;
88 88
    uint16_t *intra, *inter;
89 89
    int fd;
90 90

  
91 91
    xvid_plugin_single_t single;
92
    xvid_ff_pass1_t rc2pass1;
92
    struct xvid_ff_pass1 rc2pass1;
93 93
    xvid_plugin_2pass2_t rc2pass2;
94 94
    xvid_gbl_init_t xvid_gbl_init;
95 95
    xvid_enc_create_t xvid_enc_create;
......
208 208
    x->twopassfile = NULL;
209 209

  
210 210
    if( xvid_flags & CODEC_FLAG_PASS1 ) {
211
        memset(&rc2pass1, 0, sizeof(xvid_ff_pass1_t));
211
        memset(&rc2pass1, 0, sizeof(struct xvid_ff_pass1));
212 212
        rc2pass1.version = XVID_VERSION;
213 213
        rc2pass1.context = x;
214 214
        x->twopassbuffer = av_malloc(BUFFER_SIZE);
......
370 370
                         unsigned char *frame, int buf_size, void *data) {
371 371
    int xerr, i;
372 372
    char *tmp;
373
    xvid_context_t *x = avctx->priv_data;
373
    struct xvid_context *x = avctx->priv_data;
374 374
    AVFrame *picture = data;
375 375
    AVFrame *p = &(x->encoded_picture);
376 376

  
......
475 475
 * @return Returns 0, success guaranteed
476 476
 */
477 477
av_cold int ff_xvid_encode_close(AVCodecContext *avctx) {
478
    xvid_context_t *x = avctx->priv_data;
478
    struct xvid_context *x = avctx->priv_data;
479 479

  
480 480
    xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
481 481

  
......
616 616
 */
617 617
static int xvid_ff_2pass_create(xvid_plg_create_t * param,
618 618
                                void ** handle) {
619
    xvid_ff_pass1_t *x = (xvid_ff_pass1_t *)param->param;
619
    struct xvid_ff_pass1 *x = (struct xvid_ff_pass1 *)param->param;
620 620
    char *log = x->context->twopassbuffer;
621 621

  
622 622
    /* Do a quick bounds check */
......
645 645
 * @param param Destrooy context
646 646
 * @return Returns 0, success guaranteed
647 647
 */
648
static int xvid_ff_2pass_destroy(xvid_context_t *ref,
648
static int xvid_ff_2pass_destroy(struct xvid_context *ref,
649 649
                                xvid_plg_destroy_t *param) {
650 650
    /* Currently cannot think of anything to do on destruction */
651 651
    /* Still, the framework should be here for reference/use */
......
661 661
 * @param param Frame data
662 662
 * @return Returns 0, success guaranteed
663 663
 */
664
static int xvid_ff_2pass_before(xvid_context_t *ref,
664
static int xvid_ff_2pass_before(struct xvid_context *ref,
665 665
                                xvid_plg_data_t *param) {
666 666
    int motion_remove;
667 667
    int motion_replacements;
......
704 704
 * @param param Statistic data
705 705
 * @return Returns XVID_ERR_xxxx on failure, or 0 on success
706 706
 */
707
static int xvid_ff_2pass_after(xvid_context_t *ref,
707
static int xvid_ff_2pass_after(struct xvid_context *ref,
708 708
                                xvid_plg_data_t *param) {
709 709
    char *log = ref->twopassbuffer;
710 710
    char *frame_types = " ipbs";
......
770 770
    "libxvid",
771 771
    CODEC_TYPE_VIDEO,
772 772
    CODEC_ID_XVID,
773
    sizeof(xvid_context_t),
773
    sizeof(struct xvid_context),
774 774
    ff_xvid_encode_init,
775 775
    ff_xvid_encode_frame,
776 776
    ff_xvid_encode_close,

Also available in: Unified diff