~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/libxvidff.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "avcodec.h"
31
31
#include "libavutil/cpu.h"
32
32
#include "libavutil/intreadwrite.h"
 
33
#include "libavutil/mathematics.h"
33
34
#include "libxvid_internal.h"
34
35
#if !HAVE_MKSTEMP
35
36
#include <fcntl.h>
136
137
    xvid_enc_create_t xvid_enc_create;
137
138
    xvid_enc_plugin_t plugins[7];
138
139
 
139
 
    /* Bring in VOP flags from ffmpeg command-line */
 
140
    /* Bring in VOP flags from avconv command-line */
140
141
    x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */
141
142
    if( xvid_flags & CODEC_FLAG_4MV )
142
143
        x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */
190
191
           break;
191
192
    }
192
193
 
193
 
    /* Bring in VOL flags from ffmpeg command-line */
 
194
    /* Bring in VOL flags from avconv command-line */
194
195
    x->vol_flags = 0;
195
196
    if( xvid_flags & CODEC_FLAG_GMC ) {
196
197
        x->vol_flags |= XVID_VOL_GMC;
269
270
        rc2pass2.version = XVID_VERSION;
270
271
        rc2pass2.bitrate = avctx->bit_rate;
271
272
 
272
 
        fd = ff_tempfile("xvidff.", &(x->twopassfile));
 
273
        fd = ff_tempfile("xvidff.", &x->twopassfile);
273
274
        if( fd == -1 ) {
274
275
            av_log(avctx, AV_LOG_ERROR,
275
276
                "Xvid: Cannot write 2-pass pipe\n");
413
414
    char *tmp;
414
415
    struct xvid_context *x = avctx->priv_data;
415
416
    AVFrame *picture = data;
416
 
    AVFrame *p = &(x->encoded_picture);
 
417
    AVFrame *p = &x->encoded_picture;
417
418
 
418
419
    xvid_enc_frame_t xvid_enc_frame;
419
420
    xvid_enc_stats_t xvid_enc_stats;
574
575
        }
575
576
        /* Less dangerous now, memmove properly copies the two
576
577
           chunks of overlapping data */
577
 
        memmove(frame, &(frame[vo_len]), frame_len - vo_len);
 
578
        memmove(frame, &frame[vo_len], frame_len - vo_len);
578
579
        return frame_len - vo_len;
579
580
    } else
580
581
        return frame_len;
668
669
    /* This is because we can safely prevent a buffer overflow */
669
670
    log[0] = 0;
670
671
    snprintf(log, BUFFER_REMAINING(log),
671
 
        "# ffmpeg 2-pass log file, using xvid codec\n");
 
672
        "# avconv 2-pass log file, using xvid codec\n");
672
673
    snprintf(BUFFER_CAT(log), BUFFER_REMAINING(log),
673
674
        "# Do not modify. libxvidcore version: %d.%d.%d\n\n",
674
675
        XVID_VERSION_MAJOR(XVID_VERSION),
748
749
static int xvid_ff_2pass_after(struct xvid_context *ref,
749
750
                                xvid_plg_data_t *param) {
750
751
    char *log = ref->twopassbuffer;
751
 
    char *frame_types = " ipbs";
 
752
    const char *frame_types = " ipbs";
752
753
    char frame_type;
753
754
 
754
755
    /* Quick bounds check */
808
809
 * Xvid codec definition for libavcodec.
809
810
 */
810
811
AVCodec ff_libxvid_encoder = {
811
 
    "libxvid",
812
 
    AVMEDIA_TYPE_VIDEO,
813
 
    CODEC_ID_MPEG4,
814
 
    sizeof(struct xvid_context),
815
 
    xvid_encode_init,
816
 
    xvid_encode_frame,
817
 
    xvid_encode_close,
 
812
    .name           = "libxvid",
 
813
    .type           = AVMEDIA_TYPE_VIDEO,
 
814
    .id             = CODEC_ID_MPEG4,
 
815
    .priv_data_size = sizeof(struct xvid_context),
 
816
    .init           = xvid_encode_init,
 
817
    .encode         = xvid_encode_frame,
 
818
    .close          = xvid_encode_close,
818
819
    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
819
820
    .long_name= NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"),
820
821
};