本文整理汇总了C++中Encoder::configure方法的典型用法代码示例。如果您正苦于以下问题:C++ Encoder::configure方法的具体用法?C++ Encoder::configure怎么用?C++ Encoder::configure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encoder
的用法示例。
在下文中一共展示了Encoder::configure方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memcpy
x265_encoder *x265_encoder_open(x265_param *p)
{
if (!p)
return NULL;
Encoder* encoder = NULL;
x265_param* param = PARAM_NS::x265_param_alloc();
x265_param* latestParam = PARAM_NS::x265_param_alloc();
if (!param || !latestParam)
goto fail;
memcpy(param, p, sizeof(x265_param));
x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", PFX(version_str));
x265_log(param, X265_LOG_INFO, "build info %s\n", PFX(build_info_str));
x265_setup_primitives(param, param->cpuid);
if (x265_check_params(param))
goto fail;
if (x265_set_globals(param))
goto fail;
encoder = new Encoder;
if (!param->rc.bEnableSlowFirstPass)
PARAM_NS::x265_param_apply_fastfirstpass(param);
// may change params for auto-detect, etc
encoder->configure(param);
// may change rate control and CPB params
if (!enforceLevel(*param, encoder->m_vps))
goto fail;
// will detect and set profile/tier/level in VPS
determineLevel(*param, encoder->m_vps);
if (!param->bAllowNonConformance && encoder->m_vps.ptl.profileIdc == Profile::NONE)
{
x265_log(param, X265_LOG_INFO, "non-conformant bitstreams not allowed (--allow-non-conformance)\n");
goto fail;
}
encoder->create();
encoder->m_latestParam = latestParam;
memcpy(latestParam, param, sizeof(x265_param));
if (encoder->m_aborted)
goto fail;
x265_print_params(param);
return encoder;
fail:
delete encoder;
PARAM_NS::x265_param_free(param);
PARAM_NS::x265_param_free(latestParam);
return NULL;
}
示例2: memcpy
x265_encoder *x265_encoder_open(x265_param *p)
{
if (!p)
return NULL;
x265_param *param = X265_MALLOC(x265_param, 1);
if (!param)
return NULL;
memcpy(param, p, sizeof(x265_param));
x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", x265_version_str);
x265_log(param, X265_LOG_INFO, "build info %s\n", x265_build_info_str);
x265_setup_primitives(param, param->cpuid);
if (x265_check_params(param))
return NULL;
if (x265_set_globals(param))
return NULL;
Encoder *encoder = new Encoder;
if (!param->rc.bEnableSlowFirstPass)
x265_param_apply_fastfirstpass(param);
// may change params for auto-detect, etc
encoder->configure(param);
// may change rate control and CPB params
if (!enforceLevel(*param, encoder->m_vps))
{
delete encoder;
return NULL;
}
// will detect and set profile/tier/level in VPS
determineLevel(*param, encoder->m_vps);
if (!param->bAllowNonConformance && encoder->m_vps.ptl.profileIdc == Profile::NONE)
{
x265_log(param, X265_LOG_INFO, "non-conformant bitstreams not allowed (--allow-non-conformance)\n");
delete encoder;
return NULL;
}
encoder->create();
if (encoder->m_aborted)
{
delete encoder;
return NULL;
}
x265_print_params(param);
return encoder;
}
示例3: warning
x265_encoder *x265_encoder_open(x265_param *p)
{
if (!p)
return NULL;
#if _MSC_VER
#pragma warning(disable: 4127) // conditional expression is constant, yes I know
#endif
#if HIGH_BIT_DEPTH
if (X265_DEPTH != 10 && X265_DEPTH != 12)
#else
if (X265_DEPTH != 8)
#endif
{
x265_log(p, X265_LOG_ERROR, "Build error, internal bit depth mismatch\n");
return NULL;
}
Encoder* encoder = NULL;
x265_param* param = PARAM_NS::x265_param_alloc();
x265_param* latestParam = PARAM_NS::x265_param_alloc();
if (!param || !latestParam)
goto fail;
memcpy(param, p, sizeof(x265_param));
x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", PFX(version_str));
x265_log(param, X265_LOG_INFO, "build info %s\n", PFX(build_info_str));
x265_setup_primitives(param);
if (x265_check_params(param))
goto fail;
if (x265_set_globals(param))
goto fail;
encoder = new Encoder;
if (!param->rc.bEnableSlowFirstPass)
PARAM_NS::x265_param_apply_fastfirstpass(param);
// may change params for auto-detect, etc
encoder->configure(param);
// may change rate control and CPB params
if (!enforceLevel(*param, encoder->m_vps))
goto fail;
// will detect and set profile/tier/level in VPS
determineLevel(*param, encoder->m_vps);
if (!param->bAllowNonConformance && encoder->m_vps.ptl.profileIdc == Profile::NONE)
{
x265_log(param, X265_LOG_INFO, "non-conformant bitstreams not allowed (--allow-non-conformance)\n");
goto fail;
}
encoder->create();
encoder->m_latestParam = latestParam;
memcpy(latestParam, param, sizeof(x265_param));
if (encoder->m_aborted)
goto fail;
x265_print_params(param);
return encoder;
fail:
delete encoder;
PARAM_NS::x265_param_free(param);
PARAM_NS::x265_param_free(latestParam);
return NULL;
}
示例4: oplug_mpegff
//.........这里部分代码省略.........
printf("\n Using ffmpeg mpeg2 encoder\n");
break;
case CodecXDVD:
encoder=new EncoderFFMPEGMpeg1(FF_MPEG2,&ffmpeg2DVDCodec);
printf("\n Using ffmpeg mpeg2 encoder (DVD)\n");
break;
case CodecDVD:
encoder=new EncoderMpeg2enc(MPEG2ENC_DVD,&DVDCodec);
printf("\n Using mpeg2enc encoder (DVD)\n");
break;
case CodecRequant:
if(!isMpeg12Compatible(avifileinfo->fcc))
{
GUI_Error_HIG("Incompatible Input","The input file must be mpeg2 to be able to use requant!");
return 0; // Fixme, do some cleanup
}
encoder=new EncoderRequant(&RequantCodec);
printf("\n Using mpeg2 requant\n");
break;
break;
case CodecSVCD:
encoder=new EncoderMpeg2enc(MPEG2ENC_SVCD,&SVCDCodec);
printf("\n Using mpeg2enc encoder (SVCD)\n");
break;
case CodecVCD:
encoder=new EncoderMpeg2enc(MPEG2ENC_VCD,&VCDCodec);
printf("\n Using mpeg2enc encoder (VCD)\n");
break;
default:
ADM_assert(0);
}
encoder->setLogFile(twoPass,total);
if(!encoder->configure(_incoming))
{
delete encoder;
return 0;
}
_buffer=new uint8_t[_page]; // Might overflow if _page only
_outbuffer=new uint8_t[_page];
ADM_assert( _buffer);
ADM_assert( _outbuffer);
DIA_encoding *encoding;
encoding =new DIA_encoding(_fps1000);
switch(current_codec)
{
case CodecVCD:
encoding->setCodec("libmpeg2enc VCD");
break;
case CodecSVCD:
encoding->setCodec("libmpeg2enc SVCD");
break;
case CodecDVD:
encoding->setCodec("libmpeg2enc DVD");
break;
case CodecXVCD:
encoding->setCodec("FFmpeg Mpeg1 VBR");
break;
case CodecXSVCD:
encoding->setCodec("FFmpeg Mpeg2 SVCD VBR");
break;
case CodecXDVD: