Revision 7fe0c7c8 libavcodec/flacenc.c

View differences:

libavcodec/flacenc.c
148 148
}
149 149

  
150 150

  
151
static av_cold void dprint_compression_options(FlacEncodeContext *s)
152
{
153
    AVCodecContext     *avctx = s->avctx;
154
    CompressionOptions *opt   = &s->options;
155

  
156
    av_log(avctx, AV_LOG_DEBUG, " compression: %d\n", opt->compression_level);
157

  
158
    switch (opt->lpc_type) {
159
    case AV_LPC_TYPE_NONE:
160
        av_log(avctx, AV_LOG_DEBUG, " lpc type: None\n");
161
        break;
162
    case AV_LPC_TYPE_FIXED:
163
        av_log(avctx, AV_LOG_DEBUG, " lpc type: Fixed pre-defined coefficients\n");
164
        break;
165
    case AV_LPC_TYPE_LEVINSON:
166
        av_log(avctx, AV_LOG_DEBUG, " lpc type: Levinson-Durbin recursion with Welch window\n");
167
        break;
168
    case AV_LPC_TYPE_CHOLESKY:
169
        av_log(avctx, AV_LOG_DEBUG, " lpc type: Cholesky factorization, %d pass%s\n",
170
               opt->lpc_passes, opt->lpc_passes == 1 ? "" : "es");
171
        break;
172
    }
173

  
174
    av_log(avctx, AV_LOG_DEBUG, " prediction order: %d, %d\n",
175
           opt->min_prediction_order, opt->max_prediction_order);
176

  
177
    switch (opt->prediction_order_method) {
178
    case ORDER_METHOD_EST:
179
        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "estimate");
180
        break;
181
    case ORDER_METHOD_2LEVEL:
182
        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "2-level");
183
        break;
184
    case ORDER_METHOD_4LEVEL:
185
        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "4-level");
186
        break;
187
    case ORDER_METHOD_8LEVEL:
188
        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "8-level");
189
        break;
190
    case ORDER_METHOD_SEARCH:
191
        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "full search");
192
        break;
193
    case ORDER_METHOD_LOG:
194
        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "log search");
195
        break;
196
    }
197

  
198

  
199
    av_log(avctx, AV_LOG_DEBUG, " partition order: %d, %d\n",
200
           opt->min_partition_order, opt->max_partition_order);
201

  
202
    av_log(avctx, AV_LOG_DEBUG, " block size: %d\n", avctx->frame_size);
203

  
204
    av_log(avctx, AV_LOG_DEBUG, " lpc precision: %d\n",
205
           opt->lpc_coeff_precision);
206
}
207

  
208

  
151 209
static av_cold int flac_encode_init(AVCodecContext *avctx)
152 210
{
153 211
    int freq = avctx->sample_rate;
......
200 258
        s->options.compression_level = 5;
201 259
    else
202 260
        s->options.compression_level = avctx->compression_level;
203
    av_log(avctx, AV_LOG_DEBUG, " compression: %d\n", s->options.compression_level);
204 261

  
205 262
    level = s->options.compression_level;
206 263
    if (level > 12) {
......
260 317
            }
261 318
        }
262 319
    }
263
    switch (s->options.lpc_type) {
264
    case AV_LPC_TYPE_NONE:
265
        av_log(avctx, AV_LOG_DEBUG, " lpc type: None\n");
266
        break;
267
    case AV_LPC_TYPE_FIXED:
268
        av_log(avctx, AV_LOG_DEBUG, " lpc type: Fixed pre-defined coefficients\n");
269
        break;
270
    case AV_LPC_TYPE_LEVINSON:
271
        av_log(avctx, AV_LOG_DEBUG, " lpc type: Levinson-Durbin recursion with Welch window\n");
272
        break;
273
    case AV_LPC_TYPE_CHOLESKY:
274
        av_log(avctx, AV_LOG_DEBUG, " lpc type: Cholesky factorization, %d pass%s\n",
275
               s->options.lpc_passes, s->options.lpc_passes==1?"":"es");
276
        break;
277
    }
278 320

  
279 321
    if (s->options.lpc_type == AV_LPC_TYPE_NONE) {
280 322
        s->options.min_prediction_order = 0;
......
315 357
               s->options.min_prediction_order, s->options.max_prediction_order);
316 358
        return -1;
317 359
    }
318
    av_log(avctx, AV_LOG_DEBUG, " prediction order: %d, %d\n",
319
           s->options.min_prediction_order, s->options.max_prediction_order);
320 360

  
321 361
    if (avctx->prediction_order_method >= 0) {
322 362
        if (avctx->prediction_order_method > ORDER_METHOD_LOG) {
......
326 366
        }
327 367
        s->options.prediction_order_method = avctx->prediction_order_method;
328 368
    }
329
    switch (s->options.prediction_order_method) {
330
        case ORDER_METHOD_EST:    av_log(avctx, AV_LOG_DEBUG, " order method: %s\n",
331
                                         "estimate"); break;
332
        case ORDER_METHOD_2LEVEL: av_log(avctx, AV_LOG_DEBUG, " order method: %s\n",
333
                                         "2-level"); break;
334
        case ORDER_METHOD_4LEVEL: av_log(avctx, AV_LOG_DEBUG, " order method: %s\n",
335
                                         "4-level"); break;
336
        case ORDER_METHOD_8LEVEL: av_log(avctx, AV_LOG_DEBUG, " order method: %s\n",
337
                                         "8-level"); break;
338
        case ORDER_METHOD_SEARCH: av_log(avctx, AV_LOG_DEBUG, " order method: %s\n",
339
                                         "full search"); break;
340
        case ORDER_METHOD_LOG:    av_log(avctx, AV_LOG_DEBUG, " order method: %s\n",
341
                                         "log search"); break;
342
    }
343 369

  
344 370
    if (avctx->min_partition_order >= 0) {
345 371
        if (avctx->min_partition_order > MAX_PARTITION_ORDER) {
......
362 388
               s->options.min_partition_order, s->options.max_partition_order);
363 389
        return -1;
364 390
    }
365
    av_log(avctx, AV_LOG_DEBUG, " partition order: %d, %d\n",
366
           s->options.min_partition_order, s->options.max_partition_order);
367 391

  
368 392
    if (avctx->frame_size > 0) {
369 393
        if (avctx->frame_size < FLAC_MIN_BLOCKSIZE ||
......
376 400
        s->avctx->frame_size = select_blocksize(s->samplerate, s->options.block_time_ms);
377 401
    }
378 402
    s->max_blocksize = s->avctx->frame_size;
379
    av_log(avctx, AV_LOG_DEBUG, " block size: %d\n", s->avctx->frame_size);
380 403

  
381 404
    /* set LPC precision */
382 405
    if (avctx->lpc_coeff_precision > 0) {
......
390 413
        /* default LPC precision */
391 414
        s->options.lpc_coeff_precision = 15;
392 415
    }
393
    av_log(avctx, AV_LOG_DEBUG, " lpc precision: %d\n",
394
           s->options.lpc_coeff_precision);
395 416

  
396 417
    /* set maximum encoded frame size in verbatim mode */
397 418
    s->max_framesize = ff_flac_get_max_frame_size(s->avctx->frame_size,
......
418 439
        return AVERROR(ENOMEM);
419 440
    avctx->coded_frame->key_frame = 1;
420 441

  
442
    dprint_compression_options(s);
443

  
421 444
    return 0;
422 445
}
423 446

  

Also available in: Unified diff