Compare commits
43 Commits
release/3.
...
n2.4.1
Author | SHA1 | Date | |
---|---|---|---|
e1ce4f805f | |||
bb5c0ac922 | |||
d389438296 | |||
3b57d7769a | |||
b7f2719951 | |||
dc4e34a2f0 | |||
d694ab846c | |||
ab02548c8a | |||
b45ab61b24 | |||
cc73b4f574 | |||
8ac3b2cdb7 | |||
ace90ee265 | |||
703bd31647 | |||
c16e80ee3d | |||
66ac5b96e8 | |||
547cad8c81 | |||
55b1a1e9c1 | |||
f851477889 | |||
4f2d4b98fc | |||
7d8ebb8774 | |||
07b0ccf511 | |||
9d3e69ae30 | |||
480633c6c2 | |||
b5d4f49e3c | |||
4cde8bae49 | |||
5b740d1eaa | |||
152e09fde7 | |||
110841c3ab | |||
5694831e06 | |||
1f52f82a55 | |||
e62f08ca8d | |||
ee099059e7 | |||
e2a89f7f0f | |||
7c46855074 | |||
c2d6cc2971 | |||
8c91414803 | |||
0263750a0d | |||
63795fe5b9 | |||
d2bad216f7 | |||
d04fb11868 | |||
e8f2823f06 | |||
7dfccac20c | |||
04361427e6 |
11
Changelog
11
Changelog
@ -2,6 +2,17 @@ Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
|
||||
version 2.4.1:
|
||||
- swsscale: Allow chroma samples to be above and to the left of luma samples
|
||||
- avcodec/libilbc: support for latest git of libilbc
|
||||
- avcodec/webp: treat out-of-bound palette index as translucent black
|
||||
- vf_deshake: rename Transform.vector to Transform.vec to avoid compiler confusion
|
||||
- apetag: Fix APE tag size check
|
||||
- tools/crypto_bench: fix build when AV_READ_TIME is unavailable
|
||||
|
||||
|
||||
version 2.4:
|
||||
- Icecast protocol
|
||||
- ported lenscorrection filter from frei0r filter
|
||||
- large optimizations in dctdnoiz to make it usable
|
||||
|
@ -534,7 +534,7 @@ x86 Michael Niedermayer
|
||||
Releases
|
||||
========
|
||||
|
||||
2.3 Michael Niedermayer
|
||||
2.4 Michael Niedermayer
|
||||
2.2 Michael Niedermayer
|
||||
1.2 Michael Niedermayer
|
||||
|
||||
|
@ -53,6 +53,8 @@
|
||||
• API for live metadata updates through event flags.
|
||||
• UTF-16 support in text subtitles formats.
|
||||
• The ASS muxer now reorders the Dialogue events properly.
|
||||
• support for H.261 RTP payload format (RFC 4587)
|
||||
• HEVC/H.265 RTP payload format (draft v6) depacketizer
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavfilter │
|
||||
|
@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 2.4.1
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
@ -199,8 +199,7 @@ int main(int argc, char **argv)
|
||||
fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);
|
||||
|
||||
end:
|
||||
if (dst_file)
|
||||
fclose(dst_file);
|
||||
fclose(dst_file);
|
||||
|
||||
if (src_data)
|
||||
av_freep(&src_data[0]);
|
||||
|
@ -132,8 +132,7 @@ int main(int argc, char **argv)
|
||||
av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename);
|
||||
|
||||
end:
|
||||
if (dst_file)
|
||||
fclose(dst_file);
|
||||
fclose(dst_file);
|
||||
av_freep(&src_data[0]);
|
||||
av_freep(&dst_data[0]);
|
||||
sws_freeContext(sws_ctx);
|
||||
|
@ -96,8 +96,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
|
||||
(const WebRtc_UWord16*) buf, &s->decoder, 1);
|
||||
WebRtcIlbcfix_DecodeImpl((int16_t *) frame->data[0], (const uint16_t *) buf, &s->decoder, 1);
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
@ -170,7 +169,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
|
||||
return ret;
|
||||
|
||||
WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->data, (const WebRtc_Word16*) frame->data[0], &s->encoder);
|
||||
WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->data, (const int16_t *) frame->data[0], &s->encoder);
|
||||
|
||||
avpkt->size = s->encoder.no_of_bytes;
|
||||
*got_packet_ptr = 1;
|
||||
|
@ -241,7 +241,7 @@ AVCodec ff_amv_encoder = {
|
||||
.encode2 = amv_encode_picture,
|
||||
.close = ff_mpv_encode_end,
|
||||
.pix_fmts = (const enum AVPixelFormat[]){
|
||||
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_NONE
|
||||
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
@ -1028,7 +1028,7 @@ static int apply_color_indexing_transform(WebPContext *s)
|
||||
ImageContext *img;
|
||||
ImageContext *pal;
|
||||
int i, x, y;
|
||||
uint8_t *p, *pi;
|
||||
uint8_t *p;
|
||||
|
||||
img = &s->image[IMAGE_ROLE_ARGB];
|
||||
pal = &s->image[IMAGE_ROLE_COLOR_INDEXING];
|
||||
@ -1066,11 +1066,11 @@ static int apply_color_indexing_transform(WebPContext *s)
|
||||
p = GET_PIXEL(img->frame, x, y);
|
||||
i = p[2];
|
||||
if (i >= pal->frame->width) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid palette index %d\n", i);
|
||||
return AVERROR_INVALIDDATA;
|
||||
AV_WB32(p, 0xFF000000);
|
||||
} else {
|
||||
const uint8_t *pi = GET_PIXEL(pal->frame, i, 0);
|
||||
AV_COPY32(p, pi);
|
||||
}
|
||||
pi = GET_PIXEL(pal->frame, i, 0);
|
||||
AV_COPY32(p, pi);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,10 +20,10 @@
|
||||
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
;******************************************************************************
|
||||
|
||||
%if ARCH_X86_64
|
||||
|
||||
%include "libavutil/x86/x86util.asm"
|
||||
|
||||
%if ARCH_X86_64
|
||||
|
||||
SECTION_RODATA
|
||||
|
||||
cextern pb_3
|
||||
|
@ -48,7 +48,7 @@ typedef struct {
|
||||
} MotionVector;
|
||||
|
||||
typedef struct {
|
||||
MotionVector vector; ///< Motion vector
|
||||
MotionVector vec; ///< Motion vector
|
||||
double angle; ///< Angle of rotation
|
||||
double zoom; ///< Zoom percentage
|
||||
} Transform;
|
||||
|
@ -294,8 +294,8 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
||||
for (x = 0; x < deshake->rx * 2 + 1; x++) {
|
||||
//av_log(NULL, AV_LOG_ERROR, "%5d ", deshake->counts[x][y]);
|
||||
if (deshake->counts[x][y] > count_max_value) {
|
||||
t->vector.x = x - deshake->rx;
|
||||
t->vector.y = y - deshake->ry;
|
||||
t->vec.x = x - deshake->rx;
|
||||
t->vec.y = y - deshake->ry;
|
||||
count_max_value = deshake->counts[x][y];
|
||||
}
|
||||
}
|
||||
@ -304,12 +304,12 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
||||
|
||||
p_x = (center_x - width / 2.0);
|
||||
p_y = (center_y - height / 2.0);
|
||||
t->vector.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
|
||||
t->vector.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
|
||||
t->vec.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
|
||||
t->vec.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
|
||||
|
||||
// Clamp max shift & rotation?
|
||||
t->vector.x = av_clipf(t->vector.x, -deshake->rx * 2, deshake->rx * 2);
|
||||
t->vector.y = av_clipf(t->vector.y, -deshake->ry * 2, deshake->ry * 2);
|
||||
t->vec.x = av_clipf(t->vec.x, -deshake->rx * 2, deshake->rx * 2);
|
||||
t->vec.y = av_clipf(t->vec.y, -deshake->ry * 2, deshake->ry * 2);
|
||||
t->angle = av_clipf(t->angle, -0.1, 0.1);
|
||||
|
||||
//av_log(NULL, AV_LOG_ERROR, "%d x %d\n", avg->x, avg->y);
|
||||
@ -407,8 +407,8 @@ static int config_props(AVFilterLink *link)
|
||||
DeshakeContext *deshake = link->dst->priv;
|
||||
|
||||
deshake->ref = NULL;
|
||||
deshake->last.vector.x = 0;
|
||||
deshake->last.vector.y = 0;
|
||||
deshake->last.vec.x = 0;
|
||||
deshake->last.vec.y = 0;
|
||||
deshake->last.angle = 0;
|
||||
deshake->last.zoom = 0;
|
||||
|
||||
@ -476,57 +476,57 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
|
||||
|
||||
|
||||
// Copy transform so we can output it later to compare to the smoothed value
|
||||
orig.vector.x = t.vector.x;
|
||||
orig.vector.y = t.vector.y;
|
||||
orig.vec.x = t.vec.x;
|
||||
orig.vec.y = t.vec.y;
|
||||
orig.angle = t.angle;
|
||||
orig.zoom = t.zoom;
|
||||
|
||||
// Generate a one-sided moving exponential average
|
||||
deshake->avg.vector.x = alpha * t.vector.x + (1.0 - alpha) * deshake->avg.vector.x;
|
||||
deshake->avg.vector.y = alpha * t.vector.y + (1.0 - alpha) * deshake->avg.vector.y;
|
||||
deshake->avg.vec.x = alpha * t.vec.x + (1.0 - alpha) * deshake->avg.vec.x;
|
||||
deshake->avg.vec.y = alpha * t.vec.y + (1.0 - alpha) * deshake->avg.vec.y;
|
||||
deshake->avg.angle = alpha * t.angle + (1.0 - alpha) * deshake->avg.angle;
|
||||
deshake->avg.zoom = alpha * t.zoom + (1.0 - alpha) * deshake->avg.zoom;
|
||||
|
||||
// Remove the average from the current motion to detect the motion that
|
||||
// is not on purpose, just as jitter from bumping the camera
|
||||
t.vector.x -= deshake->avg.vector.x;
|
||||
t.vector.y -= deshake->avg.vector.y;
|
||||
t.vec.x -= deshake->avg.vec.x;
|
||||
t.vec.y -= deshake->avg.vec.y;
|
||||
t.angle -= deshake->avg.angle;
|
||||
t.zoom -= deshake->avg.zoom;
|
||||
|
||||
// Invert the motion to undo it
|
||||
t.vector.x *= -1;
|
||||
t.vector.y *= -1;
|
||||
t.vec.x *= -1;
|
||||
t.vec.y *= -1;
|
||||
t.angle *= -1;
|
||||
|
||||
// Write statistics to file
|
||||
if (deshake->fp) {
|
||||
snprintf(tmp, 256, "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", orig.vector.x, deshake->avg.vector.x, t.vector.x, orig.vector.y, deshake->avg.vector.y, t.vector.y, orig.angle, deshake->avg.angle, t.angle, orig.zoom, deshake->avg.zoom, t.zoom);
|
||||
snprintf(tmp, 256, "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", orig.vec.x, deshake->avg.vec.x, t.vec.x, orig.vec.y, deshake->avg.vec.y, t.vec.y, orig.angle, deshake->avg.angle, t.angle, orig.zoom, deshake->avg.zoom, t.zoom);
|
||||
fwrite(tmp, sizeof(char), strlen(tmp), deshake->fp);
|
||||
}
|
||||
|
||||
// Turn relative current frame motion into absolute by adding it to the
|
||||
// last absolute motion
|
||||
t.vector.x += deshake->last.vector.x;
|
||||
t.vector.y += deshake->last.vector.y;
|
||||
t.vec.x += deshake->last.vec.x;
|
||||
t.vec.y += deshake->last.vec.y;
|
||||
t.angle += deshake->last.angle;
|
||||
t.zoom += deshake->last.zoom;
|
||||
|
||||
// Shrink motion by 10% to keep things centered in the camera frame
|
||||
t.vector.x *= 0.9;
|
||||
t.vector.y *= 0.9;
|
||||
t.vec.x *= 0.9;
|
||||
t.vec.y *= 0.9;
|
||||
t.angle *= 0.9;
|
||||
|
||||
// Store the last absolute motion information
|
||||
deshake->last.vector.x = t.vector.x;
|
||||
deshake->last.vector.y = t.vector.y;
|
||||
deshake->last.vec.x = t.vec.x;
|
||||
deshake->last.vec.y = t.vec.y;
|
||||
deshake->last.angle = t.angle;
|
||||
deshake->last.zoom = t.zoom;
|
||||
|
||||
// Generate a luma transformation matrix
|
||||
avfilter_get_matrix(t.vector.x, t.vector.y, t.angle, 1.0 + t.zoom / 100.0, matrix_y);
|
||||
avfilter_get_matrix(t.vec.x, t.vec.y, t.angle, 1.0 + t.zoom / 100.0, matrix_y);
|
||||
// Generate a chroma transformation matrix
|
||||
avfilter_get_matrix(t.vector.x / (link->w / CHROMA_WIDTH(link)), t.vector.y / (link->h / CHROMA_HEIGHT(link)), t.angle, 1.0 + t.zoom / 100.0, matrix_uv);
|
||||
avfilter_get_matrix(t.vec.x / (link->w / CHROMA_WIDTH(link)), t.vec.y / (link->h / CHROMA_HEIGHT(link)), t.angle, 1.0 + t.zoom / 100.0, matrix_uv);
|
||||
// Transform the luma and chroma planes
|
||||
ret = deshake->transform(link->dst, link->w, link->h, CHROMA_WIDTH(link), CHROMA_HEIGHT(link),
|
||||
matrix_y, matrix_uv, INTERPOLATE_BILINEAR, deshake->edge, in, out);
|
||||
|
@ -557,10 +557,10 @@ static const AVOption scale_options[] = {
|
||||
{ "mpeg", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
|
||||
{ "tv", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
|
||||
{ "pc", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG}, 0, 0, FLAGS, "range" },
|
||||
{ "in_v_chr_pos", "input vertical chroma position in luma grid/256" , OFFSET(in_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
||||
{ "in_h_chr_pos", "input horizontal chroma position in luma grid/256", OFFSET(in_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
||||
{ "out_v_chr_pos", "output vertical chroma position in luma grid/256" , OFFSET(out_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
||||
{ "out_h_chr_pos", "output horizontal chroma position in luma grid/256", OFFSET(out_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
||||
{ "in_v_chr_pos", "input vertical chroma position in luma grid/256" , OFFSET(in_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||
{ "in_h_chr_pos", "input horizontal chroma position in luma grid/256", OFFSET(in_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||
{ "out_v_chr_pos", "output vertical chroma position in luma grid/256" , OFFSET(out_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||
{ "out_h_chr_pos", "output horizontal chroma position in luma grid/256", OFFSET(out_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||
{ "force_original_aspect_ratio", "decrease or increase w/h if necessary to keep the original AR", OFFSET(force_original_aspect_ratio), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2, FLAGS, "force_oar" },
|
||||
{ "disable", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, FLAGS, "force_oar" },
|
||||
{ "decrease", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, FLAGS, "force_oar" },
|
||||
|
@ -55,8 +55,10 @@ static int ape_tag_read_field(AVFormatContext *s)
|
||||
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
|
||||
return -1;
|
||||
}
|
||||
if (size >= UINT_MAX)
|
||||
return -1;
|
||||
if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
|
||||
av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (flags & APE_TAG_FLAG_IS_BINARY) {
|
||||
uint8_t filename[1024];
|
||||
enum AVCodecID id;
|
||||
|
@ -64,10 +64,10 @@ static const AVOption swscale_options[] = {
|
||||
{ "param0", "scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, VE },
|
||||
{ "param1", "scaler param 1", OFFSET(param[1]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, VE },
|
||||
|
||||
{ "src_v_chr_pos", "source vertical chroma position in luma grid/256" , OFFSET(src_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 512, VE },
|
||||
{ "src_h_chr_pos", "source horizontal chroma position in luma grid/256", OFFSET(src_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 512, VE },
|
||||
{ "dst_v_chr_pos", "destination vertical chroma position in luma grid/256" , OFFSET(dst_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 512, VE },
|
||||
{ "dst_h_chr_pos", "destination horizontal chroma position in luma grid/256", OFFSET(dst_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 512, VE },
|
||||
{ "src_v_chr_pos", "source vertical chroma position in luma grid/256" , OFFSET(src_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513 }, -513, 512, VE },
|
||||
{ "src_h_chr_pos", "source horizontal chroma position in luma grid/256", OFFSET(src_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513 }, -513, 512, VE },
|
||||
{ "dst_v_chr_pos", "destination vertical chroma position in luma grid/256" , OFFSET(dst_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513 }, -513, 512, VE },
|
||||
{ "dst_h_chr_pos", "destination horizontal chroma position in luma grid/256", OFFSET(dst_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513 }, -513, 512, VE },
|
||||
|
||||
{ "sws_dither", "set dithering algorithm", OFFSET(dither), AV_OPT_TYPE_INT, { .i64 = SWS_DITHER_AUTO }, 0, NB_SWS_DITHER, VE, "sws_dither" },
|
||||
{ "auto", "leave choice to sws", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_AUTO }, INT_MIN, INT_MAX, VE, "sws_dither" },
|
||||
|
@ -266,7 +266,7 @@ static double getSplineCoeff(double a, double b, double c, double d,
|
||||
|
||||
static av_cold int get_local_pos(SwsContext *s, int chr_subsample, int pos, int dir)
|
||||
{
|
||||
if (pos < 0) {
|
||||
if (pos == -1 || pos <= -513) {
|
||||
pos = (128 << chr_subsample) - 128;
|
||||
}
|
||||
pos += 128; // relative to ideal left edge
|
||||
|
@ -33,6 +33,10 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/timer.h"
|
||||
|
||||
#ifndef AV_READ_TIME
|
||||
#define AV_READ_TIME(x) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h> /* for getopt */
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user