History

avcodec/utvideo: Move stuff only used by Ut encoder to Ut encoder

Andreas Rheinhardt committed 6 years ago

Commit bb16dbc1 parent 5f5f0b04 files · +23 −55Browse files

Unified · Split

4 files
  1. libavcodec/Makefile +2 −2
  2. libavcodec/utvideo.c +0 −39
  3. libavcodec/utvideo.h +0 −12
  4. libavcodec/utvideoenc.c +21 −2
libavcodec/Makefile+2−2
@@ -664,8 +664,8 @@ OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttaencdsp.o ttadata.o · 663 unmodified lines
664664 OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o
665665 OBJS-$(CONFIG_TXD_DECODER) += txd.o
666666 OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
667−OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideo.o utvideodsp.o
668−OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o utvideo.o
667+OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideodsp.o
668+OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o
669669 OBJS-$(CONFIG_V210_DECODER) += v210dec.o
670670 OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
671671 OBJS-$(CONFIG_V210X_DECODER) += v210x.o
libavcodec/utvideo.c+0−39
@@ -1,39 +0,0 @@
1−/*
2− * Common Ut Video code
3− * Copyright (c) 2011 Konstantin Shishkov
4− *
5− * This file is part of FFmpeg.
6− *
7− * FFmpeg is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU Lesser General Public
9− * License as published by the Free Software Foundation; either
10− * version 2.1 of the License, or (at your option) any later version.
11− *
12− * FFmpeg is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15− * Lesser General Public License for more details.
16− *
17− * You should have received a copy of the GNU Lesser General Public
18− * License along with FFmpeg; if not, write to the Free Software
19− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20− */
21−
22−/**
23− * @file
24− * Common Ut Video code
25− */
26−
27−#include "utvideo.h"
28−
29−#if FF_API_PRIVATE_OPT
30−const int ff_ut_pred_order[5] = {
31− PRED_LEFT, PRED_MEDIAN, PRED_MEDIAN, PRED_NONE, PRED_GRADIENT
32−};
33−#endif
34−
35−int ff_ut_huff_cmp_len(const void *a, const void *b)
36−{
37− const HuffEntry *aa = a, *bb = b;
38− return (aa->len - bb->len)*256 + aa->sym - bb->sym;
39−}
libavcodec/utvideo.h+0−12
@@ -61,9 +61,6 @@ enum { · 60 unmodified lines
6161 UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'),
6262 };
6363
64−/* Mapping of libavcodec prediction modes to Ut Video's */
65−extern const int ff_ut_pred_order[5];
66−
6764 typedef struct UtvideoContext {
6865 const AVClass *class;
6966 AVCodecContext *avctx;
@@ -91,13 +88,4 @@ typedef struct UtvideoContext { · 21 unmodified lines
9188 size_t control_stream_size[4][256];
9289 } UtvideoContext;
9390
94−typedef struct HuffEntry {
95− uint16_t sym;
96− uint8_t len;
97− uint32_t code;
98−} HuffEntry;
99−
100−/* Compare huffman tree nodes */
101−int ff_ut_huff_cmp_len(const void *a, const void *b);
102−
10391 #endif /* AVCODEC_UTVIDEO_H */
libavcodec/utvideoenc.c+21−2
@@ -37,6 +37,25 @@ · 36 unmodified lines
3737 #include "utvideo.h"
3838 #include "huffman.h"
3939
40+typedef struct HuffEntry {
41+ uint16_t sym;
42+ uint8_t len;
43+ uint32_t code;
44+} HuffEntry;
45+
46+#if FF_API_PRIVATE_OPT
47+static const int ut_pred_order[5] = {
48+ PRED_LEFT, PRED_MEDIAN, PRED_MEDIAN, PRED_NONE, PRED_GRADIENT
49+};
50+#endif
51+
52+/* Compare huffman tree nodes */
53+static int ut_huff_cmp_len(const void *a, const void *b)
54+{
55+ const HuffEntry *aa = a, *bb = b;
56+ return (aa->len - bb->len)*256 + aa->sym - bb->sym;
57+}
58+
4059 /* Compare huffentry symbols */
4160 static int huff_cmp_sym(const void *a, const void *b)
4261 {
@@ -139,7 +158,7 @@ FF_DISABLE_DEPRECATION_WARNINGS · 96 unmodified lines
139158
140159 /* Convert from libavcodec prediction type to Ut Video's */
141160 if (avctx->prediction_method)
142− c->frame_pred = ff_ut_pred_order[avctx->prediction_method];
161+ c->frame_pred = ut_pred_order[avctx->prediction_method];
143162 FF_ENABLE_DEPRECATION_WARNINGS
144163 #endif
145164
@@ -340,7 +359,7 @@ static void calculate_codes(HuffEntry *he) · 194 unmodified lines
340359 int last, i;
341360 uint32_t code;
342361
343− qsort(he, 256, sizeof(*he), ff_ut_huff_cmp_len);
362+ qsort(he, 256, sizeof(*he), ut_huff_cmp_len);
344363
345364 last = 255;
346365 while (he[last].len == 255 && last)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t