[FFmpeg-cvslog] avcodec/adpcm: Mono ADPCM for EA WVE Files

2024-07-22 Thread aaron
ffmpeg | branch: master | aaron  | Sun Jul 21 
11:18:02 2024 +1000| [f44353cfb65ef9d54febbc552cacea52675bb8d1] | committer: 
Peter Ross

avcodec/adpcm: Mono ADPCM for EA WVE Files

Reviewed-by: Peter Ross 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f44353cfb65ef9d54febbc552cacea52675bb8d1
---

 libavcodec/adpcm.c | 44 
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index f63afefd63..afdbeaa15e 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -262,7 +262,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
 break;
 case AV_CODEC_ID_ADPCM_DTK:
 case AV_CODEC_ID_ADPCM_EA:
-min_channels = 2;
+min_channels = 1;
 break;
 case AV_CODEC_ID_ADPCM_AFC:
 case AV_CODEC_ID_ADPCM_EA_R1:
@@ -914,10 +914,12 @@ static int get_nb_samples(AVCodecContext *avctx, 
GetByteContext *gb,
 bytestream2_seek(gb, -8, SEEK_CUR);
 break;
 case AV_CODEC_ID_ADPCM_EA:
+/* Stereo is 30 bytes per block */
+/* Mono is 15 bytes per block */
 has_coded_samples = 1;
 *coded_samples  = bytestream2_get_le32(gb);
 *coded_samples -= *coded_samples % 28;
-nb_samples  = (buf_size - 12) / 30 * 28;
+nb_samples  = (buf_size - 12) / (ch == 2 ? 30 : 15) * 28;
 break;
 case AV_CODEC_ID_ADPCM_IMA_EA_EACS:
 has_coded_samples = 1;
@@ -1652,10 +1654,10 @@ static int adpcm_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
 int coeff1l, coeff2l, coeff1r, coeff2r;
 int shift_left, shift_right;
 
-/* Each EA ADPCM frame has a 12-byte header followed by 30-byte pieces,
-   each coding 28 stereo samples. */
+/* Each EA ADPCM frame has a 12-byte header followed by 30-byte 
(stereo) or 15-byte (mono) pieces,
+   each coding 28 stereo/mono samples. */
 
-if (channels != 2)
+if (channels != 2 && channels != 1)
 return AVERROR_INVALIDDATA;
 
 current_left_sample   = sign_extend(bytestream2_get_le16u(&gb), 16);
@@ -1670,11 +1672,16 @@ static int adpcm_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
 coeff1r = ea_adpcm_table[ byte & 0x0F];
 coeff2r = ea_adpcm_table[(byte & 0x0F) + 4];
 
-byte = bytestream2_get_byteu(&gb);
-shift_left  = 20 - (byte >> 4);
-shift_right = 20 - (byte & 0x0F);
+if (channels == 2){
+byte = bytestream2_get_byteu(&gb);
+shift_left = 20 - (byte >> 4);
+shift_right = 20 - (byte & 0x0F);
+} else{
+/* Mono packs the shift into the coefficient byte's lower 
nibble instead */
+shift_left = 20 - (byte & 0x0F);
+}
 
-for (int count2 = 0; count2 < 28; count2++) {
+for (int count2 = 0; count2 < (channels == 2 ? 28 : 14); count2++) 
{
 byte = bytestream2_get_byteu(&gb);
 next_left_sample  = sign_extend(byte >> 4, 4) * (1 << 
shift_left);
 next_right_sample = sign_extend(byte,  4) * (1 << 
shift_right);
@@ -1691,11 +1698,24 @@ static int adpcm_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
 previous_right_sample = current_right_sample;
 current_right_sample = av_clip_int16(next_right_sample);
 *samples++ = current_left_sample;
-*samples++ = current_right_sample;
+
+if (channels == 2){
+*samples++ = current_right_sample;
+} else {
+next_left_sample  = sign_extend(byte, 4) * (1 << 
shift_left);
+
+next_left_sample = (next_left_sample +
+(current_left_sample * coeff1l) +
+(previous_left_sample * coeff2l) + 0x80) >> 8;
+
+previous_left_sample = current_left_sample;
+current_left_sample = av_clip_int16(next_left_sample);
+
+*samples++ = current_left_sample;
+}
 }
 }
-
-bytestream2_skip(&gb, 2); // Skip terminating 0x
+bytestream2_skip(&gb, channels == 2 ? 2 : 3); // Skip terminating NULs
 ) /* End of CASE */
 CASE(ADPCM_EA_MAXIS_XA,
 int coeff[2][2], shift[2];

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/electronicarts: decode framerate

2024-07-22 Thread aaron
ffmpeg | branch: master | aaron  | Sun Jul 21 
11:35:42 2024 +1000| [53d0f9afb46ac811269252c9e3be000fc7c3b2cc] | committer: 
Peter Ross

avcodec/electronicarts: decode framerate

Reviewed-by: Peter Ross 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=53d0f9afb46ac811269252c9e3be000fc7c3b2cc
---

 libavformat/electronicarts.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index f7f6fd4cab..04acf3a409 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -198,6 +198,10 @@ static int process_audio_header_elements(AVFormatContext 
*s)
 av_log(s, AV_LOG_DEBUG, "end of header block reached\n");
 in_header = 0;
 break;
+case 0x1B:
+ea->video.time_base = (AVRational) {1, read_arbitrary(pb)};
+av_log(s, AV_LOG_DEBUG, "Setting framerate to %u\n", 
ea->video.time_base.den);
+break;
 default:
 av_log(s, AV_LOG_DEBUG,
"header element 0x%02x set to 0x%08"PRIx32"\n",
@@ -325,7 +329,8 @@ static void process_video_header_mdec(AVFormatContext *s, 
VideoProperties *video
 avio_skip(pb, 4);
 video->width   = avio_rl16(pb);
 video->height  = avio_rl16(pb);
-video->time_base   = (AVRational) { 1, 15 };
+if (!video->time_base.num)
+video->time_base   = (AVRational) { 1, 15 };
 video->codec = AV_CODEC_ID_MDEC;
 }
 
@@ -427,12 +432,14 @@ static int process_ea_header(AVFormatContext *s)
 case pQGT_TAG:
 case TGQs_TAG:
 ea->video.codec = AV_CODEC_ID_TGQ;
-ea->video.time_base   = (AVRational) { 1, 15 };
+if (!ea->video.time_base.num)
+ea->video.time_base   = (AVRational) { 1, 15 };
 break;
 
 case pIQT_TAG:
 ea->video.codec = AV_CODEC_ID_TQI;
-ea->video.time_base   = (AVRational) { 1, 15 };
+if (!ea->video.time_base.num)
+ea->video.time_base   = (AVRational) { 1, 15 };
 break;
 
 case MADk_TAG:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] movenc: Add support for writing st3d and sv3d boxes.

2017-03-27 Thread Aaron Colwell
ffmpeg | branch: master | Aaron Colwell  | Mon Mar 27 
08:00:12 2017 -0700| [b4189590a59159317f6316106e2f061e5c6df556] | committer: 
James Almer

movenc: Add support for writing st3d and sv3d boxes.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4189590a59159317f6316106e2f061e5c6df556
---

 libavformat/movenc.c | 99 
 1 file changed, 99 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 3b4e3b5..112471d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -46,6 +46,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/dict.h"
 #include "libavutil/pixdesc.h"
+#include "libavutil/stereo3d.h"
 #include "libavutil/timecode.h"
 #include "libavutil/color_utils.h"
 #include "hevc.h"
@@ -1603,6 +1604,94 @@ static int mov_write_subtitle_tag(AVIOContext *pb, 
MOVTrack *track)
 return update_size(pb, pos);
 }
 
+static int mov_write_st3d_tag(AVIOContext *pb, AVStereo3D *stereo_3d)
+{
+int8_t stereo_mode;
+
+if (stereo_3d->flags != 0) {
+av_log(pb, AV_LOG_WARNING, "Unsupported stereo_3d flags %x. st3d not 
written.\n", stereo_3d->flags);
+return 0;
+}
+
+switch (stereo_3d->type) {
+case AV_STEREO3D_2D:
+stereo_mode = 0;
+break;
+case AV_STEREO3D_TOPBOTTOM:
+stereo_mode = 1;
+break;
+case AV_STEREO3D_SIDEBYSIDE:
+stereo_mode = 2;
+break;
+default:
+av_log(pb, AV_LOG_WARNING, "Unsupported stereo_3d type %s. st3d not 
written.\n", av_stereo3d_type_name(stereo_3d->type));
+return 0;
+}
+avio_wb32(pb, 13); /* size */
+ffio_wfourcc(pb, "st3d");
+avio_wb32(pb, 0); /* version = 0 & flags = 0 */
+avio_w8(pb, stereo_mode);
+return 13;
+}
+
+static int mov_write_sv3d_tag(AVFormatContext *s, AVIOContext *pb, 
AVSphericalMapping *spherical_mapping)
+{
+int64_t sv3d_pos, svhd_pos, proj_pos;
+const char* metadata_source = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : 
LIBAVFORMAT_IDENT;
+
+if (spherical_mapping->projection != AV_SPHERICAL_EQUIRECTANGULAR &&
+spherical_mapping->projection != AV_SPHERICAL_EQUIRECTANGULAR_TILE &&
+spherical_mapping->projection != AV_SPHERICAL_CUBEMAP) {
+av_log(pb, AV_LOG_WARNING, "Unsupported projection %d. sv3d not 
written.\n", spherical_mapping->projection);
+return 0;
+}
+
+sv3d_pos = avio_tell(pb);
+avio_wb32(pb, 0);  /* size */
+ffio_wfourcc(pb, "sv3d");
+
+svhd_pos = avio_tell(pb);
+avio_wb32(pb, 0);  /* size */
+ffio_wfourcc(pb, "svhd");
+avio_wb32(pb, 0); /* version = 0 & flags = 0 */
+avio_put_str(pb, metadata_source);
+update_size(pb, svhd_pos);
+
+proj_pos = avio_tell(pb);
+avio_wb32(pb, 0); /* size */
+ffio_wfourcc(pb, "proj");
+
+avio_wb32(pb, 24); /* size */
+ffio_wfourcc(pb, "prhd");
+avio_wb32(pb, 0); /* version = 0 & flags = 0 */
+avio_wb32(pb, spherical_mapping->yaw);
+avio_wb32(pb, spherical_mapping->pitch);
+avio_wb32(pb, spherical_mapping->roll);
+
+switch (spherical_mapping->projection) {
+case AV_SPHERICAL_EQUIRECTANGULAR:
+case AV_SPHERICAL_EQUIRECTANGULAR_TILE:
+avio_wb32(pb, 28);/* size */
+ffio_wfourcc(pb, "equi");
+avio_wb32(pb, 0); /* version = 0 & flags = 0 */
+avio_wb32(pb, spherical_mapping->bound_top);
+avio_wb32(pb, spherical_mapping->bound_bottom);
+avio_wb32(pb, spherical_mapping->bound_left);
+avio_wb32(pb, spherical_mapping->bound_right);
+break;
+case AV_SPHERICAL_CUBEMAP:
+avio_wb32(pb, 20);/* size */
+ffio_wfourcc(pb, "cbmp");
+avio_wb32(pb, 0); /* version = 0 & flags = 0 */
+avio_wb32(pb, 0); /* layout */
+avio_wb32(pb, spherical_mapping->padding); /* padding */
+break;
+}
+update_size(pb, proj_pos);
+
+return update_size(pb, sv3d_pos);
+}
+
 static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
 {
 AVRational sar;
@@ -1873,6 +1962,16 @@ static int mov_write_video_tag(AVIOContext *pb, 
MOVMuxContext *mov, MOVTrack *tr
 av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format 
is not MOV or MP4.\n");
 }
 
+if (mov->fc->strict_std_compliance <= FF_COMPLIANCE_EXPERIMENTAL) {
+AVStereo3D* stereo_3d = (AVStereo3D*) 
av_stream_get_side_data(track->st, AV_PKT_DATA_STEREO3D, NULL);
+AVSphericalMapping* spherical_mapping = 
(AVSphericalMapping*)av_stream_get_side_data(track->st, AV_PKT_DATA_SPHERICAL, 
NULL);
+
+if (stereo_3d)
+mov_write_st3d_tag(pb, 

[FFmpeg-cvslog] Support building C++ files with MSVC

2017-04-13 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Thu Apr 13 
02:38:02 2017 -0700| [bceb3d0f8621dd4dcdab2148e29d1473165d9cb6] | committer: 
Hendrik Leppkes

Support building C++ files with MSVC

Made appropriate changes to be able to successfully
build C++ files using a Visual C++ build on Windows.

Based on an earlier patch by Kyle Schwarz.

Comments:

-- compat/w32pthreads.h: Made appropriate changes to w32pthreads.h to
   get it to build when it is being included in a C++ file and built
   with Visual C++.  This is mostly a copy of Kyle Schwarz's patch as
   described above.

-- configure:
a) Now calling set_ccvars CXX to cause the various CXX_ variables to
   be setup properly.  For example, with MSVC (Microsoft Visual C++),
   this causes CXX_O to be set to -Fo$@ instead of using the default
   value.  The default value does not work with Visual C++.  This
   change will also have the impact of correcting CXX_O (and possibly
   CXX_C) for other compilers, although this is really only relevant
   for the Intel compiler, in addition to MSVC.
b) Now using cl for the C++ compiler for the MSVC toolchain.  This is
   currently only relevant for building the
   Blackmagic/Decklink-related files under avdevice.

Signed-off-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bceb3d0f8621dd4dcdab2148e29d1473165d9cb6
---

 compat/w32pthreads.h | 14 +++---
 configure|  4 
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 0c9a7fa13b..eeead6051f 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -77,7 +77,7 @@ typedef struct pthread_cond_t {
 
 static av_unused unsigned __stdcall attribute_align_arg 
win32thread_worker(void *arg)
 {
-pthread_t *h = arg;
+pthread_t *h = (pthread_t*)arg;
 h->ret = h->func(h->arg);
 return 0;
 }
@@ -270,7 +270,7 @@ static av_unused int pthread_cond_init(pthread_cond_t 
*cond, const void *unused_
 }
 
 /* non native condition variables */
-win32_cond = av_mallocz(sizeof(win32_cond_t));
+win32_cond = (win32_cond_t*)av_mallocz(sizeof(win32_cond_t));
 if (!win32_cond)
 return ENOMEM;
 cond->Ptr = win32_cond;
@@ -288,7 +288,7 @@ static av_unused int pthread_cond_init(pthread_cond_t 
*cond, const void *unused_
 
 static av_unused int pthread_cond_destroy(pthread_cond_t *cond)
 {
-win32_cond_t *win32_cond = cond->Ptr;
+win32_cond_t *win32_cond = (win32_cond_t*)cond->Ptr;
 /* native condition variables do not destroy */
 if (cond_init)
 return 0;
@@ -305,7 +305,7 @@ static av_unused int pthread_cond_destroy(pthread_cond_t 
*cond)
 
 static av_unused int pthread_cond_broadcast(pthread_cond_t *cond)
 {
-win32_cond_t *win32_cond = cond->Ptr;
+win32_cond_t *win32_cond = (win32_cond_t*)cond->Ptr;
 int have_waiter;
 
 if (cond_broadcast) {
@@ -337,7 +337,7 @@ static av_unused int pthread_cond_broadcast(pthread_cond_t 
*cond)
 
 static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t 
*mutex)
 {
-win32_cond_t *win32_cond = cond->Ptr;
+win32_cond_t *win32_cond = (win32_cond_t*)cond->Ptr;
 int last_waiter;
 if (cond_wait) {
 cond_wait(cond, mutex, INFINITE);
@@ -369,7 +369,7 @@ static av_unused int pthread_cond_wait(pthread_cond_t 
*cond, pthread_mutex_t *mu
 
 static av_unused int pthread_cond_signal(pthread_cond_t *cond)
 {
-win32_cond_t *win32_cond = cond->Ptr;
+win32_cond_t *win32_cond = (win32_cond_t*)cond->Ptr;
 int have_waiter;
 if (cond_signal) {
 cond_signal(cond);
@@ -397,7 +397,7 @@ static av_unused int pthread_cond_signal(pthread_cond_t 
*cond)
 static av_unused void w32thread_init(void)
 {
 #if _WIN32_WINNT < 0x0600
-HANDLE kernel_dll = GetModuleHandle(TEXT("kernel32.dll"));
+HMODULE kernel_dll = GetModuleHandle(TEXT("kernel32.dll"));
 /* if one is available, then they should all be available */
 cond_init  = (void (WINAPI*)(pthread_cond_t *))
 GetProcAddress(kernel_dll, "InitializeConditionVariable");
diff --git a/configure b/configure
index d01cb59d6d..98f7828489 100755
--- a/configure
+++ b/configure
@@ -3640,8 +3640,10 @@ case "$toolchain" in
 cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version 
\([[:digit:]]\{1,\}\)\..*/\1/p')
 if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
 cc_default="cl"
+cxx_default="cl"
 else
 cc_default="c99wrap cl"
+cxx_default="c99wrap cl"
 fi
 ld_default="$source_path/compat/windows/mslink"
 nm_default="dumpbin -symbols"
@@ -3852,6 +3854,7 @@ msvc_common_flags(){
 -lz)  echo zlib.lib ;;
 -lavicap32)   ec

[FFmpeg-cvslog] avdevice/decklink: remove pthread dependency

2017-04-15 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Sat Apr 15 
08:41:46 2017 +0200| [9e86a61870c1652cdcc6a34646aee40d973ba23b] | committer: 
Marton Balint

avdevice/decklink: remove pthread dependency

Purpose: avdevice/decklink: Removed pthread dependency by replacing
semaphore used in code appropriately.  Doing so makes it easier to
build ffmpeg using Visual C++ on Windows.  This is a contination of
Kyle Schwarz's "avdevice/decklink: Remove pthread dependency" patch
that is available at https://patchwork.ffmpeg.org/patch/2654/ .  This
patch wasn't accepted, and as far as I can tell, there was no
follow-up after it was rejected.

Notes: Used Visual Studio 2015 (with update 3) for this.

Comments:

-- configure: Eliminated pthreads dependency for decklink_indev_deps
   and decklink_outdev_deps and replaced with threads dependency

-- libavdevice/decklink_common.cpp / .h:
a) Eliminated semaphore and replaced with a combination of a mutex,
   condition variable, and a counter (frames_buffer_available_spots).
b) Removed include of pthread.h and semaphore.h and now using
   libavutil/thread.h instead.

-- libavdevice/decklink_dec.cpp: Eliminated include of pthread.h and
   semaphore.h.

-- libavdevice/decklink_enc.cpp:
a) Eliminated include of pthread.h and semaphore.h.
b) Replaced use of semaphore with the equivalent using a combination
   of a mutex, condition variable, and a counter
   (frames_buffer_available_spots).  In theory, libavutil/thread.h and
   the associated code could have been modified instead to add
   cross-platform implementations of the sem_ functions, but an
   inspection of the ffmpeg source base indicates that there are only
   two cases in which semaphores are used (including this one that was
   replaced), so it was deemed to not be worth the effort.

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e86a61870c1652cdcc6a34646aee40d973ba23b
---

 configure   |  4 ++--
 libavdevice/decklink_common.cpp |  3 ---
 libavdevice/decklink_common.h   |  5 -
 libavdevice/decklink_dec.cpp|  3 ---
 libavdevice/decklink_enc.cpp| 23 +++
 5 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index 98f7828489..3f2811a5b3 100755
--- a/configure
+++ b/configure
@@ -2995,9 +2995,9 @@ avfoundation_indev_deps="pthreads"
 avfoundation_indev_extralibs="-framework Foundation -framework AVFoundation 
-framework CoreVideo -framework CoreMedia"
 bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h 
dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
 caca_outdev_deps="libcaca"
-decklink_indev_deps="decklink pthreads"
+decklink_indev_deps="decklink threads"
 decklink_indev_extralibs="-lstdc++"
-decklink_outdev_deps="decklink pthreads"
+decklink_outdev_deps="decklink threads"
 decklink_outdev_extralibs="-lstdc++"
 dshow_indev_deps="IBaseFilter"
 dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index c9107c036a..f01fba953e 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -26,9 +26,6 @@
 #include 
 #endif
 
-#include 
-#include 
-
 extern "C" {
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h
index 4753287ecf..c12cf18d70 100644
--- a/libavdevice/decklink_common.h
+++ b/libavdevice/decklink_common.h
@@ -24,6 +24,7 @@
 
 #include 
 
+#include "libavutil/thread.h"
 #include "decklink_common_c.h"
 
 class decklink_output_callback;
@@ -89,7 +90,9 @@ struct decklink_ctx {
 int frames_preroll;
 int frames_buffer;
 
-sem_t semaphore;
+pthread_mutex_t mutex;
+pthread_cond_t cond;
+int frames_buffer_available_spots;
 
 int channels;
 };
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 8cc1bdf7c9..67eaf97e89 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -21,9 +21,6 @@
 
 #include 
 
-#include 
-#include 
-
 extern "C" {
 #include "config.h"
 #include "libavformat/avformat.h"
diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp
index 18ef9058e2..5105967101 100644
--- a/libavdevice/decklink_enc.cpp
+++ b/libavdevice/decklink_enc.cpp
@@ -24,9 +24,6 @@ using std::atomic;
 
 #include 
 
-#include 
-#include 
-
 extern "C" {
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
@@ -91,7 +88,10 @@ public:
 
 av_frame_unref(avframe);
 
-sem_post(&ctx->semaphore);
+pthread_mutex_lock(&ctx->mutex);
+ctx->frames_buffer_available_spots++;
+pthre

[FFmpeg-cvslog] libavutil/thread.h: Fixed g++ build error when ASSERT_LEVEL is greater than 1

2017-04-22 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Sun Apr 16 
17:13:31 2017 -0700| [5b281b476b32c35527c0eea5f42161c4acad83f9] | committer: 
Marton Balint

libavutil/thread.h: Fixed g++ build error when ASSERT_LEVEL is greater than 1

Purpose: libavutil/thread.h: Fixed g++ build error when ASSERT_LEVEL
is greater than 1.  This is only relevant when thread.h is included by
C++ files.  In this case, the relevant code is only defined if
HAVE_PTHREADS is defined as 1.  Use configure --assert-level=2 to do
so.

Note: Issue discovered as a result of Coverity build failure.  Cause
of build failure pinpointed by Hendrik Leppkes.

Comments:

-- libavutil/thread.h: Altered ASSERT_PTHREAD_NORET definition such
   that it uses av_make_error_string instead of av_err2str().
   av_err2str() uses a "parenthesized type followed by an initializer
   list", which is apparently not valid C++.  This issue started
   occurring because thread.h is now included by the DeckLink C++
   files.  The alteration does the equivalent of what av_err2str()
   does, but instead declares the character buffer as a local
   variable.

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b281b476b32c35527c0eea5f42161c4acad83f9
---

 libavutil/thread.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavutil/thread.h b/libavutil/thread.h
index 6e5744736b..f108e20052 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -36,8 +36,11 @@
 #define ASSERT_PTHREAD_NORET(func, ...) do {\
 int ret = func(__VA_ARGS__);\
 if (ret) {  \
+char errbuf[AV_ERROR_MAX_STRING_SIZE] = ""; \
 av_log(NULL, AV_LOG_FATAL, AV_STRINGIFY(func)   \
-   " failed with error: %s\n", av_err2str(AVERROR(ret)));   \
+   " failed with error: %s\n",  \
+   av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE,   \
+AVERROR(ret))); \
 abort();\
 }   \
 } while (0)

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


Re: [FFmpeg-cvslog] Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'

2017-05-04 Thread Aaron Levinson

On 5/4/2017 2:31 PM, Carl Eugen Hoyos wrote:

2017-05-03 16:54 GMT+02:00 Clément Bœsch :

ffmpeg | branch: master | Clément Bœsch  | Wed May  3 12:51:48 
2017 +0200| [3f17751eeb7e3348576e2597884d5e5155aadcfb] | committer: Clément Bœsch

Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'

* commit '11a9320de54759340531177c9f2b1e31e6112cc2':
  build: Move build-system-related helper files to a separate subdirectory


Why?

This is most horrible patch I can imagine, am I really the only one
who gets hit by this on the first day?

Please consider to revert, Carl Eugen


I found it annoying initially, but once you take the initial hit, its 
not a problem, and it does organize some related files together in a 
separate directory.  Even with this change, there are a still a decent 
number of files in the root directory, not all of which are related.  I 
think better organization of the entire source tree into directories and 
sub-directories would improve things further.


Aaron Levinson
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/utils: free AVStream.codec properly in free_stream()

2017-05-06 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Thu Apr 20 
23:30:13 2017 -0700| [b9d2005ea5d6837917a69bc2b8e98f5695f54e39] | committer: 
James Almer

avformat/utils: free AVStream.codec properly in free_stream()

Fixes memory leaks.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9d2005ea5d6837917a69bc2b8e98f5695f54e39
---

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index ba82a766dc..fbd8b58ac2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4266,9 +4266,7 @@ static void free_stream(AVStream **pst)
 av_freep(&st->index_entries);
 #if FF_API_LAVF_AVCTX
 FF_DISABLE_DEPRECATION_WARNINGS
-av_freep(&st->codec->extradata);
-av_freep(&st->codec->subtitle_header);
-av_freep(&st->codec);
+avcodec_free_context(&st->codec);
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 av_freep(&st->priv_data);

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


[FFmpeg-cvslog] avformat/utils: free AVStream.codec properly in free_stream()

2017-05-06 Thread Aaron Levinson
ffmpeg | branch: release/3.3 | Aaron Levinson  | Thu Apr 
20 23:30:13 2017 -0700| [329176adc52c51878160530a655f9c787fa338b3] | committer: 
James Almer

avformat/utils: free AVStream.codec properly in free_stream()

Fixes memory leaks.

Signed-off-by: James Almer 
(cherry picked from commit b9d2005ea5d6837917a69bc2b8e98f5695f54e39)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=329176adc52c51878160530a655f9c787fa338b3
---

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a059046a2c..a82bbc702d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4146,9 +4146,7 @@ static void free_stream(AVStream **pst)
 av_freep(&st->index_entries);
 #if FF_API_LAVF_AVCTX
 FF_DISABLE_DEPRECATION_WARNINGS
-av_freep(&st->codec->extradata);
-av_freep(&st->codec->subtitle_header);
-av_freep(&st->codec);
+avcodec_free_context(&st->codec);
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 av_freep(&st->priv_data);

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


[FFmpeg-cvslog] avdevice/decklink: fix MSVC build issues

2017-05-08 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Fri May  5 
17:59:21 2017 -0700| [7f7ee86d5a494ddbcb22c83dec970f38a8ccd7b4] | committer: 
Marton Balint

avdevice/decklink: fix MSVC build issues

Purpose: Made minor changes to get the decklink avdevice code to build
using Visual C++.

Notes: Made changes to configure per Hendrik Leppkes's review of first
and second versions of patch.  Also made slight alterations per Marton
Balint's reviews.

Comments:

-- configure: Added if enabled decklink section and setting
   decklink_indev_extralibs and decklink_outdev_extralibs here for
   both mingw and Windows.  Also eliminated the setting of these
   variables in the mingw section earlier in the file.

-- libavdevice/decklink_common.cpp: Switched the order of the include
   of libavformat/internal.h to workaround build issues with Visual
   C++.  See comment in file for more details.

-- libavdevice/decklink_dec.cpp:
a) Rearranged the include of libavformat/internal.h (for reasons as
   described above).
b) Made slight alteration to an argument for call to av_rescale_q() to
   workaround a compiler error with Visual C++.  This appears to only
   be an issue when building C++ files with Visual C++.  See comment
   in code for more details.

-- libavdevice/decklink_enc.cpp: Rearranged the include of
   libavformat/internal.h (for reasons as described above).

Signed-off-by: Aaron Levinson 
Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f7ee86d5a494ddbcb22c83dec970f38a8ccd7b4
---

 configure   | 11 +--
 libavdevice/decklink_common.cpp |  7 ++-
 libavdevice/decklink_dec.cpp| 16 ++--
 libavdevice/decklink_enc.cpp|  7 ++-
 4 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 47c9ee9a35..e2e50e516c 100755
--- a/configure
+++ b/configure
@@ -4853,8 +4853,6 @@ case $target_os in
 else
 target_os=mingw32
 fi
-decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 
-loleaut32"
-decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
 LIBTARGET=i386
 if enabled x86_64; then
 LIBTARGET="i386:x86-64"
@@ -5959,6 +5957,15 @@ if ! disabled sdl2; then
 fi
 enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs 
$sdl2_extralibs
 
+if enabled decklink; then
+case $target_os in
+mingw32*|mingw64*|win32|win64)
+decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 
-loleaut32"
+decklink_indev_extralibs="$decklink_indev_extralibs -lole32 
-loleaut32"
+;;
+esac
+fi
+
 disabled securetransport || { check_func SecIdentityCreate 
"-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
 check_lib securetransport "Security/SecureTransport.h Security/Security.h" 
"SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation 
-Wl,-framework,Security"; }
 
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index f01fba953e..cbb591ce64 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -19,6 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+/* Include internal.h first to avoid conflict between winsock.h (used by
+ * DeckLink headers) and winsock2.h (used by libavformat) in MSVC++ builds */
+extern "C" {
+#include "libavformat/internal.h"
+}
+
 #include 
 #ifdef _WIN32
 #include 
@@ -28,7 +34,6 @@
 
 extern "C" {
 #include "libavformat/avformat.h"
-#include "libavformat/internal.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/bswap.h"
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 67eaf97e89..39974e3ff4 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -19,12 +19,17 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+/* Include internal.h first to avoid conflict between winsock.h (used by
+ * DeckLink headers) and winsock2.h (used by libavformat) in MSVC++ builds */
+extern "C" {
+#include "libavformat/internal.h"
+}
+
 #include 
 
 extern "C" {
 #include "config.h"
 #include "libavformat/avformat.h"
-#include "libavformat/internal.h"
 #include "libavutil/avutil.h"
 #include "libavutil/common.h"
 #include "libavutil/imgutils.h"
@@ -262,8 +267,15 @@ static int64_t get_pkt_pts(IDeckLinkVideoInputFrame 
*videoFrame,
 res = videoFrame->GetHardwareReferenceTimestamp(time_base.den, 
&bmd_pts, &bmd_duration);
 break;
 case PTS_S

[FFmpeg-cvslog] qsvenc: Use MFXVideoENCODE_Query() to update the parameters

2017-05-08 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Fri May  5 
18:49:57 2017 -0700| [dd8319767e1674d030b5d803c43029e67db5efb8] | committer: 
Michael Niedermayer

qsvenc: Use MFXVideoENCODE_Query() to update the parameters

Purpose: Fill out the default/unset parameters with ones actually in use.

Note: Matches the current MediaSDK example code.  This code used to be
present in ffmpeg and was eliminated in revision 1f26a23 on Oct. 31,
2016 (qsv: Merge libav implementation, at
https://github.com/FFmpeg/FFmpeg/commit/1f26a231bb065276cd80ce02957c759f3197edfa#diff-7d84a34d58597bb7aa4b8239dca1f9f8).
Already applied to libav.

Reviewed-by: Luca Barbato 
(cherry picked from commit b22094d74901fb3ac203c8322f8d84aded470bfb)
Signed-off-by: Mark Thompson 
Signed-off-by: Aaron Levinson 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd8319767e1674d030b5d803c43029e67db5efb8
---

 libavcodec/qsvenc.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 9c385a79d8..68d4f5edd0 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -740,10 +740,18 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext 
*q)
 if (ret < 0)
 return ret;
 
+ret = MFXVideoENCODE_Query(q->session, &q->param, &q->param);
+if (ret == MFX_WRN_PARTIAL_ACCELERATION) {
+av_log(avctx, AV_LOG_WARNING, "Encoder will work with partial HW 
acceleration\n");
+} else if (ret < 0) {
+return ff_qsv_print_error(avctx, ret,
+  "Error querying encoder params");
+}
+
 ret = MFXVideoENCODE_QueryIOSurf(q->session, &q->param, &q->req);
 if (ret < 0)
 return ff_qsv_print_error(avctx, ret,
-  "Error querying the encoding parameters");
+  "Error querying (IOSurf) the encoding 
parameters");
 
 if (opaque_alloc) {
 ret = qsv_init_opaque_alloc(avctx, q);

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


[FFmpeg-cvslog] qsvenc: Make sure the interlaced encoding works

2017-05-08 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Fri May  5 
21:31:30 2017 -0700| [ae5b67ee64bec00c52881ff8426fddaf477341c1] | committer: 
Michael Niedermayer

qsvenc: Make sure the interlaced encoding works

Purpose: qsvenc: make sure that interlaced encoding works.  Also,
reduce the vertical alignment constraint when possible to reduce
memory usage.

Note: Most of this code used to be present in ffmpeg and was
eliminated in revision 1f26a23 on Oct. 31, 2016 (qsv: Merge libav
implementation, at
https://github.com/FFmpeg/FFmpeg/commit/1f26a231bb065276cd80ce02957c759f3197
edfa#diff-7d84a34d58597bb7aa4b8239dca1f9f8).  Already applied to
libav.

Reviewed-by: Luca Barbato 
(cherry picked from commit 8fd8f91e47f33cd82371a97ac81afc476144964f)
Signed-off-by: Mark Thompson 
Signed-off-by: Aaron Levinson 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae5b67ee64bec00c52881ff8426fddaf477341c1
---

 libavcodec/qsvenc.c | 29 +++--
 libavcodec/qsvenc.h |  1 +
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 68d4f5edd0..57bc83a47f 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -358,8 +358,6 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 return AVERROR_BUG;
 q->param.mfx.CodecId = ret;
 
-q->width_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
-
 if (avctx->level > 0)
 q->param.mfx.CodecLevel = avctx->level;
 
@@ -381,20 +379,39 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 
 ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC);
 
-q->param.mfx.FrameInfo.Width  = FFALIGN(avctx->width, 
q->width_align);
-q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, 32);
 q->param.mfx.FrameInfo.CropX  = 0;
 q->param.mfx.FrameInfo.CropY  = 0;
 q->param.mfx.FrameInfo.CropW  = avctx->width;
 q->param.mfx.FrameInfo.CropH  = avctx->height;
 q->param.mfx.FrameInfo.AspectRatioW   = avctx->sample_aspect_ratio.num;
 q->param.mfx.FrameInfo.AspectRatioH   = avctx->sample_aspect_ratio.den;
-q->param.mfx.FrameInfo.PicStruct  = MFX_PICSTRUCT_PROGRESSIVE;
 q->param.mfx.FrameInfo.ChromaFormat   = MFX_CHROMAFORMAT_YUV420;
 q->param.mfx.FrameInfo.BitDepthLuma   = desc->comp[0].depth;
 q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
 q->param.mfx.FrameInfo.Shift  = desc->comp[0].depth > 8;
 
+// TODO:  detect version of MFX--if the minor version is greater than
+// or equal to 19, then can use the same alignment settings as H.264
+// for HEVC
+q->width_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
+q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, q->width_align);
+
+if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
+// it is important that PicStruct be setup correctly from the
+// start--otherwise, encoding doesn't work and results in a bunch
+// of incompatible video parameter errors
+q->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_TFF;
+// height alignment always must be 32 for interlaced video
+q->height_align = 32;
+} else {
+q->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
+// for progressive video, the height should be aligned to 16 for
+// H.264.  For HEVC, depending on the version of MFX, it should be
+// either 32 or 16.  The lower number is better if possible.
+q->height_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
+}
+q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, q->height_align);
+
 if (avctx->hw_frames_ctx) {
 AVHWFramesContext *frames_ctx = 
(AVHWFramesContext*)avctx->hw_frames_ctx->data;
 AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
@@ -898,7 +915,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame 
*frame,
 } else {
 /* make a copy if the input is not padded as libmfx requires */
 if (frame->height & 31 || frame->linesize[0] & (q->width_align - 1)) {
-qf->frame->height = FFALIGN(frame->height, 32);
+qf->frame->height = FFALIGN(frame->height, q->height_align);
 qf->frame->width  = FFALIGN(frame->width, q->width_align);
 
 ret = ff_get_buffer(q->avctx, qf->frame, AV_GET_BUFFER_FLAG_REF);
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 361d9333d8..12e3444b75 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -84,6 +84,7 @@ typedef struct QSVEncContext {
 
 int packet_size;
 int width_align;
+int height_align;
 
 mfxVideoParam param;
 mfxFrameAllocRequest req;

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


[FFmpeg-cvslog] configure: Added require alternative for libmfx to support alternate installation options

2017-05-08 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Fri May  5 
18:16:03 2017 -0700| [164e2773261451ef33c4616296ec5bebecff42af] | committer: 
Michael Niedermayer

configure: Added require alternative for libmfx to support alternate 
installation options

Purpose: Added require alternative for libmfx in the case that pkg-config
cannot find libmfx.  On Linux, most people likely get libmfx via
https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
well-known way to get libmfx is via the Intel Media SDK, which
provides a static build of libmfx.lib and also provides the source
code for building libmfx yourself.  If built this way, there are no
pkg-config files to be found.

Comments:

-- configure: Altered enabled libmfx step to use use_pkg_config()
   instead of require_pkg_config(), and, if use_pkg_config() fails, it
   falls back to require().  Also added explanatory comment.  Note
   that the reason that require() is passed -llibmfx as the last
   argument, instead of -lmfx, is the file name for the library
   produced from the Intel Media SDK starts with "libmfx".
   Apparently, the filename for the library produced via
   https://github.com/lu-zero/mfx_dispatch starts with "mfx".

Signed-off-by: Aaron Levinson 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=164e2773261451ef33c4616296ec5bebecff42af
---

 configure | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index e2e50e516c..e797567780 100755
--- a/configure
+++ b/configure
@@ -5791,7 +5791,14 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
"gsm/gsm.h"; do
done || die "ERROR: libgsm not found"; }
 enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
-lilbc
 enabled libkvazaar&& require_pkg_config "kvazaar >= 0.8.1" kvazaar.h 
kvz_api_get
-enabled libmfx&& require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
+# While it may appear that require is being used as a pkg-config
+# fallback for libmfx, it is actually being used to detect a different
+# installation route altogether.  If libmfx is installed via the Intel
+# Media SDK or Intel Media Server Studio, these don't come with
+# pkg-config support.  Instead, users should make sure that the build
+# can find the libraries and headers through other means.
+enabled libmfx&& { use_pkg_config libmfx "mfx/mfxvideo.h" MFXInit 
||
+   { require libmfx "mfx/mfxvideo.h" MFXInit 
-llibmfx && warn "using libmfx without pkg-config"; } }
 enabled libmodplug&& require_pkg_config libmodplug 
libmodplug/modplug.h ModPlug_Load
 enabled libmp3lame&& require "libmp3lame >= 3.98.3" lame/lame.h 
lame_set_VBR_quality -lmp3lame
 enabled libnut&& require libnut libnut.h nut_demuxer_init -lnut

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


[FFmpeg-cvslog] avformat/utils: free AVStream.codec properly in free_stream()

2017-05-11 Thread Aaron Levinson
ffmpeg | branch: release/3.2 | Aaron Levinson  | Thu Apr 
20 23:30:13 2017 -0700| [9cf601f87da8bfa8a1bab46c538cfab9deff730d] | committer: 
James Almer

avformat/utils: free AVStream.codec properly in free_stream()

Fixes memory leaks.

Signed-off-by: James Almer 
(cherry picked from commit b9d2005ea5d6837917a69bc2b8e98f5695f54e39)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9cf601f87da8bfa8a1bab46c538cfab9deff730d
---

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 55f23bab29..6d0f888aa8 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4120,9 +4120,7 @@ static void free_stream(AVStream **pst)
 av_freep(&st->index_entries);
 #if FF_API_LAVF_AVCTX
 FF_DISABLE_DEPRECATION_WARNINGS
-av_freep(&st->codec->extradata);
-av_freep(&st->codec->subtitle_header);
-av_freep(&st->codec);
+avcodec_free_context(&st->codec);
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 av_freep(&st->priv_data);

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


[FFmpeg-cvslog] avformat/utils: free AVStream.codec properly in free_stream()

2017-05-16 Thread Aaron Levinson
ffmpeg | branch: release/3.1 | Aaron Levinson  | Thu Apr 
20 23:30:13 2017 -0700| [9ebbb29ad61db72cebab31a6a68970ca8063bcf8] | committer: 
James Almer

avformat/utils: free AVStream.codec properly in free_stream()

Fixes memory leaks.

Signed-off-by: James Almer 
(cherry picked from commit b9d2005ea5d6837917a69bc2b8e98f5695f54e39)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ebbb29ad61db72cebab31a6a68970ca8063bcf8
---

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 17bbdb44be..d71aca851b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3994,9 +3994,7 @@ static void free_stream(AVStream **pst)
 av_freep(&st->index_entries);
 #if FF_API_LAVF_AVCTX
 FF_DISABLE_DEPRECATION_WARNINGS
-av_freep(&st->codec->extradata);
-av_freep(&st->codec->subtitle_header);
-av_freep(&st->codec);
+avcodec_free_context(&st->codec);
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 av_freep(&st->priv_data);

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


[FFmpeg-cvslog] avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

2017-05-16 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Tue May 16 
05:04:36 2017 -0700| [0c1c514643d5e1645160d697fa4c27cd38c7c791] | committer: 
Mark Thompson

avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

Add dxva2_pool_release_dummy() and use it in call to
av_buffer_create() in dxva2_pool_alloc().

Prior to this change, av_buffer_create() was called with NULL for the
third argument, which indicates that av_buffer_default_free() should
be used to free the buffer's data.  Eventually, it gets to
buffer_pool_free() and calls buf->free() on a surface object (which is
av_buffer_default_free()).

This can result in a crash when the debug version of the C-runtime is
used on Windows.  While it doesn't appear to result in a crash when
the release version of the C-runtime is used on Windows, it likely
results in memory corruption, since av_free() is being called on
memory that was allocated using
IDirectXVideoAccelerationService::CreateSurface().

Signed-off-by: Aaron Levinson 
Reviewed-by: wm4 
Reviewed-by: Steven Liu 
Reviewed-by: Mark Thompson 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c1c514643d5e1645160d697fa4c27cd38c7c791
---

 libavutil/hwcontext_dxva2.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index 4ed0d56aea..6c41788e2e 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -121,6 +121,13 @@ static void dxva2_frames_uninit(AVHWFramesContext *ctx)
 }
 }
 
+static void dxva2_pool_release_dummy(void *opaque, uint8_t *data)
+{
+// important not to free anything here--data is a surface object
+// associated with the call to CreateSurface(), and these surfaces are
+// released in dxva2_frames_uninit()
+}
+
 static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 {
 AVHWFramesContext  *ctx = (AVHWFramesContext*)opaque;
@@ -130,7 +137,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 if (s->nb_surfaces_used < hwctx->nb_surfaces) {
 s->nb_surfaces_used++;
 return 
av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1],
-sizeof(*hwctx->surfaces), NULL, 0, 0);
+sizeof(*hwctx->surfaces), 
dxva2_pool_release_dummy, 0, 0);
 }
 
 return NULL;

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


[FFmpeg-cvslog] avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

2017-05-16 Thread Aaron Levinson
ffmpeg | branch: release/3.3 | Aaron Levinson  | Tue May 
16 05:04:36 2017 -0700| [19fea7d703b0a7e02860df5fc2e94b826059d64d] | committer: 
Mark Thompson

avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

Add dxva2_pool_release_dummy() and use it in call to
av_buffer_create() in dxva2_pool_alloc().

Prior to this change, av_buffer_create() was called with NULL for the
third argument, which indicates that av_buffer_default_free() should
be used to free the buffer's data.  Eventually, it gets to
buffer_pool_free() and calls buf->free() on a surface object (which is
av_buffer_default_free()).

This can result in a crash when the debug version of the C-runtime is
used on Windows.  While it doesn't appear to result in a crash when
the release version of the C-runtime is used on Windows, it likely
results in memory corruption, since av_free() is being called on
memory that was allocated using
IDirectXVideoAccelerationService::CreateSurface().

Signed-off-by: Aaron Levinson 
Reviewed-by: wm4 
Reviewed-by: Steven Liu 
Reviewed-by: Mark Thompson 
(cherry picked from commit 0c1c514643d5e1645160d697fa4c27cd38c7c791)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19fea7d703b0a7e02860df5fc2e94b826059d64d
---

 libavutil/hwcontext_dxva2.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index 4ed0d56aea..6c41788e2e 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -121,6 +121,13 @@ static void dxva2_frames_uninit(AVHWFramesContext *ctx)
 }
 }
 
+static void dxva2_pool_release_dummy(void *opaque, uint8_t *data)
+{
+// important not to free anything here--data is a surface object
+// associated with the call to CreateSurface(), and these surfaces are
+// released in dxva2_frames_uninit()
+}
+
 static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 {
 AVHWFramesContext  *ctx = (AVHWFramesContext*)opaque;
@@ -130,7 +137,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 if (s->nb_surfaces_used < hwctx->nb_surfaces) {
 s->nb_surfaces_used++;
 return 
av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1],
-sizeof(*hwctx->surfaces), NULL, 0, 0);
+sizeof(*hwctx->surfaces), 
dxva2_pool_release_dummy, 0, 0);
 }
 
 return NULL;

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


[FFmpeg-cvslog] avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

2017-05-16 Thread Aaron Levinson
ffmpeg | branch: release/3.2 | Aaron Levinson  | Tue May 
16 05:04:36 2017 -0700| [7793fc5b339df0661c2cddcdc647e4641eaf83e9] | committer: 
Mark Thompson

avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

Add dxva2_pool_release_dummy() and use it in call to
av_buffer_create() in dxva2_pool_alloc().

Prior to this change, av_buffer_create() was called with NULL for the
third argument, which indicates that av_buffer_default_free() should
be used to free the buffer's data.  Eventually, it gets to
buffer_pool_free() and calls buf->free() on a surface object (which is
av_buffer_default_free()).

This can result in a crash when the debug version of the C-runtime is
used on Windows.  While it doesn't appear to result in a crash when
the release version of the C-runtime is used on Windows, it likely
results in memory corruption, since av_free() is being called on
memory that was allocated using
IDirectXVideoAccelerationService::CreateSurface().

Signed-off-by: Aaron Levinson 
Reviewed-by: wm4 
Reviewed-by: Steven Liu 
Reviewed-by: Mark Thompson 
(cherry picked from commit 0c1c514643d5e1645160d697fa4c27cd38c7c791)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7793fc5b339df0661c2cddcdc647e4641eaf83e9
---

 libavutil/hwcontext_dxva2.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index e79254bb34..cf926e89f0 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -101,6 +101,13 @@ static void dxva2_frames_uninit(AVHWFramesContext *ctx)
 }
 }
 
+static void dxva2_pool_release_dummy(void *opaque, uint8_t *data)
+{
+// important not to free anything here--data is a surface object
+// associated with the call to CreateSurface(), and these surfaces are
+// released in dxva2_frames_uninit()
+}
+
 static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 {
 AVHWFramesContext  *ctx = (AVHWFramesContext*)opaque;
@@ -110,7 +117,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 if (s->nb_surfaces_used < hwctx->nb_surfaces) {
 s->nb_surfaces_used++;
 return 
av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1],
-sizeof(*hwctx->surfaces), NULL, 0, 0);
+sizeof(*hwctx->surfaces), 
dxva2_pool_release_dummy, 0, 0);
 }
 
 return NULL;

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


[FFmpeg-cvslog] avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

2017-05-16 Thread Aaron Levinson
ffmpeg | branch: release/3.1 | Aaron Levinson  | Tue May 
16 05:04:36 2017 -0700| [f125c54b7a5f7b3d742aab2b11a59b7a4eaf4d74] | committer: 
Mark Thompson

avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

Add dxva2_pool_release_dummy() and use it in call to
av_buffer_create() in dxva2_pool_alloc().

Prior to this change, av_buffer_create() was called with NULL for the
third argument, which indicates that av_buffer_default_free() should
be used to free the buffer's data.  Eventually, it gets to
buffer_pool_free() and calls buf->free() on a surface object (which is
av_buffer_default_free()).

This can result in a crash when the debug version of the C-runtime is
used on Windows.  While it doesn't appear to result in a crash when
the release version of the C-runtime is used on Windows, it likely
results in memory corruption, since av_free() is being called on
memory that was allocated using
IDirectXVideoAccelerationService::CreateSurface().

Signed-off-by: Aaron Levinson 
Reviewed-by: wm4 
Reviewed-by: Steven Liu 
Reviewed-by: Mark Thompson 
(cherry picked from commit 0c1c514643d5e1645160d697fa4c27cd38c7c791)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f125c54b7a5f7b3d742aab2b11a59b7a4eaf4d74
---

 libavutil/hwcontext_dxva2.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index e79254bb34..cf926e89f0 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -101,6 +101,13 @@ static void dxva2_frames_uninit(AVHWFramesContext *ctx)
 }
 }
 
+static void dxva2_pool_release_dummy(void *opaque, uint8_t *data)
+{
+// important not to free anything here--data is a surface object
+// associated with the call to CreateSurface(), and these surfaces are
+// released in dxva2_frames_uninit()
+}
+
 static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 {
 AVHWFramesContext  *ctx = (AVHWFramesContext*)opaque;
@@ -110,7 +117,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 if (s->nb_surfaces_used < hwctx->nb_surfaces) {
 s->nb_surfaces_used++;
 return 
av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1],
-sizeof(*hwctx->surfaces), NULL, 0, 0);
+sizeof(*hwctx->surfaces), 
dxva2_pool_release_dummy, 0, 0);
 }
 
 return NULL;

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


[FFmpeg-cvslog] avformat/utils: free AVStream.codec properly in free_stream()

2017-05-17 Thread Aaron Levinson
ffmpeg | branch: release/3.0 | Aaron Levinson  | Thu Apr 
20 23:30:13 2017 -0700| [c54a76bf714b07cf316da06ffeac1a1d753a15f3] | committer: 
James Almer

avformat/utils: free AVStream.codec properly in free_stream()

Fixes memory leaks.

Signed-off-by: James Almer 
(cherry picked from commit b9d2005ea5d6837917a69bc2b8e98f5695f54e39)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c54a76bf714b07cf316da06ffeac1a1d753a15f3
---

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index b199ff23bf..f90aeb20c1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3728,9 +3728,7 @@ static void free_stream(AVStream **pst)
 av_dict_free(&st->metadata);
 av_freep(&st->probe_data.buf);
 av_freep(&st->index_entries);
-av_freep(&st->codec->extradata);
-av_freep(&st->codec->subtitle_header);
-av_freep(&st->codec);
+avcodec_free_context(&st->codec);
 av_freep(&st->priv_data);
 if (st->info)
 av_freep(&st->info->duration_error);

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


[FFmpeg-cvslog] avformat/utils: free AVStream.codec properly in free_stream()

2017-05-19 Thread Aaron Levinson
ffmpeg | branch: release/2.8 | Aaron Levinson  | Thu Apr 
20 23:30:13 2017 -0700| [0109a152a1651d520788000bed5ce096b515de3d] | committer: 
James Almer

avformat/utils: free AVStream.codec properly in free_stream()

Fixes memory leaks.

Signed-off-by: James Almer 
(cherry picked from commit b9d2005ea5d6837917a69bc2b8e98f5695f54e39)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0109a152a1651d520788000bed5ce096b515de3d
---

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index abc90c3c70..a88d9598dc 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3683,9 +3683,7 @@ void ff_free_stream(AVFormatContext *s, AVStream *st) {
 av_dict_free(&st->metadata);
 av_freep(&st->probe_data.buf);
 av_freep(&st->index_entries);
-av_freep(&st->codec->extradata);
-av_freep(&st->codec->subtitle_header);
-av_freep(&st->codec);
+avcodec_free_context(&st->codec);
 av_freep(&st->priv_data);
 if (st->info)
 av_freep(&st->info->duration_error);

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


[FFmpeg-cvslog] mov: Fix spherical metadata_source parsing

2017-10-17 Thread Aaron Colwell
ffmpeg | branch: master | Aaron Colwell  | Fri Jan 27 
09:33:29 2017 -0800| [17adcc40adf1f30cba55c9727dabc1365944d32b] | committer: 
Vittorio Giovara

mov: Fix spherical metadata_source parsing

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=17adcc40adf1f30cba55c9727dabc1365944d32b
---

 libavformat/mov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5c9f85c738..d5de5d6b13 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3252,7 +3252,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 }
 
 size = avio_rb32(pb);
-if (size > atom.size)
+if (size <= 12 || size > atom.size)
 return AVERROR_INVALIDDATA;
 
 tag = avio_rl32(pb);
@@ -3261,7 +3261,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 }
 avio_skip(pb, 4); /*  version + flags */
-avio_skip(pb, avio_r8(pb)); /* metadata_source */
+avio_skip(pb, size - 12); /* metadata_source */
 
 size = avio_rb32(pb);
 if (size > atom.size)

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


[FFmpeg-cvslog] qsvenc: Use MFXVideoENCODE_Query() to update the parameters

2017-10-28 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Sun Apr 16 
18:07:42 2017 -0700| [b22094d74901fb3ac203c8322f8d84aded470bfb] | committer: 
Luca Barbato

qsvenc: Use MFXVideoENCODE_Query() to update the parameters

Fill out the default/unset parameters with ones actually in use.

Matches the current MediaSDK example code.

Signed-off-by: Luca Barbato 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b22094d74901fb3ac203c8322f8d84aded470bfb
---

 libavcodec/qsvenc.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index bd8c24321e..6ac5ca1340 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -757,10 +757,18 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext 
*q)
 if (ret < 0)
 return ret;
 
+ret = MFXVideoENCODE_Query(q->session, &q->param, &q->param);
+if (ret == MFX_WRN_PARTIAL_ACCELERATION) {
+av_log(avctx, AV_LOG_WARNING, "Encoder will work with partial HW 
acceleration\n");
+} else if (ret < 0) {
+return ff_qsv_print_error(avctx, ret,
+  "Error querying encoder params");
+}
+
 ret = MFXVideoENCODE_QueryIOSurf(q->session, &q->param, &q->req);
 if (ret < 0)
 return ff_qsv_print_error(avctx, ret,
-  "Error querying the encoding parameters");
+  "Error querying (IOSurf) the encoding 
parameters");
 
 if (opaque_alloc) {
 ret = qsv_init_opaque_alloc(avctx, q);

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


[FFmpeg-cvslog] qsvenc: Make sure the interlaced encoding works

2017-10-28 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Sun Apr 16 
18:06:37 2017 -0700| [8fd8f91e47f33cd82371a97ac81afc476144964f] | committer: 
Luca Barbato

qsvenc: Make sure the interlaced encoding works

And reduce the vertical alignment constraint when possible to reduce the
memory usage.

Signed-off-by: Luca Barbato 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fd8f91e47f33cd82371a97ac81afc476144964f
---

 libavcodec/qsvenc.c | 29 +++--
 libavcodec/qsvenc.h |  1 +
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 6ac5ca1340..7c6ad09dda 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -366,8 +366,6 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 return AVERROR_BUG;
 q->param.mfx.CodecId = ret;
 
-q->width_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
-
 if (avctx->level > 0)
 q->param.mfx.CodecLevel = avctx->level;
 
@@ -389,20 +387,39 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 
 ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC);
 
-q->param.mfx.FrameInfo.Width  = FFALIGN(avctx->width, 
q->width_align);
-q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, 32);
 q->param.mfx.FrameInfo.CropX  = 0;
 q->param.mfx.FrameInfo.CropY  = 0;
 q->param.mfx.FrameInfo.CropW  = avctx->width;
 q->param.mfx.FrameInfo.CropH  = avctx->height;
 q->param.mfx.FrameInfo.AspectRatioW   = avctx->sample_aspect_ratio.num;
 q->param.mfx.FrameInfo.AspectRatioH   = avctx->sample_aspect_ratio.den;
-q->param.mfx.FrameInfo.PicStruct  = MFX_PICSTRUCT_PROGRESSIVE;
 q->param.mfx.FrameInfo.ChromaFormat   = MFX_CHROMAFORMAT_YUV420;
 q->param.mfx.FrameInfo.BitDepthLuma   = desc->comp[0].depth;
 q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
 q->param.mfx.FrameInfo.Shift  = desc->comp[0].depth > 8;
 
+// TODO:  detect version of MFX--if the minor version is greater than
+// or equal to 19, then can use the same alignment settings as H.264
+// for HEVC
+q->width_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
+q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, q->width_align);
+
+if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
+// it is important that PicStruct be setup correctly from the
+// start--otherwise, encoding doesn't work and results in a bunch
+// of incompatible video parameter errors
+q->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_TFF;
+// height alignment always must be 32 for interlaced video
+q->height_align = 32;
+} else {
+q->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
+// for progressive video, the height should be aligned to 16 for
+// H.264.  For HEVC, depending on the version of MFX, it should be
+// either 32 or 16.  The lower number is better if possible.
+q->height_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
+}
+q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, q->height_align);
+
 if (avctx->hw_frames_ctx) {
 AVHWFramesContext *frames_ctx = 
(AVHWFramesContext*)avctx->hw_frames_ctx->data;
 AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
@@ -898,7 +915,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame 
*frame,
 } else {
 /* make a copy if the input is not padded as libmfx requires */
 if (frame->height & 31 || frame->linesize[0] & (q->width_align - 1)) {
-qf->frame->height = FFALIGN(frame->height, 32);
+qf->frame->height = FFALIGN(frame->height, q->height_align);
 qf->frame->width  = FFALIGN(frame->width, q->width_align);
 
 ret = ff_get_buffer(q->avctx, qf->frame, AV_GET_BUFFER_FLAG_REF);
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 13e4c47481..a6399040e9 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -79,6 +79,7 @@ typedef struct QSVEncContext {
 
 int packet_size;
 int width_align;
+int height_align;
 
 mfxVideoParam param;
 mfxFrameAllocRequest req;

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


[FFmpeg-cvslog] avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

2017-10-31 Thread Aaron Levinson
ffmpeg | branch: master | Aaron Levinson  | Tue May 16 
14:23:27 2017 -0700| [3d040513a1de4797a4f81dde4984395f51db76b7] | committer: 
Anton Khirnov

avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects

Add dxva2_pool_release_dummy() and use it in call to
av_buffer_create() in dxva2_pool_alloc().

Prior to this change, av_buffer_create() was called with NULL for the
third argument, which indicates that av_buffer_default_free() should
be used to free the buffer's data.  Eventually, it gets to
buffer_pool_free() and calls buf->free() on a surface object (which is
av_buffer_default_free()).

This can result in a crash when the debug version of the C-runtime is
used on Windows.  While it doesn't appear to result in a crash when
the release version of the C-runtime is used on Windows, it likely
results in memory corruption, since av_free() is being called on
memory that was allocated using
IDirectXVideoAccelerationService::CreateSurface().

Signed-off-by: Aaron Levinson 
Reviewed-by: wm4 
Reviewed-by: Steven Liu 
Reviewed-by: Mark Thompson 
Signed-off-by: Anton Khirnov 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d040513a1de4797a4f81dde4984395f51db76b7
---

 libavutil/hwcontext_dxva2.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index 3790bed4b7..d1b19ab237 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -119,6 +119,13 @@ static void dxva2_frames_uninit(AVHWFramesContext *ctx)
 }
 }
 
+static void dxva2_pool_release_dummy(void *opaque, uint8_t *data)
+{
+// important not to free anything here--data is a surface object
+// associated with the call to CreateSurface(), and these surfaces are
+// released in dxva2_frames_uninit()
+}
+
 static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 {
 AVHWFramesContext  *ctx = (AVHWFramesContext*)opaque;
@@ -128,7 +135,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
 if (s->nb_surfaces_used < hwctx->nb_surfaces) {
 s->nb_surfaces_used++;
 return 
av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1],
-sizeof(*hwctx->surfaces), NULL, 0, 0);
+sizeof(*hwctx->surfaces), 
dxva2_pool_release_dummy, 0, 0);
 }
 
 return NULL;

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


[FFmpeg-cvslog] mov: Fix spherical metadata_source parsing

2017-01-27 Thread Aaron Colwell
ffmpeg | branch: master | Aaron Colwell  | Fri Jan 27 
09:33:29 2017 -0800| [b9f2f93261548f7cfdfc7a4040b23baed11e5554] | committer: 
James Almer

mov: Fix spherical metadata_source parsing

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9f2f93261548f7cfdfc7a4040b23baed11e5554
---

 libavformat/mov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7dc550e..b1bfa0a 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4566,7 +4566,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 }
 
 size = avio_rb32(pb);
-if (size > atom.size)
+if (size <= 12 || size > atom.size)
 return AVERROR_INVALIDDATA;
 
 tag = avio_rl32(pb);
@@ -4575,7 +4575,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 }
 avio_skip(pb, 4); /*  version + flags */
-avio_skip(pb, avio_r8(pb)); /* metadata_source */
+avio_skip(pb, size - 12); /* metadata_source */
 
 size = avio_rb32(pb);
 if (size > atom.size)

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


[FFmpeg-cvslog] libavcodec/libopenjpegenc: enable lossless option, remove layer option, and improve defaults

2017-03-09 Thread Aaron Boxer
ffmpeg | branch: master | Aaron Boxer  | Thu Mar  9 23:01:48 
2017 -0500| [195784ec95266c69c111f1e977fd4cf4815c6d8d] | committer: Michael 
Bradshaw

libavcodec/libopenjpegenc: enable lossless option, remove layer option, and 
improve defaults

1. limit to single layer, as there is no current support for setting 
distortion/quality of multiple layers
2. encoder mode should be kept at default setting (0)
3. remove fixed_alloc parameter from context : seldom if ever used, and no way 
of properly configuring at the moment
4. add irreversible setting, to allow for lossless encoding. Set to OpenJPEG 
default (enabled)
5. set numresolution max to 33, which is the maximum number of allowed 
resolutions according the J2K spec

Signed-off-by: Michael Bradshaw 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=195784ec95266c69c111f1e977fd4cf4815c6d8d
---

 libavcodec/libopenjpegenc.c | 17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 1b7e168..4a12729 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -64,9 +64,8 @@ typedef struct LibOpenJPEGContext {
 int prog_order;
 int cinema_mode;
 int numresolution;
-int numlayers;
+int irreversible;
 int disto_alloc;
-int fixed_alloc;
 int fixed_quality;
 } LibOpenJPEGContext;
 
@@ -358,13 +357,12 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext 
*avctx)
 ctx->numresolution --;
 }
 
-ctx->enc_params.mode = !!avctx->global_quality;
 ctx->enc_params.prog_order = ctx->prog_order;
 ctx->enc_params.numresolution = ctx->numresolution;
+ctx->enc_params.irreversible = ctx->irreversible;
 ctx->enc_params.cp_disto_alloc = ctx->disto_alloc;
-ctx->enc_params.cp_fixed_alloc = ctx->fixed_alloc;
 ctx->enc_params.cp_fixed_quality = ctx->fixed_quality;
-ctx->enc_params.tcp_numlayers = ctx->numlayers;
+ctx->enc_params.tcp_numlayers = 1;
 ctx->enc_params.tcp_rates[0] = FFMAX(avctx->compression_level, 0) * 2;
 
 if (ctx->cinema_mode > 0) {
@@ -838,11 +836,10 @@ static const AVOption options[] = {
 { "rpcl",  NULL,0, 
AV_OPT_TYPE_CONST, { .i64 = OPJ(RPCL)}, 0, 0,   VE, 
"prog_order"  },
 { "pcrl",  NULL,0, 
AV_OPT_TYPE_CONST, { .i64 = OPJ(PCRL)}, 0, 0,   VE, 
"prog_order"  },
 { "cprl",  NULL,0, 
AV_OPT_TYPE_CONST, { .i64 = OPJ(CPRL)}, 0, 0,   VE, 
"prog_order"  },
-{ "numresolution", NULL,OFFSET(numresolution), 
AV_OPT_TYPE_INT,   { .i64 = 0   }, 0, INT_MAX, VE   
 },
-{ "numlayers", NULL,OFFSET(numlayers), 
AV_OPT_TYPE_INT,   { .i64 = 1   }, 1, 10,  VE   
 },
-{ "disto_alloc",   NULL,OFFSET(disto_alloc),   
AV_OPT_TYPE_INT,   { .i64 = 1   }, 0, 1,   VE   
 },
-{ "fixed_alloc",   NULL,OFFSET(fixed_alloc),   
AV_OPT_TYPE_INT,   { .i64 = 0   }, 0, 1,   VE   
 },
-{ "fixed_quality", NULL,OFFSET(fixed_quality), 
AV_OPT_TYPE_INT,   { .i64 = 0   }, 0, 1,   VE   
 },
+{ "numresolution", NULL,OFFSET(numresolution), 
AV_OPT_TYPE_INT,   { .i64 = 6}, 0, 33,  VE  
  },
+{ "irreversible",  NULL,OFFSET(irreversible),  
AV_OPT_TYPE_INT,   { .i64 = 0}, 0, 1,   VE  
  },
+{ "disto_alloc",   NULL,OFFSET(disto_alloc),   
AV_OPT_TYPE_INT,   { .i64 = 1}, 0, 1,   VE  
  },
+{ "fixed_quality", NULL,OFFSET(fixed_quality), 
AV_OPT_TYPE_INT,   { .i64 = 0}, 0, 1,   VE  
  },
 { NULL },
 };
 

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


[FFmpeg-cvslog] avformat/matroskadec: Fix sample_aspect_ratio for stereo matroska content

2015-12-02 Thread Aaron Colwell
ffmpeg | branch: master | Aaron Colwell  | Mon Nov 23 
12:06:14 2015 -0800| [ec83efd4d3c5fe1e4bc5723d0b91abf85b722f41] | committer: wm4

avformat/matroskadec: Fix sample_aspect_ratio for stereo matroska content

matroskaenc.c applies divisors to the display width/height when generating
stereo content. This patch adds the corresponding multipliers to matroskadec.c
so that the original sample aspect ratio can be recovered.

Signed-off-by: wm4 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec83efd4d3c5fe1e4bc5723d0b91abf85b722f41
---

 libavformat/matroskadec.c |   34 --
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 424d7bf..f05ddd6 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1648,6 +1648,30 @@ static int matroska_parse_flac(AVFormatContext *s,
 return 0;
 }
 
+static void mkv_stereo_mode_display_mul(int stereo_mode, int *h_width, int 
*h_height)
+{
+switch (stereo_mode) {
+case MATROSKA_VIDEO_STEREOMODE_TYPE_MONO:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR:
+break;
+case MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR:
+*h_width = 2;
+break;
+case MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR:
+*h_height = 2;
+break;
+}
+}
+
 static int matroska_parse_tracks(AVFormatContext *s)
 {
 MatroskaDemuxContext *matroska = s->priv_data;
@@ -2007,6 +2031,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
 
 if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
 MatroskaTrackPlane *planes = track->operation.combine_planes.elem;
+int display_width_mul = 1;
+int display_height_mul = 1;
 
 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
 st->codec->codec_tag  = fourcc;
@@ -2014,10 +2040,14 @@ static int matroska_parse_tracks(AVFormatContext *s)
 st->codec->bits_per_coded_sample = bit_depth;
 st->codec->width  = track->video.pixel_width;
 st->codec->height = track->video.pixel_height;
+
+if (track->video.stereo_mode && track->video.stereo_mode < 
MATROSKA_VIDEO_STEREOMODE_TYPE_NB)
+mkv_stereo_mode_display_mul(track->video.stereo_mode, 
&display_width_mul, &display_height_mul);
+
 av_reduce(&st->sample_aspect_ratio.num,
   &st->sample_aspect_ratio.den,
-  st->codec->height * track->video.display_width,
-  st->codec->width  * track->video.display_height,
+  st->codec->height * track->video.display_width * 
display_width_mul,
+  st->codec->width  * track->video.display_height * 
display_height_mul,
   255);
 if (st->codec->codec_id != AV_CODEC_ID_HEVC)
 st->need_parsing = AVSTREAM_PARSE_HEADERS;

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


[FFmpeg-cvslog] matroskadec: Fix sample_aspect_ratio for stereo matroska content

2015-12-18 Thread Aaron Colwell
ffmpeg | branch: master | Aaron Colwell  | Wed Dec  2 
18:13:18 2015 -0500| [febfb49a70e82f5ac46dc7ea34dabd4d56b19b31] | committer: 
Vittorio Giovara

matroskadec: Fix sample_aspect_ratio for stereo matroska content

matroskaenc applies divisors to the display width/height when generating
stereo content. This patch adds the corresponding multipliers to matroskadec
so that the original sample aspect ratio can be recovered.

Signed-off-by: wm4 
Signed-off-by: Vittorio Giovara 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=febfb49a70e82f5ac46dc7ea34dabd4d56b19b31
---

 libavformat/matroskadec.c |   36 ++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index bdf2eb4..0757bf5 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1525,6 +1525,31 @@ static int matroska_parse_flac(AVFormatContext *s,
 return 0;
 }
 
+static void mkv_stereo_mode_display_mul(int stereo_mode,
+int *h_width, int *h_height)
+{
+switch (stereo_mode) {
+case MATROSKA_VIDEO_STEREOMODE_TYPE_MONO:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR:
+break;
+case MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR:
+*h_width = 2;
+break;
+case MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL:
+case MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR:
+*h_height = 2;
+break;
+}
+}
+
 static int matroska_parse_tracks(AVFormatContext *s)
 {
 MatroskaDemuxContext *matroska = s->priv_data;
@@ -1810,14 +1835,21 @@ static int matroska_parse_tracks(AVFormatContext *s)
 }
 
 if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
+int display_width_mul  = 1;
+int display_height_mul = 1;
+
 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
 st->codec->codec_tag  = track->video.fourcc;
 st->codec->width  = track->video.pixel_width;
 st->codec->height = track->video.pixel_height;
+
+if (track->video.stereo_mode && track->video.stereo_mode < 
MATROSKA_VIDEO_STEREOMODE_TYPE_NB)
+mkv_stereo_mode_display_mul(track->video.stereo_mode, 
&display_width_mul, &display_height_mul);
+
 av_reduce(&st->sample_aspect_ratio.num,
   &st->sample_aspect_ratio.den,
-  st->codec->height * track->video.display_width,
-  st->codec->width  * track->video.display_height,
+  st->codec->height * track->video.display_width  * 
display_width_mul,
+  st->codec->width  * track->video.display_height * 
display_height_mul,
   255);
 if (st->codec->codec_id != AV_CODEC_ID_H264 &&
 st->codec->codec_id != AV_CODEC_ID_HEVC)

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


[FFmpeg-cvslog] vp8: avoid race condition on segment map.

2015-03-11 Thread Aaron Colwell
ffmpeg | branch: release/0.10 | Aaron Colwell  | Sun Mar 
18 20:03:00 2012 -0700| [57c36de7265761dd94fb6bb4a9180011f796128f] | committer: 
Diego Biurrun

vp8: avoid race condition on segment map.

This change avoids accessing the segment map of the previous frame if
segmentation is not enabled for the current frame. The caller of
decode_mb_mode() only calls ff_thread_await_progress() on the reference
segmentation index array if segmentation is enabled, so Chromium's TSAN
will report a race when accessing this data while segmentation is not
enabled.

Signed-off-by: Ronald S. Bultje 
(cherry picked from commit 30011bf20109eef1a0f9ee949b19f9998ad88663)
Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=57c36de7265761dd94fb6bb4a9180011f796128f
---

 libavcodec/vp8.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index a16f5ca..0b6d818 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -642,7 +642,7 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int 
mb_x, int mb_y, uint8_
 
 if (s->segmentation.update_map)
 *segment = vp8_rac_get_tree(c, vp8_segmentid_tree, s->prob->segmentid);
-else
+else if (s->segmentation.enabled)
 *segment = ref ? *ref : *segment;
 s->segment = *segment;
 

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


[FFmpeg-cvslog] avcodec/j2kenc: Add attribution to OpenJPEG project:

2016-04-01 Thread Aaron Boxer
ffmpeg | branch: master | Aaron Boxer  | Thu Mar 31 16:02:14 
2016 -0400| [b6b4b0a65e02495edf9d7e5b23bef99a92921147] | committer: Michael 
Niedermayer

avcodec/j2kenc: Add attribution to OpenJPEG project:

http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b6b4b0a65e02495edf9d7e5b23bef99a92921147
---

 libavcodec/j2kenc.c |   38 ++
 1 file changed, 38 insertions(+)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 2cd837d..c8d3861 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -17,8 +17,46 @@
  * 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
+ *
+ * 
**
+ *
+ *
+ *
+ * This source code incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, 
Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
+ * Copyright (c) 2001-2003, David Janssens
+ * Copyright (c) 2002-2003, Yannick Verschueren
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
+ * Copyright (c) 2007, Callum Lerwick 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 /**
  * JPEG2000 image encoder
  * @file

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


[FFmpeg-cvslog] avcodec/j2kenc: Add attribution to OpenJPEG project:

2016-04-21 Thread Aaron Boxer
ffmpeg | branch: release/3.0 | Aaron Boxer  | Thu Mar 31 
16:02:14 2016 -0400| [5d79566ab3ddfc6fc46cc2fe7f3b894b4c384f3e] | committer: 
Michael Niedermayer

avcodec/j2kenc: Add attribution to OpenJPEG project:

http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b4b0a65e02495edf9d7e5b23bef99a92921147)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d79566ab3ddfc6fc46cc2fe7f3b894b4c384f3e
---

 libavcodec/j2kenc.c |   38 ++
 1 file changed, 38 insertions(+)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 2cd837d..c8d3861 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -17,8 +17,46 @@
  * 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
+ *
+ * 
**
+ *
+ *
+ *
+ * This source code incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, 
Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
+ * Copyright (c) 2001-2003, David Janssens
+ * Copyright (c) 2002-2003, Yannick Verschueren
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
+ * Copyright (c) 2007, Callum Lerwick 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 /**
  * JPEG2000 image encoder
  * @file

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


[FFmpeg-cvslog] avcodec/j2kenc: Add attribution to OpenJPEG project:

2016-04-26 Thread Aaron Boxer
ffmpeg | branch: release/2.8 | Aaron Boxer  | Thu Mar 31 
16:02:14 2016 -0400| [b5d4b1731eadadaf25db0d3edaf6f7588d359366] | committer: 
Michael Niedermayer

avcodec/j2kenc: Add attribution to OpenJPEG project:

http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b4b0a65e02495edf9d7e5b23bef99a92921147)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b5d4b1731eadadaf25db0d3edaf6f7588d359366
---

 libavcodec/j2kenc.c |   38 ++
 1 file changed, 38 insertions(+)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 152da8b..bedc889 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -17,8 +17,46 @@
  * 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
+ *
+ * 
**
+ *
+ *
+ *
+ * This source code incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, 
Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
+ * Copyright (c) 2001-2003, David Janssens
+ * Copyright (c) 2002-2003, Yannick Verschueren
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
+ * Copyright (c) 2007, Callum Lerwick 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 /**
  * JPEG2000 image encoder
  * @file

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


[FFmpeg-cvslog] avcodec/j2kenc: Add attribution to OpenJPEG project:

2016-04-27 Thread Aaron Boxer
ffmpeg | branch: release/2.7 | Aaron Boxer  | Thu Mar 31 
16:02:14 2016 -0400| [1bccba1893cffee4778d79bb94185ad715e76838] | committer: 
Michael Niedermayer

avcodec/j2kenc: Add attribution to OpenJPEG project:

http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b4b0a65e02495edf9d7e5b23bef99a92921147)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bccba1893cffee4778d79bb94185ad715e76838
---

 libavcodec/j2kenc.c |   38 ++
 1 file changed, 38 insertions(+)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 593ceb4..d044948 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -17,8 +17,46 @@
  * 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
+ *
+ * 
**
+ *
+ *
+ *
+ * This source code incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, 
Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
+ * Copyright (c) 2001-2003, David Janssens
+ * Copyright (c) 2002-2003, Yannick Verschueren
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
+ * Copyright (c) 2007, Callum Lerwick 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 /**
  * JPEG2000 image encoder
  * @file

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


[FFmpeg-cvslog] avcodec/j2kenc: Add attribution to OpenJPEG project:

2016-04-29 Thread Aaron Boxer
ffmpeg | branch: release/2.6 | Aaron Boxer  | Thu Mar 31 
16:02:14 2016 -0400| [6ec961197138eb5063ef98da18207ce5af00a5f6] | committer: 
Michael Niedermayer

avcodec/j2kenc: Add attribution to OpenJPEG project:

http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b4b0a65e02495edf9d7e5b23bef99a92921147)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ec961197138eb5063ef98da18207ce5af00a5f6
---

 libavcodec/j2kenc.c |   38 ++
 1 file changed, 38 insertions(+)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index ddb0b68..60e211e 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -17,8 +17,46 @@
  * 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
+ *
+ * 
**
+ *
+ *
+ *
+ * This source code incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, 
Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
+ * Copyright (c) 2001-2003, David Janssens
+ * Copyright (c) 2002-2003, Yannick Verschueren
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
+ * Copyright (c) 2007, Callum Lerwick 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 /**
  * JPEG2000 image encoder
  * @file

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


[FFmpeg-cvslog] avcodec/j2kenc: Add attribution to OpenJPEG project:

2016-04-30 Thread Aaron Boxer
ffmpeg | branch: release/2.5 | Aaron Boxer  | Thu Mar 31 
16:02:14 2016 -0400| [eae0a6582df3c658e9f32744c6c3252876db2570] | committer: 
Michael Niedermayer

avcodec/j2kenc: Add attribution to OpenJPEG project:

http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b4b0a65e02495edf9d7e5b23bef99a92921147)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eae0a6582df3c658e9f32744c6c3252876db2570
---

 libavcodec/j2kenc.c |   38 ++
 1 file changed, 38 insertions(+)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index ddb0b68..60e211e 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -17,8 +17,46 @@
  * 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
+ *
+ * 
**
+ *
+ *
+ *
+ * This source code incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, 
Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
+ * Copyright (c) 2001-2003, David Janssens
+ * Copyright (c) 2002-2003, Yannick Verschueren
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
+ * Copyright (c) 2007, Callum Lerwick 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 /**
  * JPEG2000 image encoder
  * @file

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


[FFmpeg-cvslog] lavc/libvpxenc: Fix parsing of ts_layering_mode parameter

2024-05-17 Thread Aaron Thompson
ffmpeg | branch: master | Aaron Thompson  | Thu May 16 
06:10:36 2024 +| [be3404bbacae5a046e1b3e66a98810b4b7564249] | committer: 
James Zern

lavc/libvpxenc: Fix parsing of ts_layering_mode parameter

The value was being parsed as base 4, so the value "4" was invalid and
would result in ts_layering_mode being set to 0.

Signed-off-by: Aaron Thompson 
Signed-off-by: James Zern 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be3404bbacae5a046e1b3e66a98810b4b7564249
---

 libavcodec/libvpxenc.c | 2 +-
 libavcodec/version.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index bcbdc4981e..5c7b6e9de7 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -684,7 +684,7 @@ static int vpx_ts_param_parse(VPxContext *ctx, struct 
vpx_codec_enc_cfg *enccfg,
 vp8_ts_parse_int_array(enccfg->ts_layer_id, value, value_len, 
VPX_TS_MAX_PERIODICITY);
 } else if (!strcmp(key, "ts_layering_mode")) {
 /* option for pre-defined temporal structures in function 
set_temporal_layer_pattern. */
-ts_layering_mode = strtoul(value, &value, 4);
+ts_layering_mode = strtoul(value, &value, 10);
 }
 
 #if (VPX_ENCODER_ABI_VERSION >= 12) && CONFIG_LIBVPX_VP9_ENCODER
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f0958eee14..3d2de546b3 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 #include "version_major.h"
 
 #define LIBAVCODEC_VERSION_MINOR   5
-#define LIBAVCODEC_VERSION_MICRO 103
+#define LIBAVCODEC_VERSION_MICRO 104
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".