You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avformat/hevcdec: cosmetics, whitespaces
This reduces the difference to the latest hevc demuxer Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
21b3563dcb
commit
2ac31773f3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* RAW H.265 video demuxer
|
* RAW HEVC video demuxer
|
||||||
* Copyright (c) 2013 Dirk Farin <dirk.farin@gmail.com>
|
* Copyright (c) 2013 Dirk Farin <dirk.farin@gmail.com>
|
||||||
*
|
*
|
||||||
* This file is part of FFmpeg.
|
* This file is part of FFmpeg.
|
||||||
@@ -22,39 +22,41 @@
|
|||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "rawdec.h"
|
#include "rawdec.h"
|
||||||
|
|
||||||
|
#include "libavcodec/hevc.h"
|
||||||
|
|
||||||
static int hevc_probe(AVProbeData *p)
|
static int hevc_probe(AVProbeData *p)
|
||||||
{
|
{
|
||||||
uint32_t code= -1;
|
uint32_t code = -1;
|
||||||
int vps=0, sps=0, pps=0, idr=0;
|
int vps = 0, sps = 0, pps = 0, irap = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i=0; i<p->buf_size-1; i++){
|
for (i = 0; i < p->buf_size - 1; i++) {
|
||||||
code = (code<<8) + p->buf[i];
|
code = (code << 8) + p->buf[i];
|
||||||
if ((code & 0xffffff00) == 0x100) {
|
if ((code & 0xffffff00) == 0x100) {
|
||||||
uint8_t nal2 = p->buf[i+1];
|
uint8_t nal2 = p->buf[i + 1];
|
||||||
int type = (code & 0x7E)>>1;
|
int type = (code & 0x7E) >> 1;
|
||||||
|
|
||||||
if (code & 0x81) // forbidden and reserved zero bits
|
if (code & 0x81) // forbidden and reserved zero bits
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (nal2 & 0xf8) // reserved zero
|
if (nal2 & 0xf8) // reserved zero
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 32: vps++; break;
|
case NAL_VPS: vps++; break;
|
||||||
case 33: sps++; break;
|
case NAL_SPS: sps++; break;
|
||||||
case 34: pps++; break;
|
case NAL_PPS: pps++; break;
|
||||||
case 19:
|
case 19:
|
||||||
case 20: idr++; break;
|
case 20: irap++; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("vps=%d, sps=%d, pps=%d, idr=%d\n", vps, sps, pps, idr);
|
// printf("vps=%d, sps=%d, pps=%d, irap=%d\n", vps, sps, pps, irap);
|
||||||
|
|
||||||
if (vps && sps && pps && idr)
|
if (vps && sps && pps && irap)
|
||||||
return AVPROBE_SCORE_EXTENSION + 1; // 1 more than .mpg
|
return AVPROBE_SCORE_EXTENSION + 1; // 1 more than .mpg
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FF_DEF_RAWVIDEO_DEMUXER(hevc , "raw HEVC video", hevc_probe, "h265,265,hevc", AV_CODEC_ID_HEVC)
|
FF_DEF_RAWVIDEO_DEMUXER(hevc, "raw HEVC video", hevc_probe, "hevc,h265,265", AV_CODEC_ID_HEVC)
|
||||||
|
Reference in New Issue
Block a user