Hello community, here is the log from the commit of package libavutil for openSUSE:Factory checked in at 2013-11-29 07:01:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libavutil (Old) and /work/SRC/openSUSE:Factory/.libavutil.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libavutil" Changes: -------- --- /work/SRC/openSUSE:Factory/libavutil/libavutil.changes 2013-11-17 20:19:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libavutil.new/libavutil.changes 2013-11-29 07:01:37.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Nov 20 00:00:00 UTC 2013 - [email protected] + +- update to 2.1.1 + * bugfix release + +------------------------------------------------------------------- Old: ---- ffmpeg-2.1-crippled.tar.bz2 libavutil-2.1-cripple.patch New: ---- ffmpeg-2.1.1-crippled.tar.bz2 libavutil-2.1.1-cripple.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libavutil.spec ++++++ --- /var/tmp/diff_new_pack.2KARkB/_old 2013-11-29 07:01:38.000000000 +0100 +++ /var/tmp/diff_new_pack.2KARkB/_new 2013-11-29 07:01:38.000000000 +0100 @@ -20,7 +20,7 @@ %define swscale 2 Name: libavutil -Version: 2.1 +Version: 2.1.1 Release: 0 Summary: Utilities library from ffmpeg License: LGPL-3.0+ ++++++ ffmpeg-2.1-crippled.tar.bz2 -> ffmpeg-2.1.1-crippled.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/RELEASE new/ffmpeg-2.1.1/RELEASE --- old/ffmpeg-2.1/RELEASE 2013-10-28 01:58:04.000000000 +0100 +++ new/ffmpeg-2.1.1/RELEASE 2013-11-20 03:29:07.000000000 +0100 @@ -1 +1 @@ -2.1 +2.1.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/VERSION new/ffmpeg-2.1.1/VERSION --- old/ffmpeg-2.1/VERSION 2013-10-28 01:58:04.000000000 +0100 +++ new/ffmpeg-2.1.1/VERSION 2013-11-20 03:29:07.000000000 +0100 @@ -1 +1 @@ -2.1 +2.1.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/configure new/ffmpeg-2.1.1/configure --- old/ffmpeg-2.1/configure 2013-10-28 01:58:04.000000000 +0100 +++ new/ffmpeg-2.1.1/configure 2013-11-20 03:29:07.000000000 +0100 @@ -2878,7 +2878,9 @@ unset _depflags _DEPCMD _DEPFLAGS _flags_filter=echo - if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then + if $_cc --version 2>&1 | grep -q '^GNU assembler'; then + true # no-op to avoid reading stdin in following checks + elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then _type=llvm_gcc gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/doc/Doxyfile new/ffmpeg-2.1.1/doc/Doxyfile --- old/ffmpeg-2.1/doc/Doxyfile 2013-10-28 01:58:04.000000000 +0100 +++ new/ffmpeg-2.1.1/doc/Doxyfile 2013-11-20 03:29:07.000000000 +0100 @@ -31,7 +31,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.1 +PROJECT_NUMBER = 2.1.1 # With the PROJECT_LOGO tag one can specify a logo or icon that is included # in the documentation. The maximum height of the logo should not exceed 55 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/doc/filters.texi new/ffmpeg-2.1.1/doc/filters.texi --- old/ffmpeg-2.1/doc/filters.texi 2013-10-28 01:58:04.000000000 +0100 +++ new/ffmpeg-2.1.1/doc/filters.texi 2013-11-20 03:29:07.000000000 +0100 @@ -6422,9 +6422,11 @@ load and make pullup usable in realtime on slow machines. @end table -For example to inverse telecined NTSC input: +For best results (without duplicated frames in the output file) it is +necessary to change the output frame rate. For example, to inverse +telecine NTSC input: @example -pullup,fps=24000/1001 +ffmpeg -i input -vf pullup -r 24000/1001 ... @end example @section removelogo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/Makefile new/ffmpeg-2.1.1/libavutil/Makefile --- old/ffmpeg-2.1/libavutil/Makefile 2013-10-28 01:58:06.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/Makefile 2013-11-20 03:29:07.000000000 +0100 @@ -90,7 +90,8 @@ intfloat_readwrite.o \ intmath.o \ lfg.o \ - lls.o \ + lls1.o \ + lls2.o \ log.o \ log2_tab.o \ mathematics.o \ @@ -143,7 +144,8 @@ fifo \ hmac \ lfg \ - lls \ + lls1 \ + lls2 \ md5 \ murmur3 \ opt \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/lls.c new/ffmpeg-2.1.1/libavutil/lls.c --- old/ffmpeg-2.1/libavutil/lls.c 2013-10-28 01:58:06.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/lls.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,179 +0,0 @@ -/* - * linear least squares model - * - * Copyright (c) 2006 Michael Niedermayer <[email protected]> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * linear least squares model - */ - -#include <math.h> -#include <string.h> - -#include "attributes.h" -#include "version.h" -#include "lls.h" - -static void update_lls(LLSModel *m, double *var) -{ - int i, j; - - for (i = 0; i <= m->indep_count; i++) { - for (j = i; j <= m->indep_count; j++) { - m->covariance[i][j] += var[i] * var[j]; - } - } -} - -void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order) -{ - int i, j, k; - double (*factor)[MAX_VARS_ALIGN] = (void *) &m->covariance[1][0]; - double (*covar) [MAX_VARS_ALIGN] = (void *) &m->covariance[1][1]; - double *covar_y = m->covariance[0]; - int count = m->indep_count; - - for (i = 0; i < count; i++) { - for (j = i; j < count; j++) { - double sum = covar[i][j]; - - for (k = i - 1; k >= 0; k--) - sum -= factor[i][k] * factor[j][k]; - - if (i == j) { - if (sum < threshold) - sum = 1.0; - factor[i][i] = sqrt(sum); - } else { - factor[j][i] = sum / factor[i][i]; - } - } - } - - for (i = 0; i < count; i++) { - double sum = covar_y[i + 1]; - - for (k = i - 1; k >= 0; k--) - sum -= factor[i][k] * m->coeff[0][k]; - - m->coeff[0][i] = sum / factor[i][i]; - } - - for (j = count - 1; j >= min_order; j--) { - for (i = j; i >= 0; i--) { - double sum = m->coeff[0][i]; - - for (k = i + 1; k <= j; k++) - sum -= factor[k][i] * m->coeff[j][k]; - - m->coeff[j][i] = sum / factor[i][i]; - } - - m->variance[j] = covar_y[0]; - - for (i = 0; i <= j; i++) { - double sum = m->coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1]; - - for (k = 0; k < i; k++) - sum += 2 * m->coeff[j][k] * covar[k][i]; - - m->variance[j] += m->coeff[j][i] * sum; - } - } -} - -static double evaluate_lls(LLSModel *m, double *param, int order) -{ - int i; - double out = 0; - - for (i = 0; i <= order; i++) - out += param[i] * m->coeff[order][i]; - - return out; -} - -av_cold void avpriv_init_lls(LLSModel *m, int indep_count) -{ - memset(m, 0, sizeof(LLSModel)); - m->indep_count = indep_count; - m->update_lls = update_lls; - m->evaluate_lls = evaluate_lls; - if (ARCH_X86) - ff_init_lls_x86(m); -} - -#if FF_API_LLS_PRIVATE -av_cold void av_init_lls(LLSModel *m, int indep_count) -{ - avpriv_init_lls(m, indep_count); -} -void av_update_lls(LLSModel *m, double *param, double decay) -{ - m->update_lls(m, param); -} -void av_solve_lls(LLSModel *m, double threshold, int min_order) -{ - avpriv_solve_lls(m, threshold, min_order); -} -double av_evaluate_lls(LLSModel *m, double *param, int order) -{ - return m->evaluate_lls(m, param, order); -} -#endif /* FF_API_LLS_PRIVATE */ - -#ifdef TEST - -#include <stdio.h> -#include <limits.h> -#include "lfg.h" - -int main(void) -{ - LLSModel m; - int i, order; - AVLFG lfg; - - av_lfg_init(&lfg, 1); - avpriv_init_lls(&m, 3); - - for (i = 0; i < 100; i++) { - LOCAL_ALIGNED(32, double, var, [4]); - double eval; - - var[0] = (av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2; - var[1] = var[0] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; - var[2] = var[1] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; - var[3] = var[2] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; - m.update_lls(&m, var); - avpriv_solve_lls(&m, 0.001, 0); - for (order = 0; order < 3; order++) { - eval = m.evaluate_lls(&m, var + 1, order); - printf("real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n", - var[0], order, eval, sqrt(m.variance[order] / (i + 1)), - m.coeff[order][0], m.coeff[order][1], - m.coeff[order][2]); - } - } - return 0; -} - -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/lls.h new/ffmpeg-2.1.1/libavutil/lls.h --- old/ffmpeg-2.1/libavutil/lls.h 2013-10-28 01:58:06.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/lls.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,71 +0,0 @@ -/* - * linear least squares model - * - * Copyright (c) 2006 Michael Niedermayer <[email protected]> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVUTIL_LLS_H -#define AVUTIL_LLS_H - -#include "common.h" -#include "mem.h" -#include "version.h" - -#define MAX_VARS 32 -#define MAX_VARS_ALIGN FFALIGN(MAX_VARS+1,4) - -//FIXME avoid direct access to LLSModel from outside - -/** - * Linear least squares model. - */ -typedef struct LLSModel { - DECLARE_ALIGNED(32, double, covariance[MAX_VARS_ALIGN][MAX_VARS_ALIGN]); - DECLARE_ALIGNED(32, double, coeff[MAX_VARS][MAX_VARS]); - double variance[MAX_VARS]; - int indep_count; - /** - * Take the outer-product of var[] with itself, and add to the covariance matrix. - * @param m this context - * @param var training samples, starting with the value to be predicted - * 32-byte aligned, and any padding elements must be initialized - * (i.e not denormal/nan). - */ - void (*update_lls)(struct LLSModel *m, double *var); - /** - * Inner product of var[] and the LPC coefs. - * @param m this context - * @param var training samples, excluding the value to be predicted. unaligned. - * @param order lpc order - */ - double (*evaluate_lls)(struct LLSModel *m, double *var, int order); -} LLSModel; - -void avpriv_init_lls(LLSModel *m, int indep_count); -void ff_init_lls_x86(LLSModel *m); -void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order); - -#if FF_API_LLS_PRIVATE -void av_init_lls(LLSModel *m, int indep_count); -void av_update_lls(LLSModel *m, double *param, double decay); -void av_solve_lls(LLSModel *m, double threshold, int min_order); -double av_evaluate_lls(LLSModel *m, double *param, int order); -#endif /* FF_API_LLS_PRIVATE */ - -#endif /* AVUTIL_LLS_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/lls1.c new/ffmpeg-2.1.1/libavutil/lls1.c --- old/ffmpeg-2.1/libavutil/lls1.c 1970-01-01 01:00:00.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/lls1.c 2013-11-20 03:29:07.000000000 +0100 @@ -0,0 +1,180 @@ +/* + * linear least squares model + * + * Copyright (c) 2006 Michael Niedermayer <[email protected]> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * linear least squares model + */ + +#include <math.h> +#include <string.h> + +#include "attributes.h" +#include "version.h" +#include "lls1.h" + +#if FF_API_LLS1 + +av_cold void avpriv_init_lls(LLSModel *m, int indep_count) +{ + memset(m, 0, sizeof(LLSModel)); + m->indep_count = indep_count; +} + +void avpriv_update_lls(LLSModel *m, double *var, double decay) +{ + int i, j; + + for (i = 0; i <= m->indep_count; i++) { + for (j = i; j <= m->indep_count; j++) { + m->covariance[i][j] *= decay; + m->covariance[i][j] += var[i] * var[j]; + } + } +} + +void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order) +{ + int i, j, k; + double (*factor)[MAX_VARS + 1] = (void *) &m->covariance[1][0]; + double (*covar) [MAX_VARS + 1] = (void *) &m->covariance[1][1]; + double *covar_y = m->covariance[0]; + int count = m->indep_count; + + for (i = 0; i < count; i++) { + for (j = i; j < count; j++) { + double sum = covar[i][j]; + + for (k = i - 1; k >= 0; k--) + sum -= factor[i][k] * factor[j][k]; + + if (i == j) { + if (sum < threshold) + sum = 1.0; + factor[i][i] = sqrt(sum); + } else { + factor[j][i] = sum / factor[i][i]; + } + } + } + + for (i = 0; i < count; i++) { + double sum = covar_y[i + 1]; + + for (k = i - 1; k >= 0; k--) + sum -= factor[i][k] * m->coeff[0][k]; + + m->coeff[0][i] = sum / factor[i][i]; + } + + for (j = count - 1; j >= min_order; j--) { + for (i = j; i >= 0; i--) { + double sum = m->coeff[0][i]; + + for (k = i + 1; k <= j; k++) + sum -= factor[k][i] * m->coeff[j][k]; + + m->coeff[j][i] = sum / factor[i][i]; + } + + m->variance[j] = covar_y[0]; + + for (i = 0; i <= j; i++) { + double sum = m->coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1]; + + for (k = 0; k < i; k++) + sum += 2 * m->coeff[j][k] * covar[k][i]; + + m->variance[j] += m->coeff[j][i] * sum; + } + } +} + +double avpriv_evaluate_lls(LLSModel *m, double *param, int order) +{ + int i; + double out = 0; + + for (i = 0; i <= order; i++) + out += param[i] * m->coeff[order][i]; + + return out; +} + +#if FF_API_LLS_PRIVATE +av_cold void av_init_lls(LLSModel *m, int indep_count) +{ + avpriv_init_lls(m, indep_count); +} +void av_update_lls(LLSModel *m, double *param, double decay) +{ + avpriv_update_lls(m, param, decay); +} +void av_solve_lls(LLSModel *m, double threshold, int min_order) +{ + avpriv_solve_lls(m, threshold, min_order); +} +double av_evaluate_lls(LLSModel *m, double *param, int order) +{ + return avpriv_evaluate_lls(m, param, order); +} +#endif /* FF_API_LLS_PRIVATE */ + +#endif /* FF_API_LLS1 */ + +#ifdef TEST + +#include <stdio.h> +#include <limits.h> +#include "lfg.h" + +int main(void) +{ + LLSModel m; + int i, order; + AVLFG lfg; + + av_lfg_init(&lfg, 1); + avpriv_init_lls(&m, 3); + + for (i = 0; i < 100; i++) { + double var[4]; + double eval; + + var[0] = (av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2; + var[1] = var[0] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; + var[2] = var[1] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; + var[3] = var[2] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; + avpriv_update_lls(&m, var, 0.99); + avpriv_solve_lls(&m, 0.001, 0); + for (order = 0; order < 3; order++) { + eval = avpriv_evaluate_lls(&m, var + 1, order); + printf("real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n", + var[0], order, eval, sqrt(m.variance[order] / (i + 1)), + m.coeff[order][0], m.coeff[order][1], + m.coeff[order][2]); + } + } + return 0; +} + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/lls1.h new/ffmpeg-2.1.1/libavutil/lls1.h --- old/ffmpeg-2.1/libavutil/lls1.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/lls1.h 2013-11-20 03:29:07.000000000 +0100 @@ -0,0 +1,54 @@ +/* + * linear least squares model + * + * Copyright (c) 2006 Michael Niedermayer <[email protected]> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LLS_H +#define AVUTIL_LLS_H + +#include "version.h" + +#define MAX_VARS 32 + +//FIXME avoid direct access to LLSModel from outside + +/** + * Linear least squares model. + */ +typedef struct LLSModel { + double covariance[MAX_VARS + 1][MAX_VARS + 1]; + double coeff[MAX_VARS][MAX_VARS]; + double variance[MAX_VARS]; + int indep_count; +} LLSModel; + +void avpriv_init_lls(LLSModel *m, int indep_count); +void avpriv_update_lls(LLSModel *m, double *param, double decay); +void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order); +double avpriv_evaluate_lls(LLSModel *m, double *param, int order); + +#if FF_API_LLS_PRIVATE +void av_init_lls(LLSModel *m, int indep_count); +void av_update_lls(LLSModel *m, double *param, double decay); +void av_solve_lls(LLSModel *m, double threshold, int min_order); +double av_evaluate_lls(LLSModel *m, double *param, int order); +#endif /* FF_API_LLS_PRIVATE */ + +#endif /* AVUTIL_LLS_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/lls2.c new/ffmpeg-2.1.1/libavutil/lls2.c --- old/ffmpeg-2.1/libavutil/lls2.c 1970-01-01 01:00:00.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/lls2.c 2013-11-20 03:29:07.000000000 +0100 @@ -0,0 +1,160 @@ +/* + * linear least squares model + * + * Copyright (c) 2006 Michael Niedermayer <[email protected]> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * linear least squares model + */ + +#include <math.h> +#include <string.h> + +#include "attributes.h" +#include "version.h" +#include "lls2.h" + +static void update_lls(LLSModel2 *m, double *var) +{ + int i, j; + + for (i = 0; i <= m->indep_count; i++) { + for (j = i; j <= m->indep_count; j++) { + m->covariance[i][j] += var[i] * var[j]; + } + } +} + +void avpriv_solve_lls2(LLSModel2 *m, double threshold, unsigned short min_order) +{ + int i, j, k; + double (*factor)[MAX_VARS_ALIGN] = (void *) &m->covariance[1][0]; + double (*covar) [MAX_VARS_ALIGN] = (void *) &m->covariance[1][1]; + double *covar_y = m->covariance[0]; + int count = m->indep_count; + + for (i = 0; i < count; i++) { + for (j = i; j < count; j++) { + double sum = covar[i][j]; + + for (k = i - 1; k >= 0; k--) + sum -= factor[i][k] * factor[j][k]; + + if (i == j) { + if (sum < threshold) + sum = 1.0; + factor[i][i] = sqrt(sum); + } else { + factor[j][i] = sum / factor[i][i]; + } + } + } + + for (i = 0; i < count; i++) { + double sum = covar_y[i + 1]; + + for (k = i - 1; k >= 0; k--) + sum -= factor[i][k] * m->coeff[0][k]; + + m->coeff[0][i] = sum / factor[i][i]; + } + + for (j = count - 1; j >= min_order; j--) { + for (i = j; i >= 0; i--) { + double sum = m->coeff[0][i]; + + for (k = i + 1; k <= j; k++) + sum -= factor[k][i] * m->coeff[j][k]; + + m->coeff[j][i] = sum / factor[i][i]; + } + + m->variance[j] = covar_y[0]; + + for (i = 0; i <= j; i++) { + double sum = m->coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1]; + + for (k = 0; k < i; k++) + sum += 2 * m->coeff[j][k] * covar[k][i]; + + m->variance[j] += m->coeff[j][i] * sum; + } + } +} + +static double evaluate_lls(LLSModel2 *m, double *param, int order) +{ + int i; + double out = 0; + + for (i = 0; i <= order; i++) + out += param[i] * m->coeff[order][i]; + + return out; +} + +av_cold void avpriv_init_lls2(LLSModel2 *m, int indep_count) +{ + memset(m, 0, sizeof(LLSModel2)); + m->indep_count = indep_count; + m->update_lls = update_lls; + m->evaluate_lls = evaluate_lls; + if (ARCH_X86) + ff_init_lls_x86(m); +} + +#ifdef TEST + +#include <stdio.h> +#include <limits.h> +#include "lfg.h" + +int main(void) +{ + LLSModel2 m; + int i, order; + AVLFG lfg; + + av_lfg_init(&lfg, 1); + avpriv_init_lls2(&m, 3); + + for (i = 0; i < 100; i++) { + LOCAL_ALIGNED(32, double, var, [4]); + double eval; + + var[0] = (av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2; + var[1] = var[0] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; + var[2] = var[1] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; + var[3] = var[2] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; + m.update_lls(&m, var); + avpriv_solve_lls2(&m, 0.001, 0); + for (order = 0; order < 3; order++) { + eval = m.evaluate_lls(&m, var + 1, order); + printf("real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n", + var[0], order, eval, sqrt(m.variance[order] / (i + 1)), + m.coeff[order][0], m.coeff[order][1], + m.coeff[order][2]); + } + } + return 0; +} + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/lls2.h new/ffmpeg-2.1.1/libavutil/lls2.h --- old/ffmpeg-2.1/libavutil/lls2.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/lls2.h 2013-11-20 03:29:07.000000000 +0100 @@ -0,0 +1,64 @@ +/* + * linear least squares model + * + * Copyright (c) 2006 Michael Niedermayer <[email protected]> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LLS_H +#define AVUTIL_LLS_H + +#include "common.h" +#include "mem.h" +#include "version.h" + +#define MAX_VARS 32 +#define MAX_VARS_ALIGN FFALIGN(MAX_VARS+1,4) + +//FIXME avoid direct access to LLSModel2 from outside + +/** + * Linear least squares model. + */ +typedef struct LLSModel2 { + DECLARE_ALIGNED(32, double, covariance[MAX_VARS_ALIGN][MAX_VARS_ALIGN]); + DECLARE_ALIGNED(32, double, coeff[MAX_VARS][MAX_VARS]); + double variance[MAX_VARS]; + int indep_count; + /** + * Take the outer-product of var[] with itself, and add to the covariance matrix. + * @param m this context + * @param var training samples, starting with the value to be predicted + * 32-byte aligned, and any padding elements must be initialized + * (i.e not denormal/nan). + */ + void (*update_lls)(struct LLSModel2 *m, double *var); + /** + * Inner product of var[] and the LPC coefs. + * @param m this context + * @param var training samples, excluding the value to be predicted. unaligned. + * @param order lpc order + */ + double (*evaluate_lls)(struct LLSModel2 *m, double *var, int order); +} LLSModel2; + +void avpriv_init_lls2(LLSModel2 *m, int indep_count); +void ff_init_lls_x86(LLSModel2 *m); +void avpriv_solve_lls2(LLSModel2 *m, double threshold, unsigned short min_order); + +#endif /* AVUTIL_LLS_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/version.h new/ffmpeg-2.1.1/libavutil/version.h --- old/ffmpeg-2.1/libavutil/version.h 2013-10-28 01:58:06.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/version.h 2013-11-20 03:29:07.000000000 +0100 @@ -76,7 +76,7 @@ #define LIBAVUTIL_VERSION_MAJOR 52 #define LIBAVUTIL_VERSION_MINOR 48 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ @@ -132,6 +132,9 @@ #ifndef FF_API_LLS_PRIVATE #define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53) #endif +#ifndef FF_API_LLS1 +#define FF_API_LLS1 (LIBAVUTIL_VERSION_MAJOR < 53) +#endif #ifndef FF_API_AVFRAME_LAVC #define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 53) #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/x86/lls.asm new/ffmpeg-2.1.1/libavutil/x86/lls.asm --- old/ffmpeg-2.1/libavutil/x86/lls.asm 2013-10-28 01:58:06.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/x86/lls.asm 2013-11-20 03:29:07.000000000 +0100 @@ -29,7 +29,7 @@ %define COVAR_STRIDE MAX_VARS_ALIGN*8 %define COVAR(x,y) [covarq + (x)*8 + (y)*COVAR_STRIDE] -struc LLSModel +struc LLSModel2 .covariance: resq MAX_VARS_ALIGN*MAX_VARS_ALIGN .coeff: resq MAX_VARS*MAX_VARS .variance: resq MAX_VARS @@ -49,7 +49,7 @@ %define movdqa movaps cglobal update_lls, 2,5,8, ctx, var, i, j, covar2 %define covarq ctxq - mov id, [ctxq + LLSModel.indep_count] + mov id, [ctxq + LLSModel2.indep_count] lea varq, [varq + iq*8] neg iq mov covar2q, covarq @@ -129,7 +129,7 @@ INIT_YMM avx cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2 %define covarq ctxq - mov countd, [ctxq + LLSModel.indep_count] + mov countd, [ctxq + LLSModel2.indep_count] lea count2d, [countq-2] xor id, id .loopi: @@ -206,7 +206,7 @@ %define coefsq ctxq mov id, orderd imul orderd, MAX_VARS - lea coefsq, [ctxq + LLSModel.coeff + orderq*8] + lea coefsq, [ctxq + LLSModel2.coeff + orderq*8] movsd m0, [varq] movhpd m0, [varq + 8] mulpd m0, [coefsq] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpeg-2.1/libavutil/x86/lls_init.c new/ffmpeg-2.1.1/libavutil/x86/lls_init.c --- old/ffmpeg-2.1/libavutil/x86/lls_init.c 2013-10-28 01:58:06.000000000 +0100 +++ new/ffmpeg-2.1.1/libavutil/x86/lls_init.c 2013-11-20 03:29:07.000000000 +0100 @@ -20,14 +20,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/lls.h" +#include "libavutil/lls2.h" #include "libavutil/x86/cpu.h" -void ff_update_lls_sse2(LLSModel *m, double *var); -void ff_update_lls_avx(LLSModel *m, double *var); -double ff_evaluate_lls_sse2(LLSModel *m, double *var, int order); +void ff_update_lls_sse2(LLSModel2 *m, double *var); +void ff_update_lls_avx(LLSModel2 *m, double *var); +double ff_evaluate_lls_sse2(LLSModel2 *m, double *var, int order); -av_cold void ff_init_lls_x86(LLSModel *m) +av_cold void ff_init_lls_x86(LLSModel2 *m) { int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { ++++++ libavutil-2.1-cripple.patch -> libavutil-2.1.1-cripple.patch ++++++ --- /work/SRC/openSUSE:Factory/libavutil/libavutil-2.1-cripple.patch 2013-11-17 20:19:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libavutil.new/libavutil-2.1.1-cripple.patch 2013-11-29 07:01:37.000000000 +0100 @@ -1,6 +1,6 @@ -diff -ur ffmpeg-2.1.orig/configure ffmpeg-2.1/configure ---- ffmpeg-2.1.orig/configure 2013-10-28 01:58:04.000000000 +0100 -+++ ffmpeg-2.1/configure 2013-11-09 17:02:38.138479786 +0100 +diff -ur ffmpeg-2.1.1.orig/configure ffmpeg-2.1.1/configure +--- ffmpeg-2.1.1.orig/configure 2013-11-20 03:29:07.000000000 +0100 ++++ ffmpeg-2.1.1/configure 2013-11-20 21:17:12.335506063 +0100 @@ -1236,14 +1236,7 @@ " @@ -35,9 +35,9 @@ ALL_COMPONENTS=" $BSF_LIST $DECODER_LIST -diff -ur ffmpeg-2.1.orig/libavutil/frame.h ffmpeg-2.1/libavutil/frame.h ---- ffmpeg-2.1.orig/libavutil/frame.h 2013-10-28 01:58:06.000000000 +0100 -+++ ffmpeg-2.1/libavutil/frame.h 2013-11-09 17:03:30.307167925 +0100 +diff -ur ffmpeg-2.1.1.orig/libavutil/frame.h ffmpeg-2.1.1/libavutil/frame.h +--- ffmpeg-2.1.1.orig/libavutil/frame.h 2013-11-20 03:28:58.000000000 +0100 ++++ ffmpeg-2.1.1/libavutil/frame.h 2013-11-20 21:17:12.336506040 +0100 @@ -22,8 +22,6 @@ #include <stdint.h> @@ -47,9 +47,9 @@ #include "avutil.h" #include "buffer.h" #include "dict.h" -diff -ur ffmpeg-2.1.orig/tests/Makefile ffmpeg-2.1/tests/Makefile ---- ffmpeg-2.1.orig/tests/Makefile 2013-10-28 01:58:06.000000000 +0100 -+++ ffmpeg-2.1/tests/Makefile 2013-11-09 17:04:30.244660726 +0100 +diff -ur ffmpeg-2.1.1.orig/tests/Makefile ffmpeg-2.1.1/tests/Makefile +--- ffmpeg-2.1.1.orig/tests/Makefile 2013-11-20 03:28:58.000000000 +0100 ++++ ffmpeg-2.1.1/tests/Makefile 2013-11-20 21:17:12.336506040 +0100 @@ -72,68 +72,6 @@ FILTERDEMDECMUX = $(call ALLYES, $(1)_FILTER $(2)_DEMUXER $(3)_DECODER $(4)_MUXER) FILTERDEMDECENCMUX = $(call ALLYES, $(1)_FILTER $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER) -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
