Re: [FFmpeg-devel] [PATCH] ffplay: use av_codec_get_pkt_timebase()

2014-09-24 Thread Benoit Fouet
Hi,

- Mail original -
> Signed-off-by: Michael Niedermayer 
> ---
>  ffplay.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 6eb5aef..7728452 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -598,7 +598,7 @@ static int decoder_decode_frame(Decoder *d, void
> *fframe) {
>  if (frame->pts != AV_NOPTS_VALUE)
>  frame->pts = av_rescale_q(frame->pts,
>  d->avctx->time_base, tb);
>  else if (frame->pkt_pts != AV_NOPTS_VALUE)
> -frame->pts = av_rescale_q(frame->pkt_pts,
> d->avctx->pkt_timebase, tb);
> +frame->pts = av_rescale_q(frame->pkt_pts,
> av_codec_get_pkt_timebase(d->avctx), tb);
>  else if (d->next_pts != AV_NOPTS_VALUE)
>  frame->pts = av_rescale_q(d->next_pts,
>  d->next_pts_tb, tb);
>  if (frame->pts != AV_NOPTS_VALUE) {
> 

LGTM

-- 
Ben
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Experiences in using ffmpeg to transcode broadcast video

2014-09-24 Thread Mika Raento
Dear all

This mail is meant mainly as a note to other potential users, but
possibly as input to development - time allowing I might be able to pick
up some of the pieces myself. It's also a thank-you for all the hard
work in ffmpeg.

I've successfully implemented a transcoding pipeline for producing
multi-bitrate fragmented mp4 files from broadcast DVB input. More
concretely, I'm taking in broadcast TS captures with either mpeg2 video
and mp2 audio (SD, varying aspect ratio) or h264 video and aac audio,
both potentially with dvbsub. From that I'm producing ISMV output with
multiple bitrate h264 video at fixed 16:9 aspect ratio and multiple
bitrate aac audio, with burned subtitles. The ISMV outputs are
post-processed with tools/ismindex and with the hls muxer.

There are number of limitations in ffmpeg that I've had to work around:

- I haven't gotten sub2video or async working without reasonably
  monotonous DTS. Broadcast TS streams can easily contain backward jumps
  in time (e.g., a cheapo source that plays mp4 files and starts each file
  at 0). The fix is to cut the TS into pieces at timestamp jump locations
  and using '-itsoffset' to rewrite the timestamps and then concatenate.
  I'm using the segment and concat muxers for that.
- Sub2video doesn't work with negative timestamps, so I use '-itsoffset'
  to get positive timestamps
- For HD streams, I need to scale up the sub2video results from SD to
  HD. Sub2video doesn't handle the HD subtitle geometries. I'm not
  enough of an expert to know whether that's the issue, or whether that's
  just the way it's supposed to work with SD subs (typical) with HD video.
- For columnboxing, I use the scale, pad and setdar video filters. These
  work fine, but their parameters are only evaluated at start, so I need
  to cut the video into pieces with a single aspect ratio first and
  concatenate later.
- Audio sync (using aresample) gets confused if the input contains
  errors, so I need to first re-encode audio (with '-copyts') and only
  after that synchronize.
- The TS PIDs are not kept over the segment muxer, so I given them on
  the command line with '-streamid'.

I think all of the above would make great out-of-the-box ffmpeg features
:-)

If somebody is interested I can provide private copies of my inputs for
playing with, since they are copyrighted material I can't easily
distribute them.

I've automated the above steps with a bunch of python, using ffprobe to
parse the video stream. The result manages to correctly transcode about
98% of the TS inputs that our commercial transcoding and packaging pipe
fails to handle (it would probably do even better on the rest).

Thanks for all the features of ffmpeg that did work out-of-the-box :-)

BR,

Mika Raento
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] ffmpeg stickers

2014-09-24 Thread Thilo Borgmann
Am 24.09.14 04:02, schrieb compn:
> some ffmpeg stickers were passed out at vdd this year.
> i'm offering to mail these to any canadian / american devs who want
> them.
> just reply to me off list and include your addy.

I've the rest of the stickers available for our european community.

> i think they will also be available at fosdem or other euro
> conventions, so if you are planning to be there, probably better to get
> them there.
> 
> they are white lettering, no background, includes the 3d zigzag logo.

There zigzag only as well as zigzag + ffmpeg.org versions available.

-Thilo

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffplay: use av_codec_get_pkt_timebase()

2014-09-24 Thread Marton Balint



On Wed, 24 Sep 2014, Michael Niedermayer wrote:


Signed-off-by: Michael Niedermayer 
---
ffplay.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 6eb5aef..7728452 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -598,7 +598,7 @@ static int decoder_decode_frame(Decoder *d, void *fframe) {
if (frame->pts != AV_NOPTS_VALUE)
frame->pts = av_rescale_q(frame->pts, 
d->avctx->time_base, tb);
else if (frame->pkt_pts != AV_NOPTS_VALUE)
-frame->pts = av_rescale_q(frame->pkt_pts, 
d->avctx->pkt_timebase, tb);
+frame->pts = av_rescale_q(frame->pkt_pts, 
av_codec_get_pkt_timebase(d->avctx), tb);
else if (d->next_pts != AV_NOPTS_VALUE)
frame->pts = av_rescale_q(d->next_pts, d->next_pts_tb, 
tb);
if (frame->pts != AV_NOPTS_VALUE) {
--
1.7.9.5


LGTM, thanks.

Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavd/avfoundation: Add Audio Support (second try)

2014-09-24 Thread Thilo Borgmann
Hi!

Second try with changed timebase to microseconds as suggested by Michael for the
first patchset. Also applies to current HEAD where avfoundation already has
pixel format options.

Adding limited audio support to the AVFoundation device including some
predecessor patches.

Works on my device with AC3 encoding. I think there has to be some work done
concerning the PTS values. For example it is not in sync using FLAC encoding
(video is superfast, audio sounds normal). This has not been solved by changing
the timebase, any hints welcome!

I appreciate any comments!

Also this could use some more testing than on my only mac machine.

-Thilo
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/5] lavd/avfoundation: Split adding a device and getting the device configuration into separate functions.

2014-09-24 Thread Thilo Borgmann

>From be85e7d6fe11431ca3917d07da673cc2cc6a5ad6 Mon Sep 17 00:00:00 2001
From: Thilo Borgmann 
Date: Wed, 24 Sep 2014 12:16:31 +0200
Subject: [PATCH 1/5] lavd/avfoundation: Split adding a device and getting the
 device configuration into separate functions.

---
 libavdevice/avfoundation.m | 194 -
 1 file changed, 105 insertions(+), 89 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 4ac50a0..895bd29 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -172,99 +172,23 @@ static void destroy_context(AVFContext* ctx)
 }
 }
 
-static int avf_read_header(AVFormatContext *s)
+static int add_video_device(AVFormatContext *s, AVCaptureDevice *video_device)
 {
-NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-AVFContext *ctx = (AVFContext*)s->priv_data;
-ctx->first_pts  = av_gettime();
-
-pthread_mutex_init(&ctx->frame_lock, NULL);
-pthread_cond_init(&ctx->frame_wait_cond, NULL);
-
-// List devices if requested
-if (ctx->list_devices) {
-av_log(ctx, AV_LOG_INFO, "AVFoundation video devices:\n");
-NSArray *devices = [AVCaptureDevice 
devicesWithMediaType:AVMediaTypeVideo];
-for (AVCaptureDevice *device in devices) {
-const char *name = [[device localizedName] UTF8String];
-int index  = [devices indexOfObject:device];
-av_log(ctx, AV_LOG_INFO, "[%d] %s\n", index, name);
-}
-goto fail;
-}
-
-// Find capture device
-AVCaptureDevice *video_device = nil;
-
-// check for device index given in filename
-if (ctx->video_device_index == -1) {
-sscanf(s->filename, "%d", &ctx->video_device_index);
-}
-
-if (ctx->video_device_index >= 0) {
-NSArray *devices = [AVCaptureDevice 
devicesWithMediaType:AVMediaTypeVideo];
-
-if (ctx->video_device_index >= [devices count]) {
-av_log(ctx, AV_LOG_ERROR, "Invalid device index\n");
-goto fail;
-}
-
-video_device = [devices objectAtIndex:ctx->video_device_index];
-} else if (strncmp(s->filename, "",1) &&
-   strncmp(s->filename, "default", 7)) {
-NSArray *devices = [AVCaptureDevice 
devicesWithMediaType:AVMediaTypeVideo];
-
-for (AVCaptureDevice *device in devices) {
-if (!strncmp(s->filename, [[device localizedName] UTF8String], 
strlen(s->filename))) {
-video_device = device;
-break;
-}
-}
-
-if (!video_device) {
-av_log(ctx, AV_LOG_ERROR, "Video device not found\n");
-goto fail;
-}
-} else {
-video_device = [AVCaptureDevice 
defaultDeviceWithMediaType:AVMediaTypeMuxed];
-}
-
-// Video capture device not found, looking for AVMediaTypeVideo
-if (!video_device) {
-video_device = [AVCaptureDevice 
defaultDeviceWithMediaType:AVMediaTypeVideo];
-
-if (!video_device) {
-av_log(s, AV_LOG_ERROR, "No AV capture device found\n");
-goto fail;
-}
-}
-
-NSString* dev_display_name = [video_device localizedName];
-av_log(s, AV_LOG_DEBUG, "'%s' opened\n", [dev_display_name UTF8String]);
-
-// Initialize capture session
-ctx->capture_session = [[AVCaptureSession alloc] init];
-
-NSError *error = nil;
+AVFContext *ctx = (AVFContext*)s->priv_data;
+NSError *error  = nil;
 AVCaptureDeviceInput* capture_dev_input = [[[AVCaptureDeviceInput alloc] 
initWithDevice:video_device error:&error] autorelease];
 
 if (!capture_dev_input) {
 av_log(s, AV_LOG_ERROR, "Failed to create AV capture input device: 
%s\n",
[[error localizedDescription] UTF8String]);
-goto fail;
-}
-
-if (!capture_dev_input) {
-av_log(s, AV_LOG_ERROR, "Failed to add AV capture input device to 
session: %s\n",
-   [[error localizedDescription] UTF8String]);
-goto fail;
+return 1;
 }
 
 if ([ctx->capture_session canAddInput:capture_dev_input]) {
 [ctx->capture_session addInput:capture_dev_input];
 } else {
 av_log(s, AV_LOG_ERROR, "can't add video input to capture session\n");
-goto fail;
+return 1;
 }
 
 // Attaching output
@@ -272,7 +196,7 @@ static int avf_read_header(AVFormatContext *s)
 
 if (!ctx->video_output) {
 av_log(s, AV_LOG_ERROR, "Failed to init AV video output\n");
-goto fail;
+return 1;
 }
 
 // select pixel format
@@ -290,7 +214,7 @@ static int avf_read_header(AVFormatContext *s)
 if (pxl_fmt_spec.ff_id == AV_PIX_FMT_NONE) {
 av_log(s, AV_LOG_ERROR, "Selected pixel format (%s) is not supported 
by AVFoundation.\n",
av_get_pix_fmt_name(pxl_fmt_spec.ff_id));
-goto fail;
+return 1;
 }
 
 // check if the pixel format is available for this devi

[FFmpeg-devel] [PATCH 2/5] lavd/avfoundation: Using the actual stream index instead of hardcoded value.

2014-09-24 Thread Thilo Borgmann

>From 4feac7499c412de035f79f12c33fa130a8a517c8 Mon Sep 17 00:00:00 2001
From: Thilo Borgmann 
Date: Tue, 23 Sep 2014 16:48:06 +0200
Subject: [PATCH 2/5] lavd/avfoundation: Using the actual stream index instead
 of hardcoded value.

---
 libavdevice/avfoundation.m | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 895bd29..207d5c9 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -89,6 +89,7 @@ typedef struct
 
 int list_devices;
 int video_device_index;
+int video_stream_index;
 enum AVPixelFormat pixel_format;
 
 AVCaptureSession *capture_session;
@@ -295,6 +296,8 @@ static int get_video_config(AVFormatContext *s)
 return 1;
 }
 
+ctx->video_stream_index = stream->index;
+
 avpriv_set_pts_info(stream, 64, 1, avf_time_base);
 
 CVImageBufferRef image_buffer = 
CMSampleBufferGetImageBuffer(ctx->current_frame);
@@ -423,7 +426,7 @@ static int avf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 pkt->pts = pkt->dts = av_rescale_q(av_gettime() - ctx->first_pts,
AV_TIME_BASE_Q,
avf_time_base_q);
-pkt->stream_index  = 0;
+pkt->stream_index  = ctx->video_stream_index;
 pkt->flags|= AV_PKT_FLAG_KEY;
 
 CVPixelBufferLockBaseAddress(image_buffer, 0);
-- 
1.8.3.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/5] lavd/avfoundation: Simplify debug message generation.

2014-09-24 Thread Thilo Borgmann

>From 8035a104e439bc17b3d734cd0476530b4cb4a310 Mon Sep 17 00:00:00 2001
From: Thilo Borgmann 
Date: Tue, 23 Sep 2014 16:49:16 +0200
Subject: [PATCH 3/5] lavd/avfoundation: Simplify debug message generation.

---
 libavdevice/avfoundation.m | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 207d5c9..5b1e694 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -384,8 +384,7 @@ static int avf_read_header(AVFormatContext *s)
 }
 }
 
-NSString* dev_display_name = [video_device localizedName];
-av_log(s, AV_LOG_DEBUG, "'%s' opened\n", [dev_display_name UTF8String]);
+av_log(s, AV_LOG_DEBUG, "'%s' opened\n", [[video_device localizedName] 
UTF8String]);
 
 // Initialize capture session
 ctx->capture_session = [[AVCaptureSession alloc] init];
-- 
1.8.3.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 4/5] lavd/avfoundation: Use microseconds as common timebase.

2014-09-24 Thread Thilo Borgmann

>From 1aa75436cbb8ee1244e8bf5a08193db47e39e813 Mon Sep 17 00:00:00 2001
From: Thilo Borgmann 
Date: Tue, 23 Sep 2014 16:49:59 +0200
Subject: [PATCH 4/5] lavd/avfoundation: Use microseconds as common timebase.

---
 libavdevice/avfoundation.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 5b1e694..c31a934 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -35,7 +35,7 @@
 #include "libavutil/time.h"
 #include "avdevice.h"
 
-static const int avf_time_base = 100;
+static const int avf_time_base = 100;
 
 static const AVRational avf_time_base_q = {
 .num = 1,
-- 
1.8.3.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 5/5] lavd/avfoundation: Add basic PCM audio support.

2014-09-24 Thread Thilo Borgmann

>From 0eaddfcea9f2a557bf35a4fbeb30f0944b2e4d7d Mon Sep 17 00:00:00 2001
From: Thilo Borgmann 
Date: Tue, 23 Sep 2014 17:06:37 +0200
Subject: [PATCH 5/5] lavd/avfoundation: Add basic PCM audio support.

---
 libavdevice/avfoundation.m | 345 +++--
 1 file changed, 331 insertions(+), 14 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index c31a934..8c00a0e 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -82,19 +82,41 @@ typedef struct
 
 float   frame_rate;
 int frames_captured;
+int audio_frames_captured;
 int64_t first_pts;
+int64_t first_audio_pts;
 pthread_mutex_t frame_lock;
 pthread_cond_t  frame_wait_cond;
 id  avf_delegate;
+id  avf_audio_delegate;
 
 int list_devices;
 int video_device_index;
 int video_stream_index;
+int audio_device_index;
+int audio_stream_index;
+
+char*video_filename;
+char*audio_filename;
+
+int audio_channels;
+int audio_bits_per_sample;
+int audio_float;
+int audio_be;
+int audio_signed_integer;
+int audio_packed;
+int audio_non_interleaved;
+
+int32_t *audio_buffer;
+int audio_buffer_size;
+
 enum AVPixelFormat pixel_format;
 
 AVCaptureSession *capture_session;
 AVCaptureVideoDataOutput *video_output;
+AVCaptureAudioDataOutput *audio_output;
 CMSampleBufferRef current_frame;
+CMSampleBufferRef current_audio_frame;
 } AVFContext;
 
 static void lock_frames(AVFContext* ctx)
@@ -153,17 +175,69 @@ static void unlock_frames(AVFContext* ctx)
 
 @end
 
+/** AudioReciever class - delegate for AVCaptureSession
+ */
+@interface AVFAudioReceiver : NSObject
+{
+AVFContext* _context;
+}
+
+- (id)initWithContext:(AVFContext*)context;
+
+- (void)  captureOutput:(AVCaptureOutput *)captureOutput
+  didOutputSampleBuffer:(CMSampleBufferRef)audioFrame
+ fromConnection:(AVCaptureConnection *)connection;
+
+@end
+
+@implementation AVFAudioReceiver
+
+- (id)initWithContext:(AVFContext*)context
+{
+if (self = [super init]) {
+_context = context;
+}
+return self;
+}
+
+- (void)  captureOutput:(AVCaptureOutput *)captureOutput
+  didOutputSampleBuffer:(CMSampleBufferRef)audioFrame
+ fromConnection:(AVCaptureConnection *)connection
+{
+lock_frames(_context);
+
+if (_context->current_audio_frame != nil) {
+CFRelease(_context->current_audio_frame);
+}
+
+_context->current_audio_frame = (CMSampleBufferRef)CFRetain(audioFrame);
+
+pthread_cond_signal(&_context->frame_wait_cond);
+
+unlock_frames(_context);
+
+++_context->audio_frames_captured;
+}
+
+@end
+
 static void destroy_context(AVFContext* ctx)
 {
 [ctx->capture_session stopRunning];
 
 [ctx->capture_session release];
 [ctx->video_outputrelease];
+[ctx->audio_outputrelease];
 [ctx->avf_delegaterelease];
+[ctx->avf_audio_delegate release];
 
 ctx->capture_session = NULL;
 ctx->video_output= NULL;
+ctx->audio_output= NULL;
 ctx->avf_delegate= NULL;
+ctx->avf_audio_delegate = NULL;
+
+av_freep(&ctx->audio_buffer);
 
 pthread_mutex_destroy(&ctx->frame_lock);
 pthread_cond_destroy(&ctx->frame_wait_cond);
@@ -173,6 +247,19 @@ static void destroy_context(AVFContext* ctx)
 }
 }
 
+static void parse_device_name(AVFormatContext *s)
+{
+AVFContext *ctx = (AVFContext*)s->priv_data;
+char *tmp = av_strdup(s->filename);
+
+if (tmp[0] != ':') {
+ctx->video_filename = strtok(tmp,  ":");
+ctx->audio_filename = strtok(NULL, ":");
+} else {
+ctx->audio_filename = strtok(tmp,  ":");
+}
+}
+
 static int add_video_device(AVFormatContext *s, AVCaptureDevice *video_device)
 {
 AVFContext *ctx = (AVFContext*)s->priv_data;
@@ -279,6 +366,49 @@ static int add_video_device(AVFormatContext *s, 
AVCaptureDevice *video_device)
 return 0;
 }
 
+static int add_audio_device(AVFormatContext *s, AVCaptureDevice *audio_device)
+{
+AVFContext *ctx = (AVFContext*)s->priv_data;
+NSError *error  = nil;
+AVCaptureDeviceInput* audio_dev_input = [[[AVCaptureDeviceInput alloc] 
initWithDevice:audio_device error:&error] autorelease];
+
+if (!audio_dev_input) {
+av_log(s, AV_LOG_ERROR, "Failed to create AV capture input device: 
%s\n",
+   [[error localizedDescription] UTF8String]);
+return 1;
+}
+
+if ([ctx->capture_session canAddInput:audio_dev_input]) {
+[ctx->capture_session addInput:audio_dev_input];
+} else {
+av_log(s, AV_LOG_ERROR, "can't add audio input to capture session\n");
+return 1;
+}
+

[FFmpeg-devel] xtory codec support

2014-09-24 Thread I.C. Wiener


Hello, i have just upload the sample of dxtory 2.0 output file with ffmpeg 
stder dump(in corresponding txt file) to ftp://upload.ffmpeg.org/incoming . 
Please, have a look. Recent version of avcodec can not decode it.

I.C. Wiener. user...@rambler.ru
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: Support merging side data before the muxer

2014-09-24 Thread Nicolas George
Le primidi 1er vendémiaire, an CCXXIII, Thomas Volkert a écrit :
> There were enough votes declining this fast patch.  That's okay.
> Yes, you are right. This patch could cause some confusion in the future.
> 
> See https://trac.ffmpeg.org/ticket/3936 for the origin of this patch.
> The idea/patch is no longer pursued.

Thanks for the explanations. I see this in the ticket discussion:

# FFmpeg(AV muxer) ==> APP ==> FFmpeg(RTP muxer)

This looks strange to me: what is the "AV muxer" for exactly? Why not just
five the packets to the RTP muxer?

# This is useful to create verbose statistics about each individual data
# stream in the application.

It seems to me that you could gather the statistics from the AVPackets
before the muxer, could you not?

# this structure is needed to use also proprietary RTP packetizers beside the
# ones from ffmpeg.

This looks interesting. Can you explain what is missing from the API to be
able to use them? And also: what packetizer are missing from FFmpeg?

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 16/17] avformat/assenc: mux an event header if none are found in extradata

2014-09-24 Thread Nicolas George
Le jour de la Raison, an CCXXII, Clément Bœsch a écrit :
> ---
>  libavformat/assenc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/assenc.c b/libavformat/assenc.c
> index 236d021..5779e92 100644
> --- a/libavformat/assenc.c
> +++ b/libavformat/assenc.c
> @@ -54,6 +54,8 @@ static int write_header(AVFormatContext *s)
>  if (avctx->extradata[avctx->extradata_size - 1] != '\n')
>  avio_write(s->pb, "\r\n", 2);
>  }
> +if (!strstr(avctx->extradata, "\n[Events]"))
> +avio_printf(s->pb, "[Events]\r\nFormat: Layer, Start, End, Style, 
> Actor, MarginL, MarginR, MarginV, Effect, Text\r\n");
>  avio_flush(s->pb);
>  
>  return 0;

Can you point out in what case it is necessary? Broken input file?

Maybe a warning should be printed.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 16/17] avformat/assenc: mux an event header if none are found in extradata

2014-09-24 Thread Clément Bœsch
On Wed, Sep 24, 2014 at 01:20:36PM +0200, Nicolas George wrote:
> Le jour de la Raison, an CCXXII, Clément Bœsch a écrit :
> > ---
> >  libavformat/assenc.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/libavformat/assenc.c b/libavformat/assenc.c
> > index 236d021..5779e92 100644
> > --- a/libavformat/assenc.c
> > +++ b/libavformat/assenc.c
> > @@ -54,6 +54,8 @@ static int write_header(AVFormatContext *s)
> >  if (avctx->extradata[avctx->extradata_size - 1] != '\n')
> >  avio_write(s->pb, "\r\n", 2);
> >  }
> > +if (!strstr(avctx->extradata, "\n[Events]"))
> > +avio_printf(s->pb, "[Events]\r\nFormat: Layer, Start, End, Style, 
> > Actor, MarginL, MarginR, MarginV, Effect, Text\r\n");
> >  avio_flush(s->pb);
> >  
> >  return 0;
> 
> Can you point out in what case it is necessary? Broken input file?
> 
> Maybe a warning should be printed.
> 

No, this happens when people follow the specifications from matroska:
these two lines are not supposed to be muxed into the
CodecPrivate/extradata. That doesn't happen in practice (because you need
to store the Comments below the Format line, in the CodecPrivate), but it
can happen, and mkvextract seems to be able to deal with that by doing
something similar to that.

[...]

-- 
Clément B.


pgpqO1B0IUCdk.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 12/17] avformat/assdec: output ASS packets

2014-09-24 Thread Clément Bœsch
On Sun, Sep 21, 2014 at 08:32:59AM +0200, wm4 wrote:
> On Sat, 20 Sep 2014 22:27:52 +0200
> Clément Bœsch  wrote:
> 
> > After this the order from the original file is stored through readorder
> > when doing ffmpeg -i input.ass -c copy output.mkv.
> > 
> > And now that the ASS muxer honors the ReadOrder, extracting the ass back
> > (without transcoding) restores the original order.
> > ---
> >  libavformat/assdec.c  | 31 ---
> >  libavformat/version.h |  2 +-
> >  2 files changed, 25 insertions(+), 8 deletions(-)
> > 
> > diff --git a/libavformat/assdec.c b/libavformat/assdec.c
> > index a5f792a..5480171 100644
> > --- a/libavformat/assdec.c
> > +++ b/libavformat/assdec.c
> > @@ -29,6 +29,7 @@
> >  
> >  typedef struct ASSContext {
> >  FFDemuxSubtitlesQueue q;
> > +unsigned readorder;
> >  } ASSContext;
> >  
> >  static int ass_probe(AVProbeData *p)
> > @@ -52,18 +53,32 @@ static int ass_read_close(AVFormatContext *s)
> >  return 0;
> >  }
> >  
> > -static int read_ts(const uint8_t *p, int64_t *start, int *duration)
> > +static void rstrip_buf(AVBPrint *buf)
> > +{
> > +while (buf->len > 0 &&
> > +   buf->str[buf->len - 1] == '\r' ||
> > +   buf->str[buf->len - 1] == '\n')
> > +buf->str[--buf->len] = 0;
> > +}
> > +
> > +static int read_dialogue(ASSContext *ass, AVBPrint *dst, const uint8_t *p,
> > + int64_t *start, int *duration)
> >  {
> >  int64_t end;
> > +int layer, pos;
> >  int hh1, mm1, ss1, ms1;
> >  int hh2, mm2, ss2, ms2;
> >  
> > -if (sscanf(p, "%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",
> > +if (sscanf(p, "Dialogue: %d,%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n", &layer,
> > &hh1, &mm1, &ss1, &ms1,
> > -   &hh2, &mm2, &ss2, &ms2) == 8) {
> > +   &hh2, &mm2, &ss2, &ms2, &pos) >= 9) {
> >  end= (hh2*3600LL + mm2*60LL + ss2) * 100LL + ms2;
> >  *start = (hh1*3600LL + mm1*60LL + ss1) * 100LL + ms1;
> >  *duration = end - *start;
> > +
> > +av_bprint_clear(dst);
> > +av_bprintf(dst, "%u,%d,%s", ass->readorder++, layer, p + pos);
> > +rstrip_buf(dst);
> >  return 0;
> >  }
> >  return -1;
> > @@ -88,7 +103,7 @@ static int64_t get_line(AVBPrint *buf, FFTextReader *tr)
> >  static int ass_read_header(AVFormatContext *s)
> >  {
> >  ASSContext *ass = s->priv_data;
> > -AVBPrint header, line;
> > +AVBPrint header, line, rline;
> >  int header_remaining, res = 0;
> >  AVStream *st;
> >  FFTextReader tr;
> > @@ -99,12 +114,13 @@ static int ass_read_header(AVFormatContext *s)
> >  return AVERROR(ENOMEM);
> >  avpriv_set_pts_info(st, 64, 1, 100);
> >  st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
> > -st->codec->codec_id   = AV_CODEC_ID_SSA;
> > +st->codec->codec_id   = AV_CODEC_ID_ASS;
> >  
> >  header_remaining = INT_MAX;
> >  
> >  av_bprint_init(&header, 0, AV_BPRINT_SIZE_UNLIMITED);
> >  av_bprint_init(&line,   0, AV_BPRINT_SIZE_UNLIMITED);
> > +av_bprint_init(&rline,  0, AV_BPRINT_SIZE_UNLIMITED);
> >  
> >  for (;;) {
> >  int64_t pos = get_line(&line, &tr);
> > @@ -125,9 +141,9 @@ static int ass_read_header(AVFormatContext *s)
> >  int duration = -1;
> >  AVPacket *sub;
> >  
> > -if (read_ts(line.str, &ts_start, &duration) < 0)
> > +if (read_dialogue(ass, &rline, line.str, &ts_start, &duration) 
> > < 0)
> >  continue;
> > -sub = ff_subtitles_queue_insert(&ass->q, line.str, line.len, 
> > 0);
> > +sub = ff_subtitles_queue_insert(&ass->q, rline.str, rline.len, 
> > 0);
> >  if (!sub) {
> >  res = AVERROR(ENOMEM);
> >  goto end;
> > @@ -139,6 +155,7 @@ static int ass_read_header(AVFormatContext *s)
> >  }
> >  
> >  av_bprint_finalize(&line, NULL);
> > +av_bprint_finalize(&rline, NULL);
> >  
> >  res = avpriv_bprint_to_extradata(st->codec, &header);
> >  if (res < 0)
> > diff --git a/libavformat/version.h b/libavformat/version.h
> > index a869602..61decb9 100644
> > --- a/libavformat/version.h
> > +++ b/libavformat/version.h
> > @@ -31,7 +31,7 @@
> >  
> >  #define LIBAVFORMAT_VERSION_MAJOR 56
> >  #define LIBAVFORMAT_VERSION_MINOR  4
> > -#define LIBAVFORMAT_VERSION_MICRO 102
> > +#define LIBAVFORMAT_VERSION_MICRO 103
> >  
> >  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
> > LIBAVFORMAT_VERSION_MINOR, \
> 
> I think this was ok.

Note: I still haven't pushed this because it breaks when line are in old
ASS (with Marked=0 prefix). I'll fix that ASAP.

-- 
Clément B.


pgp8ZMGq6T2Y6.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: Support merging side data before the muxer

2014-09-24 Thread Thomas Volkert


On 24.09.2014 13:16, Nicolas George wrote:

Le primidi 1er vendémiaire, an CCXXIII, Thomas Volkert a écrit :

There were enough votes declining this fast patch.  That's okay.
Yes, you are right. This patch could cause some confusion in the future.

See https://trac.ffmpeg.org/ticket/3936 for the origin of this patch.
The idea/patch is no longer pursued.

Thanks for the explanations. I see this in the ticket discussion:

# this structure is needed to use also proprietary RTP packetizers beside the
# ones from ffmpeg.

This looks interesting. Can you explain what is missing from the API to be
able to use them? And also: what packetizer are missing from FFmpeg?




For example, support for H.261 and H.265/HEVC were missing.
Both packetizing schemes are supported now.

Best regards,
Thomas.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffplay: use av_codec_get_pkt_timebase()

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 05:56:00AM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  ffplay.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 6eb5aef..7728452 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -598,7 +598,7 @@ static int decoder_decode_frame(Decoder *d, void *fframe) 
> {
>  if (frame->pts != AV_NOPTS_VALUE)
>  frame->pts = av_rescale_q(frame->pts, 
> d->avctx->time_base, tb);
>  else if (frame->pkt_pts != AV_NOPTS_VALUE)
> -frame->pts = av_rescale_q(frame->pkt_pts, 
> d->avctx->pkt_timebase, tb);
> +frame->pts = av_rescale_q(frame->pkt_pts, 
> av_codec_get_pkt_timebase(d->avctx), tb);
>  else if (d->next_pts != AV_NOPTS_VALUE)
>  frame->pts = av_rescale_q(d->next_pts, 
> d->next_pts_tb, tb);
>  if (frame->pts != AV_NOPTS_VALUE) {

applied

thanks to all

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/avidec: ensure that palette does not contain the BottomUp info.

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 08:57:31AM +0200, Benoit Fouet wrote:
> Hi,
> 
> - Mail original -
> > On Tue, Sep 23, 2014 at 03:11:58PM +0200, Michael Niedermayer wrote:
> > > On Tue, Sep 23, 2014 at 01:33:30PM +0200, Benoit Fouet wrote:
> > > > Hi,
> > > > 
> > > > - Mail original -
> > > > > Hi,
> > > > > 
> > > > > - Mail original -
> > > > > > On Tue, Sep 23, 2014 at 10:19:17AM +0200, Benoit Fouet wrote:
> > > > > 
> > > > > > > Here is a patch to illustrate this...
> > > > > > 
> > > > > > this looks better but:
> > > > > > 
> > > > > > 
> > > > > > [...]
> > > > > > > -ff_put_bmp_header(pb, enc,
> > > > > > > ff_codec_bmp_tags, 0,
> > > > > > > 0);
> > > > > > > +if (keep_height) {
> > > > > > > +enc->extradata_size -= 9;
> > > > > > > +if (!enc->extradata_size)
> > > > > > > +av_freep(&enc->extradata);
> > > > > > > +}
> > > > > > 
> > > > > > what if extradata is stored in 2 files, the 2nd muxer would
> > > > > > no
> > > > > > longer
> > > > > > see it
> > > > > > also the muxer shouldnt change the encoders/demuxer extradata
> > > > > > 
> > > > > > and cant all this logic be put in ff_put_bmp_header() ?
> > > > > > might even be simpler
> > > > > > 
> > > > > 
> > > > > Do you mean that ff_put_bmp_header() would check for the
> > > > > BottomUp
> > > > > presence and not negate height in this case, and also only
> > > > > write the
> > > > > palette in the stream?
> > > > > 
> > > > 
> > > > Patch attached, just in case this is what you meant...
> > > 
> > > >  riffenc.c |6 --
> > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > d3a93efc5680ad2340086a61ba3d59749f67e770
> > > >  0001-avformat-riffenc-extend-ff_put_bmp_header-to-be-able.patch
> > > > From b8c8f07555769215af7a10c48e7a479f783a7c49 Mon Sep 17 00:00:00
> > > > 2001
> > > > From: Benoit Fouet 
> > > > Date: Tue, 23 Sep 2014 10:07:10 +0200
> > > > Subject: [PATCH] avformat/riffenc: extend ff_put_bmp_header to be
> > > > able to
> > > >  force height to not be changed.
> > > > 
> > > > When stream copying, height shouldn't be changed when writing the
> > > > BITMAPINFOHEADER header if the BottomUp information is present in
> > > > the
> > > > extradata.
> > > > ---
> > > >  libavformat/riffenc.c | 6 --
> > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
> > > > index ef4d399..f1a2274 100644
> > > > --- a/libavformat/riffenc.c
> > > > +++ b/libavformat/riffenc.c
> > > > @@ -209,11 +209,13 @@ int ff_put_wav_header(AVIOContext *pb,
> > > > AVCodecContext *enc, int flags)
> > > >  void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
> > > > const AVCodecTag *tags, int for_asf, int
> > > > ignore_extradata)
> > > >  {
> > > > +int keep_height = enc->extradata_size >= 9 &&
> > > > +  !memcmp(enc->extradata +
> > > > enc->extradata_size - 9, "BottomUp", 9);
> > > >  /* size */
> > > >  avio_wl32(pb, 40 + (ignore_extradata ? 0 :
> > > >  enc->extradata_size));
> > > >  avio_wl32(pb, enc->width);
> > > >  //We always store RGB TopDown
> > > > -avio_wl32(pb, enc->codec_tag ? enc->height : -enc->height);
> > > > +avio_wl32(pb, enc->codec_tag || keep_height ? enc->height :
> > > > -enc->height);
> > > >  /* planes */
> > > >  avio_wl16(pb, 1);
> > > >  /* depth */
> > > 
> > > > @@ -227,7 +229,7 @@ void ff_put_bmp_header(AVIOContext *pb,
> > > > AVCodecContext *enc,
> > > >  avio_wl32(pb, 0);
> > > >  
> > > >  if (!ignore_extradata) {
> > > > -avio_write(pb, enc->extradata, enc->extradata_size);
> > > > +avio_write(pb, enc->extradata, keep_height ?
> > > > enc->extradata_size : enc->extradata_size - 9);
> > > 
> > > this corrupts the stored extradata and breaks fate
> > 
> > fixed and applied
> > 
> > thanks
> > 
> 
> Yes, I swapped the ternary...
> Also, do you think it makes sense to revert my previous patch?

id like to keep it so we also support files that where remuxed with
the previous buggy code

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] x86/videodsp: add ff_emu_edge_{hfix, hvar}_avx2

2014-09-24 Thread Ronald S. Bultje
Hi,

On Tue, Sep 23, 2014 at 5:46 PM, James Almer  wrote:

> ~15% faster than sse2
>
> Signed-off-by: James Almer 
> ---
> ssse3's pshufb didn't prove to be faster, but fortunately avx2's broadcast
> instructions did.
> Maybe we could drop that FIXME altogheter.
>

Yes let's do that (it was a reminder to test it at some point, so that's
done now).

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Regression problem

2014-09-24 Thread JULIAN GARDNER
> From: JULIAN GARDNER 

>To: FFmpeg development discussions and patches  
>Sent: Tuesday, 23 September 2014, 13:37
>Subject: Re: [FFmpeg-devel] Regression problem
> 
>
>- Original Message -
>> From: Michael Niedermayer 
>> To: FFmpeg development discussions and patches 
>> Cc: 
>> Sent: Tuesday, 23 September 2014, 12:24
>> Subject: Re: [FFmpeg-devel] Regression problem
>> 
>> On Tue, Sep 23, 2014 at 09:27:57AM +0100, JULIAN GARDNER wrote:
>>>  I seem to be having problems using the ff_load_image routine, with a git 
>> pulled build from the beginning of the week, which used to work but is now 
>> giving me "failed to decode image file", and this is on a png that has 
>> been in use for over a year,
>>> 
>>>  The code is is based on VSRC_TESTSRC with an addition call to this code
>>> 
>>>  static int load_image(uint8_t **image_data, int *w, int *h, int *stride,
>>>   const char *filename, void *log_ctx)
>>>  {
>>>      int ret;
>>>      enum AVPixelFormat pix_fmt;
>>>      uint8_t *src_data[4], *dst_data[4];
>>>      int src_linesize[4], dst_linesize[4];
>>> 
>>>      av_log( NULL, AV_LOG_WARNING, "load_image %s\n", 
>> filename);
>>> 
>>>      /* load image from file */
>>>      if ((ret = ff_load_image(src_data, src_linesize, w, h, &pix_fmt, 
>> filename, log_ctx)) < 0)
>>>      return ret;
>>> 
>>>      if ((ret = ff_scale_image(dst_data, dst_linesize, *w, *h, PIXEL_FORMAT,
>>>    src_data, src_linesize, *w, *h, pix_fmt,
>>>    log_ctx)) < 0)
>>>      goto end;
>>> 
>>>      *stride = dst_linesize[0];
>>> 
>>>      /* copy image_data to a newly allocated array */
>>>      *image_data = av_malloc(*stride * *h);
>>>      if (!*image_data)
>>>      ret = AVERROR(ENOMEM);
>>>      av_image_copy_plane(*image_data, *stride, dst_data[0], 
>>>dst_linesize[0], 
>> *w*4, *h);
>>>  end:
>>>      av_free(src_data[0]);
>>>      av_free(dst_data[0]);
>>> 
>>>      return ret;
>>>  }
>>> 
>>> 
>>>  This used to work but now as I have said give the error message about not 
>> being able to decode
>>> 
>>>  There is nothing in the log, even with  as "-loglevel debug"
>>> 
>>>  load_image /home/encoder/images/Logo640x360.png
>>>  [AVIOContext @ 0x7fdcf8002580] Statistics: 3713 bytes read, 0 seeks
>>>  [libx264 @ 0x2c63320] frame= 322 QP=12.00 NAL=2 Slice:P Poc:144 I:15   
>> P:524  SKIP:381  size=14355 bytes
>>>  [Parsed_osd_0 @ 0x2c3b200] Failed to decode image from file
>>>  [Parsed_osd_0 @ 0x2c3b200] Error loading image file 
>> '/home/encoder/images/Logo640x360.png'
>> 
>> how can this be reproduced ?
>> can you share the png file ?
>> 
>
>It happens with any png, i just created a simple 100x100 png in gimp and this 
>also fails
>
>joolz
>


Started debgging the code and found that the return from the pngdec.c 
decode_frame is ok, data decoded and got_packet set to 1, image size if correct.

So looks like it is somewhere further down the chain.

joolz
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Juliet Fru
Hello,

I am Juliet Fru, a sophomore, Computer Engineering student of the
University of Buea. I'm intererested in working on the  MPEG-4 Audio
Lossless Coding (ALS) encoder project. I'll like to be added as a
propective student for this project. I'll also like to get some
pointers on how to get started on this project and what is need to
complete the qualification task.


Thanks,
Juliet
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Thilo Borgmann
Hi Juliet,

> I am Juliet Fru, a sophomore, Computer Engineering student of the
> University of Buea. I'm intererested in working on the  MPEG-4 Audio
> Lossless Coding (ALS) encoder project. I'll like to be added as a
> propective student for this project. I'll also like to get some
> pointers on how to get started on this project and what is need to
> complete the qualification task.

you have found the description of this project on our Google Summer of Code
project ideas page. Unfortunately, FFmpeg was not part of GSoC this year, so you
might very well work on this project but you will not be part of the GSoC
program - which means there is no funding nor certificate nor anything like 
that.

Of course we would appreciate it if you are interested in bringing the ALS
encoder into the codebase in spite of not being enlisted to GSoC. In that case
we are happy to give you a hand, help you prepare a github repo for the existing
encoder and things like that. Just let us know.

-Thilo
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Clément Bœsch
Hi Thilo,

On Wed, Sep 24, 2014 at 03:30:41PM +0200, Thilo Borgmann wrote:
> Hi Juliet,
> 
> > I am Juliet Fru, a sophomore, Computer Engineering student of the
> > University of Buea. I'm intererested in working on the  MPEG-4 Audio
> > Lossless Coding (ALS) encoder project. I'll like to be added as a
> > propective student for this project. I'll also like to get some
> > pointers on how to get started on this project and what is need to
> > complete the qualification task.
> 
> you have found the description of this project on our Google Summer of Code
> project ideas page. Unfortunately, FFmpeg was not part of GSoC this year, so 
> you
> might very well work on this project but you will not be part of the GSoC
> program - which means there is no funding nor certificate nor anything like 
> that.
> 
> Of course we would appreciate it if you are interested in bringing the ALS
> encoder into the codebase in spite of not being enlisted to GSoC. In that case
> we are happy to give you a hand, help you prepare a github repo for the 
> existing
> encoder and things like that. Just let us know.
> 

OPW ≠ GSoC. We did actually copy the task from GSoC to OPW. You can see
them at
http://trac.ffmpeg.org/wiki/SponsoringPrograms/OPW/2014-12#MPEG-4AudioLosslessCodingALSencoder

-- 
Clément B.


pgpwIbPbhVTUD.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Thilo Borgmann
Am 24.09.14 15:41, schrieb Clément Bœsch:
> Hi Thilo,
> 
> On Wed, Sep 24, 2014 at 03:30:41PM +0200, Thilo Borgmann wrote:
>> Hi Juliet,
>>
>>> I am Juliet Fru, a sophomore, Computer Engineering student of the
>>> University of Buea. I'm intererested in working on the  MPEG-4 Audio
>>> Lossless Coding (ALS) encoder project. I'll like to be added as a
>>> propective student for this project. I'll also like to get some
>>> pointers on how to get started on this project and what is need to
>>> complete the qualification task.
>>
>> you have found the description of this project on our Google Summer of Code
>> project ideas page. Unfortunately, FFmpeg was not part of GSoC this year, so 
>> you
>> might very well work on this project but you will not be part of the GSoC
>> program - which means there is no funding nor certificate nor anything like 
>> that.
>>
>> Of course we would appreciate it if you are interested in bringing the ALS
>> encoder into the codebase in spite of not being enlisted to GSoC. In that 
>> case
>> we are happy to give you a hand, help you prepare a github repo for the 
>> existing
>> encoder and things like that. Just let us know.
>>
> 
> OPW ≠ GSoC. We did actually copy the task from GSoC to OPW. You can see
> them at
> http://trac.ffmpeg.org/wiki/SponsoringPrograms/OPW/2014-12#MPEG-4AudioLosslessCodingALSencoder

Yes, my fault, sorry! Then, Juliet, please ignore my statement and wait for the
OPW mentor (Paul) or someone else attached to OPW to answer on this.

-Thilo

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Juliet Fru
Hello Thilo,


> Yes, my fault, sorry! Then, Juliet, please ignore my statement and wait
> for the
> OPW mentor (Paul) or someone else attached to OPW to answer on this.
>

I'll start working on my application, while waiting for instructions on how
to submit my qualification task.

Thanks,
Juliet
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Michael Niedermayer
Hi

On Wed, Sep 24, 2014 at 02:13:17PM +0100, Juliet Fru wrote:
> Hello,
> 
> I am Juliet Fru, a sophomore, Computer Engineering student of the
> University of Buea. I'm intererested in working on the  MPEG-4 Audio
> Lossless Coding (ALS) encoder project. I'll like to be added as a
> propective student for this project.

added you to the page
btw you can retry to register on trac/wiki, ive marked your last
attempt as ham so it might work now, or try from a different IP as
the one you used is on several dnsbl lists.


> I'll also like to get some
> pointers on how to get started on this project and what is need to
> complete the qualification task.

thilo, paul and stefano would be the right ones to talk to
assuming one of them agrees to mentor this in OPW (the page is laregly
copied from our last GSOC)


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Juliet Fru
Hello,


> added you to the page
> btw you can retry to register on trac/wiki, ive marked your last
> attempt as ham so it might work now, or try from a different IP as
> the one you used is on several dnsbl lists.
>
>
I'll retry the the registration again.

>
> thilo, paul and stefano would be the right ones to talk to
> assuming one of them agrees to mentor this in OPW (the page is laregly
> copied from our last GSOC)
>

Thanks would contact ASAP.


Regards,
Juliet
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] OPW, MPEG-4 Audio Lossless Coding (ALS) encoder

2014-09-24 Thread Thilo Borgmann
Am 24.09.14 16:11, schrieb Juliet Fru:
> [...]
>> thilo, paul and stefano would be the right ones to talk to
>> assuming one of them agrees to mentor this in OPW (the page is laregly
>> copied from our last GSOC)
>>
> 
> Thanks would contact ASAP.

I volunteer as co-mentor becuase my time is very limited currently.
However, I'm willing to help as much as I can.

For a start, Juliet, you should setup an account on github and fork a repository
from FFmpeg. Github's online help explains it quite good.

-Thilo

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] postproc: add basic deblock filter visualization support#

2014-09-24 Thread Michael Niedermayer
On Fri, Sep 19, 2014 at 04:42:28PM +0200, Clément Bœsch wrote:
> On Fri, Sep 19, 2014 at 03:44:31PM +0200, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libpostproc/postprocess.c  |   36 
> > +++-
> >  libpostproc/postprocess_internal.h |1 +
> >  libpostproc/postprocess_template.c |   14 ++
> >  3 files changed, 46 insertions(+), 5 deletions(-)
> > 
> > diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
> > index b6da294..de95745 100644
> > --- a/libpostproc/postprocess.c
> > +++ b/libpostproc/postprocess.c
> > @@ -151,6 +151,7 @@ static const struct PPFilter filters[]=
> >  {"tn", "tmpnoise",  1, 7, 8, TEMP_NOISE_FILTER},
> >  {"fq", "forcequant",1, 0, 0, FORCE_QUANT},
> >  {"be", "bitexact",  1, 0, 0, BITEXACT},
> > +{"vi", "visualize", 1, 0, 0, VISUALIZE},
> >  {NULL, NULL,0,0,0,0} //End Marker
> >  };
> >  
> > @@ -430,7 +431,7 @@ static inline void horizX1Filter(uint8_t *src, int 
> > stride, int QP)
> >   * accurate deblock filter
> >   */
> >  static av_always_inline void do_a_deblock_C(uint8_t *src, int step,
> > -int stride, const PPContext *c)
> > +int stride, const PPContext 
> > *c, int mode)
> >  {
> >  int y;
> >  const int QP= c->QP;
> > @@ -485,6 +486,32 @@ static av_always_inline void do_a_deblock_C(uint8_t 
> > *src, int step,
> >  sums[8] = sums[7] - src[3*step] + last;
> >  sums[9] = sums[8] - src[4*step] + last;
> >  
> > +if (mode & VISUALIZE) {
> > +// src[0*step] = av_clip_uint8(src[0*step]+32);
> > +// src[1*step] = av_clip_uint8(src[1*step]-32);
> > +// src[2*step] = av_clip_uint8(src[2*step]+32);
> > +// src[3*step] = av_clip_uint8(src[3*step]-32);
> > +// src[4*step] = av_clip_uint8(src[4*step]+32);
> > +// src[5*step] = av_clip_uint8(src[5*step]-32);
> > +// src[6*step] = av_clip_uint8(src[6*step]+32);
> > +// src[7*step] = av_clip_uint8(src[7*step]-32);
> > +src[0*step] =
> > +src[1*step] =
> > +src[2*step] =
> > +src[3*step] =
> > +src[4*step] =
> > +src[5*step] =
> > +src[6*step] =
> > +src[7*step] = 128;
> > +// src[0*step]= av_clip_uint8((-sums[0] - sums[2] + 
> > 22*src[0*step])>>3);
> > +// src[1*step]= av_clip_uint8((-sums[1] - sums[3] + 
> > 22*src[1*step])>>3);
> > +// src[2*step]= av_clip_uint8((-sums[2] - sums[4] + 
> > 22*src[2*step])>>3);
> > +// src[3*step]= av_clip_uint8((-sums[3] - sums[5] + 
> > 22*src[3*step])>>3);
> > +// src[4*step]= av_clip_uint8((-sums[4] - sums[6] + 
> > 22*src[4*step])>>3);
> > +// src[5*step]= av_clip_uint8((-sums[5] - sums[7] + 
> > 22*src[5*step])>>3);
> > +// src[6*step]= av_clip_uint8((-sums[6] - sums[8] + 
> > 22*src[6*step])>>3);
> > +// src[7*step]= av_clip_uint8((-sums[7] - sums[9] + 
> > 22*src[7*step])>>3);
> > +}
> 
> If you want to add dead code, please at least explain above why it should
> be kept.

removed


> 
> [...]
> 
> No opinion on the rest of the patchset; don't forget to bump micro if you
> apply.

bumped minor

applied

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v7] Add SUP/PGS subtitle demuxer

2014-09-24 Thread wm4
---
doc reference, bump minor, no other changes
---
 doc/general.texi |   1 +
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/supdec.c | 109 +++
 libavformat/version.h|   4 +-
 5 files changed, 114 insertions(+), 2 deletions(-)
 create mode 100644 libavformat/supdec.c

diff --git a/doc/general.texi b/doc/general.texi
index 8d7555d..7f6fb86 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -453,6 +453,7 @@ library:
 @item Sony PlayStation STR  @tab   @tab X
 @item Sony Wave64 (W64) @tab X @tab X
 @item SoX native format @tab X @tab X
+@item SUP raw PGS subtitles @tab   @tab X
 @item SUN AU format @tab X @tab X
 @item Text files@tab   @tab X
 @item THP   @tab   @tab X
diff --git a/libavformat/Makefile b/libavformat/Makefile
index d3bf48f..d9b839e 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -406,6 +406,7 @@ OBJS-$(CONFIG_SRT_MUXER) += srtenc.o
 OBJS-$(CONFIG_STR_DEMUXER)   += psxstr.o
 OBJS-$(CONFIG_SUBVIEWER1_DEMUXER)+= subviewer1dec.o subtitles.o
 OBJS-$(CONFIG_SUBVIEWER_DEMUXER) += subviewerdec.o subtitles.o
+OBJS-$(CONFIG_SUP_DEMUXER)   += supdec.o
 OBJS-$(CONFIG_SWF_DEMUXER)   += swfdec.o swf.o
 OBJS-$(CONFIG_SWF_MUXER) += swfenc.o swf.o
 OBJS-$(CONFIG_TAK_DEMUXER)   += takdec.o apetag.o img2.o rawdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 8f70c4b..e6c0e5f 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -280,6 +280,7 @@ void av_register_all(void)
 REGISTER_DEMUXER (STR,  str);
 REGISTER_DEMUXER (SUBVIEWER1,   subviewer1);
 REGISTER_DEMUXER (SUBVIEWER,subviewer);
+REGISTER_DEMUXER (SUP,  sup);
 REGISTER_MUXDEMUX(SWF,  swf);
 REGISTER_DEMUXER (TAK,  tak);
 REGISTER_MUXER   (TEE,  tee);
diff --git a/libavformat/supdec.c b/libavformat/supdec.c
new file mode 100644
index 000..90a6ab7
--- /dev/null
+++ b/libavformat/supdec.c
@@ -0,0 +1,109 @@
+/*
+ * 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 "avformat.h"
+#include "internal.h"
+#include "libavutil/intreadwrite.h"
+
+#define SUP_PGS_MAGIC 0x5047 /* "PG", big endian */
+
+static int sup_read_header(AVFormatContext *s)
+{
+AVStream *st = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
+st->codec->codec_id = AV_CODEC_ID_HDMV_PGS_SUBTITLE;
+avpriv_set_pts_info(st, 32, 1, 9);
+
+return 0;
+}
+
+static int sup_read_packet(struct AVFormatContext *s, AVPacket *pkt)
+{
+int64_t pts, dts, pos;
+int ret;
+
+pos = avio_tell(s->pb);
+
+if (avio_rb16(s->pb) != SUP_PGS_MAGIC)
+return avio_feof(s->pb) ? AVERROR_EOF : AVERROR_INVALIDDATA;
+
+pts = avio_rb32(s->pb);
+dts = avio_rb32(s->pb);
+
+if ((ret = av_get_packet(s->pb, pkt, 3)) < 0)
+return ret;
+
+pkt->stream_index = 0;
+pkt->flags |= AV_PKT_FLAG_KEY;
+pkt->pos = pos;
+pkt->pts = pts;
+// Many files have DTS set to 0 for all packets, so assume 0 means unset.
+pkt->dts = dts ? dts : AV_NOPTS_VALUE;
+
+if (pkt->size >= 3) {
+// The full packet size is stored as part of the packet.
+size_t len = AV_RB16(pkt->data + 1);
+
+if ((ret = av_append_packet(s->pb, pkt, len)) < 0)
+return ret;
+}
+
+return 0;
+}
+
+static int sup_probe(AVProbeData *p)
+{
+unsigned char *buf = p->buf;
+size_t buf_size = p->buf_size;
+int nb_packets;
+
+for (nb_packets = 0; nb_packets < 10; nb_packets++) {
+size_t full_packet_size;
+if (buf_size < 10 + 3)
+break;
+if (AV_RB16(buf) != SUP_PGS_MAGIC)
+return 0;
+full_packet_size = AV_RB16(buf + 10 + 1) + 10 + 3;
+if (buf_size < full_packet_size)
+break;
+buf += full_packet_size;
+buf_size -= full_packet_size;
+}
+if (!nb_packets)
+return 0;
+if (nb_packets < 2)
+return AVPROBE_SCORE_RETRY /

Re: [FFmpeg-devel] [PATCH 2/2] x86/videodsp: add ff_emu_edge_{hfix, hvar}_avx2

2014-09-24 Thread Ronald S. Bultje
Hi,

On Wed, Sep 24, 2014 at 8:14 AM, Ronald S. Bultje 
wrote:

> On Tue, Sep 23, 2014 at 5:46 PM, James Almer  wrote:
>
>> ~15% faster than sse2
>>
>> Signed-off-by: James Almer 
>> ---
>> ssse3's pshufb didn't prove to be faster, but fortunately avx2's broadcast
>> instructions did.
>> Maybe we could drop that FIXME altogheter.
>>
>
> Yes let's do that (it was a reminder to test it at some point, so that's
> done now).
>

Patch itself looks good btw, cool work!

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Handling CODEC_FLAG2_CHUNKS type H264 content.

2014-09-24 Thread Ronald S. Bultje
Hi,

On Wed, Sep 24, 2014 at 2:55 PM, Dale Curtis 
wrote:

> - Chrome currently only uses 2 threads for video decoding. I'll run the
> numbers soon, but generally, is frame level threading expected to be
> beneficial with only two threads?


Yes, very much so.

(Don't know immediately about the other question.)

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] x86/videodsp: add ff_emu_edge_{hfix, hvar}_avx2

2014-09-24 Thread James Almer
On 24/09/14 3:39 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, Sep 24, 2014 at 8:14 AM, Ronald S. Bultje 
> wrote:
> 
>> On Tue, Sep 23, 2014 at 5:46 PM, James Almer  wrote:
>>
>>> ~15% faster than sse2
>>>
>>> Signed-off-by: James Almer 
>>> ---
>>> ssse3's pshufb didn't prove to be faster, but fortunately avx2's broadcast
>>> instructions did.
>>> Maybe we could drop that FIXME altogheter.
>>>
>>
>> Yes let's do that (it was a reminder to test it at some point, so that's
>> done now).
>>
> 
> Patch itself looks good btw, cool work!
> 
> Ronald

Removed the comment and pushed. Thanks!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Do not ask for mxf samples with unknown field dominance

2014-09-24 Thread Tomas Härdin
On Tue, 2014-09-16 at 09:03 +0100, tim nicholson wrote:
> On 10/09/14 21:45, Tomas Härdin wrote:
> > On Tue, 2014-08-19 at 22:30 +0200, Michael Niedermayer wrote:
> >> On Tue, Aug 19, 2014 at 01:30:24AM +0200, Carl Eugen Hoyos wrote:
> >>> Hi!
> >>>
> >>> Attached patch removes a request for samples of which we already
> >>> have several that all work fine.
> >>
> >> field_dominance can have 256 different values, do we have samples
> >> for all ? do they even exist ?
> > 
> 
> Whilst the variable may be able to contain 256 different values in
> reality there are only two possible states f1 first or f2 first.
> 
> > As far as I recall there are only two (1, 2) and possibly "unknown" (0).
> > 
> 
> Is there a distinction between "unknown" and "progressive"? I don't have
> the numbers to hand.

Unknown means unknown. If it's an optional field it probably means the
muxer that made the file is crap, which is not uncommon.

/Tomas


signature.asc
Description: This is a digitally signed message part
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] avformat/mxfenc: H.264 Intra support

2014-09-24 Thread Tomas Härdin
On Sat, 2014-09-13 at 12:36 +0200, Michael Niedermayer wrote:
> From: Baptiste Coudurier 
> 
> Ported by michael from ffmbc to ffmpeg
> the code is under CONFIG_GPL as ffmbc is GPL
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mxfenc.c |  143 
> ++
>  1 file changed, 143 insertions(+)

> +static int mxf_parse_h264_frame(AVFormatContext *s, AVStream *st,
> +AVPacket *pkt, MXFIndexEntry *e)
> +{
> +MXFStreamContext *sc = st->priv_data;
> +H264Context h;
> +const uint8_t *buf = pkt->data;
> +const uint8_t *buf_end = pkt->data + pkt->size;
> +uint32_t state = -1;
> +AVRational sar = {1, 1};
> +
> +if (pkt->size < 5 || AV_RB32(pkt->data) != 0x001) {
> +av_log(s, AV_LOG_ERROR, "h264 bitstream malformated, "
> +   "no startcode found, use -vbsf h264_mp4toannexb\n");
> +return 0;
> +}
> +
> +memset(&h, 0, sizeof(h));
> +h.avctx = st->codec;
> +h.thread_context[0] = &h;
> +h.prev_frame_num = -1;
> +
> +for (;;) {
> +int src_length, dst_length, consumed;
> +const uint8_t *ptr;
> +
> +buf = avpriv_find_start_code(buf, buf_end, &state);
> +if (buf >= buf_end)
> +break;
> +--buf;
> +src_length = buf_end - buf;
> +switch (state & 0x1f) {
> +case NAL_SLICE:
> +case NAL_IDR_SLICE:
> +// Do not walk the whole buffer just to decode slice header
> +if (src_length > 20)
> +src_length = 20;
> +break;
> +}
> +
> +ptr = ff_h264_decode_nal(&h, buf, &dst_length, &consumed, 
> src_length);
> +if (!ptr || dst_length < 0)
> +break;
> +
> +init_get_bits(&h.gb, ptr, 8*dst_length);
> +//av_log(avctx, AV_LOG_DEBUG, "nal_unit_type:%d\n", h.nal_unit_type);
> +switch (h.nal_unit_type) {
> +case NAL_SPS:
> +ff_h264_decode_seq_parameter_set(&h);
> +if (h.sps.sar.num > 0 && h.sps.sar.den > 0) {
> +sar.num = st->codec->width * h.sps.sar.num;
> +sar.den = st->codec->height * h.sps.sar.den;
> +}
> +sc->aspect_ratio.num = st->codec->width * sar.num;
> +sc->aspect_ratio.den = st->codec->height * sar.den;
> +av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
> +  sar.num, sar.den, 1024*1024);
> +
> +sc->interlaced = !h.sps.frame_mbs_only_flag;
> +sc->component_depth = h.sps.bit_depth_luma;
> +
> +sc->codec_ul = mxf_get_h264_codec_ul(st->codec, &h.sps);
> +e->flags |= 0x40;
> +break;
> +case NAL_PPS:
> +ff_h264_decode_picture_parameter_set(&h, h.gb.size_in_bits);
> +if (h.sps.timing_info_present_flag) {
> +if (st->codec->time_base.num != h.sps.num_units_in_tick ||
> +st->codec->time_base.den*2 != h.sps.time_scale) {
> +av_log(s, AV_LOG_ERROR, "framerate does not match 
> bitstream values: %d/%d != %d/%d\n",
> +   h.sps.num_units_in_tick, h.sps.time_scale, 
> st->codec->time_base.num, st->codec->time_base.den*2);
> +return 0;
> +}
> +}
> +if (e->flags & 0x40) // sequence header present
> +e->flags |= 0x80; // random access
> +break;
> +case NAL_IDR_SLICE:
> +break;
> +case NAL_SLICE:
> +av_log(s, AV_LOG_ERROR, "mxf muxer only supports AVC Intra 
> currently\n");
> +return 0;
> +}
> +}
> +
> +return !!sc->codec_ul;
> +}

Seems awfully specific code to have in a muxer. Can this be reused
elsewhere? Don't let that stop you though.

Overall I'm OK with this patch being GPL. It's not optimal, but I
compile with libx264 for my own purposes anyway and thus have GPL
enabled. If someone wants it LGPL bad enough then they're free to
rewrite this of course. Perhaps as a part of making the functionality of
the above function reusable elsewhere? (I think MOV might support
AVC-Intra)

/Tomas


signature.asc
Description: This is a digitally signed message part
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address

2014-09-24 Thread Philip DeCamp
Signed-off-by: Philip DeCamp 
---
 libavutil/opt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index ca4edb8..ee72a96 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -627,8 +627,7 @@ int av_opt_set_channel_layout(void *obj, const char *name, 
int64_t cl, int searc
"The value set by option '%s' is not a channel layout.\n", 
o->name);
 return AVERROR(EINVAL);
 }
-*(int *)(((int64_t *)target_obj) + o->offset) = cl;
+*(int64_t *)(((uint8_t *)target_obj) + o->offset) = cl;
 return 0;
 }
 
-- 
Calling "av_opt_set_channel_layout()" was writing to the wrong address. It was 
casting the target object to an int64* instead of an int8* before adding the 
field offset.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Handling CODEC_FLAG2_CHUNKS type H264 content.

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 11:55:38AM -0700, Dale Curtis wrote:
> Some Chrome users ( http://crbug.com/415542 ) are encountering content
> which requires CODEC_FLAG2_CHUNKS to decode without the following error:
> 
> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/h264.c;hb=HEAD#l1917
> 
> We haven't enabled this flag globally in the past since it disables frame
> level threading:
> 
> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/pthread.c;hb=HEAD#l46
> 
> I have a couple questions on handling this type of content:
> 
> - Is the error returned truly an error or a warning? Ignoring it reveals
> decoding continues okay; though I have no idea if this is always true for
> chunked content.

it depends on how you see it

the decoder has as input 1 AU for each call, when the input is not a
AU thats more or less an error

for decoding the whole movie these instances of odd input are not
really errors in the case of this file


> 
> - Chrome currently only uses 2 threads for video decoding. I'll run the
> numbers soon, but generally, is frame level threading expected to be
> beneficial with only two threads?
> 
> Thanks in advance!
> 
> - dale
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] avcodec/x86: use function pointers for {put, add}_pixels_clamped

2014-09-24 Thread James Almer
Same behavior as in simple_idct.
This way the best optimized versions available will be used instead.

Signed-off-by: James Almer 
---
 libavcodec/x86/cavsdsp.c   | 2 +-
 libavcodec/x86/xvididct_mmx.c  | 9 +
 libavcodec/x86/xvididct_sse2.c | 6 --
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index d155fb2..681d16a 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -198,7 +198,7 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t 
*block, int stride)
 );
 }
 
-ff_add_pixels_clamped_mmx(b2, dst, stride);
+ff_add_pixels_clamped(b2, dst, stride);
 }
 
 #endif /* HAVE_MMX_INLINE */
diff --git a/libavcodec/x86/xvididct_mmx.c b/libavcodec/x86/xvididct_mmx.c
index f4bb39f..57aa8c0 100644
--- a/libavcodec/x86/xvididct_mmx.c
+++ b/libavcodec/x86/xvididct_mmx.c
@@ -46,6 +46,7 @@
 #include "libavutil/mem.h"
 
 #include "libavcodec/avcodec.h"
+#include "libavcodec/idctdsp.h"
 
 #include "idctdsp.h"
 #include "xvididct.h"
@@ -497,13 +498,13 @@ void ff_xvid_idct_mmx(short *block)
 void ff_xvid_idct_mmx_put(uint8_t *dest, int line_size, int16_t *block)
 {
 ff_xvid_idct_mmx(block);
-ff_put_pixels_clamped_mmx(block, dest, line_size);
+ff_put_pixels_clamped(block, dest, line_size);
 }
 
 void ff_xvid_idct_mmx_add(uint8_t *dest, int line_size, int16_t *block)
 {
 ff_xvid_idct_mmx(block);
-ff_add_pixels_clamped_mmx(block, dest, line_size);
+ff_add_pixels_clamped(block, dest, line_size);
 }
 
 #endif /* HAVE_MMX_INLINE */
@@ -536,13 +537,13 @@ void ff_xvid_idct_mmxext(short *block)
 void ff_xvid_idct_mmxext_put(uint8_t *dest, int line_size, int16_t *block)
 {
 ff_xvid_idct_mmxext(block);
-ff_put_pixels_clamped_mmx(block, dest, line_size);
+ff_put_pixels_clamped(block, dest, line_size);
 }
 
 void ff_xvid_idct_mmxext_add(uint8_t *dest, int line_size, int16_t *block)
 {
 ff_xvid_idct_mmxext(block);
-ff_add_pixels_clamped_mmx(block, dest, line_size);
+ff_add_pixels_clamped(block, dest, line_size);
 }
 
 #endif /* HAVE_MMXEXT_INLINE */
diff --git a/libavcodec/x86/xvididct_sse2.c b/libavcodec/x86/xvididct_sse2.c
index 50a2f99..51a5d9d 100644
--- a/libavcodec/x86/xvididct_sse2.c
+++ b/libavcodec/x86/xvididct_sse2.c
@@ -41,6 +41,8 @@
 #include "libavutil/mem.h"
 #include "libavutil/x86/asm.h"
 
+#include "libavcodec/idctdsp.h"
+
 #include "idctdsp.h"
 #include "xvididct.h"
 
@@ -392,13 +394,13 @@ av_extern_inline void ff_xvid_idct_sse2(short *block)
 void ff_xvid_idct_sse2_put(uint8_t *dest, int line_size, short *block)
 {
 ff_xvid_idct_sse2(block);
-ff_put_pixels_clamped_mmx(block, dest, line_size);
+ff_put_pixels_clamped(block, dest, line_size);
 }
 
 void ff_xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block)
 {
 ff_xvid_idct_sse2(block);
-ff_add_pixels_clamped_mmx(block, dest, line_size);
+ff_add_pixels_clamped(block, dest, line_size);
 }
 
 #endif /* HAVE_SSE2_INLINE */
-- 
1.8.5.5

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] x86/idctdsp: port {put, add}_pixels_clamped to yasm

2014-09-24 Thread James Almer
Also add sse2 versions for both.
put_pixels_clamped port and sse2 version originally written by Timothy Gu.

Signed-off-by: James Almer 
---
 libavcodec/x86/Makefile   |   3 +-
 libavcodec/x86/idctdsp.asm| 103 
 libavcodec/x86/idctdsp.h  |   4 ++
 libavcodec/x86/idctdsp_init.c |   7 ++-
 libavcodec/x86/idctdsp_mmx.c  | 133 --
 5 files changed, 112 insertions(+), 138 deletions(-)
 delete mode 100644 libavcodec/x86/idctdsp_mmx.c

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 7bf0e82..9f34abd 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -66,8 +66,7 @@ OBJS-$(CONFIG_WEBP_DECODER)+= x86/vp8dsp_init.o
 # subsystems
 MMX-OBJS-$(CONFIG_DIRAC_DECODER)   += x86/dirac_dwt.o
 MMX-OBJS-$(CONFIG_FDCTDSP) += x86/fdct.o
-MMX-OBJS-$(CONFIG_IDCTDSP) += x86/idctdsp_mmx.o \
-  x86/simple_idct.o
+MMX-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o
 
 # decoders/encoders
 MMX-OBJS-$(CONFIG_MPEG4_DECODER)   += x86/xvididct_mmx.o\
diff --git a/libavcodec/x86/idctdsp.asm b/libavcodec/x86/idctdsp.asm
index 44a1a6e..b816e84 100644
--- a/libavcodec/x86/idctdsp.asm
+++ b/libavcodec/x86/idctdsp.asm
@@ -78,3 +78,106 @@ INIT_MMX mmx
 PUT_SIGNED_PIXELS_CLAMPED 0
 INIT_XMM sse2
 PUT_SIGNED_PIXELS_CLAMPED 3
+
+;--
+; void ff_put_pixels_clamped(const int16_t *block, uint8_t *pixels,
+;int line_size);
+;--
+; %1 = block offset
+%macro PUT_PIXELS_CLAMPED_HALF 1
+mova m0, [blockq+mmsize*0+%1]
+mova m1, [blockq+mmsize*2+%1]
+%if mmsize == 8
+mova m2, [blockq+mmsize*4+%1]
+mova m3, [blockq+mmsize*6+%1]
+%endif
+packuswb m0, [blockq+mmsize*1+%1]
+packuswb m1, [blockq+mmsize*3+%1]
+%if mmsize == 8
+packuswb m2, [blockq+mmsize*5+%1]
+packuswb m3, [blockq+mmsize*7+%1]
+movq   [pixelsq], m0
+movq[lsizeq+pixelsq], m1
+movq  [2*lsizeq+pixelsq], m2
+movq   [lsize3q+pixelsq], m3
+%else
+movq   [pixelsq], m0
+movhps  [lsizeq+pixelsq], m0
+movq  [2*lsizeq+pixelsq], m1
+movhps [lsize3q+pixelsq], m1
+%endif
+%endmacro
+
+%macro PUT_PIXELS_CLAMPED 0
+cglobal put_pixels_clamped, 3, 4, 2, block, pixels, lsize, lsize3
+lea lsize3q, [lsizeq*3]
+PUT_PIXELS_CLAMPED_HALF 0
+lea pixelsq, [pixelsq+lsizeq*4]
+PUT_PIXELS_CLAMPED_HALF 64
+RET
+%endmacro
+
+INIT_MMX mmx
+PUT_PIXELS_CLAMPED
+INIT_XMM sse2
+PUT_PIXELS_CLAMPED
+
+;--
+; void ff_add_pixels_clamped(const int16_t *block, uint8_t *pixels,
+;int line_size);
+;--
+; %1 = block offset
+%macro ADD_PIXELS_CLAMPED 1
+mova   m0, [blockq+mmsize*0+%1]
+mova   m1, [blockq+mmsize*1+%1]
+%if mmsize == 8
+mova   m5, [blockq+mmsize*2+%1]
+mova   m6, [blockq+mmsize*3+%1]
+%endif
+movq   m2, [pixelsq]
+movq   m3, [pixelsq+lsizeq]
+%if mmsize == 8
+mova   m7, m2
+punpcklbw  m2, m4
+punpckhbw  m7, m4
+paddsw m0, m2
+paddsw m1, m7
+mova   m7, m3
+punpcklbw  m3, m4
+punpckhbw  m7, m4
+paddsw m5, m3
+paddsw m6, m7
+%else
+punpcklbw  m2, m4
+punpcklbw  m3, m4
+paddsw m0, m2
+paddsw m1, m3
+%endif
+packuswb   m0, m1
+%if mmsize == 8
+packuswb   m5, m6
+movq   [pixelsq], m0
+movq   [pixelsq+lsizeq], m5
+%else
+movq   [pixelsq], m0
+movhps [pixelsq+lsizeq], m0
+%endif
+%endmacro
+
+%macro ADD_PIXELS_CLAMPED 0
+cglobal add_pixels_clamped, 3, 3, 5, block, pixels, lsize
+pxor   m4, m4
+ADD_PIXELS_CLAMPED 0
+leapixelsq, [pixelsq+lsizeq*2]
+ADD_PIXELS_CLAMPED 32
+leapixelsq, [pixelsq+lsizeq*2]
+ADD_PIXELS_CLAMPED 64
+leapixelsq, [pixelsq+lsizeq*2]
+ADD_PIXELS_CLAMPED 96
+RET
+%endmacro
+
+INIT_MMX mmx
+ADD_PIXELS_CLAMPED
+INIT_XMM sse2
+ADD_PIXELS_CLAMPED
diff --git a/libavcodec/x86/idctdsp.h b/libavcodec/x86/idctdsp.h
index 9b7177a..ce6bdbe 100644
--- a/libavcodec/x86/idctdsp.h
+++ b/libavcodec/x86/idctdsp.h
@@ -23,8 +23,12 @@
 
 void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
int line_size);
+void ff_add_pixels_clamped_sse2(const int16_t *block, uint8_t *pixels,
+int line_size);
 void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
int line_size);
+void ff_put_pixels_clamped_sse2(const int16_t *block, uint8_t *pixels,
+int line_size);
 void ff

Re: [FFmpeg-devel] [PATCH] libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 04:15:18PM -0400, Philip DeCamp wrote:
> Signed-off-by: Philip DeCamp 
> ---
>  libavutil/opt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/x86: use function pointers for {put, add}_pixels_clamped

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 05:44:16PM -0300, James Almer wrote:
> Same behavior as in simple_idct.
> This way the best optimized versions available will be used instead.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/x86/cavsdsp.c   | 2 +-
>  libavcodec/x86/xvididct_mmx.c  | 9 +
>  libavcodec/x86/xvididct_sse2.c | 6 --
>  3 files changed, 10 insertions(+), 7 deletions(-)

LGTM

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/x86: use function pointers for {put, add}_pixels_clamped

2014-09-24 Thread James Almer
On 24/09/14 6:23 PM, Michael Niedermayer wrote:
> On Wed, Sep 24, 2014 at 05:44:16PM -0300, James Almer wrote:
>> Same behavior as in simple_idct.
>> This way the best optimized versions available will be used instead.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavcodec/x86/cavsdsp.c   | 2 +-
>>  libavcodec/x86/xvididct_mmx.c  | 9 +
>>  libavcodec/x86/xvididct_sse2.c | 6 --
>>  3 files changed, 10 insertions(+), 7 deletions(-)
> 
> LGTM
> 
> thanks

Pushed.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] x86/idctdsp: port {put, add}_pixels_clamped to yasm

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 05:44:17PM -0300, James Almer wrote:
> Also add sse2 versions for both.
> put_pixels_clamped port and sse2 version originally written by Timothy Gu.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/x86/Makefile   |   3 +-
>  libavcodec/x86/idctdsp.asm| 103 
>  libavcodec/x86/idctdsp.h  |   4 ++
>  libavcodec/x86/idctdsp_init.c |   7 ++-
>  libavcodec/x86/idctdsp_mmx.c  | 133 
> --
>  5 files changed, 112 insertions(+), 138 deletions(-)
>  delete mode 100644 libavcodec/x86/idctdsp_mmx.c
> 
> diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
> index 7bf0e82..9f34abd 100644
> --- a/libavcodec/x86/Makefile
> +++ b/libavcodec/x86/Makefile
> @@ -66,8 +66,7 @@ OBJS-$(CONFIG_WEBP_DECODER)+= x86/vp8dsp_init.o
>  # subsystems
>  MMX-OBJS-$(CONFIG_DIRAC_DECODER)   += x86/dirac_dwt.o
>  MMX-OBJS-$(CONFIG_FDCTDSP) += x86/fdct.o
> -MMX-OBJS-$(CONFIG_IDCTDSP) += x86/idctdsp_mmx.o \
> -  x86/simple_idct.o
> +MMX-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o
>  
>  # decoders/encoders
>  MMX-OBJS-$(CONFIG_MPEG4_DECODER)   += x86/xvididct_mmx.o\
> diff --git a/libavcodec/x86/idctdsp.asm b/libavcodec/x86/idctdsp.asm
> index 44a1a6e..b816e84 100644
> --- a/libavcodec/x86/idctdsp.asm
> +++ b/libavcodec/x86/idctdsp.asm
> @@ -78,3 +78,106 @@ INIT_MMX mmx
>  PUT_SIGNED_PIXELS_CLAMPED 0
>  INIT_XMM sse2
>  PUT_SIGNED_PIXELS_CLAMPED 3
> +
> +;--
> +; void ff_put_pixels_clamped(const int16_t *block, uint8_t *pixels,
> +;int line_size);
> +;--
> +; %1 = block offset
> +%macro PUT_PIXELS_CLAMPED_HALF 1
> +mova m0, [blockq+mmsize*0+%1]
> +mova m1, [blockq+mmsize*2+%1]
> +%if mmsize == 8
> +mova m2, [blockq+mmsize*4+%1]
> +mova m3, [blockq+mmsize*6+%1]
> +%endif
> +packuswb m0, [blockq+mmsize*1+%1]
> +packuswb m1, [blockq+mmsize*3+%1]
> +%if mmsize == 8
> +packuswb m2, [blockq+mmsize*5+%1]
> +packuswb m3, [blockq+mmsize*7+%1]
> +movq   [pixelsq], m0
> +movq[lsizeq+pixelsq], m1
> +movq  [2*lsizeq+pixelsq], m2
> +movq   [lsize3q+pixelsq], m3
> +%else
> +movq   [pixelsq], m0
> +movhps  [lsizeq+pixelsq], m0
> +movq  [2*lsizeq+pixelsq], m1
> +movhps [lsize3q+pixelsq], m1
> +%endif
> +%endmacro
> +
> +%macro PUT_PIXELS_CLAMPED 0
> +cglobal put_pixels_clamped, 3, 4, 2, block, pixels, lsize, lsize3
> +lea lsize3q, [lsizeq*3]
> +PUT_PIXELS_CLAMPED_HALF 0

this doesnt match the prototype
line_size is 32bit in the prototype but the code treats it as 64bit
this will crash if its negative

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] x86/idctdsp: port {put, add}_pixels_clamped to yasm

2014-09-24 Thread James Almer
On 24/09/14 6:54 PM, Michael Niedermayer wrote:
> On Wed, Sep 24, 2014 at 05:44:17PM -0300, James Almer wrote:
>> Also add sse2 versions for both.
>> put_pixels_clamped port and sse2 version originally written by Timothy Gu.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavcodec/x86/Makefile   |   3 +-
>>  libavcodec/x86/idctdsp.asm| 103 
>>  libavcodec/x86/idctdsp.h  |   4 ++
>>  libavcodec/x86/idctdsp_init.c |   7 ++-
>>  libavcodec/x86/idctdsp_mmx.c  | 133 
>> --
>>  5 files changed, 112 insertions(+), 138 deletions(-)
>>  delete mode 100644 libavcodec/x86/idctdsp_mmx.c
>>
>> diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
>> index 7bf0e82..9f34abd 100644
>> --- a/libavcodec/x86/Makefile
>> +++ b/libavcodec/x86/Makefile
>> @@ -66,8 +66,7 @@ OBJS-$(CONFIG_WEBP_DECODER)+= x86/vp8dsp_init.o
>>  # subsystems
>>  MMX-OBJS-$(CONFIG_DIRAC_DECODER)   += x86/dirac_dwt.o
>>  MMX-OBJS-$(CONFIG_FDCTDSP) += x86/fdct.o
>> -MMX-OBJS-$(CONFIG_IDCTDSP) += x86/idctdsp_mmx.o \
>> -  x86/simple_idct.o
>> +MMX-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o
>>  
>>  # decoders/encoders
>>  MMX-OBJS-$(CONFIG_MPEG4_DECODER)   += x86/xvididct_mmx.o\
>> diff --git a/libavcodec/x86/idctdsp.asm b/libavcodec/x86/idctdsp.asm
>> index 44a1a6e..b816e84 100644
>> --- a/libavcodec/x86/idctdsp.asm
>> +++ b/libavcodec/x86/idctdsp.asm
>> @@ -78,3 +78,106 @@ INIT_MMX mmx
>>  PUT_SIGNED_PIXELS_CLAMPED 0
>>  INIT_XMM sse2
>>  PUT_SIGNED_PIXELS_CLAMPED 3
>> +
>> +;--
>> +; void ff_put_pixels_clamped(const int16_t *block, uint8_t *pixels,
>> +;int line_size);
>> +;--
>> +; %1 = block offset
>> +%macro PUT_PIXELS_CLAMPED_HALF 1
>> +mova m0, [blockq+mmsize*0+%1]
>> +mova m1, [blockq+mmsize*2+%1]
>> +%if mmsize == 8
>> +mova m2, [blockq+mmsize*4+%1]
>> +mova m3, [blockq+mmsize*6+%1]
>> +%endif
>> +packuswb m0, [blockq+mmsize*1+%1]
>> +packuswb m1, [blockq+mmsize*3+%1]
>> +%if mmsize == 8
>> +packuswb m2, [blockq+mmsize*5+%1]
>> +packuswb m3, [blockq+mmsize*7+%1]
>> +movq   [pixelsq], m0
>> +movq[lsizeq+pixelsq], m1
>> +movq  [2*lsizeq+pixelsq], m2
>> +movq   [lsize3q+pixelsq], m3
>> +%else
>> +movq   [pixelsq], m0
>> +movhps  [lsizeq+pixelsq], m0
>> +movq  [2*lsizeq+pixelsq], m1
>> +movhps [lsize3q+pixelsq], m1
>> +%endif
>> +%endmacro
>> +
>> +%macro PUT_PIXELS_CLAMPED 0
>> +cglobal put_pixels_clamped, 3, 4, 2, block, pixels, lsize, lsize3
>> +lea lsize3q, [lsizeq*3]
>> +PUT_PIXELS_CLAMPED_HALF 0
> 
> this doesnt match the prototype
> line_size is 32bit in the prototype but the code treats it as 64bit
> this will crash if its negative

Would this also apply to put_signed_pixels_clamped above? That one has been 
in the tree as is for quite some time.

I'll change the prototypes then. Better making line_size into ptrdiff_t than 
adding a movsxdifnidn to every function.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] x86/idctdsp: port {put, add}_pixels_clamped to yasm

2014-09-24 Thread James Almer
Also add sse2 versions for both.
put_pixels_clamped port and sse2 version originally written by Timothy Gu.

Signed-off-by: James Almer 
---
 libavcodec/x86/Makefile   |   3 +-
 libavcodec/x86/idctdsp.asm| 103 
 libavcodec/x86/idctdsp.h  |   4 ++
 libavcodec/x86/idctdsp_init.c |   7 ++-
 libavcodec/x86/idctdsp_mmx.c  | 134 --
 5 files changed, 112 insertions(+), 139 deletions(-)
 delete mode 100644 libavcodec/x86/idctdsp_mmx.c

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 7bf0e82..9f34abd 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -66,8 +66,7 @@ OBJS-$(CONFIG_WEBP_DECODER)+= x86/vp8dsp_init.o
 # subsystems
 MMX-OBJS-$(CONFIG_DIRAC_DECODER)   += x86/dirac_dwt.o
 MMX-OBJS-$(CONFIG_FDCTDSP) += x86/fdct.o
-MMX-OBJS-$(CONFIG_IDCTDSP) += x86/idctdsp_mmx.o \
-  x86/simple_idct.o
+MMX-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o
 
 # decoders/encoders
 MMX-OBJS-$(CONFIG_MPEG4_DECODER)   += x86/xvididct_mmx.o\
diff --git a/libavcodec/x86/idctdsp.asm b/libavcodec/x86/idctdsp.asm
index c3f37c4..0aa7345 100644
--- a/libavcodec/x86/idctdsp.asm
+++ b/libavcodec/x86/idctdsp.asm
@@ -78,3 +78,106 @@ INIT_MMX mmx
 PUT_SIGNED_PIXELS_CLAMPED 0
 INIT_XMM sse2
 PUT_SIGNED_PIXELS_CLAMPED 3
+
+;--
+; void ff_put_pixels_clamped(const int16_t *block, uint8_t *pixels,
+;ptrdiff_t line_size);
+;--
+; %1 = block offset
+%macro PUT_PIXELS_CLAMPED_HALF 1
+mova m0, [blockq+mmsize*0+%1]
+mova m1, [blockq+mmsize*2+%1]
+%if mmsize == 8
+mova m2, [blockq+mmsize*4+%1]
+mova m3, [blockq+mmsize*6+%1]
+%endif
+packuswb m0, [blockq+mmsize*1+%1]
+packuswb m1, [blockq+mmsize*3+%1]
+%if mmsize == 8
+packuswb m2, [blockq+mmsize*5+%1]
+packuswb m3, [blockq+mmsize*7+%1]
+movq   [pixelsq], m0
+movq[lsizeq+pixelsq], m1
+movq  [2*lsizeq+pixelsq], m2
+movq   [lsize3q+pixelsq], m3
+%else
+movq   [pixelsq], m0
+movhps  [lsizeq+pixelsq], m0
+movq  [2*lsizeq+pixelsq], m1
+movhps [lsize3q+pixelsq], m1
+%endif
+%endmacro
+
+%macro PUT_PIXELS_CLAMPED 0
+cglobal put_pixels_clamped, 3, 4, 2, block, pixels, lsize, lsize3
+lea lsize3q, [lsizeq*3]
+PUT_PIXELS_CLAMPED_HALF 0
+lea pixelsq, [pixelsq+lsizeq*4]
+PUT_PIXELS_CLAMPED_HALF 64
+RET
+%endmacro
+
+INIT_MMX mmx
+PUT_PIXELS_CLAMPED
+INIT_XMM sse2
+PUT_PIXELS_CLAMPED
+
+;--
+; void ff_add_pixels_clamped(const int16_t *block, uint8_t *pixels,
+;ptrdiff_t line_size);
+;--
+; %1 = block offset
+%macro ADD_PIXELS_CLAMPED 1
+mova   m0, [blockq+mmsize*0+%1]
+mova   m1, [blockq+mmsize*1+%1]
+%if mmsize == 8
+mova   m5, [blockq+mmsize*2+%1]
+mova   m6, [blockq+mmsize*3+%1]
+%endif
+movq   m2, [pixelsq]
+movq   m3, [pixelsq+lsizeq]
+%if mmsize == 8
+mova   m7, m2
+punpcklbw  m2, m4
+punpckhbw  m7, m4
+paddsw m0, m2
+paddsw m1, m7
+mova   m7, m3
+punpcklbw  m3, m4
+punpckhbw  m7, m4
+paddsw m5, m3
+paddsw m6, m7
+%else
+punpcklbw  m2, m4
+punpcklbw  m3, m4
+paddsw m0, m2
+paddsw m1, m3
+%endif
+packuswb   m0, m1
+%if mmsize == 8
+packuswb   m5, m6
+movq   [pixelsq], m0
+movq   [pixelsq+lsizeq], m5
+%else
+movq   [pixelsq], m0
+movhps [pixelsq+lsizeq], m0
+%endif
+%endmacro
+
+%macro ADD_PIXELS_CLAMPED 0
+cglobal add_pixels_clamped, 3, 3, 5, block, pixels, lsize
+pxor   m4, m4
+ADD_PIXELS_CLAMPED 0
+leapixelsq, [pixelsq+lsizeq*2]
+ADD_PIXELS_CLAMPED 32
+leapixelsq, [pixelsq+lsizeq*2]
+ADD_PIXELS_CLAMPED 64
+leapixelsq, [pixelsq+lsizeq*2]
+ADD_PIXELS_CLAMPED 96
+RET
+%endmacro
+
+INIT_MMX mmx
+ADD_PIXELS_CLAMPED
+INIT_XMM sse2
+ADD_PIXELS_CLAMPED
diff --git a/libavcodec/x86/idctdsp.h b/libavcodec/x86/idctdsp.h
index 252e704..6408df1 100644
--- a/libavcodec/x86/idctdsp.h
+++ b/libavcodec/x86/idctdsp.h
@@ -23,8 +23,12 @@
 
 void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
ptrdiff_t line_size);
+void ff_add_pixels_clamped_sse2(const int16_t *block, uint8_t *pixels,
+ptrdiff_t line_size);
 void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
ptrdiff_t line_size);
+void ff_put_pixels_clamped_sse2(const int16_t *block, uint8_t *pixels,
+  

[FFmpeg-devel] [PATCH 1/2] avcodec/idctdsp: change {put, add}_pixels_clamped to ptrdiff_t line_size

2014-09-24 Thread James Almer
Signed-off-by: James Almer 
---
Architectures other than x86 are untested, but the changes are trivial so it 
should be ok.

 libavcodec/alpha/idctdsp_alpha.c |  8 
 libavcodec/alpha/idctdsp_alpha.h |  4 ++--
 libavcodec/alpha/idctdsp_alpha_asm.S |  4 ++--
 libavcodec/arm/idctdsp_arm.S |  2 +-
 libavcodec/arm/idctdsp_init_arm.c|  2 +-
 libavcodec/arm/idctdsp_init_armv6.c  |  2 +-
 libavcodec/arm/idctdsp_init_neon.c   |  6 +++---
 libavcodec/idctdsp.c | 10 +-
 libavcodec/idctdsp.h | 10 +-
 libavcodec/x86/idctdsp.asm   |  2 +-
 libavcodec/x86/idctdsp.h |  8 
 libavcodec/x86/idctdsp_mmx.c |  5 +++--
 12 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/libavcodec/alpha/idctdsp_alpha.c b/libavcodec/alpha/idctdsp_alpha.c
index 1050697..1923ebb 100644
--- a/libavcodec/alpha/idctdsp_alpha.c
+++ b/libavcodec/alpha/idctdsp_alpha.c
@@ -24,14 +24,14 @@
 #include "asm.h"
 
 void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
-int line_size);
+ptrdiff_t line_size);
 void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
-int line_size);
+ptrdiff_t line_size);
 
 void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
- int line_size);
+ ptrdiff_t line_size);
 void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
- int line_size);
+ ptrdiff_t line_size);
 
 #if 0
 /* These functions were the base for the optimized assembler routines,
diff --git a/libavcodec/alpha/idctdsp_alpha.h b/libavcodec/alpha/idctdsp_alpha.h
index e52cd80..bf98495 100644
--- a/libavcodec/alpha/idctdsp_alpha.h
+++ b/libavcodec/alpha/idctdsp_alpha.h
@@ -23,9 +23,9 @@
 #include 
 
 extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
-int line_size);
+ptrdiff_t line_size);
 extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
-int line_size);
+ptrdiff_t line_size);
 
 void ff_simple_idct_axp(int16_t *block);
 void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
diff --git a/libavcodec/alpha/idctdsp_alpha_asm.S 
b/libavcodec/alpha/idctdsp_alpha_asm.S
index e3a8364..f545df9 100644
--- a/libavcodec/alpha/idctdsp_alpha_asm.S
+++ b/libavcodec/alpha/idctdsp_alpha_asm.S
@@ -33,7 +33,7 @@
 
 /
  * void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
- * int line_size)
+ * ptrdiff_t line_size)
  */
 .align 6
 .globl put_pixels_clamped_mvi_asm
@@ -83,7 +83,7 @@ put_pixels_clamped_mvi_asm:
 
 /
  * void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
- * int line_size)
+ * ptrdiff_t line_size)
  */
 .align 6
 .globl add_pixels_clamped_mvi_asm
diff --git a/libavcodec/arm/idctdsp_arm.S b/libavcodec/arm/idctdsp_arm.S
index e8333c4..057eff9 100644
--- a/libavcodec/arm/idctdsp_arm.S
+++ b/libavcodec/arm/idctdsp_arm.S
@@ -22,7 +22,7 @@
 #include "config.h"
 #include "libavutil/arm/asm.S"
 
-@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
+@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, ptrdiff_t 
stride)
 function ff_add_pixels_clamped_arm, export=1, align=5
 push{r4-r10}
 mov r10, #8
diff --git a/libavcodec/arm/idctdsp_init_arm.c 
b/libavcodec/arm/idctdsp_init_arm.c
index 2d846dc..da5da06 100644
--- a/libavcodec/arm/idctdsp_init_arm.c
+++ b/libavcodec/arm/idctdsp_init_arm.c
@@ -30,7 +30,7 @@
 #include "idctdsp_arm.h"
 
 void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
-   int line_size);
+   ptrdiff_t line_size);
 
 /* XXX: those functions should be suppressed ASAP when all IDCTs are
  * converted */
diff --git a/libavcodec/arm/idctdsp_init_armv6.c 
b/libavcodec/arm/idctdsp_init_armv6.c
index 648f1fd..a3470a8 100644
--- a/libavcodec/arm/idctdsp_init_armv6.c
+++ b/libavcodec/arm/idctdsp_init_armv6.c
@@ -27,7 +27,7 @@
 #include "idctdsp_arm.h"
 
 void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
- int line_size);
+ ptrdiff_t line_size);
 
 av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
 

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/idctdsp: change {put, add}_pixels_clamped to ptrdiff_t line_size

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 07:56:32PM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
> Architectures other than x86 are untested, but the changes are trivial so it 
> should be ok.

LGTM

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/idctdsp: change {put, add}_pixels_clamped to ptrdiff_t line_size

2014-09-24 Thread James Almer
On 24/09/14 9:06 PM, Michael Niedermayer wrote:
> On Wed, Sep 24, 2014 at 07:56:32PM -0300, James Almer wrote:
>> Signed-off-by: James Almer 
>> ---
>> Architectures other than x86 are untested, but the changes are trivial so it 
>> should be ok.
> 
> LGTM
> 
> thanks

Pushed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] x86/idctdsp: port {put, add}_pixels_clamped to yasm

2014-09-24 Thread Michael Niedermayer
On Wed, Sep 24, 2014 at 07:56:33PM -0300, James Almer wrote:
> Also add sse2 versions for both.
> put_pixels_clamped port and sse2 version originally written by Timothy Gu.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/x86/Makefile   |   3 +-
>  libavcodec/x86/idctdsp.asm| 103 
>  libavcodec/x86/idctdsp.h  |   4 ++
>  libavcodec/x86/idctdsp_init.c |   7 ++-
>  libavcodec/x86/idctdsp_mmx.c  | 134 
> --
>  5 files changed, 112 insertions(+), 139 deletions(-)
>  delete mode 100644 libavcodec/x86/idctdsp_mmx.c

LGTM

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7] Add SUP/PGS subtitle demuxer

2014-09-24 Thread compn
On Wed, 24 Sep 2014 17:38:58 +0200
wm4  wrote:

> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -453,6 +453,7 @@ library:
>  @item Sony PlayStation STR  @tab   @tab X
>  @item Sony Wave64 (W64) @tab X @tab X
>  @item SoX native format @tab X @tab X
> +@item SUP raw PGS subtitles @tab   @tab X
>  @item SUN AU format @tab X @tab X

eheh, i hate to do it to you wm4.

SUP comes after SUN. assuming alphabetical order.
probably whoever commits this can fix it , no need to resend.

(did not review rest)
thanks for sup demuxer! :)

-compn
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] x86/idctdsp: port {put, add}_pixels_clamped to yasm

2014-09-24 Thread James Almer
On 24/09/14 9:46 PM, Michael Niedermayer wrote:
> On Wed, Sep 24, 2014 at 07:56:33PM -0300, James Almer wrote:
>> Also add sse2 versions for both.
>> put_pixels_clamped port and sse2 version originally written by Timothy Gu.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavcodec/x86/Makefile   |   3 +-
>>  libavcodec/x86/idctdsp.asm| 103 
>>  libavcodec/x86/idctdsp.h  |   4 ++
>>  libavcodec/x86/idctdsp_init.c |   7 ++-
>>  libavcodec/x86/idctdsp_mmx.c  | 134 
>> --
>>  5 files changed, 112 insertions(+), 139 deletions(-)
>>  delete mode 100644 libavcodec/x86/idctdsp_mmx.c
> 
> LGTM

Pushed. Thanks.


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] avformat/mxfenc: H.264 Intra support

2014-09-24 Thread compn
On Mon, 15 Sep 2014 14:07:06 +0200
Robert Krüger  wrote:

> On Mon, Sep 15, 2014 at 1:12 PM, Michael Niedermayer
>  wrote:
> > On Mon, Sep 15, 2014 at 10:26:28AM +0200, Robert Krüger wrote:
> >> On Sun, Sep 14, 2014 at 5:58 PM, Michael Niedermayer
> >>  wrote:
> >> > On Sun, Sep 14, 2014 at 05:40:35PM +0200, Robert Krüger wrote:
> >> >> On Sat, Sep 13, 2014 at 12:36 PM, Michael Niedermayer
> >> >>  wrote:
> >> >> > From: Baptiste Coudurier 
> >> >> Just a general policy-question: will changes like this not in a
> >> >> way discourage development of these features in ffmpeg under
> >> >> LGPL? If someone now uses this code (e.g. mxf_parse_h264_frame)

ffmpeg itself does not have license requirements (aside from being
open source licenses), as we accept code from lots of people and
companies, we have a few different licenses already.

i guess like michael says, we prefer lgpl. but as this is a volunteer
project, being volunteers, we probably wont spend time on relicense
stuff unless we get paid to.


> >> >> in other code they will have to make that GPL as well. In the
> >> >> long run this will make life harder for library users who
> >> >> cannot live with GPL. So far this hasn't been done on that

they can pay for relicensing.

> >> >> level, at least not in the part of code that I am watching.
> >> >> AFAIR currently license borders are normally on a component
> >> >> level, i.e. a certain codec, format, filter only works only
> >> >> under GPL, not parts of functionality of a cocec, filter or
> >> >> muxer, which I think makes it OK to track by people for whom
> >> >> license matters. this extends this to a level where one would
> >> >> have to know which features of a certain muxer, codec, filter
> >> >> works under which license. Of course that's a project
> >> >> maintainer decision. Just wanted to throw in that side of the
> >> >> story, so it can be consciously taken into account or
> >> >> disregarded.
> >> >
> >> > This isnt the first "#if CONFIG_GPL" in the code.
> >>
> >> Technically correct but I see only me_cmp.c and flac_dsp_init.c so
> >> far and I don't know what the code does better with GPL. So far I
> >> have not run into this as a library user and thus was not aware of
> >> it. At least it seems to be a rare exception. I am afraid of the
> >> situation it may create, if picking stuff from ffmbc and
> >> introducing it via #if CONFIG_GPL becomes more common.
> >
> > I really think you are doing a "own goal" here
> 
> I am not sure I understand what you mean by this. I am not trying to
> hide what's my interest in this, if that's what you're referring to.
> Also assuming this I am not alone in this situation, so I am bringing
> this to your attention to consider as project maintainer, one of whose
> goals might be to make adoption of ffmpeg in commercial
> projects/software easier. I may be wrong but I interpreted vlc's move

this is one of ffmpegs goals, but i dont think it is a high priority.
we dont really have official priorities, but i think the unofficial
list is something like this:

1. support all codecs
2. fastest support of all codecs
3. fastest support of all codecs and formats on all systems
4. have fun working on open source project
5. get paid to have fun working on open source project
...
(bunch of goals not listed)
...
3144. make ffmpeg work for commercial applications easier


> to relicense as much code as possible to LGPL to be motivated by that,
> potentially because they thought, the project benefits from this. I

sure. and i agree, that probably helped them out in some way.

theres an interesting question that i thought up during the
libav-ffmpeg discussion at vdd14.

are we as a project going to basically go into business for ourselves ?

are we going to package ffmpeg as a lib for commercial operations and
sell paid support as a vendor? make a few scripts and paralellize the
code a bit, fix up threading and memory management.

like x264 did. kind of like vlc did (getting on ios store etc)

or are we going to continue operating as volunteers and paid
consultants for individual companies?

i think a few devels have done similar things on their own.
should we do it as a group? can we even do it as a group or are we too
independent to do it?

> know there is the justified impression that commercial users don't
> give back enough but I am convinced that at least tons of bug reports
> and samples come from people who use ffmpeg to build commercial
> software. Again, this is a decision the project needs to make. I am

most companies wont let samples back to us, because of copyright laws
and NDA.

as a maintainer of the samples repo ( samples.ffmpeg.org ) i'd say i'm
not worried about getting samples from companies. yes its important to
get samples from companies, but the majority of our samples are from our
users and downstream users (mplayer, vlc, xine etc).

again, if a company is using ffmpeg, they can pay us to get bugs fixed.
which is what has happened a lot over th