History

avfilter/fifo: Remove unused functions and headers

The functions were forgotten in 03c8fe49ea3f2a2444607e541dff15a1ccd7f0c2; removing them also means that the avassert.h and samplefmt.h headers are no longer used any more, so they have been removed, too. Moreover, video.h is unused since b077d8d9082d057d4c7abd9e0b1a98f9651cfaa8 and channel_layout.h is since fdd9663781e3ebc8ebed0704607abd174095a905. Both headers have therefore been removed, too.

Andreas Rheinhardt committed 6 years ago

Commit d4e29d91 parent 2b71cd31 file · +0 −49Browse files

Unified · Split

libavfilter/fifo.c+0−49
@@ -23,16 +23,12 @@ · 22 unmodified lines
23 * FIFO buffering filter23 * FIFO buffering filter
24 */24 */
25 25
26#include "libavutil/avassert.h"
27#include "libavutil/channel_layout.h"
28#include "libavutil/common.h"26#include "libavutil/common.h"
29#include "libavutil/mathematics.h"27#include "libavutil/mathematics.h"
30#include "libavutil/samplefmt.h"
31 28
32#include "audio.h"29#include "audio.h"
33#include "avfilter.h"30#include "avfilter.h"
34#include "internal.h"31#include "internal.h"
35#include "video.h"
36 32
37typedef struct Buf {33typedef struct Buf {
38 AVFrame *frame;34 AVFrame *frame;
@@ -98,51 +94,6 @@ static void queue_pop(FifoContext *s) · 59 unmodified lines
98 s->root.next = tmp;94 s->root.next = tmp;
99}95}
100 96
101/**
102 * Move data pointers and pts offset samples forward.
103 */
104static void buffer_offset(AVFilterLink *link, AVFrame *frame,
105 int offset)
106{
107 int nb_channels = link->channels;
108 int planar = av_sample_fmt_is_planar(link->format);
109 int planes = planar ? nb_channels : 1;
110 int block_align = av_get_bytes_per_sample(link->format) * (planar ? 1 : nb_channels);
111 int i;
112
113 av_assert0(frame->nb_samples > offset);
114
115 for (i = 0; i < planes; i++)
116 frame->extended_data[i] += block_align * offset;
117 if (frame->data != frame->extended_data)
118 memcpy(frame->data, frame->extended_data,
119 FFMIN(planes, FF_ARRAY_ELEMS(frame->data)) * sizeof(*frame->data));
120 frame->linesize[0] -= block_align*offset;
121 frame->nb_samples -= offset;
122
123 if (frame->pts != AV_NOPTS_VALUE) {
124 frame->pts += av_rescale_q(offset, (AVRational){1, link->sample_rate},
125 link->time_base);
126 }
127}
128
129static int calc_ptr_alignment(AVFrame *frame)
130{
131 int planes = av_sample_fmt_is_planar(frame->format) ?
132 frame->channels : 1;
133 int min_align = 128;
134 int p;
135
136 for (p = 0; p < planes; p++) {
137 int cur_align = 128;
138 while ((intptr_t)frame->extended_data[p] % cur_align)
139 cur_align >>= 1;
140 if (cur_align < min_align)
141 min_align = cur_align;
142 }
143 return min_align;
144}
145
146static int request_frame(AVFilterLink *outlink)97static int request_frame(AVFilterLink *outlink)
147{98{
148 FifoContext *s = outlink->src->priv;99 FifoContext *s = outlink->src->priv;

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