Revision f3b3b489

View differences:

libavcodec/avcodec.h
30 30
#include "libavutil/avutil.h"
31 31

  
32 32
#define LIBAVCODEC_VERSION_MAJOR 52
33
#define LIBAVCODEC_VERSION_MINOR 60
33
#define LIBAVCODEC_VERSION_MINOR 61
34 34
#define LIBAVCODEC_VERSION_MICRO  0
35 35

  
36 36
#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
592 592
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
593 593
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
594 594
#define CODEC_FLAG2_MBTREE        0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
595
#define CODEC_FLAG2_PSY           0x00080000 ///< Use psycho visual optimizations.
596
#define CODEC_FLAG2_SSIM          0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
595 597

  
596 598
/* Unsupported options :
597 599
 *              Syntax Arithmetic coding (SAC)
......
2598 2600
     * - decoding: unused
2599 2601
     */
2600 2602
    int weighted_p_pred;
2603

  
2604
    /**
2605
     * AQ mode
2606
     * 0: Disabled
2607
     * 1: Variance AQ (complexity mask)
2608
     * 2: Auto-variance AQ (experimental)
2609
     * - encoding: Set by user
2610
     * - decoding: unused
2611
     */
2612
    int aq_mode;
2613

  
2614
    /**
2615
     * AQ strength
2616
     * Reduces blocking and blurring in flat and textured areas.
2617
     * - encoding: Set by user
2618
     * - decoding: unused
2619
     */
2620
    float aq_strength;
2621

  
2622
    /**
2623
     * PSY RD
2624
     * Strength of psychovisual optimization
2625
     * - encoding: Set by user
2626
     * - decoding: unused
2627
     */
2628
    float psy_rd;
2629

  
2630
    /**
2631
     * PSY trellis
2632
     * Strength of psychovisual optimization
2633
     * - encoding: Set by user
2634
     * - decoding: unused
2635
     */
2636
    float psy_trellis;
2637

  
2638
    /**
2639
     * RC lookahead
2640
     * Number of frames for frametype and ratecontrol lookahead
2641
     * - encoding: Set by user
2642
     * - decoding: unused
2643
     */
2644
    int rc_lookahead;
2601 2645
} AVCodecContext;
2602 2646

  
2603 2647
/**
libavcodec/libx264.c
242 242
        x4->params.analyse.i_me_method = X264_ME_TESA;
243 243
    else x4->params.analyse.i_me_method = X264_ME_HEX;
244 244

  
245
    x4->params.rc.i_aq_mode = avctx->aq_mode;
246
    x4->params.rc.f_aq_strength = avctx->aq_strength;
247
    x4->params.rc.i_lookahead = avctx->rc_lookahead;
248

  
249
    x4->params.analyse.b_psy = avctx->flags2 & CODEC_FLAG2_PSY;
250
    x4->params.analyse.f_psy_rd = avctx->psy_rd;
251
    x4->params.analyse.f_psy_trellis = avctx->psy_trellis;
252

  
245 253
    x4->params.analyse.i_me_range         = avctx->me_range;
246 254
    x4->params.analyse.i_subpel_refine    = avctx->me_subpel_quality;
247 255

  
......
272 280
    x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
273 281

  
274 282
    x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
283
    x4->params.analyse.b_ssim = avctx->flags & CODEC_FLAG2_SSIM;
275 284
    x4->params.i_log_level    = X264_LOG_DEBUG;
276 285

  
277 286
    x4->params.b_aud          = avctx->flags2 & CODEC_FLAG2_AUD;
......
291 300

  
292 301
    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
293 302
        x264_nal_t *nal;
294
        int nnal, s;
303
        int nnal, s, i;
295 304

  
296 305
        s = x264_encoder_headers(x4->enc, &nal, &nnal);
297 306

  
307
        for (i = 0; i < nnal; i++)
308
            if (nal[i].i_type == NAL_SEI)
309
                av_log(avctx, AV_LOG_INFO, "%s\n", nal[i].p_payload+25);
310

  
298 311
        avctx->extradata      = av_malloc(s);
299 312
        avctx->extradata_size = encode_nals(avctx, avctx->extradata, s, nal, nnal, 1);
300 313
    }
libavcodec/options.c
307 307
{"nr", "noise reduction", OFFSET(noise_reduction), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
308 308
{"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
309 309
{"inter_threshold", NULL, OFFSET(inter_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
310
{"flags2", NULL, OFFSET(flags2), FF_OPT_TYPE_FLAGS, CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_BIT_RESERVOIR, 0, UINT_MAX, V|A|E|D, "flags2"},
310
{"flags2", NULL, OFFSET(flags2), FF_OPT_TYPE_FLAGS, CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_BIT_RESERVOIR|CODEC_FLAG2_PSY, 0, UINT_MAX, V|A|E|D, "flags2"},
311 311
{"error", NULL, OFFSET(error_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
312 312
{"antialias", "MP3 antialias algorithm", OFFSET(antialias_algo), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D, "aa"},
313 313
{"auto", NULL, 0, FF_OPT_TYPE_CONST, FF_AA_AUTO, INT_MIN, INT_MAX, V|D, "aa"},
......
404 404
{"colorspace", NULL, OFFSET(colorspace), FF_OPT_TYPE_INT, AVCOL_SPC_UNSPECIFIED, 1, AVCOL_SPC_NB-1, V|E|D},
405 405
{"color_range", NULL, OFFSET(color_range), FF_OPT_TYPE_INT, AVCOL_RANGE_UNSPECIFIED, 0, AVCOL_RANGE_NB-1, V|E|D},
406 406
{"chroma_sample_location", NULL, OFFSET(chroma_sample_location), FF_OPT_TYPE_INT, AVCHROMA_LOC_UNSPECIFIED, 0, AVCHROMA_LOC_NB-1, V|E|D},
407
{"psy", "use psycho visual optimization", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_PSY, INT_MIN, INT_MAX, V|E, "flags2"},
408
{"psy_rd", "specify psycho visual strength", OFFSET(psy_rd), FF_OPT_TYPE_FLOAT, 1.0, 0, FLT_MAX, V|E},
409
{"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), FF_OPT_TYPE_FLOAT, 0, 0, FLT_MAX, V|E},
410
{"aq_mode", "specify aq method", OFFSET(aq_mode), FF_OPT_TYPE_INT, 1, 0, INT_MAX, V|E},
411
{"aq_strength", "specify aq strength", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, 1.0, 0, FLT_MAX, V|E},
412
{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, 40, 0, INT_MAX, V|E},
413
{"ssim", "ssim will be calculated during encoding", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_SSIM, INT_MIN, INT_MAX, V|E, "flags2"},
407 414
{NULL},
408 415
};
409 416

  

Also available in: Unified diff