summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_scale.c
Commit message (Collapse)AuthorAgeFilesLines
* libmpcodecs: move vf_scale.c swscale helper functions to sws_utils.cRudolf Polzer2012-10-241-82/+1
| | | | | Extracted/rebased by wm4 from commits 93978f17b76d..13211ef5fc20. Actual mp_image_swscale is added in a later commit.
* vf_scale: do the upscale detection AFTER calculating dimensionsRudolf Polzer2012-09-241-7/+8
| | | | | | Otherwise it heavily violates the manpage's description, and describing what it did before in the documentation is something too complicated to describe in the English language.
* libmpcodecs: add support for 422P9mplayer-svn2012-08-031-0/+2
| | | | | | | For some reason only 9-bit 422 wasn't added before. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34524 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* Change <endian.h> include to <sys/types.h>wm42012-07-311-1/+1
| | | | | This seems to be more portable. Should fix compilation on OSX and FreeBSD. Apparently also works on MinGW-w64.
* vf_scale: don't pass CPU flags anymorewm42012-07-301-14/+3
| | | | | | libav detects them automatically. Also fix a bunch of other VFs, which use the get_sws_cpuflags() function defined by vf_scale.c.
* Rip out 3DNOW supportwm42012-07-301-2/+1
| | | | | | | | Ancient AMD specific enhancement to the MMX instruction set. Officually discontinued by AMD. Note that support for this was already disabled in the previous commit. This commit removes the actual code.
* Remove compile time/runtime CPU detection, and drop some platformswm42012-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer had three ways of enabling CPU specific assembler routines: a) Enable them at compile time; crash if the CPU can't handle it. b) Enable them at compile time, but let the configure script detect your CPU. Your binary will only crash if you try to run it on a different system that has less features than yours. This was the default, I think. c) Runtime detection. The implementation of b) and c) suck. a) is not really feasible (it sucks for users). Remove all code related to this, and use libav's CPU detection instead. Now the configure script will always enable CPU specific features, and disable them at runtime if libav reports them not as available. One implication is that now the compiler is always expected to handle SSE (etc.) inline assembly at runtime, unless it's explicitly disabled. Only checks for x86 CPU specific features are kept, the rest is either unused or barely used. Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler to select decent settings. Get rid of support for the following operating systems: - BSD/OS (some ancient BSD fork) - QNX (don't care) - BeOS (dead, Haiku support is still welcome) - AIX (don't care) - HP-UX (don't care) - OS/2 (dead, actual support has been removed a while ago) Remove the configure code for detecting the endianness. Instead, use the standard header <endian.h>, which can be used if _GNU_SOURCE or _BSD_SOURCE is defined. (Maybe these changes should have been in a separate commit.) Since this is a quite violent code removal orgy, and I'm testing only on x86 32 bit Linux, expect regressions.
* libmpcodecs: rename IMGFMT_GBR24P to IMGFMT_GBRPwm42012-03-251-5/+5
| | | | This is more in line with the ffmpeg/libav names.
* vf_scale: prefer converting GBR24P to other 8 bit per component RGB formatsreimar2012-03-251-0/+4
| | | | | | | | Compared to converting to Y444 this should be faster and lossless. Based on patch by Hans-Kristian Arntzen [maister archlinux us] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34317 b3059339-0415-0410-9bf9-f77b7e298cf2
* libmpcodecs: support planar GBR24 decodingcehoyos2012-03-251-0/+1
| | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34245 b3059339-0415-0410-9bf9-f77b7e298cf2 Note: ffmpeg first introduced PIX_FMT_GBR24P, which was used in this commit. Later, it was renamed to PIX_FMT_GBRP in ffmpeg and libav. This was updated in revision 34492 in mplayer, but the mplayer specific names (such as IMGFMT_GBR24) were left unchanged.
* i lost my brainwm42012-01-261-1/+1
| | | | should be squashed with "screenshot: improve quality by using additional swscale flags"
* screenshot: improve quality by using additional swscale flagswm42012-01-181-1/+12
| | | | | | | | | Adding these flags improves the quality of the YUV->RGB conversion when screenshots are taken. It trades precision for performance. This doesn't affect any other swscale uses, such as vf_scale or vo_x11. Based on a patch by cantabile. Fixes #140.
* vf_dsize, vf_scale: fix behavior on multiple config() callswm42011-12-191-4/+9
| | | | | | When config() is called multiple times (e.g. aspect ratio changes while the same file is playing), the user settings are not honoured, because config() overwrites them. Don't do that.
* cleanup: vf_scale.c, vf.c: replace numbers by flag macro namesUoti Urpala2011-11-141-1/+3
|
* video, options: implement better YUV->RGB conversion controlwm42011-10-161-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite control of the colorspace and input/output level parameters used in YUV-RGB conversions, replacing VO-specific suboptions with new common options and adding configuration support to more cases. Add new option --colormatrix which selects the colorspace the original video is assumed to have in YUV->RGB conversions. The default behavior changes from assuming BT.601 to colorspace autoselection between BT.601 and BT.709 using a simple heuristic based on video size. Add new options --colormatrix-input-range and --colormatrix-output-range which select input YUV and output RGB range. Disable the previously existing VO-specific colorspace and level conversion suboptions in vo_gl and vo_vdpau. Remove the "yuv_colorspace" property and replace it with one named "colormatrix" and semantics matching the new option. Add new properties matching the options for level conversion. Colorspace selection is currently supported by vo_gl, vo_vdpau, vo_xv and vf_scale, and all can change it at runtime (previously only vo_vdpau and vo_xv could). vo_vdpau now uses the same conversion matrix generation as vo_gl instead of libvdpau functionality; the main functional difference is that the "contrast" equalizer control behaves somewhat differently (it scales the Y component around 1/2 instead of around 0, so that contrast 0 makes the image gray rather than black). vo_xv does not support level conversion. vf_scale supports range setting for input, but always outputs full-range RGB. The value of the slave properties is the policy setting used for conversions. This means they can be set to any value regardless of whether the current VO supports that value or whether there currently even is any video. Possibly separate properties could be added to query the conversion actually used at the moment, if any. Because the colorspace and level settings are now set with a single VF/VO control call, the return value of that is no longer used to signal whether all the settings are actually supported. Instead code should set all the details it can support, and ignore the rest. The core will use GET_YUV_COLORSPACE to check which colorspace details have been set and which not. In other words, the return value for SET_YUV_COLORSPACE only signals whether any kind of YUV colorspace conversion handling exists at all, and VOs have to take care to return the actual state with GET_YUV_COLORSPACE instead. To be changed in later commits: add missing option documentation.
* video/colorspaces: add new 9/10-bit formats from libavcodecUoti Urpala2011-06-261-0/+10
| | | | | | | Add new internal 9/10-bit IMGFMT values and mappings to the corresponding libav* PIX_FMT_* values. Partially based on a patch from Arne Bochem <arneb.mp@ccan.de>.
* cleanup: shut up more warningsClément Bœsch2011-05-061-2/+2
|
* cleanup: remove NULL checks before free() all over the codecboesch2010-11-141-5/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
* vf_scale: accept all non-hw-accel formats we know a PIX_FMT forreimar2010-11-081-35/+1
| | | | | | | | | | Make scale filter accept all non-hardware-acceleration input formats we know a PIX_FMT_* for. It is possible we will not have a conversion for some of these formats, but since it will just fail differently this approach is better since it avoids having to expand the explicit list continuously. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32576 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"Uoti Urpala2010-05-291-6/+6
| | | | | | | Change 'struct vf_instance' pointer arguments to more standard style as in the subject. Also some other minor formatting fixes. Patch by Diego Biurrun.
* Merge svn changes up to r31141Uoti Urpala2010-05-071-0/+2
|\
| * Add support for 12-bit color mode on framebuffer devices.cehoyos2010-05-061-0/+2
| | | | | | | | | | | | | | Patch Janusz Krzysztofik, jkrzyszt A tis icnet pl git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31139 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Mark vf_size_preset_fields m_option_t array as const.diego2010-04-041-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31001 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Mark a bunch of video filter structures as const.diego2010-02-221-7/+7
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30704 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Declare externally used variables from vd.c as extern in vd.h.diego2010-02-221-4/+1
| | | | | | | | | | | | | | This saves declaring them as extern all over the place. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30695 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: Rename struct vf_instance_s --> vf_instance.diego2010-02-211-7/+7
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30684 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30683Uoti Urpala2010-03-101-2/+2
|\|
| * Rename open() vf initialization function to vf_open().diego2010-02-211-2/+2
| | | | | | | | | | | | | | This avoids clashes with fcntl.h under certain circumstances. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30680 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30463Uoti Urpala2010-03-091-0/+18
|\| | | | | | | | | | | Note that r30455 is wrong, that commit does not in fact change the default behavior as claimed in the commit message. It only breaks "-af-adv force=0", which was already pretty much useless though.
| * Add missing license headers to all files in the libmpcodecs directory.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30463 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30419Uoti Urpala2010-01-251-11/+40
|\|
| * Make the scale filter prefer yuv conversions that do not need chroma scaling.reimar2010-01-231-7/+41
| | | | | | | | | | | | | | Also always try keeping input and output format the same first. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30409 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove the query_format_cache, it is extra complexity that makes improvementsreimar2010-01-231-6/+1
| | | | | | | | | | | | | | difficult while the speed advantage in normal use cases is not measurable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30408 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Simplify loop conditionreimar2010-01-231-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30407 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30195Uoti Urpala2010-01-081-3/+3
|\|
| * Replace deprecated sws_scale_ordered usages by sws_scale (which does the same).reimar2010-01-031-3/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30192 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30165Uoti Urpala2010-01-081-5/+21
|\|
| * One more fix for -vf scale with alpha.reimar2010-01-011-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30159 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Also pass alpha plane to swscale, avoids crashes when converting betweenreimar2010-01-011-4/+4
| | | | | | | | | | | | | | YUV with alpha and some other format supporting alpha. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30158 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add support for YUV format with alpha and fix the codecs.conf entry for vp6areimar2009-12-311-0/+2
| | | | | | | | | | | | | | | | to use it. Fixes playback of samples in http://samples.mplayerhq.hu/FLV/flash_with_alpha/ git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30157 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Try to put the list of output formats for vf_scale in a more sensiblereimar2009-12-311-6/+6
| | | | | | | | | | | | | | | | | | order. While the 16-bit yuv formats should not be preferred over the 8-bit ones, it seems reasonable to probe them directly after the equivalent 8-bit formats. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30155 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add support for 16-bit per component YUV formats.reimar2009-12-311-0/+12
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30152 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Support 440P in scale filter.reimar2009-12-301-0/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30142 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29962Uoti Urpala2009-11-231-19/+2
|\|
| * Remove unreachable parsing code: for filters that use the option parser,reimar2009-11-211-19/+0
| | | | | | | | | | | | | | | | the args argument to open will always be NULL and vf->priv will always be != NULL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29945 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Allow vf_scale to output to RGB48, though still prefer the 24 and 32 bit ↵reimar2009-11-211-0/+2
| | | | | | | | | | | | formats. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29943 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29532Uoti Urpala2009-08-181-0/+2
|\|
| * Add IMGFMT_RGB48LE and IMGFMT_RGB48BE.cehoyos2009-08-111-0/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29486 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29455Uoti Urpala2009-07-291-1/+1
|\|
| * Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code.diego2009-07-261-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-32/+32
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-32/+32
| |
* | Merge svn changes up to r29117Uoti Urpala2009-04-011-6/+6
|\|
| * Consistently use MP_MAX_PLANES as size for plane pointer/stride arrays in ↵reimar2009-03-291-6/+6
| | | | | | | | | | | | | | | | | | | | libmpcodecs. This might avoid some issues since sws_scale in some cases assumes these have at least 4 valid entries. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29103 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28341Uoti Urpala2009-01-191-1/+1
|\| | | | | | | | | | | Conflicts: configure libmpcodecs/native/rtjpegn.c
| * revert #ifdef WORDS_BIGENDIAN => #if WORDS_BIGENDIAN changes from r28331gpoirier2009-01-161-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28334 b3059339-0415-0410-9bf9-f77b7e298cf2
| * fix compilation on non x86 machines (PPC here)gpoirier2009-01-161-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28331 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Lots and lots of #ifdef ARCH_... -> #if ARCH_...reimar2009-01-161-1/+1
| | | | | | | | | | | | | | | | and #ifdef HAVE_MMX etc -> #if HAVE_MMX. There might be still more that need to be fixed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28325 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to 27824Uoti Urpala2008-10-251-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h libmpcodecs/dec_video.c libmpcodecs/vd.c libvo/x11_common.h mplayer.c stream/cache2.c
| * Change all occurrences of asm and __asm to __asm__, same as was done for FFmpeg.diego2008-10-161-1/+1
| | | | | | | | | | | | | |