summaryrefslogtreecommitdiff
path: root/libavformat/davs2.c
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2018-09-12 12:11:25 +0800
committerSteven Liu <lq@chinaffmpeg.org>2018-09-12 12:11:25 +0800
commit2e5860799bea2ffaa8e5df6aba6eb7ec9e24c046 (patch)
treebf319617804575d97292ef22e8a9368cb69b1370 /libavformat/davs2.c
parent1e20ed4382b0d99226d58bea82ace14fd3286e4e (diff)
Revert "lavf: add raw AVS2 demuxer"
This reverts commit 1e20ed4382b0d99226d58bea82ace14fd3286e4e.
Diffstat (limited to 'libavformat/davs2.c')
-rw-r--r--libavformat/davs2.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/libavformat/davs2.c b/libavformat/davs2.c
deleted file mode 100644
index bca59a3c3f..0000000000
--- a/libavformat/davs2.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * AVS2 video stream probe.
- *
- * Copyright (C) 2018 Huiwen Ren, <hwrenx@126.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawdec.h"
-#include "libavcodec/internal.h"
-#include "libavutil/intreadwrite.h"
-
-#define ISSQH(x) ((x) == 0xB0 )
-#define ISEND(x) ((x) == 0xB1 )
-#define ISPIC(x) ((x) == 0xB3 || (x) == 0xB6)
-#define ISUNIT(x) ( ISSQH(x) || ISEND(x) || (x) == 0xB2 || ISPIC(x) || (x) == 0xB5 || (x) == 0xB7 )
-#define ISAVS2(x) ((x) == 0x20 || (x) == 0x22 || (x) == 0x30 || (x) == 0x32 )
-
-static int avs2_probe(AVProbeData *p)
-{
- if (AV_RB32(p->buf) != 0x1B0){
- return 0;
- }
- uint32_t code= -1, hds=0, pic=0, seq=0;
- uint8_t state=0;
- const uint8_t *ptr = p->buf, *end = p->buf + p->buf_size, *sqb=0;
-
- while (ptr < end) {
- ptr = avpriv_find_start_code(ptr, end, &code);
- state = code & 0xFF;
- if ((code & 0xffffff00) == 0x100) {
- if (ISUNIT(state)) {
- if (sqb && !hds) {
- hds = ptr - sqb;
- }
- if (ISSQH(state)) {
- if (!ISAVS2(*ptr))
- return 0;
- sqb = ptr;
- seq++;
- } else if (ISPIC(state)) {
- pic++;
- } else if (ISEND(state)) {
- break;
- }
- }
- }
- }
- if (seq && hds >= 21 && pic){
- return AVPROBE_SCORE_EXTENSION + 2; // more than cavs
- }
-
- return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(avs2, "raw AVS2-P2/IEEE1857.4", avs2_probe, "avs,avs2", AV_CODEC_ID_AVS2)