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
664OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o664OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o
665OBJS-$(CONFIG_TXD_DECODER) += txd.o665OBJS-$(CONFIG_TXD_DECODER) += txd.o
666OBJS-$(CONFIG_ULTI_DECODER) += ulti.o666OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
667OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideo.o utvideodsp.o667OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideodsp.o
668OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o utvideo.o668OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o
669OBJS-$(CONFIG_V210_DECODER) += v210dec.o669OBJS-$(CONFIG_V210_DECODER) += v210dec.o
670OBJS-$(CONFIG_V210_ENCODER) += v210enc.o670OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
671OBJS-$(CONFIG_V210X_DECODER) += v210x.o671OBJS-$(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
30const int ff_ut_pred_order[5] = {
31 PRED_LEFT, PRED_MEDIAN, PRED_MEDIAN, PRED_NONE, PRED_GRADIENT
32};
33#endif
34
35int 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
61 UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'),61 UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'),
62};62};
63 63
64/* Mapping of libavcodec prediction modes to Ut Video's */
65extern const int ff_ut_pred_order[5];
66
67typedef struct UtvideoContext {64typedef struct UtvideoContext {
68 const AVClass *class;65 const AVClass *class;
69 AVCodecContext *avctx;66 AVCodecContext *avctx;
@@ -91,13 +88,4 @@ typedef struct UtvideoContext { · 21 unmodified lines
91 size_t control_stream_size[4][256];88 size_t control_stream_size[4][256];
92} UtvideoContext;89} UtvideoContext;
93 90
94typedef struct HuffEntry {
95 uint16_t sym;
96 uint8_t len;
97 uint32_t code;
98} HuffEntry;
99
100/* Compare huffman tree nodes */
101int ff_ut_huff_cmp_len(const void *a, const void *b);
102
103#endif /* AVCODEC_UTVIDEO_H */91#endif /* AVCODEC_UTVIDEO_H */
libavcodec/utvideoenc.c+21−2
@@ -37,6 +37,25 @@ · 36 unmodified lines
37#include "utvideo.h"37#include "utvideo.h"
38#include "huffman.h"38#include "huffman.h"
39 39
40typedef struct HuffEntry {
41 uint16_t sym;
42 uint8_t len;
43 uint32_t code;
44} HuffEntry;
45
46#if FF_API_PRIVATE_OPT
47static 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 */
53static 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
40/* Compare huffentry symbols */59/* Compare huffentry symbols */
41static int huff_cmp_sym(const void *a, const void *b)60static int huff_cmp_sym(const void *a, const void *b)
42{61{
@@ -139,7 +158,7 @@ FF_DISABLE_DEPRECATION_WARNINGS · 96 unmodified lines
139 158
140 /* Convert from libavcodec prediction type to Ut Video's */159 /* Convert from libavcodec prediction type to Ut Video's */
141 if (avctx->prediction_method)160 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];
143FF_ENABLE_DEPRECATION_WARNINGS162FF_ENABLE_DEPRECATION_WARNINGS
144#endif163#endif
145 164
@@ -340,7 +359,7 @@ static void calculate_codes(HuffEntry *he) · 194 unmodified lines
340 int last, i;359 int last, i;
341 uint32_t code;360 uint32_t code;
342 361
343 qsort(he, 256, sizeof(*he), ff_ut_huff_cmp_len);362 qsort(he, 256, sizeof(*he), ut_huff_cmp_len);
344 363
345 last = 255;364 last = 255;
346 while (he[last].len == 255 && last)365 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