~medibuntu-maintainers/mplayer/medibuntu.quantal

« back to all changes in this revision

Viewing changes to libmpcodecs/ve_x264.c

  • Committer: Gauvain Pocentek
  • Date: 2011-08-21 07:22:23 UTC
  • mfrom: (66.1.11 oneiric)
  • Revision ID: gauvain@pocentek.net-20110821072223-ummeossdz7okpb3d
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
  - update 23mplayer-debug-printf.patch
  - fixes miscompilation with gcc 4.6, Closes: #623304
  - improved internal mkv demuxer, Closes: #595452
  - Fixed segfault due to missing sanitation on playlist files,
    Closes: #591525
  - Fixed byteorder on 16-bit displays, Closes: #594093
  - tighten build depends on libav
  - --enable-largefile switch has been dropped
  - add build dependency on yasm
* Fix build dependency on libjpeg-dev, Closes: #634277
* rewrite debian/copyright in DEP5 format
* fix clean target
* don't remove snapshot_version file
* enable XVID, MP3 and X264 encoders
* simply architecture specific dependencies, Closes: #634773
* make buildlogs verbose
* unbreak building mplayer-doc package
* don't fail debian package build if not all shlibdeps information could be retrieved
* update configure flags for static libav* libraries
* fix spelling in mplayer-dbg description, Closes: #617826
* enable blueray support, Closes: #577761
* Select oss as default audio output module on kFreeBSD, Closes: #598431
* Update documentation with regard to our modifications to the upstream tarball.
* really no longer build mplayer-gui, Closes: #612473
* simplify/remove instruction to get upstream sources
* normalize debian/{control,copyright,mplayer.install} with wrap-and-sort
* bump standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
#include "config.h"
34
34
#include "mp_msg.h"
35
 
 
 
35
#include "mencoder.h"
36
36
#include "m_option.h"
37
37
#include "codec-cfg.h"
38
38
#include "stream/stream.h"
39
39
#include "libmpdemux/demuxer.h"
40
40
#include "libmpdemux/stheader.h"
41
 
 
 
41
#include "osdep/strsep.h"
42
42
#include "stream/stream.h"
43
43
#include "libmpdemux/muxer.h"
44
44
 
45
45
#include "img_format.h"
46
46
#include "mp_image.h"
47
47
#include "vf.h"
 
48
#include "ve.h"
48
49
#include "ve_x264.h"
49
50
 
50
51
#include <x264.h>
55
56
    x264_picture_t  pic;
56
57
} h264_module_t;
57
58
 
58
 
extern char* passtmpfile;
59
59
static x264_param_t param;
60
60
static int parse_error = 0;
61
61
 
186
186
 
187
187
        extradata_size = x264_encoder_headers(mod->x264, &nal, &nnal);
188
188
 
189
 
        mod->mux->bih= realloc(mod->mux->bih, sizeof(BITMAPINFOHEADER) + extradata_size);
 
189
        mod->mux->bih= realloc(mod->mux->bih, sizeof(*mod->mux->bih) + extradata_size);
190
190
        memcpy(mod->mux->bih + 1, nal->p_payload, extradata_size);
191
 
        mod->mux->bih->biSize= sizeof(BITMAPINFOHEADER) + extradata_size;
 
191
        mod->mux->bih->biSize= sizeof(*mod->mux->bih) + extradata_size;
192
192
    }
193
193
 
194
194
    if (param.i_bframe > 1 && param.i_bframe_pyramid)
236
236
    h264_module_t *mod=(h264_module_t*)vf->priv;
237
237
    int i;
238
238
 
239
 
    memset(&mod->pic, 0, sizeof(x264_picture_t));
 
239
    x264_picture_init(&mod->pic);
240
240
    mod->pic.img.i_csp=param.i_csp;
241
241
    mod->pic.img.i_plane=3;
242
242
    for(i=0; i<4; i++) {
245
245
    }
246
246
 
247
247
    mod->pic.i_type = X264_TYPE_AUTO;
 
248
    if (is_forced_key_frame(pts))
 
249
        mod->pic.i_type = X264_TYPE_KEYFRAME;
248
250
 
249
251
    return encode_frame(vf, &mod->pic) >= 0;
250
252
}
294
296
 
295
297
    mod=(h264_module_t*)vf->priv;
296
298
    mod->mux = (muxer_stream_t*)args;
297
 
    mod->mux->bih = malloc(sizeof(BITMAPINFOHEADER));
298
 
    memset(mod->mux->bih, 0, sizeof(BITMAPINFOHEADER));
299
 
    mod->mux->bih->biSize = sizeof(BITMAPINFOHEADER);
 
299
    mod->mux->bih = calloc(1, sizeof(*mod->mux->bih));
 
300
    mod->mux->bih->biSize = sizeof(*mod->mux->bih);
300
301
    mod->mux->bih->biPlanes = 1;
301
302
    mod->mux->bih->biBitCount = 24;
302
303
    mod->mux->bih->biCompression = mmioFOURCC('h', '2', '6', '4');
304
305
    return 1;
305
306
}
306
307
 
307
 
vf_info_t ve_info_x264 = {
 
308
const vf_info_t ve_info_x264 = {
308
309
    "H.264 encoder",
309
310
    "x264",
310
311
    "Bernhard Rosenkraenzer <bero@arklinux.org>",