static av_cold int pcm_encode_init(AVCodecContext *avctx)
{
    avctx->frame_size = 0;
    switch(avctx->codec->id) {
    case CODEC_ID_PCM_ALAW:
        pcm_alaw_tableinit();
        break;
    case CODEC_ID_PCM_MULAW:
        pcm_ulaw_tableinit();
        break;
    default:
        break;
    }
    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
    avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
    avctx->coded_frame= avcodec_alloc_frame();
    avctx->coded_frame->key_frame= 1;
    return 0;
}
['static av_cold int pcm_encode_init(AVCodecContext *avctx)\n{\n    avctx->frame_size = 0;\n    switch(avctx->codec->id) {\n    case CODEC_ID_PCM_ALAW:\n        pcm_alaw_tableinit();\n        break;\n    case CODEC_ID_PCM_MULAW:\n        pcm_ulaw_tableinit();\n        break;\n    default:\n        break;\n    }\n    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);\n    avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;\n    avctx->coded_frame= avcodec_alloc_frame();\n    avctx->coded_frame->key_frame= 1;\n    return 0;\n}', 'int av_get_bits_per_sample(enum CodecID codec_id){\n    switch(codec_id){\n    case CODEC_ID_ADPCM_SBPRO_2:\n        return 2;\n    case CODEC_ID_ADPCM_SBPRO_3:\n        return 3;\n    case CODEC_ID_ADPCM_SBPRO_4:\n    case CODEC_ID_ADPCM_CT:\n    case CODEC_ID_ADPCM_IMA_APC:\n    case CODEC_ID_ADPCM_IMA_WAV:\n    case CODEC_ID_ADPCM_IMA_QT:\n    case CODEC_ID_ADPCM_SWF:\n    case CODEC_ID_ADPCM_MS:\n    case CODEC_ID_ADPCM_YAMAHA:\n    case CODEC_ID_ADPCM_G722:\n        return 4;\n    case CODEC_ID_PCM_ALAW:\n    case CODEC_ID_PCM_MULAW:\n    case CODEC_ID_PCM_S8:\n    case CODEC_ID_PCM_U8:\n    case CODEC_ID_PCM_ZORK:\n        return 8;\n    case CODEC_ID_PCM_S16BE:\n    case CODEC_ID_PCM_S16LE:\n    case CODEC_ID_PCM_S16LE_PLANAR:\n    case CODEC_ID_PCM_U16BE:\n    case CODEC_ID_PCM_U16LE:\n        return 16;\n    case CODEC_ID_PCM_S24DAUD:\n    case CODEC_ID_PCM_S24BE:\n    case CODEC_ID_PCM_S24LE:\n    case CODEC_ID_PCM_U24BE:\n    case CODEC_ID_PCM_U24LE:\n        return 24;\n    case CODEC_ID_PCM_S32BE:\n    case CODEC_ID_PCM_S32LE:\n    case CODEC_ID_PCM_U32BE:\n    case CODEC_ID_PCM_U32LE:\n    case CODEC_ID_PCM_F32BE:\n    case CODEC_ID_PCM_F32LE:\n        return 32;\n    case CODEC_ID_PCM_F64BE:\n    case CODEC_ID_PCM_F64LE:\n        return 64;\n    default:\n        return 0;\n    }\n}', 'AVFrame *avcodec_alloc_frame(void){\n    AVFrame *pic= av_malloc(sizeof(AVFrame));\n    if(pic==NULL) return NULL;\n    avcodec_get_frame_defaults(pic);\n    return pic;\n}', 'void *av_malloc(size_t size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-32) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+32);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&31) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,32,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(32,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']