diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-02-10 01:19:44 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-04 13:16:50 +0100 |
commit | 1d333c154718f3851b3af2d86663451d353e3685 (patch) | |
tree | 5c0a7f758110959a8c2157c3373f3720dc56b891 /libavformat | |
parent | 3afb41655e2afa8f4284f7fc19153cccf62afaa3 (diff) | |
download | ffmpeg-1d333c154718f3851b3af2d86663451d353e3685.tar.gz |
avcodec/jpegtables: Unavpriv MJPEG-tables
There are seven MJPEG-tables, five small (1x12, 4x17) and two
not small (2x162). These are all avpriv, despite this not being
worthwhile due to the overhead of exporting a symbol: The total
overhead for each symbol consists of two entries in .dynsym (24B each),
one entry in the importing library's .rela.dyn (24B) and one in .got
(8B) as well as 2x2B for symbol versions and 4B for symbol hashes
in the exporting library; in addition to that, the name of the symbol
is included in both exporting and importing libraries, using 2x210 bytes
in this case.
(The above numbers are for a x64 Elf/Linux/GNU system. Other platforms
will give different numbers.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/Makefile | 3 | ||||
-rw-r--r-- | libavformat/jpegtables.c | 24 | ||||
-rw-r--r-- | libavformat/rtpdec_jpeg.c | 16 | ||||
-rw-r--r-- | libavformat/rtpenc_jpeg.c | 16 |
4 files changed, 42 insertions, 17 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index 82e7fd3dc7..f5d6b8fecf 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -684,7 +684,8 @@ SHLIBOBJS += log2_tab.o SHLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o SHLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o SHLIBOBJS-$(CONFIG_MXF_MUXER) += golomb_tab.o -SHLIBOBJS-$(CONFIG_RTP_MUXER) += golomb_tab.o +SHLIBOBJS-$(CONFIG_RTPDEC) += jpegtables.o +SHLIBOBJS-$(CONFIG_RTP_MUXER) += golomb_tab.o jpegtables.o SHLIBOBJS-$(CONFIG_SPDIF_MUXER) += dca_sample_rate_tab.o # libavdevice dependencies diff --git a/libavformat/jpegtables.c b/libavformat/jpegtables.c new file mode 100644 index 0000000000..57eae9f9a6 --- /dev/null +++ b/libavformat/jpegtables.c @@ -0,0 +1,24 @@ +/* + * MJPEG tables + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2003 Alex Beregszaszi + * Copyright (c) 2003-2004 Michael Niedermayer + * + * 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 "libavcodec/jpegtabs.h" diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c index b32d074136..81036247c1 100644 --- a/libavformat/rtpdec_jpeg.c +++ b/libavformat/rtpdec_jpeg.c @@ -144,14 +144,14 @@ static int jpeg_create_header(uint8_t *buf, int size, uint32_t type, uint32_t w, bytestream2_put_be16(&pbc, 0); dht_size = 2; - dht_size += jpeg_create_huffman_table(&pbc, 0, 0,avpriv_mjpeg_bits_dc_luminance, - avpriv_mjpeg_val_dc); - dht_size += jpeg_create_huffman_table(&pbc, 0, 1, avpriv_mjpeg_bits_dc_chrominance, - avpriv_mjpeg_val_dc); - dht_size += jpeg_create_huffman_table(&pbc, 1, 0, avpriv_mjpeg_bits_ac_luminance, - avpriv_mjpeg_val_ac_luminance); - dht_size += jpeg_create_huffman_table(&pbc, 1, 1, avpriv_mjpeg_bits_ac_chrominance, - avpriv_mjpeg_val_ac_chrominance); + dht_size += jpeg_create_huffman_table(&pbc, 0, 0,ff_mjpeg_bits_dc_luminance, + ff_mjpeg_val_dc); + dht_size += jpeg_create_huffman_table(&pbc, 0, 1, ff_mjpeg_bits_dc_chrominance, + ff_mjpeg_val_dc); + dht_size += jpeg_create_huffman_table(&pbc, 1, 0, ff_mjpeg_bits_ac_luminance, + ff_mjpeg_val_ac_luminance); + dht_size += jpeg_create_huffman_table(&pbc, 1, 1, ff_mjpeg_bits_ac_chrominance, + ff_mjpeg_val_ac_chrominance); AV_WB16(dht_size_ptr, dht_size); /* SOF0 */ diff --git a/libavformat/rtpenc_jpeg.c b/libavformat/rtpenc_jpeg.c index 38eb2e68eb..91116832da 100644 --- a/libavformat/rtpenc_jpeg.c +++ b/libavformat/rtpenc_jpeg.c @@ -101,8 +101,8 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) switch (buf[i + 1]) { case 0x00: if ( dht_size >= 29 - && !memcmp(buf + i + 2, avpriv_mjpeg_bits_dc_luminance + 1, 16) - && !memcmp(buf + i + 18, avpriv_mjpeg_val_dc, 12)) { + && !memcmp(buf + i + 2, ff_mjpeg_bits_dc_luminance + 1, 16) + && !memcmp(buf + i + 18, ff_mjpeg_val_dc, 12)) { default_huffman_tables |= 1; i += 29; dht_size -= 29; @@ -113,8 +113,8 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) break; case 0x01: if ( dht_size >= 29 - && !memcmp(buf + i + 2, avpriv_mjpeg_bits_dc_chrominance + 1, 16) - && !memcmp(buf + i + 18, avpriv_mjpeg_val_dc, 12)) { + && !memcmp(buf + i + 2, ff_mjpeg_bits_dc_chrominance + 1, 16) + && !memcmp(buf + i + 18, ff_mjpeg_val_dc, 12)) { default_huffman_tables |= 1 << 1; i += 29; dht_size -= 29; @@ -125,8 +125,8 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) break; case 0x10: if ( dht_size >= 179 - && !memcmp(buf + i + 2, avpriv_mjpeg_bits_ac_luminance + 1, 16) - && !memcmp(buf + i + 18, avpriv_mjpeg_val_ac_luminance, 162)) { + && !memcmp(buf + i + 2, ff_mjpeg_bits_ac_luminance + 1, 16) + && !memcmp(buf + i + 18, ff_mjpeg_val_ac_luminance, 162)) { default_huffman_tables |= 1 << 2; i += 179; dht_size -= 179; @@ -137,8 +137,8 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) break; case 0x11: if ( dht_size >= 179 - && !memcmp(buf + i + 2, avpriv_mjpeg_bits_ac_chrominance + 1, 16) - && !memcmp(buf + i + 18, avpriv_mjpeg_val_ac_chrominance, 162)) { + && !memcmp(buf + i + 2, ff_mjpeg_bits_ac_chrominance + 1, 16) + && !memcmp(buf + i + 18, ff_mjpeg_val_ac_chrominance, 162)) { default_huffman_tables |= 1 << 3; i += 179; dht_size -= 179; |