From 1ba91d5a0e1df7419a561f6dcf16a0839509a5e7 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 27 Aug 2008 13:28:57 +0000 Subject: Reordering of the directories[1]: moving Game/Code to src git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1302 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 202 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 src/lib/ffmpeg/swscale.pas (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas new file mode 100644 index 00000000..cac14d57 --- /dev/null +++ b/src/lib/ffmpeg/swscale.pas @@ -0,0 +1,202 @@ +(* + * Copyright (C) 2001-2003 Michael Niedermayer + * + * 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 + *) + +(* + * FFmpeg Pascal port + * - Ported by the UltraStar Deluxe Team + *) + +(* + * Conversion of libswscale/swscale.h + * revision 26183, Thu Mar 6 11:32:25 2008 UTC + *) + +unit swscale; + +{$IFDEF FPC} + {$MODE DELPHI } + {$PACKENUM 4} (* use 4-byte enums *) + {$PACKRECORDS C} (* C/C++-compatible record packing *) +{$ELSE} + {$MINENUMSIZE 4} (* use 4-byte enums *) +{$ENDIF} + +{$IFDEF DARWIN} + {$linklib libswscale} +{$ENDIF} + +interface + +uses + ctypes, + avutil, + UConfig; + +const + (* Max. supported version by this header *) + LIBSWSCALE_MAX_VERSION_MAJOR = 0; + LIBSWSCALE_MAX_VERSION_MINOR = 5; + LIBSWSCALE_MAX_VERSION_RELEASE = 1; + LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + + (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); + +(* Check if linked versions are supported *) +{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} + {$MESSAGE Warn 'Linked version of libswscale may be unsupported!'} +{$IFEND} + +type + TQuadCintArray = array[0..3] of cint; + PQuadCintArray = ^TQuadCintArray; + TCintArray = array[0..0] of cint; + PCintArray = ^TCintArray; + TPCuint8Array = array[0..0] of PCuint8; + PPCuint8Array = ^TPCuint8Array; + +const + {* values for the flags, the stuff on the command line is different *} + SWS_FAST_BILINEAR = 1; + SWS_BILINEAR = 2; + SWS_BICUBIC = 4; + SWS_X = 8; + SWS_POINT = $10; + SWS_AREA = $20; + SWS_BICUBLIN = $40; + SWS_GAUSS = $80; + SWS_SINC = $100; + SWS_LANCZOS = $200; + SWS_SPLINE = $400; + + SWS_SRC_V_CHR_DROP_MASK = $30000; + SWS_SRC_V_CHR_DROP_SHIFT = 16; + + SWS_PARAM_DEFAULT = 123456; + + SWS_PRINT_INFO = $1000; + + //the following 3 flags are not completely implemented + //internal chrominace subsampling info + SWS_FULL_CHR_H_INT = $2000; + //input subsampling info + SWS_FULL_CHR_H_INP = $4000; + SWS_DIRECT_BGR = $8000; + SWS_ACCURATE_RND = $40000; + + SWS_CPU_CAPS_MMX = $80000000; + SWS_CPU_CAPS_MMX2 = $20000000; + SWS_CPU_CAPS_3DNOW = $40000000; + SWS_CPU_CAPS_ALTIVEC = $10000000; + SWS_CPU_CAPS_BFIN = $01000000; + + SWS_MAX_REDUCE_CUTOFF = 0.002; + + SWS_CS_ITU709 = 1; + SWS_CS_FCC = 4; + SWS_CS_ITU601 = 5; + SWS_CS_ITU624 = 5; + SWS_CS_SMPTE170M = 5; + SWS_CS_SMPTE240M = 7; + SWS_CS_DEFAULT = 5; + + +type + + // when used for filters they must have an odd number of elements + // coeffs cannot be shared between vectors + PSwsVector = ^TSwsVector; + TSwsVector = record + coeff: PCdouble; + length: cint; + end; + + // vectors can be shared + PSwsFilter = ^TSwsFilter; + TSwsFilter = record + lumH: PSwsVector; + lumV: PSwsVector; + chrH: PSwsVector; + chrV: PSwsVector; + end; + + PSwsContext = ^TSwsContext; + TSwsContext = record + {internal structure} + end; + + +procedure sws_freeContext(swsContext: PSwsContext); + cdecl; external sw__scale; + +function sws_getContext(srcW: cint; srcH: cint; srcFormat: cint; dstW: cint; dstH: cint; dstFormat: cint; flags: cint; + srcFilter: PSwsFilter; dstFilter: PSwsFilter; param: PCdouble): PSwsContext; + cdecl; external sw__scale; +function sws_scale(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; + dst: PPCuint8Array; dstStride: PCintArray): cint; + cdecl; external sw__scale; +function sws_scale_ordered(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; + srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; + cdecl; external sw__scale; deprecated; + +function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; srcRange: cint; table: PQuadCintArray; dstRange: cint; + brightness: cint; contrast: cint; saturation: cint): cint; + cdecl; external sw__scale; +function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; + var brightness: cint; var contrast: cint; var saturation: cint): cint; + cdecl; external sw__scale; +function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; + cdecl; external sw__scale; +function sws_getConstVec(c: cdouble; length: cint): PSwsVector; + cdecl; external sw__scale; +function sws_getIdentityVec: PSwsVector; + cdecl; external sw__scale; +procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); + cdecl; external sw__scale; +procedure sws_normalizeVec(a: PSwsVector; height: cdouble); + cdecl; external sw__scale; +procedure sws_convVec(a: PSwsVector; b: PSwsVector); + cdecl; external sw__scale; +procedure sws_addVec(a: PSwsVector; b: PSwsVector); + cdecl; external sw__scale; +procedure sws_subVec(a: PSwsVector; b: PSwsVector); + cdecl; external sw__scale; +procedure sws_shiftVec(a: PSwsVector; shift: cint); + cdecl; external sw__scale; +function sws_cloneVec(a: PSwsVector): PSwsVector; + cdecl; external sw__scale; + +procedure sws_printVec(a: PSwsVector); + cdecl; external sw__scale; +procedure sws_freeVec(a: PSwsVector); + cdecl; external sw__scale; + +function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; lumaSarpen: cfloat; chromaSharpen: cfloat; chromaHShift: cfloat; + chromaVShift: cfloat; verbose: cint): PSwsFilter; + cdecl; external sw__scale; +procedure sws_freeFilter(filter: PSwsFilter); + cdecl; external sw__scale; + +function sws_getCachedContext(context: PSwsContext; + srcW: cint; srcH: cint; srcFormat: cint; + dstW: cint; dstH: cint; dstFormat: cint; flags: cint; + srcFilter: PSwsFilter; dstFilter: PSwsFilter; param: PCdouble): PSwsContext; + cdecl; external sw__scale; + +implementation + +end. -- cgit v1.2.3 From 08a0ddf3d8f9eb819e03d9cd6c8d79bd8634fec6 Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 1 Oct 2008 12:28:15 +0000 Subject: - FFmpeg header update - update to newest revision - if linked libs are too new, USDX will not compile anymore and display an error message (to avoid mysterious crashes if an unsupported version of FFmpeg is used) - comment change in UVisualizer.pas git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1428 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index cac14d57..fb57296f 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -23,7 +23,7 @@ (* * Conversion of libswscale/swscale.h - * revision 26183, Thu Mar 6 11:32:25 2008 UTC + * revision 27592, Fri Sep 12 21:46:53 2008 UTC *) unit swscale; @@ -50,7 +50,7 @@ uses const (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 0; - LIBSWSCALE_MAX_VERSION_MINOR = 5; + LIBSWSCALE_MAX_VERSION_MINOR = 6; LIBSWSCALE_MAX_VERSION_RELEASE = 1; LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -58,7 +58,7 @@ const (* Check if linked versions are supported *) {$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Warn 'Linked version of libswscale may be unsupported!'} + {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} {$IFEND} type @@ -69,6 +69,14 @@ type TPCuint8Array = array[0..0] of PCuint8; PPCuint8Array = ^TPCuint8Array; +{$IF LIBSWSCALE_VERSION >= 000006001} // 0.6.1 +(** + * Returns the LIBSWSCALE_VERSION_INT constant. + *) +function swscale_version(): cuint; + cdecl; external sw__scale; +{$IFEND} + const {* values for the flags, the stuff on the command line is different *} SWS_FAST_BILINEAR = 1; @@ -97,6 +105,7 @@ const SWS_FULL_CHR_H_INP = $4000; SWS_DIRECT_BGR = $8000; SWS_ACCURATE_RND = $40000; + SWS_BITEXACT = $80000; SWS_CPU_CAPS_MMX = $80000000; SWS_CPU_CAPS_MMX2 = $20000000; -- cgit v1.2.3 From da91f86e54d9f87dd28a7558b5a6e930362c3803 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 31 Oct 2008 15:45:18 +0000 Subject: - swscale get_context parameter from cint -> TAVPixelFormat - some refactoring missed last time git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1489 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index fb57296f..965659d9 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -152,7 +152,8 @@ type procedure sws_freeContext(swsContext: PSwsContext); cdecl; external sw__scale; -function sws_getContext(srcW: cint; srcH: cint; srcFormat: cint; dstW: cint; dstH: cint; dstFormat: cint; flags: cint; +function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; + dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; flags: cint; srcFilter: PSwsFilter; dstFilter: PSwsFilter; param: PCdouble): PSwsContext; cdecl; external sw__scale; function sws_scale(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; -- cgit v1.2.3 From d5c37124567bb67fcef16348dc7ad67c4aff9e59 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 10 Jun 2009 11:04:33 +0000 Subject: part 1 of ffmpeg update. several are still missing git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1807 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 121 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 106 insertions(+), 15 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 965659d9..12f66b47 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -50,7 +50,7 @@ uses const (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 0; - LIBSWSCALE_MAX_VERSION_MINOR = 6; + LIBSWSCALE_MAX_VERSION_MINOR = 7; LIBSWSCALE_MAX_VERSION_RELEASE = 1; LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -130,8 +130,8 @@ type // coeffs cannot be shared between vectors PSwsVector = ^TSwsVector; TSwsVector = record - coeff: PCdouble; - length: cint; + coeff: PCdouble; // pointer to the list of coefficients + length: cint; // number of coefficients in the vector end; // vectors can be shared @@ -149,34 +149,95 @@ type end; +{ + Scales the image slice in \p srcSlice and puts the resulting scaled + slice in the image in \p dst. A slice is a sequence of consecutive + rows in an image. + + @param context the scaling context previously created with + sws_getContext() + @param srcSlice the array containing the pointers to the planes of + the source slice + @param srcStride the array containing the strides for each plane of + the source image + @param srcSliceY the position in the source image of the slice to + process, that is the number (counted starting from + zero) in the image of the first row of the slice + @param srcSliceH the height of the source slice, that is the number + of rows in the slice + @param dst the array containing the pointers to the planes of + the destination image + @param dstStride the array containing the strides for each plane of + the destination image + @return the height of the output slice +} procedure sws_freeContext(swsContext: PSwsContext); cdecl; external sw__scale; +{ +Allocates and returns a SwsContext. You need it to perform +scaling/conversion operations using sws_scale(). + +param srcW the width of the source image +param srcH the height of the source image +param srcFormat the source image format +param dstW the width of the destination image +param dstH the height of the destination image +param dstFormat the destination image format +param flags specify which algorithm and options to use for rescaling +return a pointer to an allocated context, or NULL in case of error +} function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; flags: cint; - srcFilter: PSwsFilter; dstFilter: PSwsFilter; param: PCdouble): PSwsContext; + dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; + flags: cint; srcFilter: PSwsFilter; + dstFilter: PSwsFilter; param: PCdouble): PSwsContext; cdecl; external sw__scale; -function sws_scale(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - dst: PPCuint8Array; dstStride: PCintArray): cint; +function sws_scale(context: PSwsContext; srcSlice: PPCuint8Array; srcStride: PCintArray; + srcSliceY: cint; srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; cdecl; external sw__scale; -function sws_scale_ordered(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; - srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; + +{$IF LIBSWSCALE_VERSION_MAJOR < 1} +// deprecated. Use sws_scale() instead. +function sws_scale_ordered(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; + srcSliceY: cint; srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; cdecl; external sw__scale; deprecated; +{$IFEND} -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; srcRange: cint; table: PQuadCintArray; dstRange: cint; +// param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] +// param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 +// return -1 if not supported +function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; + srcRange: cint; table: PQuadCintArray; dstRange: cint; brightness: cint; contrast: cint; saturation: cint): cint; cdecl; external sw__scale; -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; + +// return -1 if not supported +function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; + var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; var brightness: cint; var contrast: cint; var saturation: cint): cint; cdecl; external sw__scale; + +// Returns a normalized Gaussian curve used to filter stuff +// quality=3 is high quality, lower is lower quality. function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; cdecl; external sw__scale; + +// Allocates and returns a vector with \p length coefficients, all +// with the same value \p c. function sws_getConstVec(c: cdouble; length: cint): PSwsVector; cdecl; external sw__scale; + +// Allocates and returns a vector with just one coefficient, with +// value 1.0. function sws_getIdentityVec: PSwsVector; cdecl; external sw__scale; + +// Scales all the coefficients of \p a by the \p scalar value. procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); cdecl; external sw__scale; + +// Scales all the coefficients of \p a so that their sum equals \p +// height." procedure sws_normalizeVec(a: PSwsVector; height: cdouble); cdecl; external sw__scale; procedure sws_convVec(a: PSwsVector; b: PSwsVector); @@ -187,24 +248,54 @@ procedure sws_subVec(a: PSwsVector; b: PSwsVector); cdecl; external sw__scale; procedure sws_shiftVec(a: PSwsVector; shift: cint); cdecl; external sw__scale; + +// Allocates and returns a clone of the vector \p a, that is a vector +// with the same coefficients as \p a. function sws_cloneVec(a: PSwsVector): PSwsVector; cdecl; external sw__scale; +{$IF LIBSWSCALE_VERSION_MAJOR < 1} +// deprecated Use sws_printVec2() instead. + procedure sws_printVec(a: PSwsVector); + cdecl; external sw__scale; deprecated; +{$IFEND} + +{$IF LIBSWSCALE_VERSION_MINOR >= 7} +// Prints with av_log() a textual representation of the vector \p a +// if \p log_level <= av_log_level. +procedure sws_printVec2(a: PSwsVector, + log_ctx: PAVClass, log_level: cint); // Hint: PAVClass needs to be done in avutil as in log.h cdecl; external sw__scale; +{$IFEND} + procedure sws_freeVec(a: PSwsVector); cdecl; external sw__scale; -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; lumaSarpen: cfloat; chromaSharpen: cfloat; chromaHShift: cfloat; +function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; lumaSharpen: cfloat; chromaSharpen: cfloat; chromaHShift: cfloat; chromaVShift: cfloat; verbose: cint): PSwsFilter; cdecl; external sw__scale; procedure sws_freeFilter(filter: PSwsFilter); cdecl; external sw__scale; +{ +Checks if \p context can be reused, otherwise reallocates a new +one. + +If \p context is NULL, just calls sws_getContext() to get a new +context. Otherwise, checks if the parameters are the ones already +saved in \p context. If that is the case, returns the current +context. Otherwise, frees \p context and gets a new context with +the new parameters. + +Be warned that \p srcFilter and \p dstFilter are not checked, they +are assumed to remain the same. +} function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: cint; - dstW: cint; dstH: cint; dstFormat: cint; flags: cint; - srcFilter: PSwsFilter; dstFilter: PSwsFilter; param: PCdouble): PSwsContext; + srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; + dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; + flags: cint; srcFilter: PSwsFilter; + dstFilter: PSwsFilter; param: PCdouble): PSwsContext; cdecl; external sw__scale; implementation -- cgit v1.2.3 From 4a225ba239b550b01cbf848ab3a2a86c5c44afc1 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 13 Jun 2009 11:19:09 +0000 Subject: fix of typos git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1820 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 12f66b47..402c0bc4 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -249,8 +249,8 @@ procedure sws_subVec(a: PSwsVector; b: PSwsVector); procedure sws_shiftVec(a: PSwsVector; shift: cint); cdecl; external sw__scale; -// Allocates and returns a clone of the vector \p a, that is a vector -// with the same coefficients as \p a. +// Allocates and returns a clone of the vector a, that is a vector +// with the same coefficients as a. function sws_cloneVec(a: PSwsVector): PSwsVector; cdecl; external sw__scale; @@ -262,10 +262,11 @@ procedure sws_printVec(a: PSwsVector); {$IFEND} {$IF LIBSWSCALE_VERSION_MINOR >= 7} -// Prints with av_log() a textual representation of the vector \p a -// if \p log_level <= av_log_level. -procedure sws_printVec2(a: PSwsVector, - log_ctx: PAVClass, log_level: cint); // Hint: PAVClass needs to be done in avutil as in log.h +// Prints with av_log() a textual representation of the vector a +// if log_level <= av_log_level. +procedure sws_printVec2(a: PSwsVector; + log_ctx: PAVClass; + log_level: cint); // Hint: PAVClass needs to be done in avutil as in log.h cdecl; external sw__scale; {$IFEND} @@ -279,16 +280,16 @@ procedure sws_freeFilter(filter: PSwsFilter); cdecl; external sw__scale; { -Checks if \p context can be reused, otherwise reallocates a new +Checks if context can be reused, otherwise reallocates a new one. -If \p context is NULL, just calls sws_getContext() to get a new +If context is NULL, just calls sws_getContext() to get a new context. Otherwise, checks if the parameters are the ones already -saved in \p context. If that is the case, returns the current -context. Otherwise, frees \p context and gets a new context with +saved in context. If that is the case, returns the current +context. Otherwise, frees context and gets a new context with the new parameters. -Be warned that \p srcFilter and \p dstFilter are not checked, they +Be warned that srcFilter and dstFilter are not checked, they are assumed to remain the same. } function sws_getCachedContext(context: PSwsContext; -- cgit v1.2.3 From 85019271681bb95450c38bb5c019b4b5afe4d10d Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 13 Jun 2009 11:26:23 +0000 Subject: include avcodec git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1821 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 402c0bc4..309a7340 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -45,6 +45,7 @@ interface uses ctypes, avutil, + avcodec, UConfig; const -- cgit v1.2.3 From 0de87e4c87f30f39f444d95eac4d47009f966e1b Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 19 Jun 2009 08:11:20 +0000 Subject: cosmetics in the comments. using GTK-Doc style as is swscale.h git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1825 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 179 +++++++++++++++++++++++++-------------------- 1 file changed, 101 insertions(+), 78 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 309a7340..0d35667c 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -79,7 +79,7 @@ function swscale_version(): cuint; {$IFEND} const - {* values for the flags, the stuff on the command line is different *} + (* values for the flags, the stuff on the command line is different *) SWS_FAST_BILINEAR = 1; SWS_BILINEAR = 2; SWS_BICUBIC = 4; @@ -99,10 +99,10 @@ const SWS_PRINT_INFO = $1000; - //the following 3 flags are not completely implemented - //internal chrominace subsampling info + // the following 3 flags are not completely implemented + // internal chrominace subsampling info SWS_FULL_CHR_H_INT = $2000; - //input subsampling info + // input subsampling info SWS_FULL_CHR_H_INP = $4000; SWS_DIRECT_BGR = $8000; SWS_ACCURATE_RND = $40000; @@ -124,7 +124,6 @@ const SWS_CS_SMPTE240M = 7; SWS_CS_DEFAULT = 5; - type // when used for filters they must have an odd number of elements @@ -149,50 +148,50 @@ type {internal structure} end; - -{ - Scales the image slice in \p srcSlice and puts the resulting scaled - slice in the image in \p dst. A slice is a sequence of consecutive - rows in an image. - - @param context the scaling context previously created with - sws_getContext() - @param srcSlice the array containing the pointers to the planes of - the source slice - @param srcStride the array containing the strides for each plane of - the source image - @param srcSliceY the position in the source image of the slice to - process, that is the number (counted starting from - zero) in the image of the first row of the slice - @param srcSliceH the height of the source slice, that is the number - of rows in the slice - @param dst the array containing the pointers to the planes of - the destination image - @param dstStride the array containing the strides for each plane of - the destination image - @return the height of the output slice -} procedure sws_freeContext(swsContext: PSwsContext); cdecl; external sw__scale; -{ -Allocates and returns a SwsContext. You need it to perform -scaling/conversion operations using sws_scale(). - -param srcW the width of the source image -param srcH the height of the source image -param srcFormat the source image format -param dstW the width of the destination image -param dstH the height of the destination image -param dstFormat the destination image format -param flags specify which algorithm and options to use for rescaling -return a pointer to an allocated context, or NULL in case of error -} +(** + * Allocates and returns a SwsContext. You need it to perform + * scaling/conversion operations using sws_scale(). + * + * @param srcW the width of the source image + * @param srcH the height of the source image + * @param srcFormat the source image format + * @param dstW the width of the destination image + * @param dstH the height of the destination image + * @param dstFormat the destination image format + * @param flags specify which algorithm and options to use for rescaling + * @return a pointer to an allocated context, or NULL in case of error + *) function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; + dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; + flags: cint; srcFilter: PSwsFilter; + dstFilter: PSwsFilter; param: PCdouble): PSwsContext; cdecl; external sw__scale; + +(** + * Scales the image slice in srcSlice and puts the resulting scaled + * slice in the image in dst. A slice is a sequence of consecutive + * rows in an image. + * + * @param context the scaling context previously created with + * sws_getContext() + * @param srcSlice the array containing the pointers to the planes of + * the source slice + * @param srcStride the array containing the strides for each plane of + * the source image + * @param srcSliceY the position in the source image of the slice to + * process, that is the number (counted starting from + * zero) in the image of the first row of the slice + * @param srcSliceH the height of the source slice, that is the number + * of rows in the slice + * @param dst the array containing the pointers to the planes of + * the destination image + * @param dstStride the array containing the strides for each plane of + * the destination image + * @return the height of the output slice + *) function sws_scale(context: PSwsContext; srcSlice: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; cdecl; external sw__scale; @@ -204,54 +203,73 @@ function sws_scale_ordered(context: PSwsContext; src: PPCuint8Array; srcStride: cdecl; external sw__scale; deprecated; {$IFEND} -// param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] -// param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 -// return -1 if not supported +(** + * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] + * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 + * @return -1 if not supported + *) function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; srcRange: cint; table: PQuadCintArray; dstRange: cint; brightness: cint; contrast: cint; saturation: cint): cint; cdecl; external sw__scale; -// return -1 if not supported +(** + * @return -1 if not supported + *) function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; var brightness: cint; var contrast: cint; var saturation: cint): cint; cdecl; external sw__scale; -// Returns a normalized Gaussian curve used to filter stuff -// quality=3 is high quality, lower is lower quality. +(** + * Returns a normalized Gaussian curve used to filter stuff + * quality=3 is high quality, lower is lower quality. + *) function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; cdecl; external sw__scale; -// Allocates and returns a vector with \p length coefficients, all -// with the same value \p c. +(** + * Allocates and returns a vector with length coefficients, all + * with the same value c. + *) function sws_getConstVec(c: cdouble; length: cint): PSwsVector; cdecl; external sw__scale; -// Allocates and returns a vector with just one coefficient, with -// value 1.0. +(** + * Allocates and returns a vector with just one coefficient, with + * value 1.0. + *) function sws_getIdentityVec: PSwsVector; cdecl; external sw__scale; -// Scales all the coefficients of \p a by the \p scalar value. +(** + * Scales all the coefficients of a by the scalar value. + *) procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); cdecl; external sw__scale; -// Scales all the coefficients of \p a so that their sum equals \p -// height." +(** + * Scales all the coefficients of a so that their sum equals height. + *) procedure sws_normalizeVec(a: PSwsVector; height: cdouble); cdecl; external sw__scale; + procedure sws_convVec(a: PSwsVector; b: PSwsVector); cdecl; external sw__scale; + procedure sws_addVec(a: PSwsVector; b: PSwsVector); cdecl; external sw__scale; + procedure sws_subVec(a: PSwsVector; b: PSwsVector); cdecl; external sw__scale; + procedure sws_shiftVec(a: PSwsVector; shift: cint); cdecl; external sw__scale; -// Allocates and returns a clone of the vector a, that is a vector -// with the same coefficients as a. +(** + * Allocates and returns a clone of the vector a, that is a vector + * with the same coefficients as a. + *) function sws_cloneVec(a: PSwsVector): PSwsVector; cdecl; external sw__scale; @@ -263,36 +281,41 @@ procedure sws_printVec(a: PSwsVector); {$IFEND} {$IF LIBSWSCALE_VERSION_MINOR >= 7} -// Prints with av_log() a textual representation of the vector a -// if log_level <= av_log_level. +(** + * Prints with av_log() a textual representation of the vector a + * if log_level <= av_log_level. + *) procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; - log_level: cint); // Hint: PAVClass needs to be done in avutil as in log.h + log_ctx: PAVClass; // PAVClass is declared in avcodec.pas + log_level: cint); cdecl; external sw__scale; {$IFEND} procedure sws_freeVec(a: PSwsVector); cdecl; external sw__scale; -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; lumaSharpen: cfloat; chromaSharpen: cfloat; chromaHShift: cfloat; - chromaVShift: cfloat; verbose: cint): PSwsFilter; +function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; + lumaSharpen: cfloat; chromaSharpen: cfloat; + chromaHShift: cfloat; chromaVShift: cfloat; + verbose: cint): PSwsFilter; cdecl; external sw__scale; + procedure sws_freeFilter(filter: PSwsFilter); cdecl; external sw__scale; -{ -Checks if context can be reused, otherwise reallocates a new -one. - -If context is NULL, just calls sws_getContext() to get a new -context. Otherwise, checks if the parameters are the ones already -saved in context. If that is the case, returns the current -context. Otherwise, frees context and gets a new context with -the new parameters. - -Be warned that srcFilter and dstFilter are not checked, they -are assumed to remain the same. -} +(** + * Checks if context can be reused, otherwise reallocates a new + * one. + * + * If context is NULL, just calls sws_getContext() to get a new + * context. Otherwise, checks if the parameters are the ones already + * saved in context. If that is the case, returns the current + * context. Otherwise, frees context and gets a new context with + * the new parameters. + * + * Be warned that srcFilter and dstFilter are not checked, they + * are assumed to remain the same. + *) function sws_getCachedContext(context: PSwsContext; srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; -- cgit v1.2.3 From 4ac94939ca996ccc201d2f0e7a1a3e7bc7e7d77e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 19 Jun 2009 12:10:59 +0000 Subject: prevent future crash with version numbers git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1826 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 0d35667c..c0aabf45 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -280,7 +280,7 @@ procedure sws_printVec(a: PSwsVector); cdecl; external sw__scale; deprecated; {$IFEND} -{$IF LIBSWSCALE_VERSION_MINOR >= 7} +{$IF LIBSWSCALE_VERSION >= 000007000} // >= 0.7.0 (** * Prints with av_log() a textual representation of the vector a * if log_level <= av_log_level. -- cgit v1.2.3 From 839b3eaf9e64425f5400d7dda220507fdb75f939 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 21:26:48 +0000 Subject: update to version 0.7.2. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1998 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index c0aabf45..595e16ba 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -25,6 +25,11 @@ * Conversion of libswscale/swscale.h * revision 27592, Fri Sep 12 21:46:53 2008 UTC *) +{ + * update to + * Max. version: 0.7.2, Sun Dec 6 22:20:00 2009 CET + * MiSchi +} unit swscale; @@ -52,7 +57,7 @@ const (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 0; LIBSWSCALE_MAX_VERSION_MINOR = 7; - LIBSWSCALE_MAX_VERSION_RELEASE = 1; + LIBSWSCALE_MAX_VERSION_RELEASE = 2; LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -78,6 +83,20 @@ function swscale_version(): cuint; cdecl; external sw__scale; {$IFEND} +{$IF LIBSWSCALE_VERSION >= 000007002} // 0.7.2 +(** + * Returns the libswscale build-time configuration. + *) +function swscale_configuration(): PAnsiChar; + cdecl; external sw__scale; + +(** + * Returns the libswscale license. + *) +function swscale_license(): PAnsiChar; + cdecl; external sw__scale; +{$IFEND} + const (* values for the flags, the stuff on the command line is different *) SWS_FAST_BILINEAR = 1; @@ -148,6 +167,10 @@ type {internal structure} end; +(** + * Frees the swscaler context swsContext. + * If swsContext is NULL, then does nothing. + *) procedure sws_freeContext(swsContext: PSwsContext); cdecl; external sw__scale; @@ -175,6 +198,10 @@ function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; * slice in the image in dst. A slice is a sequence of consecutive * rows in an image. * + * Slices have to be provided in sequential order, either in + * top-bottom or bottom-top order. If slices are provided in + * non-sequential order the behavior of the function is undefined. + * * @param context the scaling context previously created with * sws_getContext() * @param srcSlice the array containing the pointers to the planes of -- cgit v1.2.3 From d35aae71ead05b26b5e00b25de4f6ed11f11ad13 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 4 Jan 2010 23:51:10 +0000 Subject: correction of some misplaced fields + some editorial changes + update to current git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2067 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 595e16ba..99a59a97 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -27,7 +27,7 @@ *) { * update to - * Max. version: 0.7.2, Sun Dec 6 22:20:00 2009 CET + * Max. version: 0.7.2, Mon Jan 4 2010 22:20:00 CET * MiSchi } -- cgit v1.2.3 From 09d95e9d79386349762995ba5d7532a8b2be926b Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 20 Feb 2010 22:33:20 +0000 Subject: update to swscale 8.0.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2116 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 99a59a97..1fbb8ec5 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -27,7 +27,7 @@ *) { * update to - * Max. version: 0.7.2, Mon Jan 4 2010 22:20:00 CET + * Max. version: 0.8.0, Sat Feb 20 2010 23:25:00 CET * MiSchi } @@ -56,8 +56,8 @@ uses const (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 0; - LIBSWSCALE_MAX_VERSION_MINOR = 7; - LIBSWSCALE_MAX_VERSION_RELEASE = 2; + LIBSWSCALE_MAX_VERSION_MINOR = 8; + LIBSWSCALE_MAX_VERSION_RELEASE = 0; LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -167,6 +167,20 @@ type {internal structure} end; +{$IF LIBSWSCALE_VERSION >= 000008000} // 0.8.0 +(** + * Returns a positive value if pix_fmt is a supported input format, 0 + * otherwise. + *) + function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; + +(** + * Returns a positive value if pix_fmt is a supported output format, 0 + * otherwise. + *) + function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; +{$IFEND} + (** * Frees the swscaler context swsContext. * If swsContext is NULL, then does nothing. @@ -219,14 +233,15 @@ function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; * the destination image * @return the height of the output slice *) -function sws_scale(context: PSwsContext; srcSlice: PPCuint8Array; srcStride: PCintArray; +function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; cdecl; external sw__scale; {$IF LIBSWSCALE_VERSION_MAJOR < 1} // deprecated. Use sws_scale() instead. -function sws_scale_ordered(context: PSwsContext; src: PPCuint8Array; srcStride: PCintArray; - srcSliceY: cint; srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; +function sws_scale_ordered(context: PSwsContext; {const} src: PPCuint8Array; + srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; + dst: PPCuint8Array; dstStride: PCintArray): cint; cdecl; external sw__scale; deprecated; {$IFEND} -- cgit v1.2.3 From 84ce09f33dac2cb9e42fe58dae9e9ed686dcb00d Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 20 Feb 2010 22:37:20 +0000 Subject: update of swscale to 0.9.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2117 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 1fbb8ec5..2afe19db 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -27,7 +27,7 @@ *) { * update to - * Max. version: 0.8.0, Sat Feb 20 2010 23:25:00 CET + * Max. version: 0.10.0, Sat Feb 20 2010 23:25:00 CET * MiSchi } @@ -55,9 +55,9 @@ uses const (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 0; - LIBSWSCALE_MAX_VERSION_MINOR = 8; - LIBSWSCALE_MAX_VERSION_RELEASE = 0; + LIBSWSCALE_MAX_VERSION_MAJOR = 0; + LIBSWSCALE_MAX_VERSION_MINOR = 10; + LIBSWSCALE_MAX_VERSION_RELEASE = 0; LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -233,8 +233,8 @@ function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; * the destination image * @return the height of the output slice *) -function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; srcStride: PCintArray; - srcSliceY: cint; srcSliceH: cint; dst: PPCuint8Array; dstStride: PCintArray): cint; +function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; {const} srcStride: PCintArray; + srcSliceY: cint; srcSliceH: cint; {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; cdecl; external sw__scale; {$IF LIBSWSCALE_VERSION_MAJOR < 1} -- cgit v1.2.3 From 6b6c598b466c8436ef120bd8ef0e3bc296d976cf Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 20 Feb 2010 22:44:15 +0000 Subject: update of swscale to 0.10.0 and fix of missing declaration in previous commit git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2118 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 2afe19db..ccefacd8 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -143,6 +143,18 @@ const SWS_CS_SMPTE240M = 7; SWS_CS_DEFAULT = 5; +{$IF LIBSWSCALE_VERSION >= 000010000} // 0.10.0 +(** + * Returns a pointer to yuv<->rgb coefficients for the given colorspace + * suitable for sws_setColorspaceDetails(). + * + * @param colorspace One of the SWS_CS_* macros. If invalid, + * SWS_CS_DEFAULT is used. + *) + function sws_getCoefficients(colorspace: cint): Pcint; + cdecl; external sw__scale; +{$IFEND} + type // when used for filters they must have an odd number of elements @@ -172,13 +184,15 @@ type * Returns a positive value if pix_fmt is a supported input format, 0 * otherwise. *) - function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; + function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; + cdecl; external sw__scale; (** * Returns a positive value if pix_fmt is a supported output format, 0 * otherwise. *) - function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; + function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; + cdecl; external sw__scale; {$IFEND} (** -- cgit v1.2.3 From a6db8d3dae4c64681031c22d567f6d16322da2a1 Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 26 Apr 2010 08:32:45 +0000 Subject: added a warning that adjusting the max supported FFmpeg manually is not a valid fix and as a consequence random crashes or bugs may occur. The USDX team does not give any support for USDX with manually adjusted FFmpeg headers. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2311 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index ccefacd8..705932b1 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -54,6 +54,31 @@ uses UConfig; const + (* + * IMPORTANT: The official FFmpeg C headers change very quickly. Often some + * of the data structures are changed so that they become incompatible with + * older header files. The Pascal headers have to be adjusted to those changes, + * otherwise the application might crash randomly or strange bugs (not + * necessarily related to video or audio due to buffer overflows etc.) might + * occur. + * + * In the past users reported problems with USDX that took hours to fix and + * the problem was an unsupported version of FFmpeg. So we decided to disable + * support for future versions of FFmpeg until the headers are revised by us + * for that version as they otherwise most probably will break USDX. + * + * If the headers do not yet support your FFmpeg version you may want to + * adjust the max. version numbers manually but please note: it may work but + * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT + * for the game if the MAX. VERSION WAS CHANGED. + * + * The only safe way to support new versions of FFmpeg is to add the changes + * of the FFmpeg git repository C headers to the Pascal headers. + * You can accelerate this process by posting a patch with the git changes + * translated to Pascal to our bug tracker (please join our IRC chat before + * you start working on it). Simply adjusting the max. versions is NOT a valid + * fix. + *) (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 0; LIBSWSCALE_MAX_VERSION_MINOR = 10; -- cgit v1.2.3 From c7344d6932e74a261d800fc2f4bc8c3809e3854e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 11 May 2010 17:41:31 +0000 Subject: update swscale to revision 31050 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2355 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 705932b1..4f923f04 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -23,13 +23,8 @@ (* * Conversion of libswscale/swscale.h - * revision 27592, Fri Sep 12 21:46:53 2008 UTC + * Max. version: 0.10.0, revision 31050, Tue May 11 19:40:00 2010 CET *) -{ - * update to - * Max. version: 0.10.0, Sat Feb 20 2010 23:25:00 CET - * MiSchi -} unit swscale; -- cgit v1.2.3 From 259b070daa1ea802c3d310082612d5db037f8881 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 30 May 2010 18:39:54 +0000 Subject: update to recent. some cosmetics. no code change git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2427 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 4f923f04..f7c11d0d 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -14,16 +14,12 @@ * 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 - *) - -(* + * * FFmpeg Pascal port * - Ported by the UltraStar Deluxe Team - *) - -(* + * * Conversion of libswscale/swscale.h - * Max. version: 0.10.0, revision 31050, Tue May 11 19:40:00 2010 CET + * Max. version: 0.10.0, revision 31279, Tue May 30 20:25:00 2010 CET *) unit swscale; -- cgit v1.2.3 From 9eb9ae73e04ef356c111f917b6ede5ea7171f7e2 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 12 Jul 2010 05:53:29 +0000 Subject: update to swscale 0.11.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2578 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index f7c11d0d..3f4954e7 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -19,7 +19,7 @@ * - Ported by the UltraStar Deluxe Team * * Conversion of libswscale/swscale.h - * Max. version: 0.10.0, revision 31279, Tue May 30 20:25:00 2010 CET + * Max. version: 0.11.0, revision 31301, Mon Jil 12 8:00:00 2010 CET *) unit swscale; @@ -72,7 +72,7 @@ const *) (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 0; - LIBSWSCALE_MAX_VERSION_MINOR = 10; + LIBSWSCALE_MAX_VERSION_MINOR = 11; LIBSWSCALE_MAX_VERSION_RELEASE = 0; LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -395,6 +395,40 @@ function sws_getCachedContext(context: PSwsContext; dstFilter: PSwsFilter; param: PCdouble): PSwsContext; cdecl; external sw__scale; +{$IF LIBSWSCALE_VERSION >= 000011000} // >= 0.11.0 +(** + * Converts an 8bit paletted frame into a frame with a color depth of 32-bits. + * + * The output frame will have the same packed format as the palette. + * + * @param src source frame buffer + * @param dst destination frame buffer + * @param num_pixels number of pixels to convert + * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src + *) +procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; + dst: PPCuint8Array; + num_pixels: clong; + {const} palette: PPCuint8Array); + cdecl; external sw__scale; + +(** + * Converts an 8bit paletted frame into a frame with a color depth of 24 bits. + * + * With the palette format "ABCD", the destination frame ends up with the format "ABC". + * + * @param src source frame buffer + * @param dst destination frame buffer + * @param num_pixels number of pixels to convert + * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src + *) +procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; + dst: PPCuint8Array; + num_pixels: clong; + {const} palette: PPCuint8Array); + cdecl; external sw__scale; +{$IFEND} + implementation end. -- cgit v1.2.3 From c857d070ddb5db30825afa760bcfe10a5eb9e5b0 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 23:51:13 +0000 Subject: minor edits git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2604 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/swscale.pas | 70 +++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'src/lib/ffmpeg/swscale.pas') diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas index 3f4954e7..7289e902 100644 --- a/src/lib/ffmpeg/swscale.pas +++ b/src/lib/ffmpeg/swscale.pas @@ -19,7 +19,7 @@ * - Ported by the UltraStar Deluxe Team * * Conversion of libswscale/swscale.h - * Max. version: 0.11.0, revision 31301, Mon Jil 12 8:00:00 2010 CET + * Max. version: 0.11.0, revision 31301, Mon Jul 12 8:00:00 2010 CET *) unit swscale; @@ -45,31 +45,31 @@ uses UConfig; const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) +(* + * IMPORTANT: The official FFmpeg C headers change very quickly. Often some + * of the data structures are changed so that they become incompatible with + * older header files. The Pascal headers have to be adjusted to those changes, + * otherwise the application might crash randomly or strange bugs (not + * necessarily related to video or audio due to buffer overflows etc.) might + * occur. + * + * In the past users reported problems with USDX that took hours to fix and + * the problem was an unsupported version of FFmpeg. So we decided to disable + * support for future versions of FFmpeg until the headers are revised by us + * for that version as they otherwise most probably will break USDX. + * + * If the headers do not yet support your FFmpeg version you may want to + * adjust the max. version numbers manually but please note: it may work but + * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT + * for the game if the MAX. VERSION WAS CHANGED. + * + * The only safe way to support new versions of FFmpeg is to add the changes + * of the FFmpeg git repository C headers to the Pascal headers. + * You can accelerate this process by posting a patch with the git changes + * translated to Pascal to our bug tracker (please join our IRC chat before + * you start working on it). Simply adjusting the max. versions is NOT a valid + * fix. + *) (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 0; LIBSWSCALE_MAX_VERSION_MINOR = 11; @@ -159,7 +159,7 @@ const SWS_CS_SMPTE240M = 7; SWS_CS_DEFAULT = 5; -{$IF LIBSWSCALE_VERSION >= 000010000} // 0.10.0 +{$IF LIBSWSCALE_VERSION >= 000010000} // 0.10.0 (** * Returns a pointer to yuv<->rgb coefficients for the given colorspace * suitable for sws_setColorspaceDetails(). @@ -167,8 +167,8 @@ const * @param colorspace One of the SWS_CS_* macros. If invalid, * SWS_CS_DEFAULT is used. *) - function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; +function sws_getCoefficients(colorspace: cint): Pcint; + cdecl; external sw__scale; {$IFEND} type @@ -195,20 +195,20 @@ type {internal structure} end; -{$IF LIBSWSCALE_VERSION >= 000008000} // 0.8.0 +{$IF LIBSWSCALE_VERSION >= 000008000} // 0.8.0 (** * Returns a positive value if pix_fmt is a supported input format, 0 * otherwise. *) - function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; +function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; + cdecl; external sw__scale; (** * Returns a positive value if pix_fmt is a supported output format, 0 * otherwise. *) - function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; +function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; + cdecl; external sw__scale; {$IFEND} (** @@ -267,7 +267,7 @@ function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; {const srcSliceY: cint; srcSliceH: cint; {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; cdecl; external sw__scale; -{$IF LIBSWSCALE_VERSION_MAJOR < 1} +{$IF LIBSWSCALE_VERSION_MAJOR < 1} // deprecated. Use sws_scale() instead. function sws_scale_ordered(context: PSwsContext; {const} src: PPCuint8Array; srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; -- cgit v1.2.3