91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

基于HEVC的開源代碼 openHEVC-hm10.0,功能強大!

資源截圖

代碼片段和文件信息

//
//??main.c
//??libavHEVC
//
//??Created?by?Micka?l?Raulet?on?11/10/12.
//
//
#include?“SDL.h“
#include?
#include?“avcodec.h“
#include?“libavcodec/hevc.h“

int?find_start_code?(unsigned?char?*Buf?int?zeros_in_startcode)
{
????int?info;
????int?i;
????
????info?=?1;
????for?(i?=?0;?i?????????if(Buf[i]?!=?0)
????????????info?=?0;
????
????if(Buf[i]?!=?1)
????????info?=?0;
????return?info;
}

int?get_next_nal(FILE*?inpf?unsigned?char*?Buf)
{
int?pos?=?0;
while(!feof(inpf)&&(Buf[pos++]=fgetc(inpf))==0);
????
int?StartCodeFound?=?0;
int?info2?=?0;
int?info3?=?0;
????
while?(!StartCodeFound)
{
if?(feof?(inpf))
{
????????????// return?-1;
return?pos?-?1;
}
Buf[pos++]?=?fgetc?(inpf);
info3?=?find_start_code(&Buf[pos-4]?3);
if(info3?!=?1)
info2?=?find_start_code(&Buf[pos-3]?2);
StartCodeFound?=?(info2?==?1?||?info3?==?1);
}
fseek?(inpf?-?4?+?info2?SEEK_CUR);
return?pos?-?4?+?info2;
}
int?init=1;
static?void?video_decode_example(const?char?*filename)
{
????AVCodec?*codec;
????AVCodecContext?*c=?NULL;
????int?frame?got_picture?len;
????FILE?*f;
????AVframe?*picture;
????AVPacket?avpkt;
????int?nal_len?=?0;
unsigned?char*?buf;?
????
????av_init_packet(&avpkt);
????
????printf(“Video?decoding\n“);
????
????codec?=?avcodec_find_decoder(AV_CODEC_ID_HEVC);
????if?(!codec)?{
????????fprintf(stderr?“codec?not?found\n“);
????????exit(1);
????}
????AVCodecParserContext?*parser?=?av_parser_init(?codec->id?);
????
????c?=?avcodec_alloc_context3(codec);
????picture=?avcodec_alloc_frame();
????
????
????if(codec->capabilities&CODEC_CAP_TRUNCATED)
????????c->flags|=?CODEC_FLAG_TRUNCATED;?/*?we?do?not?send?complete?frames?*/
????
????/*?For?some?codecs?such?as?msmpeg4?and?mpeg4?width?and?height
?????MUST?be?initialized?there?because?this?information?is?not
?????available?in?the?bitstream.?*/
????
????/*?open?it?*/
????if?(avcodec_open2(c?codec?NULL)?????????fprintf(stderr?“could?not?open?codec\n“);
????????exit(1);
????}
????
????/*?the?codec?gives?us?the?frame?size?in?samples?*/
????
????f?=?fopen(filename?“rb“);
????if?(!f)?{
????????fprintf(stderr?“could?not?open?%s\n“?filename);
????????exit(1);
????}
????buf?=?calloc?(?1000000?sizeof(char));
????
????frame?=?0;
????for(;;)?{
????????uint8_t?*poutbuf;
????????avpkt.size?=?nal_len?=?get_next_nal(f?buf);
????????if?(nal_len?==?-?1)?exit(10);
????????
????????av_parser_parse2(parser
?????????????????????????c
?????????????????????????&poutbuf?&nal_len
?????????????????????????buf?avpkt.size
?????????????????????????0?0
?????????????????????????0);
????????avpkt.data?=?poutbuf;
????????len?=?avcodec_decode_video2(c?picture?&got_picture?&avpkt);
????????if?(len?????????????fprintf(stderr?“Error?while?decoding?frame?%d\n“?frame);
????????????exit(1);
????????}
????????if?(got_picture)?{
????????????printf(“saving?frame?%3d\n“?frame);
????????????fflush(stdout);
????????????if?(init?==?1)?{
????????????????I

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-03-01?12:15??openHEVC-hm10.0\
?????文件??????????40??2013-03-01?12:15??openHEVC-hm10.0\.gitignore
?????文件????????1146??2013-03-01?12:15??openHEVC-hm10.0\CMakeLists.txt
?????文件?????????244??2013-03-01?12:15??openHEVC-hm10.0\README.md
?????文件??????151693??2013-03-01?12:15??openHEVC-hm10.0\avcodec.h
?????文件???????34414??2013-03-01?12:15??openHEVC-hm10.0\config.h
?????目錄???????????0??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\
?????文件???????12339??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\ac3dec.h
?????文件????????3191??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\allcodecs.c
?????文件????????2590??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\audioconvert.h
?????文件????????8636??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\avpacket.c
?????文件????????3835??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\avpicture.c
?????文件????????2547??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\bit_depth_template.c
?????文件???????13211??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\bytestream.h
?????文件????????5803??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\cabac.c
?????文件????????1822??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\cabac.h
?????文件????????4987??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\cabac_functions.h
?????文件???????98849??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\dsputil.c
?????文件???????26539??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\dsputil.h
?????文件???????53791??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\dsputil_template.c
?????文件????????1134??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\faandct.h
?????文件????????1160??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\faanidct.h
?????文件???????19347??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\get_bits.h
?????文件????????9962??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\golomb.c
?????文件???????13111??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\golomb.h
?????文件??????156352??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\hevc.c
?????文件???????21630??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\hevc.h
?????文件???????23590??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\hevc_cabac.c
?????文件????????4780??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\hevc_parser.c
?????文件???????30026??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\hevc_ps.c
?????文件????????6665??2013-03-01?12:15??openHEVC-hm10.0\libavcodec\hevc_refs.c
............此處省略318個文件信息

評論

共有 條評論