| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (c) 2010, Google, Inc. | 2  * Copyright (c) 2010, Google, Inc. | 
| 3  * | 3  * | 
| 4  * This file is part of FFmpeg. | 4  * This file is part of FFmpeg. | 
| 5  * | 5  * | 
| 6  * FFmpeg is free software; you can redistribute it and/or | 6  * FFmpeg is free software; you can redistribute it and/or | 
| 7  * modify it under the terms of the GNU Lesser General Public | 7  * modify it under the terms of the GNU Lesser General Public | 
| 8  * License as published by the Free Software Foundation; either | 8  * License as published by the Free Software Foundation; either | 
| 9  * version 2.1 of the License, or (at your option) any later version. | 9  * version 2.1 of the License, or (at your option) any later version. | 
| 10  * | 10  * | 
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 331     res = vpx_codec_enc_init(&ctx->encoder, iface, &enccfg, 0); | 331     res = vpx_codec_enc_init(&ctx->encoder, iface, &enccfg, 0); | 
| 332     if (res != VPX_CODEC_OK) { | 332     if (res != VPX_CODEC_OK) { | 
| 333         log_encoder_error(avctx, "Failed to initialize encoder"); | 333         log_encoder_error(avctx, "Failed to initialize encoder"); | 
| 334         return AVERROR(EINVAL); | 334         return AVERROR(EINVAL); | 
| 335     } | 335     } | 
| 336 | 336 | 
| 337     //codec control failures are currently treated only as warnings | 337     //codec control failures are currently treated only as warnings | 
| 338     av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n"); | 338     av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n"); | 
| 339     codecctl_int(avctx, VP8E_SET_CPUUSED,           cpuused); | 339     codecctl_int(avctx, VP8E_SET_CPUUSED,           cpuused); | 
| 340     codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction); | 340     codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction); | 
|  | 341     codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS,  av_log2(avctx->slices)); | 
| 341     codecctl_int(avctx, VP8E_SET_ENABLEAUTOALTREF,  !!(avctx->flags2 & CODEC_FLA
     G2_ALT_REF)); | 342     codecctl_int(avctx, VP8E_SET_ENABLEAUTOALTREF,  !!(avctx->flags2 & CODEC_FLA
     G2_ALT_REF)); | 
| 342     codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS,  av_log2(avctx->token_partiti
     ons)); |  | 
| 343 | 343 | 
| 344     //provide dummy value to initialize wrapper, values will be updated each _en
     code() | 344     //provide dummy value to initialize wrapper, values will be updated each _en
     code() | 
| 345     vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1, | 345     vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1, | 
| 346                  (unsigned char*)1); | 346                  (unsigned char*)1); | 
| 347 | 347 | 
| 348     avctx->coded_frame = avcodec_alloc_frame(); | 348     avctx->coded_frame = avcodec_alloc_frame(); | 
| 349     if (!avctx->coded_frame) { | 349     if (!avctx->coded_frame) { | 
| 350         av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n"); | 350         av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n"); | 
| 351         vp8_free(avctx); | 351         vp8_free(avctx); | 
| 352         return AVERROR(ENOMEM); | 352         return AVERROR(ENOMEM); | 
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 529     CODEC_ID_VP8, | 529     CODEC_ID_VP8, | 
| 530     sizeof(VP8Context), | 530     sizeof(VP8Context), | 
| 531     vp8_init, | 531     vp8_init, | 
| 532     vp8_encode, | 532     vp8_encode, | 
| 533     vp8_free, | 533     vp8_free, | 
| 534     NULL, | 534     NULL, | 
| 535     CODEC_CAP_DELAY, | 535     CODEC_CAP_DELAY, | 
| 536     .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 536     .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 
| 537     .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), | 537     .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), | 
| 538 }; | 538 }; | 
| OLD | NEW | 
|---|