summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* audio: simplify furtherwm42015-05-091-12/+3
| | | | | | | | Drop mp_chmap_diff() (which is unused too now), and implement mp_chmap_diffn() in a slightly simpler way. (Too bad there is no standard function for counting set bits.) (cherry picked from commit 00130651dac758f90bf98306a9d1e569ed4155ca)
* audio: remove mp_chmap_contains()wm42015-05-091-24/+0
| | | | | | It's unsued now. (cherry picked from commit 8d5924f2c9c7d80b45cd68b44cb9c74e7b0b5a8c)
* audio: redo channel map fallback selectionwm42015-05-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | Instead of somehow having 4 different cases with each their own weight, do it with a single function that decides which channel layout is the better fallback. This is simpler, and also introduces new (fixed) semantics. The new test added to test/chmap_sel.c actually works now. This is a mixed case with no perfect upmix or downmix, but the better choice is the one which loses the least channels from the original layout. One test also changes. If the input is 7.1(wide-side), and the available layouts are 7.1 and 5.1(side), the latter is now chosen instead of the former. This makes sense: both layouts contain 6 out of 8 channels from the original layout, but the 5.1(side) one is smaller. This follows the general logic. The 7.1 layout has FLC/RLC speakers instead of BL/BR, and judging by the names, "front left center" is completely different from "back left". If these should be exchangeable, a separate exception would have to be added. (cherry picked from commit 3560a50029e160f0606d0cdc6aa1da662bbcace8)
* test: simplify chmap_sel testswm42015-05-091-121/+44
| | | | (cherry picked from commit 5142b0e3f3e2cefc5564122db5a0c4a31bc805b4)
* audio: remove UNKNOWN pseudo speakerswm42015-05-091-3/+1
| | | | | | | | Reuse MP_SPEAKER_ID_NA for this. If all mp_chmap entries are set to NA, the channel layout has special "unknown channel layout" semantics, which are used to deal with some corner cases. (cherry picked from commit 55e777f10b3e241f2634b471e482bab230773ce0)
* audio: avoid downmixing in a certain special-casewm42015-04-281-0/+17
| | | | | | | | | | As indicated by the added test. In this case, fallback and downmix have the same score, but fallback happens to give better results. So prefer fallback over downmix. (This is probably not a correct solution.) (cherry picked from commit d3c7fd9d7c971086a3d6fde5f6f1bc4ef0b2e904)
* vo_opengl: add gamma-auto optionStefano Pigozzi2015-03-042-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | This automatically sets the gamma option depending on lighting conditions measured from the computer's ambient light sensor. sRGB – arguably the “sibling” to BT.709 for still images – has a reference viewing environment defined in its specification (IEC 61966-2-1:1999, see http://www.color.org/chardata/rgb/srgb.xalter). According to this data, the assumed ambient illuminance is 64 lux. This is the illuminance where the gamma that results from ICC color management is correct. On the other hand, BT.1886 formalizes that the gamma level for dim environments to be 2.40, and Apple resources (WWDC12: 2012 Session 523: Best practices for color management) define the BT.1886 dim at 16 lux. So the logic we apply is: * >= 64lux -> 1.961 gamma * =< 16lux -> 2.400 gamma * 16lux < x < 64lux -> logaritmic rescale of lux to gamma. The human perception of illuminance roughly follows a logaritmic scale of lux [1]. [1]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd319008%28v=vs.85%29.aspx
* chmap_sel: add multichannel fallback heuristicStefano Pigozzi2014-12-293-0/+229
Instead of just failing during channel map selection, try to select a close layout that makes most sense and upmix/downmix to that instead of failing AO initialization. The heuristic is rather simple, and uses the following steps: 1) If mono is required always prefer stereo to a multichannel upmix. 2) Search for an upmix that is an exact superset of the required channel map. 3) Search for a downmix that is the exact subset of the required channel map. 4) Search for either an upmix or downmix that is the closest (minimum difference of channels) to the required channel map.