History

Merge remote-tracking branch 'qatar/master'

* qatar/master: libschroedinger: Switch to function names more in line with Libav style. Move code shared between libdirac and libschroedinger to libschroedinger. lavfi: uninline avfilter_copy_buffer_ref_props(). lavf: add missing '*' in a doxy. h264: Remove a commented-out function pointer typedef. txd: Remove write-only variable in txd_decode_frame(). mmvideo.c: Remove unused variable in mm_decode_pal(). build: cosmetics: Add missing end-of-line backslashes to item lists. build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line. libschroedinger: Move a function to avoid a forward declaration. pthread: warn on high thread counts vf_yadif: fix missing error handling for avfilter_poll_frame() avprobe: allow showing only one container/stream property. lavfi: support audio in avfilter_copy_frame_props(). lavfi: avfilter_merge_formats: handle case where inputs are same lavc: add sample rate and channel layout to AVFrame. zerocodec: check if the previous frame is missing doc: clarify check for NULL pointer style Conflicts: doc/APIchanges doc/developer.texi ffprobe.c libavcodec/Makefile libavcodec/avcodec.h libavcodec/libdirac_libschro.c libavcodec/libdirac_libschro.h libavcodec/mmvideo.c libavcodec/txd.c libavcodec/version.h libavcodec/zerocodec.c libavfilter/Makefile libavfilter/avfilter.c libavfilter/version.h libavformat/Makefile libavutil/Makefile

Michael Niedermayer committed 14 years ago

Commit 653d1172 parents cb98273 fdc918631 files · +374 −340Browse files

Unified · Split

31 files
  1. doc/ffprobe.texi +5 −0
  2. ffprobe.c +41 −10
  3. libavcodec/Makefile +31 −10
  4. libavcodec/avcodec.h +16 −18
  5. libavcodec/h264dsp.h +0 −1
  6. libavcodec/libdirac_libschro.c +0 −113
  7. libavcodec/libdirac_libschro.h +0 −105
  8. libavcodec/libschroedinger.c +90 −5
  9. libavcodec/libschroedinger.h +70 −0
  10. libavcodec/libschroedingerdec.c +19 −23
  11. libavcodec/libschroedingerenc.c +14 −15
  12. libavcodec/mmvideo.c +1 −2
  13. libavcodec/pthread.c +5 −0
  14. libavcodec/txd.c +1 −3
  15. libavcodec/utils.c +4 −0
  16. libavcodec/version.h +1 −1
  17. libavcodec/zerocodec.c +2 −2
  18. libavdevice/Makefile +2 −1
  19. libavfilter/Makefile +10 −2
  20. libavfilter/avcodec.c +3 −2
  21. libavfilter/avfilter.c +12 −0
  22. libavfilter/avfilter.h +1 −12
  23. libavfilter/formats.c +2 −1
  24. libavfilter/version.h +1 −1
  25. libavformat/Makefile +8 −2
  26. libavformat/avformat.h +1 −1
  27. libavresample/Makefile +2 −2
  28. libavresample/x86/Makefile +2 −2
  29. libavutil/Makefile +27 −4
  30. libavutil/arm/Makefile +1 −1
  31. libswscale/Makefile +2 −1
doc/ffprobe.texi+5−0
@@ -106,6 +106,11 @@ stream. · 105 unmodified lines
106All the container format information is printed within a section with106All the container format information is printed within a section with
107name "FORMAT".107name "FORMAT".
108 108
109@item -show_format_entry @var{name}
110Like @option{-show_format}, but only prints the specified entry of the
111container format information, rather than all. This option may be given more
112than once, then all specified entries will be shown.
113
109@item -show_packets114@item -show_packets
110Show information about each packet contained in the input multimedia115Show information about each packet contained in the input multimedia
111stream.116stream.
ffprobe.c+41−10
@@ -50,6 +50,7 @@ static int do_read_packets = 0; · 49 unmodified lines
50static int do_show_error = 0;50static int do_show_error = 0;
51static int do_show_format = 0;51static int do_show_format = 0;
52static int do_show_frames = 0;52static int do_show_frames = 0;
53static AVDictionary *fmt_entries_to_show = NULL;
53static int do_show_packets = 0;54static int do_show_packets = 0;
54static int do_show_streams = 0;55static int do_show_streams = 0;
55static int do_show_program_version = 0;56static int do_show_program_version = 0;
@@ -81,6 +82,7 @@ static uint64_t *nb_streams_frames; · 25 unmodified lines
81 82
82void av_noreturn exit_program(int ret)83void av_noreturn exit_program(int ret)
83{84{
85 av_dict_free(&fmt_entries_to_show);
84 exit(ret);86 exit(ret);
85}87}
86 88
@@ -279,8 +281,10 @@ static inline void writer_print_section_footer(WriterContext *wctx, · 192 unmodified lines
279static inline void writer_print_integer(WriterContext *wctx,281static inline void writer_print_integer(WriterContext *wctx,
280 const char *key, long long int val)282 const char *key, long long int val)
281{283{
282 wctx->writer->print_integer(wctx, key, val);284 if (!fmt_entries_to_show || (key && av_dict_get(fmt_entries_to_show, key, NULL, 0))) {
283 wctx->nb_item++;285 wctx->writer->print_integer(wctx, key, val);
286 wctx->nb_item++;
287 }
284}288}
285 289
286static inline void writer_print_string(WriterContext *wctx,290static inline void writer_print_string(WriterContext *wctx,
@@ -288,8 +292,10 @@ static inline void writer_print_string(WriterContext *wctx, · 1 unmodified line
288{292{
289 if (opt && !(wctx->writer->flags & WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS))293 if (opt && !(wctx->writer->flags & WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS))
290 return;294 return;
291 wctx->writer->print_string(wctx, key, val);295 if (!fmt_entries_to_show || (key && av_dict_get(fmt_entries_to_show, key, NULL, 0))) {
292 wctx->nb_item++;296 wctx->writer->print_string(wctx, key, val);
297 wctx->nb_item++;
298 }
293}299}
294 300
295static void writer_print_time(WriterContext *wctx, const char *key,301static void writer_print_time(WriterContext *wctx, const char *key,
@@ -297,12 +303,14 @@ static void writer_print_time(WriterContext *wctx, const char *key, · 1 unmodified line
297{303{
298 char buf[128];304 char buf[128];
299 305
300 if (ts == AV_NOPTS_VALUE) {306 if (!fmt_entries_to_show || (key && av_dict_get(fmt_entries_to_show, key, NULL, 0))) {
301 writer_print_string(wctx, key, "N/A", 1);307 if (ts == AV_NOPTS_VALUE) {
302 } else {308 writer_print_string(wctx, key, "N/A", 1);
303 double d = ts * av_q2d(*time_base);309 } else {
304 value_string(buf, sizeof(buf), (struct unit_value){.val.d=d, .unit=unit_second_str});310 double d = ts * av_q2d(*time_base);
305 writer_print_string(wctx, key, buf, 0);311 value_string(buf, sizeof(buf), (struct unit_value){.val.d=d, .unit=unit_second_str});
312 writer_print_string(wctx, key, buf, 0);
313 }
306 }314 }
307}315}
308 316
@@ -1428,6 +1436,20 @@ static void show_streams(WriterContext *w, AVFormatContext *fmt_ctx) · 1119 unmodified lines
1428 show_stream(w, fmt_ctx, i);1436 show_stream(w, fmt_ctx, i);
1429}1437}
1430 1438
1439static void print_format_entry(const char *tag,
1440 const char *val)
1441{
1442 if (!fmt_entries_to_show) {
1443 if (tag) {
1444 printf("%s=%s\n", tag, val);
1445 } else {
1446 printf("%s\n", val);
1447 }
1448 } else if (tag && av_dict_get(fmt_entries_to_show, tag, NULL, 0)) {
1449 printf("%s=%s\n", tag, val);
1450 }
1451}
1452
1431static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)1453static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
1432{1454{
1433 char val_str[128];1455 char val_str[128];
@@ -1621,6 +1643,13 @@ static int opt_format(const char *opt, const char *arg) · 187 unmodified lines
1621 return 0;1643 return 0;
1622}1644}
1623 1645
1646static int opt_show_format_entry(const char *opt, const char *arg)
1647{
1648 do_show_format = 1;
1649 av_dict_set(&fmt_entries_to_show, arg, "", 0);
1650 return 0;
1651}
1652
1624static void opt_input_file(void *optctx, const char *arg)1653static void opt_input_file(void *optctx, const char *arg)
1625{1654{
1626 if (input_filename) {1655 if (input_filename) {
@@ -1678,6 +1707,8 @@ static const OptionDef options[] = { · 51 unmodified lines
1678 { "show_error", OPT_BOOL, {(void*)&do_show_error} , "show probing error" },1707 { "show_error", OPT_BOOL, {(void*)&do_show_error} , "show probing error" },
1679 { "show_format", OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },1708 { "show_format", OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },
1680 { "show_frames", OPT_BOOL, {(void*)&do_show_frames} , "show frames info" },1709 { "show_frames", OPT_BOOL, {(void*)&do_show_frames} , "show frames info" },
1710 { "show_format_entry", HAS_ARG, {(void*)opt_show_format_entry},
1711 "show a particular entry from the format/container info", "entry" },
1681 { "show_packets", OPT_BOOL, {(void*)&do_show_packets}, "show packets info" },1712 { "show_packets", OPT_BOOL, {(void*)&do_show_packets}, "show packets info" },
1682 { "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },1713 { "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },
1683 { "count_frames", OPT_BOOL, {(void*)&do_count_frames}, "count the number of frames per stream" },1714 { "count_frames", OPT_BOOL, {(void*)&do_count_frames}, "count the number of frames per stream" },
libavcodec/Makefile+31−10
@@ -3,7 +3,14 @@ include $(SUBDIR)../config.mak · 2 unmodified lines
3NAME = avcodec3NAME = avcodec
4FFLIBS = avutil4FFLIBS = avutil
5 5
6HEADERS = avcodec.h avfft.h dxva2.h vaapi.h vda.h vdpau.h version.h xvmc.h6HEADERS = avcodec.h \
7 avfft.h \
8 dxva2.h \
9 vaapi.h \
10 vda.h \
11 vdpau.h \
12 version.h \
13 xvmc.h \
7 14
8OBJS = allcodecs.o \15OBJS = allcodecs.o \
9 audioconvert.o \16 audioconvert.o \
@@ -651,11 +658,9 @@ OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o · 641 unmodified lines
651OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o658OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o
652OBJS-$(CONFIG_LIBOPENJPEG_ENCODER) += libopenjpegenc.o659OBJS-$(CONFIG_LIBOPENJPEG_ENCODER) += libopenjpegenc.o
653OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \660OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
654 libschroedinger.o \661 libschroedinger.o
655 libdirac_libschro.o
656OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \662OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
657 libschroedinger.o \663 libschroedinger.o
658 libdirac_libschro.o
659OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o664OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
660OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o audio_frame_queue.o665OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o audio_frame_queue.o
661OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o666OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
@@ -753,7 +758,8 @@ SKIPHEADERS += %_tablegen.h \ · 91 unmodified lines
753 aac_tablegen_decl.h \758 aac_tablegen_decl.h \
754 fft-internal.h \759 fft-internal.h \
755 tableprint.h \760 tableprint.h \
756 $(ARCH)/vp56_arith.h761 $(ARCH)/vp56_arith.h \
762
757SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h763SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
758SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h764SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
759SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h765SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h
@@ -762,13 +768,28 @@ SKIPHEADERS-$(CONFIG_VDA) += vda_internal.h · 2 unmodified lines
762SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h768SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h
763SKIPHEADERS-$(HAVE_W32THREADS) += w32pthreads.h769SKIPHEADERS-$(HAVE_W32THREADS) += w32pthreads.h
764 770
765TESTPROGS = cabac dct fft fft-fixed golomb iirfilter rangecoder snowenc771TESTPROGS = cabac \
772 dct \
773 fft \
774 fft-fixed \
775 golomb \
776 iirfilter \
777 rangecoder \
778 snowenc \
779
766TESTPROGS-$(HAVE_MMX) += motion780TESTPROGS-$(HAVE_MMX) += motion
767TESTOBJS = dctref.o781TESTOBJS = dctref.o
768 782
769HOSTPROGS = aac_tablegen aacps_tablegen cbrt_tablegen cos_tablegen \783HOSTPROGS = aac_tablegen \
770 dv_tablegen motionpixels_tablegen mpegaudio_tablegen \784 aacps_tablegen \
771 pcm_tablegen qdm2_tablegen sinewin_tablegen785 cbrt_tablegen \
786 cos_tablegen \
787 dv_tablegen \
788 motionpixels_tablegen \
789 mpegaudio_tablegen \
790 pcm_tablegen \
791 qdm2_tablegen \
792 sinewin_tablegen \
772 793
773CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)794CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
774 795
libavcodec/avcodec.h+16−18
@@ -1242,6 +1242,22 @@ typedef struct AVFrame { · 1241 unmodified lines
1242 */1242 */
1243 uint8_t motion_subsample_log2;1243 uint8_t motion_subsample_log2;
1244 1244
1245 /**
1246 * Sample rate of the audio data.
1247 *
1248 * - encoding: unused
1249 * - decoding: read by user
1250 */
1251 int sample_rate;
1252
1253 /**
1254 * Channel layout of the audio data.
1255 *
1256 * - encoding: unused
1257 * - decoding: read by user.
1258 */
1259 uint64_t channel_layout;
1260
1245 /**1261 /**
1246 * frame timestamp estimated using various heuristics, in stream time base1262 * frame timestamp estimated using various heuristics, in stream time base
1247 * Code outside libavcodec should access this field using:1263 * Code outside libavcodec should access this field using:
@@ -1260,24 +1276,6 @@ typedef struct AVFrame { · 12 unmodified lines
1260 */1276 */
1261 int64_t pkt_pos;1277 int64_t pkt_pos;
1262 1278
1263 /**
1264 * channel layout of the audio frame
1265 * - encoding: unused
1266 * - decoding: read by user.
1267 * Code outside libavcodec should access this field using:
1268 * av_frame_get_channel_layout(frame)
1269 */
1270 int64_t channel_layout;
1271
1272 /**
1273 * sample rate of the audio frame
1274 * - encoding: unused
1275 * - decoding: read by user.
1276 * Code outside libavcodec should access this field using:
1277 * av_frame_get_channel_layout(frame)
1278 */
1279 int sample_rate;
1280
1281} AVFrame;1279} AVFrame;
1282 1280
1283/**1281/**
libavcodec/h264dsp.h+0−1
@@ -30,7 +30,6 @@ · 29 unmodified lines
30#include <stdint.h>30#include <stdint.h>
31#include "dsputil.h"31#include "dsputil.h"
32 32
33//typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
34typedef void (*h264_weight_func)(uint8_t *block, int stride, int height,33typedef void (*h264_weight_func)(uint8_t *block, int stride, int height,
35 int log2_denom, int weight, int offset);34 int log2_denom, int weight, int offset);
36typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int height,35typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int height,
libavcodec/libdirac_libschro.c+0−113
@@ -1,113 +0,0 @@
1/*
2 * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22* @file
23* functions common to libdirac and libschroedinger
24*/
25
26#include "libdirac_libschro.h"
27
28static const DiracSchroVideoFormatInfo ff_dirac_schro_video_format_info[] = {
29 { 640, 480, 24000, 1001},
30 { 176, 120, 15000, 1001},
31 { 176, 144, 25, 2 },
32 { 352, 240, 15000, 1001},
33 { 352, 288, 25, 2 },
34 { 704, 480, 15000, 1001},
35 { 704, 576, 25, 2 },
36 { 720, 480, 30000, 1001},
37 { 720, 576, 25, 1 },
38 { 1280, 720, 60000, 1001},
39 { 1280, 720, 50, 1 },
40 { 1920, 1080, 30000, 1001},
41 { 1920, 1080, 25, 1 },
42 { 1920, 1080, 60000, 1001},
43 { 1920, 1080, 50, 1 },
44 { 2048, 1080, 24, 1 },
45 { 4096, 2160, 24, 1 },
46};
47
48unsigned int ff_dirac_schro_get_video_format_idx(AVCodecContext *avccontext)
49{
50 unsigned int ret_idx = 0;
51 unsigned int idx;
52 unsigned int num_formats = sizeof(ff_dirac_schro_video_format_info) /
53 sizeof(ff_dirac_schro_video_format_info[0]);
54
55 for (idx = 1; idx < num_formats; ++idx) {
56 const DiracSchroVideoFormatInfo *vf = &ff_dirac_schro_video_format_info[idx];
57 if (avccontext->width == vf->width &&
58 avccontext->height == vf->height) {
59 ret_idx = idx;
60 if (avccontext->time_base.den == vf->frame_rate_num &&
61 avccontext->time_base.num == vf->frame_rate_denom)
62 return idx;
63 }
64 }
65 return ret_idx;
66}
67
68void ff_dirac_schro_queue_init(DiracSchroQueue *queue)
69{
70 queue->p_head = queue->p_tail = NULL;
71 queue->size = 0;
72}
73
74void ff_dirac_schro_queue_free(DiracSchroQueue *queue,
75 void (*free_func)(void *))
76{
77 while (queue->p_head)
78 free_func(ff_dirac_schro_queue_pop(queue));
79}
80
81int ff_dirac_schro_queue_push_back(DiracSchroQueue *queue, void *p_data)
82{
83 DiracSchroQueueElement *p_new = av_mallocz(sizeof(DiracSchroQueueElement));
84
85 if (!p_new)
86 return -1;
87
88 p_new->data = p_data;
89
90 if (!queue->p_head)
91 queue->p_head = p_new;
92 else
93 queue->p_tail->next = p_new;
94 queue->p_tail = p_new;
95
96 ++queue->size;
97 return 0;
98}
99
100void *ff_dirac_schro_queue_pop(DiracSchroQueue *queue)
101{
102 DiracSchroQueueElement *top = queue->p_head;
103
104 if (top) {
105 void *data = top->data;
106 queue->p_head = queue->p_head->next;
107 --queue->size;
108 av_freep(&top);
109 return data;
110 }
111
112 return NULL;
113}
libavcodec/libdirac_libschro.h+0−105
@@ -1,105 +0,0 @@
1/*
2 * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22* @file
23* data structures common to libdirac and libschroedinger
24*/
25
26#ifndef AVCODEC_LIBDIRAC_LIBSCHRO_H
27#define AVCODEC_LIBDIRAC_LIBSCHRO_H
28
29#include "avcodec.h"
30
31typedef struct {
32 uint16_t width;
33 uint16_t height;
34 uint16_t frame_rate_num;
35 uint16_t frame_rate_denom;
36} DiracSchroVideoFormatInfo;
37
38/**
39* Returns the index into the Dirac Schro common video format info table
40*/
41unsigned int ff_dirac_schro_get_video_format_idx(AVCodecContext *avccontext);
42
43/**
44* contains a single encoded frame returned from Dirac or Schroedinger
45*/
46typedef struct DiracSchroEncodedFrame {
47 /** encoded frame data */
48 uint8_t *p_encbuf;
49
50 /** encoded frame size */
51 uint32_t size;
52
53 /** encoded frame number. Will be used as pts */
54 uint32_t frame_num;
55
56 /** key frame flag. 1 : is key frame , 0 : in not key frame */
57 uint16_t key_frame;
58} DiracSchroEncodedFrame;
59
60/**
61* queue element
62*/
63typedef struct DiracSchroQueueElement {
64 /** Data to be stored in queue*/
65 void *data;
66 /** Pointer to next element queue */
67 struct DiracSchroQueueElement *next;
68} DiracSchroQueueElement;
69
70
71/**
72* A simple queue implementation used in libdirac and libschroedinger
73*/
74typedef struct DiracSchroQueue {
75 /** Pointer to head of queue */
76 DiracSchroQueueElement *p_head;
77 /** Pointer to tail of queue */
78 DiracSchroQueueElement *p_tail;
79 /** Queue size*/
80 int size;
81} DiracSchroQueue;
82
83/**
84* Initialise the queue
85*/
86void ff_dirac_schro_queue_init(DiracSchroQueue *queue);
87
88/**
89* Add an element to the end of the queue
90*/
91int ff_dirac_schro_queue_push_back(DiracSchroQueue *queue, void *p_data);
92
93/**
94* Return the first element in the queue
95*/
96void *ff_dirac_schro_queue_pop(DiracSchroQueue *queue);
97
98/**
99* Free the queue resources. free_func is a function supplied by the caller to
100* free any resources allocated by the caller. The data field of the queue
101* element is passed to it.
102*/
103void ff_dirac_schro_queue_free(DiracSchroQueue *queue,
104 void (*free_func)(void *));
105#endif /* AVCODEC_LIBDIRAC_LIBSCHRO_H */
libavcodec/libschroedinger.c+90−5
@@ -23,12 +23,97 @@ · 22 unmodified lines
23* function definitions common to libschroedinger decoder and encoder23* function definitions common to libschroedinger decoder and encoder
24*/24*/
25 25
26#include "libdirac_libschro.h"
27#include "libschroedinger.h"26#include "libschroedinger.h"
28 27
28static const SchroVideoFormatInfo ff_schro_video_format_info[] = {
29 { 640, 480, 24000, 1001},
30 { 176, 120, 15000, 1001},
31 { 176, 144, 25, 2 },
32 { 352, 240, 15000, 1001},
33 { 352, 288, 25, 2 },
34 { 704, 480, 15000, 1001},
35 { 704, 576, 25, 2 },
36 { 720, 480, 30000, 1001},
37 { 720, 576, 25, 1 },
38 { 1280, 720, 60000, 1001},
39 { 1280, 720, 50, 1 },
40 { 1920, 1080, 30000, 1001},
41 { 1920, 1080, 25, 1 },
42 { 1920, 1080, 60000, 1001},
43 { 1920, 1080, 50, 1 },
44 { 2048, 1080, 24, 1 },
45 { 4096, 2160, 24, 1 },
46};
47
48static unsigned int get_video_format_idx(AVCodecContext *avccontext)
49{
50 unsigned int ret_idx = 0;
51 unsigned int idx;
52 unsigned int num_formats = sizeof(ff_schro_video_format_info) /
53 sizeof(ff_schro_video_format_info[0]);
54
55 for (idx = 1; idx < num_formats; ++idx) {
56 const SchroVideoFormatInfo *vf = &ff_schro_video_format_info[idx];
57 if (avccontext->width == vf->width &&
58 avccontext->height == vf->height) {
59 ret_idx = idx;
60 if (avccontext->time_base.den == vf->frame_rate_num &&
61 avccontext->time_base.num == vf->frame_rate_denom)
62 return idx;
63 }
64 }
65 return ret_idx;
66}
67
68void ff_schro_queue_init(FFSchroQueue *queue)
69{
70 queue->p_head = queue->p_tail = NULL;
71 queue->size = 0;
72}
73
74void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *))
75{
76 while (queue->p_head)
77 free_func(ff_schro_queue_pop(queue));
78}
79
80int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data)
81{
82 FFSchroQueueElement *p_new = av_mallocz(sizeof(FFSchroQueueElement));
83
84 if (!p_new)
85 return -1;
86
87 p_new->data = p_data;
88
89 if (!queue->p_head)
90 queue->p_head = p_new;
91 else
92 queue->p_tail->next = p_new;
93 queue->p_tail = p_new;
94
95 ++queue->size;
96 return 0;
97}
98
99void *ff_schro_queue_pop(FFSchroQueue *queue)
100{
101 FFSchroQueueElement *top = queue->p_head;
102
103 if (top) {
104 void *data = top->data;
105 queue->p_head = queue->p_head->next;
106 --queue->size;
107 av_freep(&top);
108 return data;
109 }
110
111 return NULL;
112}
113
29/**114/**
30* Schroedinger video preset table. Ensure that this tables matches up correctly115* Schroedinger video preset table. Ensure that this tables matches up correctly
31* with the ff_dirac_schro_video_format_info table in libdirac_libschro.c.116* with the ff_schro_video_format_info table.
32*/117*/
33static const SchroVideoFormatEnum ff_schro_video_formats[]={118static const SchroVideoFormatEnum ff_schro_video_formats[]={
34 SCHRO_VIDEO_FORMAT_CUSTOM ,119 SCHRO_VIDEO_FORMAT_CUSTOM ,
@@ -55,7 +140,7 @@ SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avccontext · 20 unmodified lines
55 unsigned int num_formats = sizeof(ff_schro_video_formats) /140 unsigned int num_formats = sizeof(ff_schro_video_formats) /
56 sizeof(ff_schro_video_formats[0]);141 sizeof(ff_schro_video_formats[0]);
57 142
58 unsigned int idx = ff_dirac_schro_get_video_format_idx (avccontext);143 unsigned int idx = get_video_format_idx(avccontext);
59 144
60 return (idx < num_formats) ? ff_schro_video_formats[idx] :145 return (idx < num_formats) ? ff_schro_video_formats[idx] :
61 SCHRO_VIDEO_FORMAT_CUSTOM;146 SCHRO_VIDEO_FORMAT_CUSTOM;
@@ -78,7 +163,7 @@ int ff_get_schro_frame_format (SchroChromaFormat schro_pix_fmt, · 16 unmodified lines
78 return -1;163 return -1;
79}164}
80 165
81static void FreeSchroFrame(SchroFrame *frame, void *priv)166static void free_schro_frame(SchroFrame *frame, void *priv)
82{167{
83 AVPicture *p_pic = priv;168 AVPicture *p_pic = priv;
84 169
@@ -110,7 +195,7 @@ SchroFrame *ff_create_schro_frame(AVCodecContext *avccontext, · 25 unmodified lines
110 p_frame->format = schro_frame_fmt;195 p_frame->format = schro_frame_fmt;
111 p_frame->width = y_width;196 p_frame->width = y_width;
112 p_frame->height = y_height;197 p_frame->height = y_height;
113 schro_frame_set_free_callback(p_frame, FreeSchroFrame, (void *)p_pic);198 schro_frame_set_free_callback(p_frame, free_schro_frame, (void *)p_pic);
114 199
115 for (i = 0; i < 3; ++i) {200 for (i = 0; i < 3; ++i) {
116 p_frame->components[i].width = i ? uv_width : y_width;201 p_frame->components[i].width = i ? uv_width : y_width;
libavcodec/libschroedinger.h+70−0
@@ -28,8 +28,78 @@ · 27 unmodified lines
28 28
29#include <schroedinger/schrobitstream.h>29#include <schroedinger/schrobitstream.h>
30#include <schroedinger/schroframe.h>30#include <schroedinger/schroframe.h>
31
31#include "avcodec.h"32#include "avcodec.h"
32 33
34typedef struct {
35 uint16_t width;
36 uint16_t height;
37 uint16_t frame_rate_num;
38 uint16_t frame_rate_denom;
39} SchroVideoFormatInfo;
40
41/**
42* contains a single encoded frame returned from Dirac or Schroedinger
43*/
44typedef struct FFSchroEncodedFrame {
45 /** encoded frame data */
46 uint8_t *p_encbuf;
47
48 /** encoded frame size */
49 uint32_t size;
50
51 /** encoded frame number. Will be used as pts */
52 uint32_t frame_num;
53
54 /** key frame flag. 1 : is key frame , 0 : in not key frame */
55 uint16_t key_frame;
56} FFSchroEncodedFrame;
57
58/**
59* queue element
60*/
61typedef struct FFSchroQueueElement {
62 /** Data to be stored in queue*/
63 void *data;
64 /** Pointer to next element queue */
65 struct FFSchroQueueElement *next;
66} FFSchroQueueElement;
67
68
69/**
70* A simple queue implementation used in libschroedinger
71*/
72typedef struct FFSchroQueue {
73 /** Pointer to head of queue */
74 FFSchroQueueElement *p_head;
75 /** Pointer to tail of queue */
76 FFSchroQueueElement *p_tail;
77 /** Queue size*/
78 int size;
79} FFSchroQueue;
80
81/**
82* Initialise the queue
83*/
84void ff_schro_queue_init(FFSchroQueue *queue);
85
86/**
87* Add an element to the end of the queue
88*/
89int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data);
90
91/**
92* Return the first element in the queue
93*/
94void *ff_schro_queue_pop(FFSchroQueue *queue);
95
96/**
97* Free the queue resources. free_func is a function supplied by the caller to
98* free any resources allocated by the caller. The data field of the queue
99* element is passed to it.
100*/
101void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *));
102
33static const struct {103static const struct {
34 enum PixelFormat ff_pix_fmt;104 enum PixelFormat ff_pix_fmt;
35 SchroChromaFormat schro_pix_fmt;105 SchroChromaFormat schro_pix_fmt;
libavcodec/libschroedingerdec.c+19−23
@@ -29,7 +29,6 @@ · 28 unmodified lines
29 29
30#include "libavutil/imgutils.h"30#include "libavutil/imgutils.h"
31#include "avcodec.h"31#include "avcodec.h"
32#include "libdirac_libschro.h"
33#include "libschroedinger.h"32#include "libschroedinger.h"
34 33
35#undef NDEBUG34#undef NDEBUG
@@ -52,7 +51,7 @@ typedef struct SchroDecoderParams { · 16 unmodified lines
52 SchroDecoder* decoder;51 SchroDecoder* decoder;
53 52
54 /** queue storing decoded frames */53 /** queue storing decoded frames */
55 DiracSchroQueue dec_frame_queue;54 FFSchroQueue dec_frame_queue;
56 55
57 /** end of sequence signalled */56 /** end of sequence signalled */
58 int eos_signalled;57 int eos_signalled;
@@ -71,16 +70,19 @@ typedef struct SchroParseUnitContext { · 12 unmodified lines
71 70
72 71
73static void libschroedinger_decode_buffer_free(SchroBuffer *schro_buf,72static void libschroedinger_decode_buffer_free(SchroBuffer *schro_buf,
74 void *priv);73 void *priv)
74{
75 av_freep(&priv);
76}
75 77
76static void SchroParseContextInit(SchroParseUnitContext *parse_ctx,78static void parse_context_init(SchroParseUnitContext *parse_ctx,
77 const uint8_t *buf, int buf_size)79 const uint8_t *buf, int buf_size)
78{80{
79 parse_ctx->buf = buf;81 parse_ctx->buf = buf;
80 parse_ctx->buf_size = buf_size;82 parse_ctx->buf_size = buf_size;
81}83}
82 84
83static SchroBuffer *FindNextSchroParseUnit(SchroParseUnitContext *parse_ctx)85static SchroBuffer *find_next_parse_unit(SchroParseUnitContext *parse_ctx)
84{86{
85 SchroBuffer *enc_buf = NULL;87 SchroBuffer *enc_buf = NULL;
86 int next_pu_offset = 0;88 int next_pu_offset = 0;
@@ -152,16 +154,10 @@ static av_cold int libschroedinger_decode_init(AVCodecContext *avccontext) · 65 unmodified lines
152 return -1;154 return -1;
153 155
154 /* Initialize the decoded frame queue. */156 /* Initialize the decoded frame queue. */
155 ff_dirac_schro_queue_init(&p_schro_params->dec_frame_queue);157 ff_schro_queue_init(&p_schro_params->dec_frame_queue);
156 return 0;158 return 0;
157}159}
158 160
159static void libschroedinger_decode_buffer_free(SchroBuffer *schro_buf,
160 void *priv)
161{
162 av_freep(&priv);
163}
164
165static void libschroedinger_decode_frame_free(void *frame)161static void libschroedinger_decode_frame_free(void *frame)
166{162{
167 schro_frame_unref(frame);163 schro_frame_unref(frame);
@@ -223,7 +219,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, · 55 unmodified lines
223 219
224 *data_size = 0;220 *data_size = 0;
225 221
226 SchroParseContextInit(&parse_ctx, buf, buf_size);222 parse_context_init(&parse_ctx, buf, buf_size);
227 if (!buf_size) {223 if (!buf_size) {
228 if (!p_schro_params->eos_signalled) {224 if (!p_schro_params->eos_signalled) {
229 state = schro_decoder_push_end_of_stream(decoder);225 state = schro_decoder_push_end_of_stream(decoder);
@@ -233,7 +229,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, · 3 unmodified lines
233 229
234 /* Loop through all the individual parse units in the input buffer */230 /* Loop through all the individual parse units in the input buffer */
235 do {231 do {
236 if ((enc_buf = FindNextSchroParseUnit(&parse_ctx))) {232 if ((enc_buf = find_next_parse_unit(&parse_ctx))) {
237 /* Push buffer into decoder. */233 /* Push buffer into decoder. */
238 if (SCHRO_PARSE_CODE_IS_PICTURE(enc_buf->data[4]) &&234 if (SCHRO_PARSE_CODE_IS_PICTURE(enc_buf->data[4]) &&
239 SCHRO_PARSE_CODE_NUM_REFS(enc_buf->data[4]) > 0)235 SCHRO_PARSE_CODE_NUM_REFS(enc_buf->data[4]) > 0)
@@ -270,8 +266,8 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, · 30 unmodified lines
270 frame = schro_decoder_pull(decoder);266 frame = schro_decoder_pull(decoder);
271 267
272 if (frame)268 if (frame)
273 ff_dirac_schro_queue_push_back(&p_schro_params->dec_frame_queue,269 ff_schro_queue_push_back(&p_schro_params->dec_frame_queue,
274 frame);270 frame);
275 break;271 break;
276 case SCHRO_DECODER_EOS:272 case SCHRO_DECODER_EOS:
277 go = 0;273 go = 0;
@@ -288,7 +284,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, · 10 unmodified lines
288 } while (outer);284 } while (outer);
289 285
290 /* Grab next frame to be returned from the top of the queue. */286 /* Grab next frame to be returned from the top of the queue. */
291 frame = ff_dirac_schro_queue_pop(&p_schro_params->dec_frame_queue);287 frame = ff_schro_queue_pop(&p_schro_params->dec_frame_queue);
292 288
293 if (frame) {289 if (frame) {
294 memcpy(p_schro_params->dec_pic.data[0],290 memcpy(p_schro_params->dec_pic.data[0],
@@ -327,8 +323,8 @@ static av_cold int libschroedinger_decode_close(AVCodecContext *avccontext) · 32 unmodified lines
327 avpicture_free(&p_schro_params->dec_pic);323 avpicture_free(&p_schro_params->dec_pic);
328 324
329 /* Free data in the output frame queue. */325 /* Free data in the output frame queue. */
330 ff_dirac_schro_queue_free(&p_schro_params->dec_frame_queue,326 ff_schro_queue_free(&p_schro_params->dec_frame_queue,
331 libschroedinger_decode_frame_free);327 libschroedinger_decode_frame_free);
332 328
333 return 0;329 return 0;
334}330}
@@ -340,10 +336,10 @@ static void libschroedinger_flush(AVCodecContext *avccontext) · 5 unmodified lines
340 SchroDecoderParams *p_schro_params = avccontext->priv_data;336 SchroDecoderParams *p_schro_params = avccontext->priv_data;
341 337
342 /* Free data in the output frame queue. */338 /* Free data in the output frame queue. */
343 ff_dirac_schro_queue_free(&p_schro_params->dec_frame_queue,339 ff_schro_queue_free(&p_schro_params->dec_frame_queue,
344 libschroedinger_decode_frame_free);340 libschroedinger_decode_frame_free);
345 341
346 ff_dirac_schro_queue_init(&p_schro_params->dec_frame_queue);342 ff_schro_queue_init(&p_schro_params->dec_frame_queue);
347 schro_decoder_reset(p_schro_params->decoder);343 schro_decoder_reset(p_schro_params->decoder);
348 p_schro_params->eos_pulled = 0;344 p_schro_params->eos_pulled = 0;
349 p_schro_params->eos_signalled = 0;345 p_schro_params->eos_signalled = 0;
libavcodec/libschroedingerenc.c+14−15
@@ -36,7 +36,6 @@ · 35 unmodified lines
36 36
37#include "avcodec.h"37#include "avcodec.h"
38#include "internal.h"38#include "internal.h"
39#include "libdirac_libschro.h"
40#include "libschroedinger.h"39#include "libschroedinger.h"
41#include "bytestream.h"40#include "bytestream.h"
42 41
@@ -65,7 +64,7 @@ typedef struct SchroEncoderParams { · 22 unmodified lines
65 int enc_buf_size;64 int enc_buf_size;
66 65
67 /** queue storing encoded frames */66 /** queue storing encoded frames */
68 DiracSchroQueue enc_frame_queue;67 FFSchroQueue enc_frame_queue;
69 68
70 /** end of sequence signalled */69 /** end of sequence signalled */
71 int eos_signalled;70 int eos_signalled;
@@ -80,7 +79,7 @@ typedef struct SchroEncoderParams { · 8 unmodified lines
80/**79/**
81* Works out Schro-compatible chroma format.80* Works out Schro-compatible chroma format.
82*/81*/
83static int SetSchroChromaFormat(AVCodecContext *avccontext)82static int set_chroma_format(AVCodecContext *avccontext)
84{83{
85 int num_formats = sizeof(schro_pixel_format_map) /84 int num_formats = sizeof(schro_pixel_format_map) /
86 sizeof(schro_pixel_format_map[0]);85 sizeof(schro_pixel_format_map[0]);
@@ -129,7 +128,7 @@ static int libschroedinger_encode_init(AVCodecContext *avccontext) · 42 unmodified lines
129 p_schro_params->format->width = avccontext->width;128 p_schro_params->format->width = avccontext->width;
130 p_schro_params->format->height = avccontext->height;129 p_schro_params->format->height = avccontext->height;
131 130
132 if (SetSchroChromaFormat(avccontext) == -1)131 if (set_chroma_format(avccontext) == -1)
133 return -1;132 return -1;
134 133
135 if (avccontext->color_primaries == AVCOL_PRI_BT709) {134 if (avccontext->color_primaries == AVCOL_PRI_BT709) {
@@ -236,7 +235,7 @@ static int libschroedinger_encode_init(AVCodecContext *avccontext) · 100 unmodified lines
236 schro_encoder_start(p_schro_params->encoder);235 schro_encoder_start(p_schro_params->encoder);
237 236
238 /* Initialize the encoded frame queue. */237 /* Initialize the encoded frame queue. */
239 ff_dirac_schro_queue_init(&p_schro_params->enc_frame_queue);238 ff_schro_queue_init(&p_schro_params->enc_frame_queue);
240 return 0;239 return 0;
241}240}
242 241
@@ -259,9 +258,9 @@ static SchroFrame *libschroedinger_frame_from_data(AVCodecContext *avccontext, · 16 unmodified lines
259 return in_frame;258 return in_frame;
260}259}
261 260
262static void SchroedingerFreeFrame(void *data)261static void libschroedinger_free_frame(void *data)
263{262{
264 DiracSchroEncodedFrame *enc_frame = data;263 FFSchroEncodedFrame *enc_frame = data;
265 264
266 av_freep(&enc_frame->p_encbuf);265 av_freep(&enc_frame->p_encbuf);
267 av_free(enc_frame);266 av_free(enc_frame);
@@ -273,7 +272,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk · 5 unmodified lines
273 int enc_size = 0;272 int enc_size = 0;
274 SchroEncoderParams *p_schro_params = avccontext->priv_data;273 SchroEncoderParams *p_schro_params = avccontext->priv_data;
275 SchroEncoder *encoder = p_schro_params->encoder;274 SchroEncoder *encoder = p_schro_params->encoder;
276 struct DiracSchroEncodedFrame *p_frame_output = NULL;275 struct FFSchroEncodedFrame *p_frame_output = NULL;
277 int go = 1;276 int go = 1;
278 SchroBuffer *enc_buf;277 SchroBuffer *enc_buf;
279 int presentation_frame;278 int presentation_frame;
@@ -333,7 +332,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk · 53 unmodified lines
333 }332 }
334 333
335 /* Create output frame. */334 /* Create output frame. */
336 p_frame_output = av_mallocz(sizeof(DiracSchroEncodedFrame));335 p_frame_output = av_mallocz(sizeof(FFSchroEncodedFrame));
337 /* Set output data. */336 /* Set output data. */
338 p_frame_output->size = p_schro_params->enc_buf_size;337 p_frame_output->size = p_schro_params->enc_buf_size;
339 p_frame_output->p_encbuf = p_schro_params->enc_buf;338 p_frame_output->p_encbuf = p_schro_params->enc_buf;
@@ -345,8 +344,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk · 5 unmodified lines
345 * through 17 represesent the frame number. */344 * through 17 represesent the frame number. */
346 p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);345 p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);
347 346
348 ff_dirac_schro_queue_push_back(&p_schro_params->enc_frame_queue,347 ff_schro_queue_push_back(&p_schro_params->enc_frame_queue,
349 p_frame_output);348 p_frame_output);
350 p_schro_params->enc_buf_size = 0;349 p_schro_params->enc_buf_size = 0;
351 p_schro_params->enc_buf = NULL;350 p_schro_params->enc_buf = NULL;
352 351
@@ -373,7 +372,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk · 20 unmodified lines
373 p_schro_params->eos_pulled)372 p_schro_params->eos_pulled)
374 last_frame_in_sequence = 1;373 last_frame_in_sequence = 1;
375 374
376 p_frame_output = ff_dirac_schro_queue_pop(&p_schro_params->enc_frame_queue);375 p_frame_output = ff_schro_queue_pop(&p_schro_params->enc_frame_queue);
377 376
378 if (!p_frame_output)377 if (!p_frame_output)
379 return 0;378 return 0;
@@ -410,7 +409,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk · 30 unmodified lines
410 409
411error:410error:
412 /* free frame */411 /* free frame */
413 SchroedingerFreeFrame(p_frame_output);412 libschroedinger_free_frame(p_frame_output);
414 return ret;413 return ret;
415}414}
416 415
@@ -423,8 +422,8 @@ static int libschroedinger_encode_close(AVCodecContext *avccontext) · 6 unmodified lines
423 schro_encoder_free(p_schro_params->encoder);422 schro_encoder_free(p_schro_params->encoder);
424 423
425 /* Free data in the output frame queue. */424 /* Free data in the output frame queue. */
426 ff_dirac_schro_queue_free(&p_schro_params->enc_frame_queue,425 ff_schro_queue_free(&p_schro_params->enc_frame_queue,
427 SchroedingerFreeFrame);426 libschroedinger_free_frame);
428 427
429 428
430 /* Free the encoder buffer. */429 /* Free the encoder buffer. */
libavcodec/mmvideo.c+1−2
@@ -85,8 +85,7 @@ static int mm_decode_pal(MmContext *s) · 84 unmodified lines
85 */85 */
86static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)86static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
87{87{
88 int x, y;88 int x = 0, y = 0;
89 x=0; y=0;
90 89
91 while (bytestream2_get_bytes_left(&s->gb) > 0) {90 while (bytestream2_get_bytes_left(&s->gb) > 0) {
92 int run_length, color;91 int run_length, color;
libavcodec/pthread.c+5−0
@@ -1051,6 +1051,11 @@ static void validate_thread_parameters(AVCodecContext *avctx) · 1050 unmodified lines
1051 avctx->thread_count = 1;1051 avctx->thread_count = 1;
1052 avctx->active_thread_type = 0;1052 avctx->active_thread_type = 0;
1053 }1053 }
1054
1055 if (avctx->thread_count > MAX_AUTO_THREADS)
1056 av_log(avctx, AV_LOG_WARNING,
1057 "Application has requested %d threads. Using a thread count greater than %d is not recommended.\n",
1058 avctx->thread_count, MAX_AUTO_THREADS);
1054}1059}
1055 1060
1056int ff_thread_init(AVCodecContext *avctx)1061int ff_thread_init(AVCodecContext *avctx)
libavcodec/txd.c+1−3
@@ -48,7 +48,6 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 47 unmodified lines
48 AVFrame *picture = data;48 AVFrame *picture = data;
49 AVFrame * const p = &s->picture;49 AVFrame * const p = &s->picture;
50 unsigned int version, w, h, d3d_format, depth, stride, flags;50 unsigned int version, w, h, d3d_format, depth, stride, flags;
51 unsigned int av_unused mipmap_count;
52 unsigned int y, v;51 unsigned int y, v;
53 uint8_t *ptr;52 uint8_t *ptr;
54 uint32_t *pal;53 uint32_t *pal;
@@ -60,8 +59,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 5 unmodified lines
60 w = bytestream2_get_le16(&gb);59 w = bytestream2_get_le16(&gb);
61 h = bytestream2_get_le16(&gb);60 h = bytestream2_get_le16(&gb);
62 depth = bytestream2_get_byte(&gb);61 depth = bytestream2_get_byte(&gb);
63 mipmap_count = bytestream2_get_byte(&gb);62 bytestream2_skip(&gb, 2);
64 bytestream2_skip(&gb, 1);
65 flags = bytestream2_get_byte(&gb);63 flags = bytestream2_get_byte(&gb);
66 64
67 if (version < 8 || version > 9) {65 if (version < 8 || version > 9) {
libavcodec/utils.c+4−0
@@ -390,6 +390,10 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame) · 389 unmodified lines
390 390
391 frame->reordered_opaque = avctx->reordered_opaque;391 frame->reordered_opaque = avctx->reordered_opaque;
392 392
393 frame->sample_rate = avctx->sample_rate;
394 frame->format = avctx->sample_fmt;
395 frame->channel_layout = avctx->channel_layout;
396
393 if (avctx->debug & FF_DEBUG_BUFFERS)397 if (avctx->debug & FF_DEBUG_BUFFERS)
394 av_log(avctx, AV_LOG_DEBUG, "default_get_buffer called on frame %p, "398 av_log(avctx, AV_LOG_DEBUG, "default_get_buffer called on frame %p, "
395 "internal audio buffer used\n", frame);399 "internal audio buffer used\n", frame);
libavcodec/version.h+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27 */27 */
28 28
29#define LIBAVCODEC_VERSION_MAJOR 5429#define LIBAVCODEC_VERSION_MAJOR 54
30#define LIBAVCODEC_VERSION_MINOR 1930#define LIBAVCODEC_VERSION_MINOR 20
31#define LIBAVCODEC_VERSION_MICRO 10031#define LIBAVCODEC_VERSION_MICRO 100
32 32
33#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \33#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavcodec/zerocodec.c+2−2
@@ -65,8 +65,8 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data, · 64 unmodified lines
65 pic->key_frame = 1;65 pic->key_frame = 1;
66 pic->pict_type = AV_PICTURE_TYPE_I;66 pic->pict_type = AV_PICTURE_TYPE_I;
67 } else {67 } else {
68 if (prev == NULL) {68 if (!prev) {
69 av_log(avctx, AV_LOG_ERROR, "No previous frame!\n");69 av_log(avctx, AV_LOG_ERROR, "Missing reference frame!\n");
70 return AVERROR_INVALIDDATA;70 return AVERROR_INVALIDDATA;
71 }71 }
72 pic->key_frame = 0;72 pic->key_frame = 0;
libavdevice/Makefile+2−1
@@ -6,7 +6,8 @@ FFLIBS-$(CONFIG_LAVFI_INDEV) += avfilter · 5 unmodified lines
6 6
7HEADERS = avdevice.h7HEADERS = avdevice.h
8 8
9OBJS = alldevices.o avdevice.o9OBJS = alldevices.o \
10 avdevice.o \
10 11
11# input/output devices12# input/output devices
12OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o \13OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o \
libavfilter/Makefile+10−2
@@ -11,7 +11,14 @@ FFLIBS-$(CONFIG_PAN_FILTER) += swresample · 10 unmodified lines
11FFLIBS-$(CONFIG_REMOVELOGO_FILTER) += avformat avcodec11FFLIBS-$(CONFIG_REMOVELOGO_FILTER) += avformat avcodec
12FFLIBS-$(CONFIG_MP_FILTER) += avcodec postproc12FFLIBS-$(CONFIG_MP_FILTER) += avcodec postproc
13 13
14HEADERS = asrc_abuffer.h avcodec.h avfilter.h avfiltergraph.h buffersink.h buffersrc.h version.h vsrc_buffer.h14HEADERS = asrc_abuffer.h \
15 avcodec.h \
16 avfilter.h \
17 avfiltergraph.h \
18 buffersink.h \
19 buffersrc.h \
20 version.h \
21 vsrc_buffer.h \
15 22
16OBJS = allfilters.o \23OBJS = allfilters.o \
17 avfilter.o \24 avfilter.o \
@@ -171,4 +178,5 @@ OBJS-$(CONFIG_MP_FILTER) += libmpcodecs/pullup.o · 153 unmodified lines
171 178
172TESTPROGS = drawutils formats179TESTPROGS = drawutils formats
173 180
174TOOLS = graph2dot lavfi-showfiltfmts181TOOLS = graph2dot \
182 lavfi-showfiltfmts \
libavfilter/avcodec.c+3−2
@@ -41,10 +41,11 @@ int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src) · 40 unmodified lines
41 dst->video->pict_type = src->pict_type;41 dst->video->pict_type = src->pict_type;
42 break;42 break;
43 case AVMEDIA_TYPE_AUDIO:43 case AVMEDIA_TYPE_AUDIO:
44 dst->audio->sample_rate = av_frame_get_sample_rate(src);44 dst->audio->sample_rate = src->sample_rate;
45 dst->audio->channel_layout = src->channel_layout;
45 break;46 break;
46 default:47 default:
47 return AVERROR(ENOSYS);48 return AVERROR(EINVAL);
48 }49 }
49 50
50 return 0;51 return 0;
libavfilter/avfilter.c+12−0
@@ -901,3 +901,15 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 900 unmodified lines
901 return ret;901 return ret;
902}902}
903 903
904void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
905{
906 // copy common properties
907 dst->pts = src->pts;
908 dst->pos = src->pos;
909
910 switch (src->type) {
911 case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
912 case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
913 default: break;
914 }
915}
libavfilter/avfilter.h+1−12
@@ -155,18 +155,7 @@ typedef struct AVFilterBufferRef { · 154 unmodified lines
155/**155/**
156 * Copy properties of src to dst, without copying the actual data156 * Copy properties of src to dst, without copying the actual data
157 */157 */
158static inline void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)158void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src);
159{
160 // copy common properties
161 dst->pts = src->pts;
162 dst->pos = src->pos;
163
164 switch (src->type) {
165 case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
166 case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
167 default: break;
168 }
169}
170 159
171/**160/**
172 * Add a new reference to a buffer.161 * Add a new reference to a buffer.
libavfilter/formats.c+2−1
@@ -47,7 +47,8 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b) · 46 unmodified lines
47 AVFilterFormats *ret;47 AVFilterFormats *ret;
48 unsigned i, j, k = 0;48 unsigned i, j, k = 0;
49 49
50 if (a == b) return a;50 if (a == b)
51 return a;
51 52
52 ret = av_mallocz(sizeof(*ret));53 ret = av_mallocz(sizeof(*ret));
53 54
libavfilter/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 30
31#define LIBAVFILTER_VERSION_MAJOR 231#define LIBAVFILTER_VERSION_MAJOR 2
32#define LIBAVFILTER_VERSION_MINOR 7232#define LIBAVFILTER_VERSION_MINOR 72
33#define LIBAVFILTER_VERSION_MICRO 10433#define LIBAVFILTER_VERSION_MICRO 105
34 34
35#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \35#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
36 LIBAVFILTER_VERSION_MINOR, \36 LIBAVFILTER_VERSION_MINOR, \
libavformat/Makefile+8−2
@@ -3,7 +3,9 @@ include $(SUBDIR)../config.mak · 2 unmodified lines
3NAME = avformat3NAME = avformat
4FFLIBS = avcodec avutil4FFLIBS = avcodec avutil
5 5
6HEADERS = avformat.h avio.h version.h6HEADERS = avformat.h \
7 avio.h \
8 version.h \
7 9
8OBJS = allformats.o \10OBJS = allformats.o \
9 avio.o \11 avio.o \
@@ -378,4 +380,8 @@ OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o · 368 unmodified lines
378 380
379SKIPHEADERS-$(CONFIG_NETWORK) += network.h rtsp.h381SKIPHEADERS-$(CONFIG_NETWORK) += network.h rtsp.h
380TESTPROGS = seek382TESTPROGS = seek
381TOOLS = aviocat ismindex pktdumper probetest383
384TOOLS = aviocat \
385 ismindex \
386 pktdumper \
387 probetest \
libavformat/avformat.h+1−1
@@ -856,7 +856,7 @@ typedef struct AVFormatContext { · 855 unmodified lines
856 */856 */
857 void *priv_data;857 void *priv_data;
858 858
859 /*859 /**
860 * I/O context.860 * I/O context.
861 *861 *
862 * decoding: either set by the user before avformat_open_input() (then862 * decoding: either set by the user before avformat_open_input() (then
libavresample/Makefile+2−2
@@ -2,7 +2,7 @@ NAME = avresample · 1 unmodified line
2FFLIBS = avutil2FFLIBS = avutil
3 3
4HEADERS = avresample.h \4HEADERS = avresample.h \
5 version.h5 version.h \
6 6
7OBJS = audio_convert.o \7OBJS = audio_convert.o \
8 audio_data.o \8 audio_data.o \
@@ -10,6 +10,6 @@ OBJS = audio_convert.o \ · 1 unmodified line
10 audio_mix_matrix.o \10 audio_mix_matrix.o \
11 options.o \11 options.o \
12 resample.o \12 resample.o \
13 utils.o13 utils.o \
14 14
15TESTPROGS = avresample15TESTPROGS = avresample
libavresample/x86/Makefile+2−2
@@ -1,5 +1,5 @@
1OBJS += x86/audio_convert_init.o \1OBJS += x86/audio_convert_init.o \
2 x86/audio_mix_init.o2 x86/audio_mix_init.o \
3 3
4YASM-OBJS += x86/audio_convert.o \4YASM-OBJS += x86/audio_convert.o \
5 x86/audio_mix.o5 x86/audio_mix.o \
libavutil/Makefile+27−4
@@ -42,6 +42,11 @@ HEADERS = adler32.h \ · 41 unmodified lines
42 timecode.h \42 timecode.h \
43 timestamp.h \43 timestamp.h \
44 44
45ARCH_HEADERS = bswap.h \
46 intmath.h \
47 intreadwrite.h \
48 timer.h \
49
45BUILT_HEADERS = avconfig.h50BUILT_HEADERS = avconfig.h
46 51
47OBJS = adler32.o \52OBJS = adler32.o \
@@ -81,12 +86,30 @@ OBJS = adler32.o \ · 33 unmodified lines
81 tree.o \86 tree.o \
82 utils.o \87 utils.o \
83 88
84TESTPROGS = adler32 aes avstring base64 bprint cpu crc des eval file fifo \89TESTPROGS = adler32 \
85 lfg lls md5 opt pca parseutils random_seed rational sha tree90 aes \
91 avstring \
92 base64 \
93 bprint \
94 cpu \
95 crc \
96 des \
97 eval \
98 file \
99 fifo \
100 lfg \
101 lls \
102 md5 \
103 opt \
104 pca \
105 parseutils \
106 random_seed \
107 rational \
108 sha \
109 tree \
110
86TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo111TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo
87 112
88TOOLS = ffeval113TOOLS = ffeval
89 114
90ARCH_HEADERS = bswap.h intmath.h intreadwrite.h timer.h
91
92$(SUBDIR)lzo-test$(EXESUF): ELIBS = -llzo2115$(SUBDIR)lzo-test$(EXESUF): ELIBS = -llzo2
libavutil/arm/Makefile+1−1
@@ -1 +1 @@
1OBJS += arm/cpu.o1OBJS += arm/cpu.o \
libswscale/Makefile+2−1
@@ -14,4 +14,5 @@ OBJS = input.o \ · 13 unmodified lines
14 utils.o \14 utils.o \
15 yuv2rgb.o \15 yuv2rgb.o \
16 16
17TESTPROGS = colorspace swscale17TESTPROGS = colorspace \
18 swscale \

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