Compare commits

...
236 Commits
Author SHA1 Message Date
Sergey Larin 9c8bf1fe5d No Issue - Disable VSX extensions (uplift)
There is no detection script for them as for AltiVec, and
it's breaking older machines (PowerMac G5 in particular).
2025-07-25 16:57:09 +02:00
Sergey Larin d1cc6ff3cb Issue #2777 - Fix ffvpx build on PPC64 (uplift) 2025-07-25 16:55:27 +02:00
Moonchild db76d74820 [DOM] Make object loading use an explicit scheme whitelist. 2025-07-25 14:23:45 +02:00
Moonchild 8fdd9d52f9 [network] Stop accepting nameless cookies. 2025-07-25 14:23:34 +02:00
Moonchild d42797f587 [js] Align br_table limits with V8/Gecko. 2025-07-25 14:23:18 +02:00
Moonchild 6b9c1f6ab8 [gfx] Hold a stronger reference to gfxFontEntry. 2025-07-25 14:23:10 +02:00
Moonchild 4aedc96db2 No issue - Adjust CSP URI reporting more closely with the spec.
According to the W3C discussion we should allow websocket URIs to be
reported aside from http/https/ftp ones.
This rewrites things slightly and updates comments to clarify.
We do retain the non-standard reduction to origin only in case the
report is for cross-origin URIs (stops leaking full URIs to the CSP
reported destination).
See https://github.com/w3c/webappsec-csp/issues/735
2025-07-25 14:22:58 +02:00
Francis Dominic Fajardo 234830da1e Issue #2826 - Set up fontconfig on XRE startup (GTK only) 2025-07-25 14:22:35 +02:00
Moonchild 244b95968f Issue #2720 - Follow-up: Use temp value for duplicate color stop 2025-07-25 14:20:13 +02:00
Moonchild 810cd553b5 [devtools] Further improve special character escaping in "copy as curl".
Follow-up to 15335ce39d

Trying to cross-platform sanitize causes issues escaping too much and
as a result mangling the curl commands that get spit out.
This reverts previously added Windows-specific escaping on POSIX and
vice versa.
Since we do not offer cross-platform copying as a curl command in devtools
anyway, it makes little sense to sanitize for the O.S. we're not running on
as we would not be using the command processor in such environments that
could trip over characters for the other O.S. This was previously added
as a defense-in-depth in case we would start offering this, but I see no
real reason to do so, anyway.

Also decided to in-line comments for readability instead of a bulleted
list in the function head.

Mozilla has taken similar steps because of fall-out, but they do offer
cross-platform "copy as curl" for corner cases, so they will have to
find solutions for a problem we won't have.
2025-07-08 22:57:28 +02:00
Basilisk-dev e52eaa961c Issue #2773 - Allow building FFVPX on all architectures (uplift)
Resolves build bustage.
2025-07-03 20:16:10 +02:00
Moonchild b7827091b8 Merge branch 'master' into release 2025-06-26 14:26:02 +02:00
Moonchild 2e344377b5 Merge branch 'master' into release
# Conflicts:
#	devtools/client/shared/curl.js
#	security/nss/lib/ckfw/builtins/certdata.txt
#	security/nss/lib/nss/nss.h
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
2025-06-24 17:08:59 +02:00
Moonchild 15335ce39d [devtools] Improve special character escaping for curl 2025-05-29 17:28:44 +02:00
Moonchild 14b03e1f8c No issue - Set device contrast to an acceptable value if OOB.
On Mac and Win+DW, enhanced device contrast can possibly not be set.
This throws Skia for a loop by passing in an OOB scalar to its init.
Work around this by setting an accepted average value that helps
prevent font wash-out while not causing fringing.
2025-05-29 17:28:30 +02:00
Moonchild 0968b94e5c No issue - Force C++ run-time type information on protobuf (uplift)
Protobuf uses `dynamic_cast` on polymorphic types which cannot be
inferred properly at compile-time, which can lead to unexpected behavior.
As a code safety measure, enable C++ RTTI for protobuf.
2025-05-29 17:27:29 +02:00
Moonchild ba6b2258aa No issue - Don't support modulo math space in ExtractLinearSum. (uplift) 2025-05-20 00:56:35 +02:00
Moonchild 1e1715ff11 No issue - Fix promise combinator function state. (uplift) 2025-05-19 22:50:48 +02:00
Brian Smith c93381fa79 No Issue - Fixes for building with LLVM 19 (uplift).
Fix a conflict with libc++ 19 and the old Mozilla (re)alloc macros.
LLVM 18+ does not allow std::char_traits<unsigned char> so avoid it.
https://bugzilla.mozilla.org/show_bug.cgi?id=1849070
Partial NSS upgrade to replace ByteString with a class.
https://bugzilla.mozilla.org/show_bug.cgi?id=1851092
2025-05-07 13:01:33 +02:00
Moonchild 65b0a59757 [devtools] Escape some more characters for copying as cURL on Posix. 2025-04-30 15:01:54 +02:00
Moonchild c785639043 [NSS] Update NSS version to 3.90.7 2025-04-30 15:01:48 +02:00
Moonchild 512c259822 [NSS] Update built-in data 2025-04-30 15:01:42 +02:00
Moonchild 90fea6f0d4 [NSS] Improve locking in nssPKIObject_GetInstances. 2025-04-30 15:01:35 +02:00
Moonchild d892468fd0 Issue #2731 - Fix crashes on unknown BigInt types in JIT (uplift)
This only works around the unknown type crashes but doesn't actually fix
attempts at using 64-bit BigInts in Ion.
Resolves #2731
2025-04-22 15:27:34 +02:00
Moonchild 81ab98b329 Merge branch 'master' into release 2025-04-04 20:37:42 +02:00
Moonchild 3f1cacd3e6 Merge branch 'master' into release 2025-04-03 10:22:24 +02:00
Moonchild 6e41e01a29 No issue - fix some minor link issues in about:rights
Privacy was moved to a subdir. Also replacing http with https because
that is what everyone expects by default.
2025-03-07 15:43:13 +01:00
Moonchild 9ce81488d4 No issue - Update Twemoji font to unicode 15.1.3 2025-03-07 02:06:25 +01:00
Moonchild 25bc2630d9 [js] Disable potentially unsafe attempts at recovering JIT operations. 2025-03-06 20:18:39 +01:00
Moonchild e5b69418a0 No Issue - NULL crash fix in nsExternalResourceMap::PendingLoad::OnDataAvailable
Curiously, we should have had this at our fork point (as it was backported
by Mozilla to 52.5.2) by apparently Tobin's import wasn't actually 52.6.0.
:-/
2025-03-06 20:18:24 +01:00
Shadow 229a69be5f Update js/src/wasm/WasmIonCompile.cpp
Bug 1328639 , wasm , Simplify block-value popping in Ion compilation
2025-03-06 20:18:07 +01:00
Moonchild 7f2561312a [layout] Always reserve 64 bits for frame property value
This ensures frame property values can always be stored even in edge cases
on 32-bit machines (where a void ptr is half the width).
2025-02-18 21:42:59 +01:00
Moonchild 93d11a07f9 Issue #2694 - Improve nested grid layout performance by caching.
This improves performance by caching the grid items' block axis
measurement, avoiding potentially exponential calculations and reflows.
Resolves #2694
2025-02-18 16:57:20 +01:00
Moonchild 8e5e24c4c6 Issue #2693 - Disable CSP reporting by default in the platform.
This is a temporary measure to work around CF OOM situations.
Reporting is desirable normally so webmasters get alerted to CSP issues,
and this should be flipped back on once we can.
2025-02-18 10:13:35 +01:00
Moonchild 517ee6754c [DOM] Honor security.csp.reporting.enabled pref in more places. 2025-02-18 10:13:28 +01:00
Moonchild 47690c287c No issue - avoid potential underflow in StructuredClone.
Prevents potential loop-around if there's bogus internal Map data.
2025-02-18 10:13:19 +01:00
Moonchild 364b95170e Merge branch 'master' into release 2025-02-05 23:36:07 +01:00
Moonchild 407006d673 Merge branch 'master' into release 2025-02-05 18:33:29 +01:00
Moonchild 2d60605cc6 Merge branch 'master' into release
# Conflicts:
#	netwerk/cookie/nsCookieService.cpp
2025-02-03 19:13:42 +01:00
Moonchild 2d1129eb7e [network] Don't try to use non-existing connections. 2025-01-13 20:29:31 +01:00
Moonchild 495b4980e7 [DOM] Convert cleanup of FlushCurrentWord() to a ScopeExit task.
Ensures consistent cleanup even if early exit due to OOM.
2025-01-10 15:55:10 +01:00
Moonchild ad480be112 [DOM] Slightly extend lifetime of data in Structured Clone operations. 2025-01-10 15:54:44 +01:00
Moonchild a06001c022 [network] Verify connection NPN against negotiated NPN. 2025-01-10 15:54:35 +01:00
Moonchild 6cbda74aeb Issue #2670 - Compute baseDomain when cookies are read from the database
baseDomain is used as a key for cookies in a hashmap. For cookie
operations to work properly, the baseDomain generation must be reliable.
This is, however, not the case, because the result can change by updates
to the public suffix list (PSL).

Since the stored baseDomain is not reliable, the value must be recomputed
when the database is read. This causes a minor performance hit but is
needed if we want to keep abreast of PSL changes without clobbering the
cookies database.

Resolves #2670
2024-12-24 22:12:33 +01:00
Moonchild 576fbdf490 Issue #2672 - Follow-up: Remove unused telemetry variable. 2024-12-24 22:12:24 +01:00
Moonchild 52b00c38ea Issue #2672 - Part 4: Prevent db access while rebuilding is underway. 2024-12-24 22:12:15 +01:00
Moonchild 8ec56f459b Issue #2672 - Part 3: Ensure thread lifetimes are in tandem. 2024-12-24 22:12:05 +01:00
Moonchild 5cbe423461 Issue #2672 - Part 2: Auto-close syncConn for edge cases. 2024-12-24 22:11:59 +01:00
Moonchild 369fbba750 Issue #2672 - Part 1: Load nsCookieService OMT and use sync reads.
No more lazy-loading on the main thread, thanks. Everyone needs this.
2024-12-24 22:11:52 +01:00
Martok 8e3c35efc6 Issue #1787 - Follow-up: remove no longer used AppClearDataObserver. 2024-12-24 22:11:37 +01:00
Moonchild b3b852b877 Merge branch 'master' into release 2024-12-04 11:10:21 +01:00
Moonchild d5c6e20e9e Merge branch 'master' into release 2024-12-01 20:52:12 +01:00
Moonchild 89b36775fb Merge branch 'master' into release 2024-11-29 10:21:36 +01:00
Karl Tomlinson df16df5693 Bug 1920800 - Remove oldImages from check for flushed old principal handle
The logic should be equivalent when frame IDs on aImages are contiguously
increasing from IDs on previously set frames.

There are currently no callers passing empty aImages, but the logic in this
case would now be as described in the documentation of
UpdatePrincipalHandleForFrameID():

> We will notify mElement that aPrincipalHandle has been applied when all
> FrameIDs prior to aFrameID have been flushed out.
2024-10-31 11:44:56 +01:00
Moonchild aa1fd576ac Issue #2648 - Inherit the content disposition of the multipart response 2024-10-30 10:54:11 +01:00
Moonchild 2512188ca7 Issue #2648 - Apply CSP to documents sent through multipart/x-mixed-replace 2024-10-30 10:54:04 +01:00
Moonchild 89e88ca6a0 Merge branch 'master' into release 2024-10-02 19:45:47 +02:00
Moonchild 2697dd162f [js xpconnect] Fix error handling in xpc::CreateSandboxObject 2024-09-05 10:13:09 +02:00
Moonchild 53a4179c4a [js] Simplify with-env handling in FetchName 2024-09-05 10:13:01 +02:00
Moonchild a120731ddd [DOM] Stop exposing NotifyPaintEvent to web content.
There's no reason this should be available to the web, as it's an
indicator of browser internals.
2024-09-05 10:12:55 +02:00
Moonchild bda611a41a Revert "Issue #2523 - Part 1 - Import headers from FFmpeg 7.0"
This reverts commit 27bb48deaf.
2024-09-03 13:03:20 +02:00
Moonchild 5a02a4a1a4 Revert "Issue #2523 - Part 2 - Update audio & video decoders to work with FFmpeg 7.0"
This reverts commit 7dbc24a739.
2024-09-03 13:03:12 +02:00
Moonchild e59f358b45 Revert "Issue #2527 - Part 1 - Remove old FFmpeg and LibAV headers"
This reverts commit b970fc412a.
2024-09-03 13:02:55 +02:00
Moonchild 90c9535b39 Revert "Issue #2527 - Part 2 - Remove support for libavcodec < 58"
This reverts commit 738c6a740a.
2024-09-03 13:02:46 +02:00
Moonchild ad778bbfdb Revert "Issue #2527 - Part 3 - Remove additional checks for LibAV"
This reverts commit b0f872c919.
2024-09-03 13:02:31 +02:00
Moonchild 8868552b24 Merge branch 'master' into release 2024-08-09 19:35:34 +02:00
Moonchild 66826eb487 Merge branch 'master' into release 2024-08-09 19:18:02 +02:00
Moonchild 39127b5ee9 Merge branch 'master' into release 2024-08-09 16:18:50 +02:00
Moonchild 80cff816a8 Merge branch 'master' into release 2024-08-09 15:56:36 +02:00
Moonchild e9dda8dafa Merge branch 'master' into release
# Conflicts:
#	security/nss/doc/rst/releases/index.rst
#	security/nss/lib/nss/nss.h
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
2024-08-07 20:13:00 +02:00
Moonchild 11fc818dfb [DOM/network] Disable DNS prefetching if document nodePrincipal is systemPrincipal 2024-07-10 10:54:53 +02:00
Moonchild 84ed844e3f [IPC] Clean up control flow in WaitableEvent. 2024-07-10 10:54:43 +02:00
Moonchild 50af804f1c [network] Add additional cookie setting checks.
Added checks for sub-document navigations from cross-site to same-site in
third-party checks when setting a cookie.
2024-07-10 10:54:37 +02:00
Moonchild 82ce93bce9 No issue - Update SQLite to 3.46.0 2024-07-10 10:54:24 +02:00
Moonchild 228abc8259 No issue - Update NSS to 3.90.3 2024-07-10 10:54:17 +02:00
Moonchild 1692fa5291 Issue #2045 - Temporarily force hidden elements to be actually hidden.
For the time being, because we don't have `revert` yet, we should force
normally hidden elements to be hidden, so they aren't revealed by sites
using the bad practice of `*{ }` style blanking rules but then using
`revert` to re-hide them.
2024-07-10 10:54:02 +02:00
Moonchild bb58c6ae38 Issue #2541 - Deal with empty LineNameList in CSS grid templates.
Resolves #2541
2024-07-02 01:39:01 +02:00
Moonchild 4f58dc27f9 Re-synchronize branches, picking up 2 commits that were not correctly merged. 2024-06-16 12:32:02 +02:00
Moonchild fc5324b9f7 Issue #2532 - Align dialog submission triggered by form.submit() with the spec.
Submission in click handler of submit button should not be deferred
per https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submit-dialog

See Bug 1719872
2024-06-15 17:56:37 +02:00
Moonchild 561f65aabf Issue #2532 - Prevent unwanted text selection when backdrop is clicked. 2024-06-15 17:56:31 +02:00
Moonchild 9acfe36b95 Issue #2532 - Don't do PreventDefault for escape key if <select> dropdown is not shown
We always use PreventDefault for <select> element, which is problematic if modal
dialog is on as it prevents cancelling the dialog. We fix it by not blocking the
default action if <select> is not shown.

See Bug 1649278
2024-06-15 17:56:25 +02:00
Moonchild ce495cbd85 Issue #2532 - Fix a null pointer crash while doing dialog form submission
See Bug 1652699
2024-06-15 17:56:20 +02:00
Moonchild c44020f188 Issue #2532 - Default pref check to true 2024-06-15 17:56:15 +02:00
Moonchild 35e7a695af Issue #2532 - Implement form[method=dialog]
See bug 1557303
2024-06-15 17:56:08 +02:00
Moonchild 7a55055d22 Merge branch 'master' into release 2024-06-13 21:31:39 +02:00
Moonchild 061900b87f [gfx] Use calloc for cairo font-creation functions. 2024-05-23 13:48:18 +02:00
Moonchild abe32f7309 [gfx] Ensure font entry's unitsPerEm and font extents are initialized when gfxFont is created. 2024-05-23 13:48:11 +02:00
Moonchild 7bfd4c7fe7 [DOM] Clean up ReportLoadError and normalize error messages. 2024-05-23 13:48:04 +02:00
Moonchild 859d6a3e2c [gfx] Clear mSharedBlobData if blob creation failed. 2024-05-23 13:47:58 +02:00
Moonchild c2f05f99af [network] Make http digest auth cnonce length configurable. 2024-05-23 13:47:50 +02:00
Moonchild 55b33fb02b Merge branch 'master' into release 2024-04-19 22:05:10 +02:00
Moonchild c247e40d41 Revert "Update NSS to 3.90.2"
This reverts commit b1cb7e0a8f.
2024-03-23 07:45:56 +01:00
Moonchild 05c58f159d Revert "Undo build system change from NSS update to fix missing command-line utils."
This reverts commit 67d5fefcf2.
2024-03-23 07:45:40 +01:00
Moonchild 67d5fefcf2 Undo build system change from NSS update to fix missing command-line utils. 2024-03-21 21:53:57 +01:00
Moonchild aad017be9e [MFBT] Make move assignment of RefPtr have the same behavior as nsCOMPtr 2024-03-20 19:52:30 +01:00
Moonchild 4543dbf3ff [parser] Specialize AddAttributes for <html>/<body>. 2024-03-20 19:52:24 +01:00
Moonchild b1cb7e0a8f Update NSS to 3.90.2 2024-03-20 19:52:08 +01:00
Moonchild 1c6d21c97d [network] Block set-cookie from multipart/x-mixed-replace 2024-02-22 23:20:07 +01:00
Eitan Isaacson fc42fb38c9 [layout] Process pairs in coord list in PolyArea.
Range -1 assures the array is even with a step size of 2, avoiding lone
value processing.
2024-02-22 23:19:59 +01:00
Jens Stutte 618068c15b [DOM] Check if WorkerRunnable::Run runs on top of WorkerThreadPrimaryRunnable::Run in a worker thread. 2024-02-22 23:19:53 +01:00
FranklinDM 808516a0a8 No issue - Replacing location might throw NS_ERROR_UNEXPECTED while the developer tools window is being destroyed 2024-02-22 23:19:45 +01:00
FranklinDM 7d6b806040 No issue - Remove leftover doorhanger code from the developer tools
Partially based on reverting https://bugzilla.mozilla.org/show_bug.cgi?id=1078539
2024-02-22 23:19:38 +01:00
Martok 6b4e2c9d73 Issue #2453 - Follow-Up: Use hard-coded minimum timer interval in workers.
From the spec: "If nesting level is greater than 5, and timeout is less than 4, then set timeout to 4.",
therefore not having it user-configurable doesn't really break anything.
2024-02-22 23:19:20 +01:00
Moonchild 787883f6a4 Disable URL-paste content loading by default.
See https://repo.palemoon.org/MoonchildProductions/Pale-Moon/issues/1957
2024-02-22 23:18:36 +01:00
Moonchild 7f02753c04 Issue #2465 - Do not use our in-tree metrics hints if using system-cairo
Use a somewhat equivalent font-options instance when using the
system-supplied cairo lib, instead of our in-tree extension.

Resolves #2465
2024-02-07 21:40:55 +01:00
Moonchild 8fa38b3445 Issue #618 - Follow-up: Fix missed constant refactor preventing ExportEntries from working. 2024-02-07 21:40:29 +01:00
Moonchild 541c5f9f45 Merge branch 'master' into release 2024-01-25 15:55:20 +01:00
Moonchild 4b6bd4976a Merge branch 'master' into release
# Conflicts:
#	modules/libpref/init/all.js
2024-01-25 09:09:51 +01:00
Moonchild a0843d52b4 Revert "[XPCOM] Compare return value of readlink in nsLocalFileUnix::GetNativeTarget"
This reverts commit 188f61505f.
2023-12-21 14:03:31 +01:00
Kershaw Chang 977a8cbed8 Bug 1736385 - Make sure thread is alive in CacheIOThread::ThreadFunc 2023-12-21 11:44:50 +01:00
Moonchild 1e85085305 [dom] Better handling of aborted websocket workers.
Catch the case where we are in worker-shutdown but are still connecting
and make filing and closing connections a bit more robust with a RefPtr.
2023-12-21 11:44:42 +01:00
Barret Rennie 188f61505f [XPCOM] Compare return value of readlink in nsLocalFileUnix::GetNativeTarget 2023-12-21 11:44:32 +01:00
Moonchild a514d7f6a4 [layout] Always check against fragment length in nsTextFrame 2023-12-21 11:44:21 +01:00
Moonchild 47c2c75ceb Bug 1868901 2023-12-21 11:44:12 +01:00
Moonchild 7082ec8a9a No issue - Allow redirects for requests that require preflight
Spec update, see Bug 1312864
2023-12-21 11:43:58 +01:00
Brian Smith 2907a84362 Issue #2387 - Remove a missed AddRef() which could cause leaks.
Update comments explaining how the reference counting works.
2023-12-10 23:58:08 +01:00
Brian Smith b8d1ee05c3 Issue #2387 - Collection of fixes related to a crash while canceling a dynamic import.
Add AddRef/Release hooks for embedding's script or module private value and set this script source object where appropriate.
https://bugzilla.mozilla.org/show_bug.cgi?id=1519140 Partial, no Value passing changes.
Clear the list of dynamic import requests after cancelling them in ScriptLoader::ParsingComplete as we do for other requests.
https://bugzilla.mozilla.org/show_bug.cgi?id=1291535
ScriptLoader::OnStreamComplete never returns a failure.
https://bugzilla.mozilla.org/show_bug.cgi?id=1627275
Also cancel the correct kind of parser for Modules.
2023-12-10 23:57:54 +01:00
Moonchild 0b625e624a [DOM] Fix double-free crash in MessagePort.cpp 2023-12-10 17:02:28 +01:00
Moonchild a4da712f91 Issue #2281 - Exclude throw wrapping on modern libcpp.
As discussed.
2023-11-25 18:17:35 +01:00
Moonchild 185f124e87 Issue #2381 - Remove system-nspr/nss leftovers (release port) 2023-11-25 17:15:01 +01:00
Moonchild 8633077691 [WebGL] Flip the validation state for gl_KHR_no_validation.
The original state was inverted due to confusion due to a double
negative (not:no_error).
This validation should only be enabled on Windows (for now).
Future tracking and discussion in BZ 1862039
2023-11-24 12:24:55 +01:00
Moonchild 39a1899045 [DOM] Improve MessagePort state machine. 2023-11-24 12:24:32 +01:00
Moonchild 4dc011a187 [Network] Fix relative URL path starting with multiple slashes 2023-11-24 12:24:19 +01:00
Moonchild ccb12e1dda [DOM] Check if rootDoc is secure context for web compat 2023-11-24 12:24:04 +01:00
Moonchild 63f0d3e295 [WebGL] Turn on more validation/error checking in webgl (when not on Win) 2023-11-24 12:23:49 +01:00
Moonchild 09d598c496 Revert "No Issue - add mutex in EventSource"
This reverts commit 10b3237e52.

Apparently causes deadlocks in Linux.
2023-11-15 12:22:11 +01:00
Moonchild 7e60482d80 No issue - Stop supporting data: scheme in SVG <use> elements. 2023-11-14 12:42:58 +01:00
Moonchild 10b3237e52 No Issue - add mutex in EventSource
Potentially avoids a gc crash when load is high.
2023-11-14 12:42:26 +01:00
athenian200 99af7cc028 Issue #1824 - Support SunOS Linker mapfiles.
Generating OS-appropriate mapfiles from a provided SYMBOL_FILE is
apparently required to work with newer ffvpx. Nothing else in our
codebase actually seemed to require it. Also seems to reduce the amount
of console spam I see relating to symbol visibility during the build
process, and I think it even makes libxul.so link a bit faster.
2023-11-04 01:47:00 -05:00
athenian200 76b360b5d1 Issue #1824 - Move to GCC 10.
It seems to work, but it is a lot slower than compiling with GCC 7.
2023-11-04 01:38:20 -05:00
Moonchild 4001b58a3e [DOM] For now, use C++11 static_asserts only.
Single-param static_assert is C++17 or later.
Follow-up to 3d92b82125
2023-10-27 14:20:10 +02:00
Moonchild 134a8aac87 Issue #35 - Follow-up: undo locale changes so they aren't pre-processed.
Pre-processing loses our localization notes and licensing headers for
l10n which is not a good thing. It's not a big deal having a few unused
strings in these files in the resulting locales.
2023-10-26 22:47:13 +02:00
Moonchild 3e2e48872a Merge branch 'master' into release 2023-10-25 22:51:58 +02:00
Moonchild 622b43cbc5 Merge branch 'master' into release 2023-10-25 22:49:37 +02:00
Moonchild 75b44ef620 Merge branch 'master' into release
# Conflicts:
#	js/src/wasm/WasmBinaryIterator.cpp
#	media/libvpx/vp8/encoder/onyx_if.c
2023-10-05 23:43:10 +02:00
Basilisk-Dev 00084ea49c Cherry-pick upstream libvpx fix
Backport of https://hg.mozilla.org/releases/mozilla-esr115/rev/5241232a3292943bd59ff1704eab60fee3cbc9d1
Addresses CVE-2023-5217
2023-09-28 16:18:01 +02:00
Moonchild b6fae24296 [network] Refactor TransactionObserver::OnDataAvailable() 2023-09-27 21:55:28 +02:00
André Bargull 13c6b7422d [js] Handle dead wrappers 2023-09-27 21:55:19 +02:00
Moonchild 24f2e663cd Restore incorrect SIMD Op removals. 2023-09-25 10:48:42 +02:00
Brian Smith f96b155988 Issue #2313 - Implement WebAssembly sign extension opcodes. (uplift) 2023-09-25 10:46:25 +02:00
Brian Smith d5cc24e916 Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Doubles in Ion. 2023-09-20 03:34:06 +02:00
Brian Smith 8eba271c5f Issue #2308 & #1240 Follow-up - Replace JSOP_POS in ++/-- with JSOP_TONUMERIC.
https://bugzilla.mozilla.org/show_bug.cgi?id=1519135
2023-09-20 03:33:57 +02:00
Brian Smith 19955c82b3 Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Ion on Intel32/64. 2023-09-20 03:33:50 +02:00
Brian Smith 80ae8aec7c Issue #2308 & #1240 Follow-up - Add BigInt support to JSOP_INC and JSOP_DEC.
https://bugzilla.mozilla.org/show_bug.cgi?id=1526309
2023-09-20 03:33:41 +02:00
Brian Smith d8441d7c81 Issue #2308 & #1240 Follow-up - Introduce new increment and decrement operations.
https://bugzilla.mozilla.org/show_bug.cgi?id=1508521
2023-09-20 03:33:33 +02:00
Brian Smith c2446f2478 Issue #2308 - Fix JSON BigInt regressions.
https://bugzilla.mozilla.org/show_bug.cgi?id=1522433
2023-09-20 03:33:23 +02:00
Brian Smith 6efb7a1904 Issue #2282 - Performance observer safety checks.
Both fixes from later revisions, without the Dispatch API changes.
2023-09-20 03:33:14 +02:00
Brian Smith fa0b03a10f Issue #2026 Follow-up: Fill in missing BigInt64 cases in js::IsTypedArrayConstructor().
Hopefully fixes RSA errors on ProtonMail.
2023-09-20 03:32:41 +02:00
Moonchild 3ae2972950 Issue #2309 - Cherry-pick upstream libwebp fix.
Backport of: https://chromium.googlesource.com/webm/libwebp.git/+/2af26267cdfcb63a88e5c74a85927a12d6ca1d76

Resolves #2309
2023-09-13 10:22:50 +02:00
Moonchild 2d48de9998 Merge branch 'master' into release 2023-09-01 15:44:29 +02:00
Moonchild 3b029cdfe4 Merge branch 'master' into release 2023-07-15 16:01:39 +02:00
Moonchild ea9077a8a5 Merge branch 'master' into release 2023-07-07 19:41:06 +02:00
Moonchild b4af6b6265 No issue - Set the default for incremental cycle collector to be off.
Negative performance impact if enabled.
2023-06-05 21:17:24 +02:00
Moonchild ae1d53ceb1 Issue #2257 - Remove rematerialized frames after bailouts and exceptions.
This ensures that rematerialized frames used by the devtools debugger
are properly removed so that no stale data is used during bailouts.
2023-06-05 21:17:13 +02:00
Brian Smith c3f4709d5e Issue #2252 - Prevent crash when attempting to load a script with execution disallowed.
This issue is due to the ExecutionContext added in Issue #1691 not handling GetScript()
in a context where script execution is not allowed.  This expressed itself in crashes when
playing MP4s with the NoScript extension installed and enabled.
2023-06-05 21:16:57 +02:00
FranklinDM a7bb3fc175 Issue #1592 - Follow-up: Ensure topmost scope marker is cleaned up 2023-06-05 21:16:43 +02:00
FranklinDM 6a0203f25f Issue #2250 - Part 2: Ignore the ancestor filter assertion if rule matching is restricted or if the current element is under a shadow host
This only affects debug builds.
2023-06-05 21:16:31 +02:00
FranklinDM b0dfcb147f Issue #2250 - Part 1: Return early if the element being tested for is likely an ancestor and does not have an assigned slot 2023-06-05 21:16:22 +02:00
Job Bautista 06fd4c9357 Issue #2221 - Follow-up: Simplify jit_ioncheck{1|2|3}_deunified_sources assignment. 2023-06-05 21:15:52 +02:00
Job Bautista b9ea7fd9ee Issue #2221 - Follow-up: Ensure jit_ioncheck{1|2|3}_deunified_sources is defined.
Should fix build bustage in armhf, as well as prevent bustage in mips32.
2023-06-05 21:15:33 +02:00
Moonchild 58308a5c7a Merge branch 'master' into release
# Conflicts:
#	python/mozbuild/mozpack/dmg.py
2023-05-11 17:35:14 +02:00
Brian Smith 88c7d54975 No Issue - Fix FreeBSD build failure with WebRTC enabled. (release uplift)
Tag #2227
2023-05-01 22:12:11 +02:00
Timothy Valldeperas eadb5678b3 Issue #2175 - Fix build bustage in WebRTC. (release uplift)
Resolves #2227
2023-05-01 19:04:57 +02:00
Moonchild 54e3e60796 Revert "[devtools] Don't allow sourcemap URLs to redirect"
This reverts commit 2a05494abe.
2023-04-17 10:25:45 +02:00
Moonchild 2a05494abe [devtools] Don't allow sourcemap URLs to redirect 2023-04-13 10:54:34 +02:00
Moonchild bc89e58def [network] Improve checks while parsing MIME parameters. 2023-04-13 10:54:27 +02:00
Moonchild 3a009b97f6 Issue #1911 - Follow-up: Filter out illegal characters in more locations. 2023-04-13 10:54:10 +02:00
Moonchild a105f6d5e9 No issue - Fix off-by-one of kLargeDatasetSize 2023-04-13 10:54:02 +02:00
Sandra 5db241c0c0 Increase size of data over which we write the data to disk rather than keep it around in memory 2023-04-13 10:53:53 +02:00
Sandra d38dca10e5 Use nsAnonymousTemporaryFile for clipboard cache
Base on https://github.com/mozilla/gecko-dev/commit/ecc04a9245b409d7eed7df63ba733cd2073180de
2023-04-13 10:53:14 +02:00
Moonchild 54fc723126 Issue #2180 - Follow-up: Move sentinel check up a bit. 2023-04-02 15:39:05 +02:00
Moonchild 9b8ca17ee4 Issue #2180 - Add pref to control NSS TLS 1.3 protocol downgrade sentinel 2023-04-02 15:38:57 +02:00
Moonchild cddc95b39b Issue #2176 - Don't reconstruct the parent when tearing down
display:contents nodes with pseudo-elements.

We need to use StyleChildrenIterator which iterates over them, instead.
This is a bit of a hack but we can't always have our cake.

We need to be a bit careful though, since ::before and ::after are owned
by their own frame, and thus could be unbound from the tree or even dead
after removing the frame.

This basically ports bugs 1435566 and 1438467
2023-04-02 15:38:31 +02:00
Moonchild 5676529793 Issue #2171 - Skip over shadow nodes that don't have an owning node.
Resolves #2171
2023-04-02 15:37:44 +02:00
Moonchild ce68156cf4 Revert "[widget] Linux GTK3: Detach accessible from moz_container before it's deleted"
This reverts commit 465a18f342.
Resolves #2168
2023-03-18 19:57:56 +01:00
Moonchild 5032ad9593 Issue #2117 - Follow-up: Run precomplete cmd during package staging
We rely on this for all OSes except Mac where precomplete should not
be in the root (it uses Mozilla's fallback packaging that places it in
$RESPATH)
2023-03-17 22:11:30 +01:00
Moonchild b55f765f2e Issue #1911 - Follow-up: Filter out illegal file extensions also.
We already did this for file names, just not extensions.
2023-03-17 12:02:55 +01:00
Moonchild 856078d435 [widget] Linux GTK3: Detach accessible from moz_container before it's deleted 2023-03-17 12:02:46 +01:00
Moonchild c74c262d2f [GFX] Add some sanity checks and clamps to SurfaceData calculations. 2023-03-17 12:02:38 +01:00
Moonchild 787e29e374 No Issue - Ensure more OsiSpace
ensureOsiSpace(); was very much under-used. This adds more instances
where it makes sense to ensure Osi space before placing masm calls.
2023-03-17 12:02:31 +01:00
FranklinDM e439896c9b Issue #2148 - Shrink Vector from (usually) four pointers in size to three
when no inline storage is used.

See Bug 1338374
2023-03-17 12:02:20 +01:00
FranklinDM 15b508f1fb Issue #2148 - Make Vector not use AlignedStorage for its inline element storage
See Bug 1338374 1/2
2023-03-17 12:02:12 +01:00
Job Bautista 5651ebfc76 Issue #2148 - Discard RegExpShared data tables when discarding regexp JIT code.
Based on Mozilla bug 1378736's part 2.
Should fix the double-free.
Follow-up for #2083
2023-03-17 12:02:04 +01:00
Job Bautista 593bfc1ce8 Issue #2148 - Don't null out RegExpObject -> RegExpShared pointer on GC.
Follow-up for issue #2083.
Taken from Mozilla bug 1378736.
2023-03-17 12:01:50 +01:00
Brian Smith 28953cda7a Issue #2160 - Initial support for notarizing during DMG package.
Added --with-macbundle-idenity configure option to set a codesign identity.
If no identity is set or cross-compiling from Linux no codesigning will be
done. Currently doing a full deep bundle v2 sign, instead of limited v1.
2023-03-15 15:10:52 +01:00
Moonchild 516f3f545d Merge branch 'master' into release
# Conflicts:
#	CLOBBER
#	js/src/vm/RegExpObject.cpp
#	security/nss/lib/nss/nss.h
#	security/nss/lib/pkcs12/p12d.c
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
2023-03-13 13:11:20 +01:00
Moonchild 83aff65a42 Force clobber 2023-02-19 17:53:31 +01:00
Moonchild 5bd97df957 [NSS] Update NSS to 3.52.9 to pick up fixes. 2023-02-19 17:51:26 +01:00
Moonchild 8772711181 [DOM] Check whether module load request was already cancelled when a load fails 2023-02-19 17:51:18 +01:00
Moonchild dc9526f4c6 [widget] Properly test for and handle errors in target-surface creation
and mapping.
2023-02-19 17:51:10 +01:00
Moonchild 9ab36e7ae0 Issue #2103 - Fix typo in RegExp Parser
This corrects the typo where the left-hand character would determine if
the right-hand character would be added or not.

Resolves #2103
2023-02-02 10:50:47 +01:00
Job Bautista e8d30841e7 Issue #2091 - Parse \p{Extended_Pictographic} too.
This is essentially a follow up to Issue #1286. We already have
 UCHAR_EXTENDED_PICTOGRAPHIC in our in-tree ICU, so there's no reason to comment
 this case out.
2023-01-27 05:01:53 +01:00
Martok 9faf29374e Issue #2093 - Trace HeapPtr<RegExpShared::groupsTemplate_> for GC move/compact events, regression from #2072 2023-01-26 20:11:28 +01:00
Moonchild 75e4818d36 Merge branch 'master' into release 2023-01-19 00:42:00 +01:00
Moonchild a65144e9e0 Fix merge conflicts. 2023-01-13 12:55:52 +01:00
Moonchild 4f29548526 Merge branch 'master' into release
# Conflicts:
#	image/decoders/nsJXLDecoder.cpp
#	js/src/irregexp/NativeRegExpMacroAssembler.cpp
#	js/src/irregexp/RegExpAST.h
#	js/src/irregexp/RegExpEngine.cpp
#	js/src/irregexp/RegExpParser.cpp
#	js/src/irregexp/RegExpParser.h
#	xpcom/io/nsLocalFileUnix.cpp
2023-01-13 12:11:56 +01:00
Moonchild 528db2cbd8 Issue #1818 - Remove obsolete path hack in widget code. 2022-12-16 09:13:48 +00:00
Moonchild 84e6bcc1e6 [network] Align cookie checks with RFC 6265 (bis) 2022-12-16 09:13:38 +00:00
Moonchild 0dc9ff518d [libjar] Add some extra sanity checks to our Zip reader. 2022-12-16 09:13:25 +00:00
Moonchild a2e3bd44aa [network] move some generic websocket code to the baseclass 2022-12-16 09:13:09 +00:00
Moonchild 163a0e7caf Revert "Issue #1279 - Implement regular expressions lookbehind (v2)"
This reverts commit d10e8a5b06.
2022-12-15 09:11:02 +00:00
Moonchild 49a86db5f3 Issue #2040 - Pre-multiply the alpha values in our JXL decode buffer. (uplift)
Using selective calculation (only if not opaque) and fast integer
math here should optimize well in compilers.
2022-12-15 09:09:19 +00:00
Moonchild 2640953d8b Issue #2019 - Follow-up: Make nsPluginInstanceOwner also listen to keypress events in the system event group.
nsPluginInstanceOwner only listens to keypress events in the default event group.
However, in our changed operating mode, keypress events are not fired in the
default event group if the key does not result in something printable.
This means that nsPluginInstanceOwner should also listen to keypress events
in the system event group and should handle each keypress that way, but
only once. I.e., if a printable keypress event is received in the system event
group, it should be ignored, since it would've already been handled in the
default event group in that case.
2022-11-26 18:18:09 +00:00
Moonchild 7eb7d67f7a Issue #2033 - Temporary fix of R<->B channel swap.
We have a BGR/RGB channel ordering mismatch here. to at least
provide proper display, a quick&dirty byte swap on the output
buffer will fix this for now, but we should look into seeing where
the surface mismatch is caused.
std::swap() should optimize pretty well in any of the used
compilers, but if necessary, a full buffer ASM routine can be
slotted in (although on current hardware I doubt this will be
even noticeable as it is)
2022-11-26 02:43:18 +00:00
Moonchild e28860ba7f Revert "[XPCOM] Deal with lstat potentially lying in nsLocalFileUnix."
This reverts commit c127f58ef3.
2022-11-20 14:14:48 +00:00
Moonchild 49a96b1d91 Merge branch 'master' into release 2022-11-19 20:15:23 +00:00
Moonchild 3130812693 Merge branch 'master' into release 2022-11-12 18:34:07 +00:00
Moonchild 71ae69aea8 [WebGL] Implement webgl.max-size-per-texture-mib 2022-10-26 14:50:05 +00:00
Moonchild 9e34d697c7 [XPCOM] Fix Base64 off-by-one issue and safeguard against this mistake in the future. 2022-10-26 14:49:55 +00:00
Moonchild 8fa9125d02 [No issue] Hold some strong references on nsRefreshDriver 2022-10-26 14:49:46 +00:00
Brian Smith 4b4488c3e4 Issue #2022 - Part 2 - Add Ventura version detection.
Also add Monterey and Ventura to the graphics driver blocklist.
2022-10-26 14:49:33 +00:00
Brian Smith 248db7d301 Issue #2022 - Part 1 - Fix transparent windows on MacOS 13 Ventura.
During the BaseWindow creation contenView is nil on Ventura...
So create a NSView with the requested dimensions and set is as the contenView.
2022-10-26 14:49:23 +00:00
Moonchild e199f2949b [No issue] Ensure LockImpl::Try() returns the correct bool value. 2022-10-26 14:45:39 +00:00
Moonchild 456b5450a4 Issue #2010 - Ensure raw tagnames are safe exiting internalEntityParser
This resolves #2010
2022-09-28 13:50:10 +00:00
Moonchild d8e629c4a3 Merge branch 'master' into release 2022-09-27 20:12:40 +00:00
Moonchild 4898c4f297 Merge branch 'master' into release 2022-09-24 12:16:59 +00:00
Moonchild 7cd578bbc6 Merge branch 'master' into release 2022-09-22 13:16:48 +00:00
Moonchild 1e91df628a Merge branch 'master' into release 2022-09-22 11:52:16 +00:00
Moonchild b110549cbd Merge branch 'master' into release 2022-07-27 06:07:45 +00:00
Moonchild 971047835a Merge branch 'master' into release
# Conflicts:
#	config/milestone.txt
#	toolkit/mozapps/extensions/internal/XPIProvider.jsm
2022-07-25 20:47:06 +00:00
Moonchild dd4d9eb032 [XPCOM] Crash safely when TArray replacements are OOB.
In the unlikely event of TArray element replacement calls are OOB, crash safely
with a debug breakpoint instead of corrupting memory.
2022-07-03 15:49:44 +00:00
Moonchild 8b94f1e480 [DOM] use the sanitizer to restrict href in svg:use to fragment-only URLs 2022-07-03 15:49:34 +00:00
Moonchild c89610a5c7 [network] Clear PAC loader when the load failed 2022-07-03 15:49:23 +00:00
Moonchild 217963cbed Update NSS to 3.52.7 2022-07-03 15:49:14 +00:00
Moonchild c4f4e18340 [DOM media] Remove potentially unsafe type accesses when debug logging 2022-07-03 15:49:04 +00:00
Moonchild 8a7c0e7345 [network] Clean up and update the list of external protocol handlers. 2022-07-03 15:48:54 +00:00
Moonchild 52e304d450 Issue #1053 - Follow-up: Correct conditional define on POSIX systems. (uplift)
This conditional was incorrectly changed when removing Android support.
This potentially causes issues on Linux systems by not using pthreads correctly,
which may lead to high idle CPU usage.
2022-06-28 13:28:20 +00:00
Moonchild cfc0eeca53 Revert "Issue #1909 - Guard against empty update manifest URL"
This reverts commit d7fadcdef9.
2022-06-07 11:59:07 +00:00
Moonchild ebd3dd9228 Merge branch 'master' into release 2022-06-03 21:50:44 +00:00
Moonchild cb40e4e7ef Merge branch 'master' into release 2022-06-01 13:54:11 +00:00
Moonchild 662dba55fd Merge branch 'master' into release 2022-05-29 11:13:44 +00:00
Moonchild 8760ce023c Issue #1895 - Implement queueMicroTask(callback()) (uplift) 2022-05-07 14:40:14 +00:00
Moonchild b86e148bb7 Roll back milestone version to release. 2022-05-06 12:43:43 +00:00
Moonchild 9e83721e5e Merge branch 'master' into release 2022-05-06 12:43:00 +00:00
Moonchild dc2d6c2e60 Revert "No Issue - Make content-type on JAR channels behave the same as HTTP channels."
This reverts commit 425677ada7.
2022-05-03 17:38:19 +00:00
Moonchild 4ada6f6762 Update 7zSD for v31 2022-05-03 17:38:12 +00:00
33 changed files with 2753 additions and 124 deletions

No files matched your search

+27 -38
View File
@@ -395,9 +395,6 @@ const CurlUtils = {
return "\\u" + ("0000" + code).substr(code.length, 4);
}
// Escape & and |, which are special characters on Windows.
const winSpecialCharsRegEx = /([&\|])/g;
if (/[^\x20-\x7E]|\'/.test(str)) {
// Use ANSI-C quoting syntax.
return "$\'" + str.replace(/\\/g, "\\\\")
@@ -405,58 +402,50 @@ const CurlUtils = {
.replace(/\n/g, "\\n")
.replace(/\r/g, "\\r")
.replace(/!/g, "\\041")
.replace(winSpecialCharsRegEx, "^$1")
.replace(/[^\x20-\x7E]/g, escapeCharacter) + "'";
}
// Use single quote syntax.
return "'" + str.replace(winSpecialCharsRegEx, "^$1") + "'";
return "'" + str + "'";
},
/**
* Escape util function for Windows systems.
*/
escapeStringWin: function (str) {
/*
Because the cmd.exe parser and the MS Crt arguments parsers use some
of the same escape characters, they can interact with each other in
terrible ways, meaning the order of operations is critical here.
1. Replace \ with \\ first, because it is an escape character for
certain conditions in both parsers.
2. Escape double quotes with double backslashes.
3. Escape ` and $ so commands do not get executed, e.g $(calc.exe) or
`\$(calc.exe)
4. Escape all characters we are not sure about with ^, to ensure it
gets to the MS Crt arguments parser safely.
5. The % character is special because the MS Crt arguments parser will
try and look for environment variables and fill them in, in-place. We
cannot escape them with % and cannot escape them with ^ (because it's
cmd.exe's escape, not the MS Crt arguments parser). So, we can get the
cmd.exe parser to escape the character after it, if it is followed by
a valid starting character of an environment variable.
This ensures we do not try and double-escape another ^ if it was placed
by the previous replace.
6. Lastly, we replace new lines with ^ and TWO new lines, because the
first new line is there to enact the escape command, and the second is
the character to escape (in this case new line).
*/
const encapsChars = '^"';
const encapsChars = '"';
return (
encapsChars +
str
// Replace \ with \\ first because it is an escape character for certain
// conditions in both parsers.
.replace(/\\/g, "\\\\")
.replace(/"/g, '\\"')
// Replace double quote chars with two double quotes (not by escaping with \")
// because it is recognized by both cmd.exe and MS CRT arguments parser.
.replace(/"/g, '""')
// Escape ` and $ so commands do not get executed e.g $(calc.exe) or `\$(calc.exe)
.replace(/[`$]/g, "\\$&")
// Then escape all characters we are not sure about with ^ to ensure it
// gets to the MS CRT parser safely.
.replace(/[^a-zA-Z0-9\s_\-:=+~\/.',?;()*\$&\\{}\"`]/g, "^$&")
// The % character is special because MS CRT parser will try and look for
// ENV variables and fill them in its place. We cannot escape them with %
// and cannot escape them with ^ (because it's cmd.exe's escape not MS CRT
// parser); So we can get cmd.exe parser to escape the character after it,
// if it is followed by a valid beginning character of an ENV variable.
// This ensures we do not try and double escape another ^ if it was placed
// by the previous replace.
.replace(/%(?=[a-zA-Z0-9_])/g, "%^")
.replace(/\r?\n/g, "^\n\n")
+ encapsChars);
// We replace \r and \r\n with \n, this allows to consistently escape all new
// lines in the next replace
.replace(/\r\n?/g, "\n")
// Lastly we replace new lines with ^ and TWO new lines because the first
// new line is there to enact the escape command the second is the character
// to escape (in this case new line).
// The extra " enables escaping new lines with ^ within quotes in cmd.exe.
.replace(/\n/g, '"^\r\n\r\n"')
+ encapsChars
);
}
};
+25 -21
View File
@@ -2336,28 +2336,32 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
}
}
// Don't allow view-source scheme.
// view-source is the only scheme to which this applies at the moment due to
// potential timing attacks to read data from cross-origin documents. If this
// widens we should add a protocol flag for whether the scheme is only allowed
// in top and use something like nsNetUtil::NS_URIChainHasFlags.
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element
// requires that `embed` and `object` go through `Fetch` with mode=navigate,
// see 1.3.5. This will in https://fetch.spec.whatwg.org/#fetching plumb us
// through to https://fetch.spec.whatwg.org/#concept-main-fetch where in step
// 12 a switch is performed. Since `object` and `embed` have mode=navigate the
// result of https://fetch.spec.whatwg.org/#concept-scheme-fetch will decide
// if main fetch proceeds. We short-circuit that scheme-fetch here, inspecting
// if the scheme of `mURI` is one that would return a network error. The
// following schemes are allowed through in scheme fetch:
// "about", "blob", "data", "file", "http", "https".
// XXXMC: Should we include "ftp" as well?
//
// Some accessibility tests use our internal "chrome" scheme.
if (mType != eType_Null) {
nsCOMPtr<nsIURI> tempURI = mURI;
nsCOMPtr<nsINestedURI> nestedURI = do_QueryInterface(tempURI);
while (nestedURI) {
// view-source should always be an nsINestedURI, loop and check the
// scheme on this and all inner URIs that are also nested URIs.
bool isViewSource = false;
rv = tempURI->SchemeIs("view-source", &isViewSource);
if (NS_FAILED(rv) || isViewSource) {
LOG(("OBJLC [%p]: Blocking as effective URI has view-source scheme",
this));
mType = eType_Null;
break;
}
nestedURI->GetInnerURI(getter_AddRefs(tempURI));
nestedURI = do_QueryInterface(tempURI);
bool isCandidate = false;
for (const auto& candidate :
{"about", "blob", "chrome", "data", "file", "http", "https"}) {
rv = mURI->SchemeIs(candidate, &isCandidate);
if (NS_SUCCEEDED(rv) && isCandidate) {
break;
}
}
if (!isCandidate) {
LOG(("OBJLC [%p]: Blocking as effective URI does not have an allowed scheme",
this));
mType = eType_Null;
}
}
+37 -19
View File
@@ -810,33 +810,51 @@ StripURIForReporting(nsIURI* aURI,
nsIURI* aSelfURI,
nsACString& outStrippedURI)
{
// 1) If the origin of uri is a globally unique identifier (for example,
// aURI has a scheme of data, blob, or filesystem), then return the
// ASCII serialization of uri’s scheme.
bool isHttpOrFtp =
(NS_SUCCEEDED(aURI->SchemeIs("http", &isHttpOrFtp)) && isHttpOrFtp) ||
(NS_SUCCEEDED(aURI->SchemeIs("https", &isHttpOrFtp)) && isHttpOrFtp) ||
(NS_SUCCEEDED(aURI->SchemeIs("ftp", &isHttpOrFtp)) && isHttpOrFtp);
bool isAllowedScheme =
(NS_SUCCEEDED(aURI->SchemeIs("http", &isAllowedScheme)) && isAllowedScheme) ||
(NS_SUCCEEDED(aURI->SchemeIs("https", &isAllowedScheme)) && isAllowedScheme) ||
(NS_SUCCEEDED(aURI->SchemeIs("ftp", &isAllowedScheme)) && isAllowedScheme) ||
(NS_SUCCEEDED(aURI->SchemeIs("ws", &isAllowedScheme)) && isAllowedScheme) ||
(NS_SUCCEEDED(aURI->SchemeIs("wss", &isAllowedScheme)) && isAllowedScheme);
if (!isHttpOrFtp) {
// not strictly spec compliant, but what we really care about is
// http/https and also ftp. If it's not http/https or ftp, then treat aURI
// as if it's a globally unique identifier and just return the scheme.
if (!isAllowedScheme) {
// Step 1. If url's scheme is not an allowed scheme, then just return url's scheme,
// i.e. treat aURI as a globally unique identifier.
// What we really care about reporting is http/https/ftp.
// https://github.com/w3c/webappsec-csp/issues/735: We also allow WS(S) schemes.
aURI->GetScheme(outStrippedURI);
return;
}
// 2) If the origin of uri is not the same as the origin of the protected
// resource, then return the ASCII serialization of uri’s origin.
if (!NS_SecurityCompareURIs(aSelfURI, aURI, false)) {
// cross origin redirects also fall into this category, see:
// http://www.w3.org/TR/CSP/#violation-reports
aURI->GetPrePath(outStrippedURI);
// Step 2. Set url's fragment to the empty string.
// Implicit in GetSpecIgnoringRef() below.
// Step 3. Set url's username/password to the empty string.
nsCOMPtr<nsIURI> stripped;
nsresult rv = aURI->Clone(getter_AddRefs(stripped));
if (NS_FAILED(rv)) {
// Cloning the URI failed for some reason, just return the scheme.
aURI->GetScheme(outStrippedURI);
return;
}
rv = stripped->SetUserPass(EmptyCString());
if (NS_FAILED(rv)) {
// Mutating the URI failed for some reason, just return the scheme.
aURI->GetScheme(outStrippedURI);
return;
}
// 3) Return uri, with any fragment component removed.
aURI->GetSpecIgnoringRef(outStrippedURI);
// Non-standard: https://github.com/w3c/webappsec-csp/issues/735
// We match other browsers here: To avoid leaking the whole URL when blocking
// (or reporting!) cross-origin navigations inside a frame, we restrict the URLs
// to just the (ASCII serialization of) uri's origin.
if (!NS_SecurityCompareURIs(aSelfURI, stripped, false)) {
stripped->GetPrePath(outStrippedURI);
return;
}
// Step 4. Return uri, with any unwanted component removed.
stripped->GetSpecIgnoringRef(outStrippedURI);
}
nsresult
+15 -13
View File
@@ -448,7 +448,7 @@ class gfxFontEntry::FontTableBlobData {
public:
explicit FontTableBlobData(nsTArray<uint8_t>&& aBuffer)
: mTableData(Move(aBuffer))
, mHashtable(nullptr)
, mFontEntry(nullptr)
, mHashKey(0)
{
MOZ_COUNT_CTOR(FontTableBlobData);
@@ -456,8 +456,9 @@ public:
~FontTableBlobData() {
MOZ_COUNT_DTOR(FontTableBlobData);
if (mHashtable && mHashKey) {
mHashtable->RemoveEntry(mHashKey);
if (mFontEntry && mHashKey) {
RefPtr<gfxFontEntry> kungFuDeathGrip(mFontEntry);
mFontEntry->mFontTableCache->RemoveEntry(mHashKey);
}
}
@@ -470,10 +471,10 @@ public:
// Tell this FontTableBlobData to remove the HashEntry when this is
// destroyed.
void ManageHashEntry(nsTHashtable<FontTableHashEntry> *aHashtable,
void ManageHashEntry(gfxFontEntry* aFontEntry,
uint32_t aHashKey)
{
mHashtable = aHashtable;
mFontEntry = aFontEntry;
mHashKey = aHashKey;
}
@@ -481,7 +482,7 @@ public:
// removed from the hashtable).
void ForgetHashEntry()
{
mHashtable = nullptr;
mFontEntry = nullptr;
mHashKey = 0;
}
@@ -496,10 +497,11 @@ private:
// The font table data block
nsTArray<uint8_t> mTableData;
// The blob destroy function needs to know the owning hashtable
// and the hashtable key, so that it can remove the entry.
nsTHashtable<FontTableHashEntry> *mHashtable;
uint32_t mHashKey;
// The blob destroy function needs to know the owning font entry
// so that it can hold the font-entry's reference while modifying the
// hashtable; and the hashtable key, so that it can remove the entry.
gfxFontEntry* mFontEntry;
uint32_t mHashKey;
// not implemented
FontTableBlobData(const FontTableBlobData&);
@@ -508,7 +510,7 @@ private:
hb_blob_t *
gfxFontEntry::FontTableHashEntry::
ShareTableAndGetBlob(nsTArray<uint8_t>&& aTable,
nsTHashtable<FontTableHashEntry> *aHashtable)
gfxFontEntry* aFontEntry)
{
Clear();
// adopts elements of aTable
@@ -528,7 +530,7 @@ ShareTableAndGetBlob(nsTArray<uint8_t>&& aTable,
// Tell the FontTableBlobData to remove this hash entry when destroyed.
// The hashtable does not keep a strong reference.
mSharedBlobData->ManageHashEntry(aHashtable, GetKey());
mSharedBlobData->ManageHashEntry(aFontEntry, GetKey());
return mBlob;
}
@@ -600,7 +602,7 @@ gfxFontEntry::ShareFontTableAndGetBlob(uint32_t aTag,
return nullptr;
}
return entry->ShareTableAndGetBlob(Move(*aBuffer), mFontTableCache.get());
return entry->ShareTableAndGetBlob(Move(*aBuffer), this);
}
already_AddRefed<gfxCharacterMap>
+3 -3
View File
@@ -534,11 +534,11 @@ private:
// Transfer (not copy) elements of aTable to a new hb_blob_t and
// return ownership to the caller. A weak reference to the blob is
// recorded in the hashtable entry so that others may use the same
// table.
// recorded in the font entry's table cache so that others may use
// the same table.
hb_blob_t *
ShareTableAndGetBlob(nsTArray<uint8_t>&& aTable,
nsTHashtable<FontTableHashEntry> *aHashtable);
gfxFontEntry* aFontEntry);
// Return a strong reference to the blob.
// Callers must hb_blob_destroy the returned blob.
@@ -148,11 +148,11 @@ var exp = asmLink(asmCompile(USE_ASM + "var x=0; function a() { return x|0 } fun
assertEq(exp.c(10), undefined);
assertEq(exp.a(), 10);
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=-1; break; case 133742: i=2; break; default: i=42; break } return i|0 } return f"));
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=-1; break; case 65520: i=2; break; default: i=42; break } return i|0 } return f"));
assertEq(f(1), -1);
assertEq(f(2), 42);
assertEq(f(133742), 2);
assertEq(f(133743), 42);
assertEq(f(65520), 2);
assertEq(f(65521), 42);
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=42; break; default: i=13 } return i|0 } return f"));
assertEq(f(-1), 13);
+1 -1
View File
@@ -1332,7 +1332,7 @@ static const unsigned MaxTableElems = 1024 * 1024;
static const unsigned MaxDataSegments = 64 * 1024;
static const unsigned MaxElemSegments = 64 * 1024;
static const unsigned MaxArgsPerFunc = 4 * 1024;
static const unsigned MaxBrTableElems = 4 * 1024 * 1024;
static const unsigned MaxBrTableElems = 65520;
// To be able to assign function indices during compilation while the number of
// imports is still unknown, asm.js sets a maximum number of imports so it can
+3 -1
View File
@@ -10562,6 +10562,8 @@ CSSParserImpl::ParseColorStop(nsCSSValueGradient* aGradient)
stop->mIsInterpolationHint = true;
}
nsCSSValue stopColor=stop->mColor;
// Stop positions do not have to fall between the starting-point and
// ending-point, so we don't use ParseNonNegativeVariant.
result = ParseVariant(stop->mLocation, VARIANT_LP | VARIANT_CALC, nullptr);
@@ -10588,7 +10590,7 @@ CSSParserImpl::ParseColorStop(nsCSSValueGradient* aGradient)
aGradient->mStops.SetLength(aGradient->mStops.Length()-1);
return false;
}
stop2->mColor = stop->mColor; // copy color from first stop arg
stop2->mColor = stopColor; // We found a valid location; copy color from first stop arg.
} else {
// We didn't get a second stop after all, remove the additional stop again.
aGradient->mStops.SetLength(aGradient->mStops.Length()-1);
+2
View File
@@ -39,6 +39,8 @@
#elif defined(XP_UNIX)
#if defined(__aarch64__)
#include "config_unix_aarch64.h"
#elif defined(__powerpc__)
#include "config_unix_ppc.h"
#else
#if defined(HAVE_64BIT_BUILD)
#include "config_unix64.h"
+770
View File
@@ -0,0 +1,770 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "--disable-all --enable-avcodec --enable-decoder='vp8,vp9,flac' --enable-parser='vp8,vp9' --disable-static --enable-shared --disable-autodetect --disable-iconv --disable-linux-perf"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2024
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 13.3.0 (Adelie 13.3.0)"
#define OS_NAME linux
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
#define BUILDSUF ""
#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define SWS_MAX_FILTER_SIZE 256
#define ARCH_AARCH64 0
#define ARCH_ALPHA 0
#define ARCH_ARM 0
#define ARCH_AVR32 0
#define ARCH_AVR32_AP 0
#define ARCH_AVR32_UC 0
#define ARCH_BFIN 0
#define ARCH_IA64 0
#define ARCH_LOONGARCH 0
#define ARCH_LOONGARCH32 0
#define ARCH_LOONGARCH64 0
#define ARCH_M68K 0
#define ARCH_MIPS 0
#define ARCH_MIPS64 0
#define ARCH_PARISC 0
#define ARCH_PPC 1
#ifdef __powerpc64__
#define ARCH_PPC64 1
#else
#define ARCH_PPC64 0
#endif
#define ARCH_RISCV 0
#define ARCH_S390 0
#define ARCH_SH4 0
#define ARCH_SPARC 0
#define ARCH_SPARC64 0
#define ARCH_TILEGX 0
#define ARCH_TILEPRO 0
#define ARCH_X86 0
#define ARCH_X86_32 0
#define ARCH_X86_64 0
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
#define HAVE_ARMV8 0
#define HAVE_DOTPROD 0
#define HAVE_I8MM 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
#define HAVE_SETEND 0
#ifdef __ALTIVEC__
#define HAVE_ALTIVEC 1
#else
#define HAVE_ALTIVEC 0
#endif
#define HAVE_DCBZL 1
#define HAVE_LDBRX 0
#define HAVE_POWER8 0
#define HAVE_PPC4XX 0
#define HAVE_VSX 0
#define HAVE_RVV 0
#define HAVE_AESNI 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
#define HAVE_AVX512 0
#define HAVE_AVX512ICL 0
#define HAVE_FMA3 0
#define HAVE_FMA4 0
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
#define HAVE_SSE2 0
#define HAVE_SSE3 0
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
#define HAVE_XOP 0
#define HAVE_CPUNOP 0
#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPS32R5 0
#define HAVE_MIPS64R2 0
#define HAVE_MIPS32R6 0
#define HAVE_MIPS64R6 0
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
#define HAVE_LSX 0
#define HAVE_LASX 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_DOTPROD_EXTERNAL 0
#define HAVE_I8MM_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
#define HAVE_SETEND_EXTERNAL 0
#define HAVE_ALTIVEC_EXTERNAL 0
#define HAVE_DCBZL_EXTERNAL 0
#define HAVE_LDBRX_EXTERNAL 0
#define HAVE_POWER8_EXTERNAL 0
#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_VSX_EXTERNAL 0
#define HAVE_RVV_EXTERNAL 0
#define HAVE_AESNI_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
#define HAVE_AVX512_EXTERNAL 0
#define HAVE_AVX512ICL_EXTERNAL 0
#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
#define HAVE_SSE2_EXTERNAL 0
#define HAVE_SSE3_EXTERNAL 0
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
#define HAVE_XOP_EXTERNAL 0
#define HAVE_CPUNOP_EXTERNAL 0
#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPS32R5_EXTERNAL 0
#define HAVE_MIPS64R2_EXTERNAL 0
#define HAVE_MIPS32R6_EXTERNAL 0
#define HAVE_MIPS64R6_EXTERNAL 0
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
#define HAVE_LSX_EXTERNAL 0
#define HAVE_LASX_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
#define HAVE_ARMV8_INLINE 0
#define HAVE_DOTPROD_INLINE 0
#define HAVE_I8MM_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
#define HAVE_SETEND_INLINE 0
#define HAVE_ALTIVEC_INLINE 0
#define HAVE_DCBZL_INLINE 0
#define HAVE_LDBRX_INLINE 0
#define HAVE_POWER8_INLINE 0
#define HAVE_PPC4XX_INLINE 0
#define HAVE_VSX_INLINE 0
#define HAVE_RVV_INLINE 0
#define HAVE_AESNI_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
#define HAVE_AVX512_INLINE 0
#define HAVE_AVX512ICL_INLINE 0
#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
#define HAVE_SSE2_INLINE 0
#define HAVE_SSE3_INLINE 0
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
#define HAVE_XOP_INLINE 0
#define HAVE_CPUNOP_INLINE 0
#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPS32R5_INLINE 0
#define HAVE_MIPS64R2_INLINE 0
#define HAVE_MIPS32R6_INLINE 0
#define HAVE_MIPS64R6_INLINE 0
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
#define HAVE_LSX_INLINE 0
#define HAVE_LASX_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
#define HAVE_FAST_CMOV 0
#define HAVE_FAST_FLOAT16 0
#define HAVE_LOCAL_ALIGNED 1
#define HAVE_SIMD_ALIGN_16 1
#define HAVE_SIMD_ALIGN_32 0
#define HAVE_SIMD_ALIGN_64 0
#define HAVE_ATOMIC_CAS_PTR 0
#define HAVE_MACHINE_RW_BARRIER 0
#define HAVE_MEMORYBARRIER 0
#define HAVE_MM_EMPTY 0
#define HAVE_RDTSC 0
#define HAVE_SEM_TIMEDWAIT 1
#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
#define HAVE_SYMVER 1
#define HAVE_X86ASM 0
#define HAVE_BIGENDIAN 1
#define HAVE_FAST_UNALIGNED 1
#define HAVE_ARPA_INET_H 1
#define HAVE_ASM_TYPES_H 1
#define HAVE_CDIO_PARANOIA_H 0
#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
#define HAVE_CUDA_H 0
#define HAVE_DISPATCH_DISPATCH_H 0
#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
#define HAVE_DEV_IC_BT8XX_H 0
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
#define HAVE_DIRENT_H 1
#define HAVE_DXGIDEBUG_H 0
#define HAVE_DXVA_H 0
#define HAVE_ES2_GL_H 0
#define HAVE_GSM_H 0
#define HAVE_IO_H 0
#define HAVE_LINUX_DMA_BUF_H 0
#define HAVE_LINUX_PERF_EVENT_H 1
#define HAVE_MACHINE_IOCTL_BT848_H 0
#define HAVE_MACHINE_IOCTL_METEOR_H 0
#define HAVE_MALLOC_H 1
#define HAVE_OPENCV2_CORE_CORE_C_H 0
#define HAVE_OPENGL_GL3_H 0
#define HAVE_POLL_H 1
#define HAVE_PTHREAD_NP_H 0
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOUNDCARD_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_UN_H 1
#define HAVE_SYS_VIDEOIO_H 0
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
#define HAVE_VALGRIND_VALGRIND_H 0
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
#define HAVE_HYPOT 1
#define HAVE_ISFINITE 1
#define HAVE_ISINF 1
#define HAVE_ISNAN 1
#define HAVE_LDEXPF 1
#define HAVE_LLRINT 1
#define HAVE_LLRINTF 1
#define HAVE_LOG2 1
#define HAVE_LOG2F 1
#define HAVE_LOG10F 1
#define HAVE_LRINT 1
#define HAVE_LRINTF 1
#define HAVE_POWF 1
#define HAVE_RINT 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SINF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_DOS_PATHS 0
#define HAVE_LIBC_MSVCRT 0
#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0
#define HAVE_SECTION_DATA_REL_RO 1
#define HAVE_THREADS 1
#define HAVE_UWP 0
#define HAVE_WINRT 0
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
#define HAVE_ARC4RANDOM_BUF 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
#define HAVE_FCNTL 1
#define HAVE_GETADDRINFO 1
#define HAVE_GETAUXVAL 1
#define HAVE_GETENV 1
#define HAVE_GETHRTIME 0
#define HAVE_GETOPT 1
#define HAVE_GETMODULEHANDLE 0
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSTDHANDLE 0
#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_GMTIME_R 1
#define HAVE_INET_ATON 1
#define HAVE_ISATTY 1
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
#define HAVE_MKSTEMP 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
#define HAVE_PEEKNAMEDPIPE 0
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_PRCTL 1
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_PTHREAD_SET_NAME_NP 0
#define HAVE_PTHREAD_SETNAME_NP 0
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SECITEMIMPORT 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETDLLDIRECTORY 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
#define HAVE_STRERROR_R 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTL 0
#define HAVE_SYSCTLBYNAME 0
#define HAVE_USLEEP 1
#define HAVE_UTGETOSTYPEFROMSTRING 0
#define HAVE_VIRTUALALLOC 0
#define HAVE_WGLGETPROCADDRESS 0
#define HAVE_BCRYPT 0
#define HAVE_VAAPI_DRM 0
#define HAVE_VAAPI_X11 0
#define HAVE_VAAPI_WIN32 0
#define HAVE_VDPAU_X11 0
#define HAVE_PTHREADS 1
#define HAVE_OS2THREADS 0
#define HAVE_W32THREADS 0
#define HAVE_AS_ARCH_DIRECTIVE 0
#define HAVE_AS_ARCHEXT_DOTPROD_DIRECTIVE 0
#define HAVE_AS_ARCHEXT_I8MM_DIRECTIVE 0
#define HAVE_AS_DN_DIRECTIVE 0
#define HAVE_AS_FPU_DIRECTIVE 0
#define HAVE_AS_FUNC 1
#define HAVE_AS_OBJECT_ARCH 0
#define HAVE_ASM_MOD_Q 0
#define HAVE_BLOCKS_EXTENSION 0
#define HAVE_EBP_AVAILABLE 0
#define HAVE_EBX_AVAILABLE 0
#define HAVE_GNU_AS 0
#define HAVE_GNU_WINDRES 0
#define HAVE_IBM_ASM 1
#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
#define HAVE_INLINE_ASM_LABELS 1
#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_RSYNC_CONTIMEOUT 0
#define HAVE_SYMVER_ASM_LABEL 0
#define HAVE_SYMVER_GNU_ASM 1
#define HAVE_VFP_ARGS 0
#define HAVE_XFORM_ASM 1
#define HAVE_XMM_CLOBBERS 0
#define HAVE_DPI_AWARENESS_CONTEXT 0
#define HAVE_IDXGIOUTPUT5 0
#define HAVE_KCMVIDEOCODECTYPE_HEVC 0
#define HAVE_KCMVIDEOCODECTYPE_HEVCWITHALPHA 0
#define HAVE_KCMVIDEOCODECTYPE_VP9 0
#define HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_422YPCBCR8BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_422YPCBCR10BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_422YPCBCR16BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_444YPCBCR8BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_444YPCBCR10BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR 0
#define HAVE_KCVIMAGEBUFFERYCBCRMATRIX_ITU_R_2020 0
#define HAVE_KCVIMAGEBUFFERCOLORPRIMARIES_ITU_R_2020 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2020 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_428_1 0
#define HAVE_SOCKLEN_T 1
#define HAVE_STRUCT_ADDRINFO 1
#define HAVE_STRUCT_GROUP_SOURCE_REQ 1
#define HAVE_STRUCT_IP_MREQ_SOURCE 1
#define HAVE_STRUCT_IPV6_MREQ 1
#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 1
#define HAVE_STRUCT_POLLFD 1
#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
#define HAVE_STRUCT_SOCKADDR_IN6 1
#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
#define HAVE_GZIP 1
#define HAVE_LIBDRM_GETFB2 0
#define HAVE_MAKEINFO 0
#define HAVE_MAKEINFO_HTML 0
#define HAVE_OPENCL_D3D11 0
#define HAVE_OPENCL_DRM_ARM 0
#define HAVE_OPENCL_DRM_BEIGNET 0
#define HAVE_OPENCL_DXVA2 0
#define HAVE_OPENCL_VAAPI_BEIGNET 0
#define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_TEXI2HTML 0
#define HAVE_XMLLINT 1
#define HAVE_ZLIB_GZIP 0
#define HAVE_OPENVINO2 0
#define CONFIG_DOC 0
#define CONFIG_HTMLPAGES 0
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_HTTP_SERVE_FILES_EXAMPLE 1
#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
#define CONFIG_AVIO_READ_CALLBACK_EXAMPLE 1
#define CONFIG_DECODE_AUDIO_EXAMPLE 1
#define CONFIG_DECODE_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_DECODE_FILTER_VIDEO_EXAMPLE 0
#define CONFIG_DECODE_VIDEO_EXAMPLE 1
#define CONFIG_DEMUX_DECODE_EXAMPLE 0
#define CONFIG_ENCODE_AUDIO_EXAMPLE 1
#define CONFIG_ENCODE_VIDEO_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 0
#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_HW_DECODE_EXAMPLE 0
#define CONFIG_MUX_EXAMPLE 0
#define CONFIG_QSV_DECODE_EXAMPLE 0
#define CONFIG_REMUX_EXAMPLE 0
#define CONFIG_RESAMPLE_AUDIO_EXAMPLE 0
#define CONFIG_SCALE_VIDEO_EXAMPLE 0
#define CONFIG_SHOW_METADATA_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
#define CONFIG_TRANSCODE_EXAMPLE 0
#define CONFIG_VAAPI_ENCODE_EXAMPLE 0
#define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0
#define CONFIG_QSV_TRANSCODE_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_FREI0R 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBDAVS2 0
#define CONFIG_LIBRUBBERBAND 0
#define CONFIG_LIBVIDSTAB 0
#define CONFIG_LIBX264 0
#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXAVS2 0
#define CONFIG_LIBXVID 0
#define CONFIG_DECKLINK 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBTLS 0
#define CONFIG_GMP 0
#define CONFIG_LIBARIBB24 0
#define CONFIG_LIBLENSFUN 0
#define CONFIG_LIBOPENCORE_AMRNB 0
#define CONFIG_LIBOPENCORE_AMRWB 0
#define CONFIG_LIBVO_AMRWBENC 0
#define CONFIG_MBEDTLS 0
#define CONFIG_RKMPP 0
#define CONFIG_LIBSMBCLIENT 0
#define CONFIG_CHROMAPRINT 0
#define CONFIG_GCRYPT 0
#define CONFIG_GNUTLS 0
#define CONFIG_JNI 0
#define CONFIG_LADSPA 0
#define CONFIG_LCMS2 0
#define CONFIG_LIBAOM 0
#define CONFIG_LIBARIBCAPTION 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCELT 0
#define CONFIG_LIBCODEC2 0
#define CONFIG_LIBDAV1D 0
#define CONFIG_LIBDC1394 0
#define CONFIG_LIBDRM 0
#define CONFIG_LIBFLITE 0
#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBFRIBIDI 0
#define CONFIG_LIBHARFBUZZ 0
#define CONFIG_LIBGLSLANG 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
#define CONFIG_LIBJACK 0
#define CONFIG_LIBJXL 0
#define CONFIG_LIBKLVANC 0
#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
#define CONFIG_LIBMYSOFA 0
#define CONFIG_LIBOPENCV 0
#define CONFIG_LIBOPENH264 0
#define CONFIG_LIBOPENJPEG 0
#define CONFIG_LIBOPENMPT 0
#define CONFIG_LIBOPENVINO 0
#define CONFIG_LIBOPUS 0
#define CONFIG_LIBPLACEBO 0
#define CONFIG_LIBPULSE 0
#define CONFIG_LIBRABBITMQ 0
#define CONFIG_LIBRAV1E 0
#define CONFIG_LIBRIST 0
#define CONFIG_LIBRSVG 0
#define CONFIG_LIBRTMP 0
#define CONFIG_LIBSHADERC 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSRT 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSVTAV1 0
#define CONFIG_LIBTENSORFLOW 0
#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUAVS3D 0
#define CONFIG_LIBV4L2 0
#define CONFIG_LIBVMAF 0
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWEBP 0
#define CONFIG_LIBXML2 0
#define CONFIG_LIBZIMG 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_LV2 0
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
#define CONFIG_AVFOUNDATION 0
#define CONFIG_BZLIB 0
#define CONFIG_COREIMAGE 0
#define CONFIG_ICONV 0
#define CONFIG_LIBXCB 0
#define CONFIG_LIBXCB_SHM 0
#define CONFIG_LIBXCB_SHAPE 0
#define CONFIG_LIBXCB_XFIXES 0
#define CONFIG_LZMA 0
#define CONFIG_MEDIAFOUNDATION 0
#define CONFIG_METAL 0
#define CONFIG_SCHANNEL 0
#define CONFIG_SDL2 0
#define CONFIG_SECURETRANSPORT 0
#define CONFIG_SNDIO 0
#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
#define CONFIG_CUDA_NVCC 0
#define CONFIG_CUDA_SDK 0
#define CONFIG_LIBNPP 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBVPL 0
#define CONFIG_MMAL 0
#define CONFIG_OMX 0
#define CONFIG_OPENCL 0
#define CONFIG_AMF 0
#define CONFIG_AUDIOTOOLBOX 0
#define CONFIG_CRYSTALHD 0
#define CONFIG_CUDA 0
#define CONFIG_CUDA_LLVM 0
#define CONFIG_CUVID 0
#define CONFIG_D3D11VA 0
#define CONFIG_DXVA2 0
#define CONFIG_FFNVCODEC 0
#define CONFIG_NVDEC 0
#define CONFIG_NVENC 0
#define CONFIG_VAAPI 0
#define CONFIG_VDPAU 0
#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_VULKAN 0
#define CONFIG_V4L2_M2M 0
#define CONFIG_FTRAPV 0
#define CONFIG_GRAY 0
#define CONFIG_HARDCODED_TABLES 0
#define CONFIG_OMX_RPI 0
#define CONFIG_RUNTIME_CPUDETECT 1
#define CONFIG_SAFE_BITSTREAM_READER 1
#define CONFIG_SHARED 1
#define CONFIG_SMALL 0
#define CONFIG_STATIC 0
#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
#define CONFIG_VERSION3 0
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
#define CONFIG_SWSCALE 0
#define CONFIG_POSTPROC 0
#define CONFIG_AVFORMAT 0
#define CONFIG_AVCODEC 1
#define CONFIG_SWRESAMPLE 0
#define CONFIG_AVUTIL 1
#define CONFIG_FFPLAY 0
#define CONFIG_FFPROBE 0
#define CONFIG_FFMPEG 0
#define CONFIG_DWT 0
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAAN 1
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_LSP 0
#define CONFIG_PIXELUTILS 0
#define CONFIG_NETWORK 0
#define CONFIG_AUTODETECT 0
#define CONFIG_FONTCONFIG 0
#define CONFIG_LARGE_TESTS 1
#define CONFIG_LINUX_PERF 0
#define CONFIG_MACOS_KPERF 0
#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_OSSFUZZ 0
#define CONFIG_PIC 1
#define CONFIG_PTX_COMPRESSION 0
#define CONFIG_THUMB 0
#define CONFIG_VALGRIND_BACKTRACE 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_ENCODERS 0
#define CONFIG_HWACCELS 0
#define CONFIG_PARSERS 1
#define CONFIG_INDEVS 0
#define CONFIG_OUTDEVS 0
#define CONFIG_FILTERS 0
#define CONFIG_DEMUXERS 0
#define CONFIG_MUXERS 0
#define CONFIG_PROTOCOLS 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_ADTS_HEADER 0
#define CONFIG_ATSC_A53 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
#define CONFIG_AUDIODSP 0
#define CONFIG_BLOCKDSP 0
#define CONFIG_BSWAPDSP 0
#define CONFIG_CABAC 0
#define CONFIG_CBS 0
#define CONFIG_CBS_AV1 0
#define CONFIG_CBS_H264 0
#define CONFIG_CBS_H265 0
#define CONFIG_CBS_H266 0
#define CONFIG_CBS_JPEG 0
#define CONFIG_CBS_MPEG2 0
#define CONFIG_CBS_VP9 0
#define CONFIG_DEFLATE_WRAPPER 0
#define CONFIG_DIRAC_PARSE 0
#define CONFIG_DNN 0
#define CONFIG_DOVI_RPU 0
#define CONFIG_DVPROFILE 0
#define CONFIG_EVCPARSE 0
#define CONFIG_EXIF 0
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_G722DSP 0
#define CONFIG_GOLOMB 0
#define CONFIG_GPLV3 0
#define CONFIG_H263DSP 0
#define CONFIG_H264CHROMA 0
#define CONFIG_H264DSP 0
#define CONFIG_H264PARSE 0
#define CONFIG_H264PRED 1
#define CONFIG_H264QPEL 0
#define CONFIG_H264_SEI 0
#define CONFIG_HEVCPARSE 0
#define CONFIG_HEVC_SEI 0
#define CONFIG_HPELDSP 0
#define CONFIG_HUFFMAN 0
#define CONFIG_HUFFYUVDSP 0
#define CONFIG_HUFFYUVENCDSP 0
#define CONFIG_IDCTDSP 1
#define CONFIG_IIRFILTER 0
#define CONFIG_INFLATE_WRAPPER 0
#define CONFIG_INTRAX8 0
#define CONFIG_ISO_MEDIA 0
#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
#define CONFIG_LGPLV3 0
#define CONFIG_LIBX262 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LLVIDENCDSP 0
#define CONFIG_LPC 0
#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGAUDIOHEADER 0
#define CONFIG_MPEG4AUDIO 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEODEC 0
#define CONFIG_MPEGVIDEOENC 0
#define CONFIG_MSMPEG4DEC 0
#define CONFIG_MSMPEG4ENC 0
#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
#define CONFIG_QSVDEC 0
#define CONFIG_QSVENC 0
#define CONFIG_QSVVPP 0
#define CONFIG_RANGECODER 0
#define CONFIG_RIFFDEC 0
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_RV34DSP 0
#define CONFIG_SCENE_SAD 0
#define CONFIG_SINEWIN 0
#define CONFIG_SNAPPY 0
#define CONFIG_SRTP 0
#define CONFIG_STARTCODE 0
#define CONFIG_TEXTUREDSP 0
#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VAAPI_1 0
#define CONFIG_VAAPI_ENCODE 0
#define CONFIG_VC1DSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 0
#define CONFIG_VP56DSP 0
#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
#define CONFIG_WMV2DSP 0
#endif /* FFMPEG_CONFIG_H */
+2
View File
@@ -13,6 +13,8 @@ if CONFIG['FFVPX_ASFLAGS']:
if CONFIG['CPU_ARCH'] == 'aarch64':
DIRS += ['aarch64']
elif CONFIG['CPU_ARCH'].startswith('ppc'):
DIRS += ['ppc']
SharedLibrary('mozavcodec')
SOURCES += [
@@ -0,0 +1,386 @@
/*
* Copyright (c) 2002 Brian Foley
* Copyright (c) 2002 Dieter Shirley
* Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
*
* 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
*/
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/hpeldsp.h"
#include "hpeldsp_altivec.h"
#if HAVE_ALTIVEC
/* next one assumes that ((line_size % 16) == 0) */
void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register vector unsigned char pixelsv1;
register vector unsigned char pixelsv1B;
register vector unsigned char pixelsv1C;
register vector unsigned char pixelsv1D;
int i;
register ptrdiff_t line_size_2 = line_size << 1;
register ptrdiff_t line_size_3 = line_size + line_size_2;
register ptrdiff_t line_size_4 = line_size << 2;
// hand-unrolling the loop by 4 gains about 15%
// mininum execution time goes from 74 to 60 cycles
// it's faster than -funroll-loops, but using
// -funroll-loops w/ this is bad - 74 cycles again.
// all this is on a 7450, tuning for the 7450
for (i = 0; i < h; i += 4) {
pixelsv1 = unaligned_load( 0, pixels);
pixelsv1B = unaligned_load(line_size, pixels);
pixelsv1C = unaligned_load(line_size_2, pixels);
pixelsv1D = unaligned_load(line_size_3, pixels);
VEC_ST(pixelsv1, 0, (unsigned char*)block);
VEC_ST(pixelsv1B, line_size, (unsigned char*)block);
VEC_ST(pixelsv1C, line_size_2, (unsigned char*)block);
VEC_ST(pixelsv1D, line_size_3, (unsigned char*)block);
pixels+=line_size_4;
block +=line_size_4;
}
}
/* next one assumes that ((line_size % 16) == 0) */
#define op_avg(a,b) a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEUL)>>1) )
void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register vector unsigned char pixelsv, blockv;
int i;
for (i = 0; i < h; i++) {
blockv = vec_ld(0, block);
pixelsv = VEC_LD( 0, pixels);
blockv = vec_avg(blockv,pixelsv);
vec_st(blockv, 0, (unsigned char*)block);
pixels+=line_size;
block +=line_size;
}
}
/* next one assumes that ((line_size % 8) == 0) */
static void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
{
register vector unsigned char pixelsv, blockv;
int i;
for (i = 0; i < h; i++) {
/* block is 8 bytes-aligned, so we're either in the
left block (16 bytes-aligned) or in the right block (not) */
int rightside = ((unsigned long)block & 0x0000000F);
blockv = vec_ld(0, block);
pixelsv = VEC_LD( 0, pixels);
if (rightside) {
pixelsv = vec_perm(blockv, pixelsv, vcprm(0,1,s0,s1));
} else {
pixelsv = vec_perm(blockv, pixelsv, vcprm(s0,s1,2,3));
}
blockv = vec_avg(blockv, pixelsv);
vec_st(blockv, 0, block);
pixels += line_size;
block += line_size;
}
}
/* next one assumes that ((line_size % 8) == 0) */
static void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
register vector unsigned char blockv;
register vector unsigned short pixelssum1, pixelssum2, temp3;
register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
pixelsv1 = VEC_LD(0, pixels);
pixelsv2 = VEC_LD(1, pixels);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vctwo);
for (i = 0; i < h ; i++) {
int rightside = ((unsigned long)block & 0x0000000F);
blockv = vec_ld(0, block);
pixelsv1 = unaligned_load(line_size, pixels);
pixelsv2 = unaligned_load(line_size+1, pixels);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum2 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
temp3 = vec_add(pixelssum1, pixelssum2);
temp3 = vec_sra(temp3, vctwo);
pixelssum1 = vec_add(pixelssum2, vctwo);
pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
if (rightside) {
blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
} else {
blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
}
vec_st(blockv, 0, block);
block += line_size;
pixels += line_size;
}
}
/* next one assumes that ((line_size % 8) == 0) */
static void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
register vector unsigned char blockv;
register vector unsigned short pixelssum1, pixelssum2, temp3;
register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
register const vector unsigned short vcone = (const vector unsigned short)vec_splat_u16(1);
register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
pixelsv1 = VEC_LD(0, pixels);
pixelsv2 = VEC_LD(1, pixels);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vcone);
for (i = 0; i < h ; i++) {
int rightside = ((unsigned long)block & 0x0000000F);
blockv = vec_ld(0, block);
pixelsv1 = unaligned_load(line_size, pixels);
pixelsv2 = unaligned_load(line_size+1, pixels);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum2 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
temp3 = vec_add(pixelssum1, pixelssum2);
temp3 = vec_sra(temp3, vctwo);
pixelssum1 = vec_add(pixelssum2, vcone);
pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
if (rightside) {
blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
} else {
blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
}
vec_st(blockv, 0, block);
block += line_size;
pixels += line_size;
}
}
/* next one assumes that ((line_size % 16) == 0) */
static void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4;
register vector unsigned char blockv;
register vector unsigned short temp3, temp4,
pixelssum1, pixelssum2, pixelssum3, pixelssum4;
register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
pixelsv1 = VEC_LD(0, pixels);
pixelsv2 = VEC_LD(1, pixels);
pixelsv3 = VEC_MERGEL(vczero, pixelsv1);
pixelsv4 = VEC_MERGEL(vczero, pixelsv2);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum3 = vec_add((vector unsigned short)pixelsv3,
(vector unsigned short)pixelsv4);
pixelssum3 = vec_add(pixelssum3, vctwo);
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vctwo);
for (i = 0; i < h ; i++) {
blockv = vec_ld(0, block);
pixelsv1 = unaligned_load(line_size, pixels);
pixelsv2 = unaligned_load(line_size+1, pixels);
pixelsv3 = VEC_MERGEL(vczero, pixelsv1);
pixelsv4 = VEC_MERGEL(vczero, pixelsv2);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum4 = vec_add((vector unsigned short)pixelsv3,
(vector unsigned short)pixelsv4);
pixelssum2 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
temp4 = vec_add(pixelssum3, pixelssum4);
temp4 = vec_sra(temp4, vctwo);
temp3 = vec_add(pixelssum1, pixelssum2);
temp3 = vec_sra(temp3, vctwo);
pixelssum3 = vec_add(pixelssum4, vctwo);
pixelssum1 = vec_add(pixelssum2, vctwo);
blockv = vec_packsu(temp3, temp4);
vec_st(blockv, 0, block);
block += line_size;
pixels += line_size;
}
}
/* next one assumes that ((line_size % 16) == 0) */
static void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4;
register vector unsigned char blockv;
register vector unsigned short temp3, temp4,
pixelssum1, pixelssum2, pixelssum3, pixelssum4;
register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
register const vector unsigned short vcone = (const vector unsigned short)vec_splat_u16(1);
register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
pixelsv1 = VEC_LD(0, pixels);
pixelsv2 = VEC_LD(1, pixels);
pixelsv3 = VEC_MERGEL(vczero, pixelsv1);
pixelsv4 = VEC_MERGEL(vczero, pixelsv2);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum3 = vec_add((vector unsigned short)pixelsv3,
(vector unsigned short)pixelsv4);
pixelssum3 = vec_add(pixelssum3, vcone);
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vcone);
for (i = 0; i < h ; i++) {
pixelsv1 = unaligned_load(line_size, pixels);
pixelsv2 = unaligned_load(line_size+1, pixels);
pixelsv3 = VEC_MERGEL(vczero, pixelsv1);
pixelsv4 = VEC_MERGEL(vczero, pixelsv2);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum4 = vec_add((vector unsigned short)pixelsv3,
(vector unsigned short)pixelsv4);
pixelssum2 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
temp4 = vec_add(pixelssum3, pixelssum4);
temp4 = vec_sra(temp4, vctwo);
temp3 = vec_add(pixelssum1, pixelssum2);
temp3 = vec_sra(temp3, vctwo);
pixelssum3 = vec_add(pixelssum4, vcone);
pixelssum1 = vec_add(pixelssum2, vcone);
blockv = vec_packsu(temp3, temp4);
VEC_ST(blockv, 0, block);
block += line_size;
pixels += line_size;
}
}
/* next one assumes that ((line_size % 8) == 0) */
static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
register vector unsigned char blockv, blocktemp;
register vector unsigned short pixelssum1, pixelssum2, temp3;
register const vector unsigned char vczero = (const vector unsigned char)
vec_splat_u8(0);
register const vector unsigned short vctwo = (const vector unsigned short)
vec_splat_u16(2);
pixelsv1 = VEC_LD(0, pixels);
pixelsv2 = VEC_LD(1, pixels);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vctwo);
for (i = 0; i < h ; i++) {
int rightside = ((unsigned long)block & 0x0000000F);
blockv = vec_ld(0, block);
pixelsv1 = unaligned_load(line_size, pixels);
pixelsv2 = unaligned_load(line_size+1, pixels);
pixelsv1 = VEC_MERGEH(vczero, pixelsv1);
pixelsv2 = VEC_MERGEH(vczero, pixelsv2);
pixelssum2 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
temp3 = vec_add(pixelssum1, pixelssum2);
temp3 = vec_sra(temp3, vctwo);
pixelssum1 = vec_add(pixelssum2, vctwo);
pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
if (rightside) {
blocktemp = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
} else {
blocktemp = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
}
blockv = vec_avg(blocktemp, blockv);
vec_st(blockv, 0, block);
block += line_size;
pixels += line_size;
}
}
#endif /* HAVE_ALTIVEC */
av_cold void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags)
{
#if HAVE_ALTIVEC
if (!PPC_ALTIVEC(av_get_cpu_flags()))
return;
c->avg_pixels_tab[0][0] = ff_avg_pixels16_altivec;
c->avg_pixels_tab[1][0] = avg_pixels8_altivec;
c->avg_pixels_tab[1][3] = avg_pixels8_xy2_altivec;
c->put_pixels_tab[0][0] = ff_put_pixels16_altivec;
c->put_pixels_tab[1][3] = put_pixels8_xy2_altivec;
c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec;
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_altivec;
c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec;
c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
#endif /* HAVE_ALTIVEC */
}
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2002 Brian Foley
* Copyright (c) 2002 Dieter Shirley
* Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
*
* 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 AVCODEC_PPC_HPELDSP_ALTIVEC_H
#define AVCODEC_PPC_HPELDSP_ALTIVEC_H
#include <stddef.h>
#include <stdint.h>
void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h);
void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h);
#endif /* AVCODEC_PPC_HPELDSP_ALTIVEC_H */
+79
View File
@@ -0,0 +1,79 @@
/*
* simple math operations
* Copyright (c) 2001, 2002 Fabrice Bellard
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al
*
* 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 AVCODEC_PPC_MATHOPS_H
#define AVCODEC_PPC_MATHOPS_H
#include <stdint.h>
#include "config.h"
#include "libavutil/common.h"
#if HAVE_PPC4XX == 1
/* signed 16x16 -> 32 multiply add accumulate */
#define MAC16(rt, ra, rb) \
__asm__ ("maclhw %0, %2, %3" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb));
/* signed 16x16 -> 32 multiply */
#define MUL16(ra, rb) \
({ int __rt; \
__asm__ ("mullhw %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb)); \
__rt; })
#endif
#define MULH MULH
static inline av_const int MULH(int a, int b){
int r;
__asm__ ("mulhw %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
return r;
}
#if !ARCH_PPC64
static inline av_const int64_t MAC64(int64_t d, int a, int b)
{
union { uint64_t x; unsigned hl[2]; } x = { d };
int h, l;
__asm__ ("mullw %3, %4, %5 \n\t"
"mulhw %2, %4, %5 \n\t"
"addc %1, %1, %3 \n\t"
"adde %0, %0, %2 \n\t"
: "+r"(x.hl[0]), "+r"(x.hl[1]), "=&r"(h), "=&r"(l)
: "r"(a), "r"(b));
return x.x;
}
#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
static inline av_const int64_t MLS64(int64_t d, int a, int b)
{
union { uint64_t x; unsigned hl[2]; } x = { d };
int h, l;
__asm__ ("mullw %3, %4, %5 \n\t"
"mulhw %2, %4, %5 \n\t"
"subfc %1, %3, %1 \n\t"
"subfe %0, %2, %0 \n\t"
: "+r"(x.hl[0]), "+r"(x.hl[1]), "=&r"(h), "=&r"(l)
: "r"(a), "r"(b));
return x.x;
}
#define MLS64(d, a, b) ((d) = MLS64(d, a, b))
#endif
#endif /* AVCODEC_PPC_MATHOPS_H */
+14
View File
@@ -0,0 +1,14 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SOURCES += [
'hpeldsp_altivec.c',
'videodsp.c',
'vp8dsp_altivec.c'
]
FINAL_LIBRARY = 'mozavcodec'
include('/media/ffvpx/ffvpxcommon.mozbuild')
+36
View File
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2003-2004 Romain Dolbeau
*
* 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
*/
#include "libavutil/attributes.h"
#include "libavcodec/videodsp.h"
static void prefetch_ppc(const uint8_t *mem, ptrdiff_t stride, int h)
{
register const uint8_t *p = mem;
do {
__asm__ volatile ("dcbt 0,%0" : : "r" (p));
p += stride;
} while(--h);
}
av_cold void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc)
{
ctx->prefetch = prefetch_ppc;
}
+362
View File
@@ -0,0 +1,362 @@
/*
* VP8 compatible video decoder
*
* Copyright (C) 2010 David Conrad
*
* 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
*/
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/mem_internal.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vp8dsp.h"
#include "hpeldsp_altivec.h"
#if HAVE_ALTIVEC == 1
#define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }
// h subpel filter uses msum to multiply+add 4 pixel taps at once
static const vec_s8 h_subpel_filters_inner[7] =
{
REPT4( -6, 123, 12, -1),
REPT4(-11, 108, 36, -8),
REPT4( -9, 93, 50, -6),
REPT4(-16, 77, 77, -16),
REPT4( -6, 50, 93, -9),
REPT4( -8, 36, 108, -11),
REPT4( -1, 12, 123, -6),
};
// for 6tap filters, these are the outer two taps
// The zeros mask off pixels 4-7 when filtering 0-3
// and vice-versa
static const vec_s8 h_subpel_filters_outer[3] =
{
REPT4(0, 0, 2, 1),
REPT4(0, 0, 3, 3),
REPT4(0, 0, 1, 2),
};
#define LOAD_H_SUBPEL_FILTER(i) \
vec_s8 filter_inner = h_subpel_filters_inner[i]; \
vec_s8 filter_outerh = h_subpel_filters_outer[(i)>>1]; \
vec_s8 filter_outerl = vec_sld(filter_outerh, filter_outerh, 2)
#if HAVE_BIGENDIAN == 1
#define GET_PIXHL(offset) \
a = vec_ld((offset)-is6tap-1, src); \
b = vec_ld((offset)-is6tap-1+15, src); \
pixh = vec_perm(a, b, permh##offset); \
pixl = vec_perm(a, b, perml##offset)
#define GET_OUTER(offset) outer = vec_perm(a, b, perm_6tap##offset)
#else
#define GET_PIXHL(offset) \
a = vec_vsx_ld((offset)-is6tap-1, src); \
pixh = vec_perm(a, a, perm_inner); \
pixl = vec_perm(a, a, vec_add(perm_inner, vec_splat_u8(4)))
#define GET_OUTER(offset) outer = vec_perm(a, a, perm_outer)
#endif
#define FILTER_H(dstv, off) \
GET_PIXHL(off); \
filth = vec_msum(filter_inner, pixh, c64); \
filtl = vec_msum(filter_inner, pixl, c64); \
\
if (is6tap) { \
GET_OUTER(off); \
filth = vec_msum(filter_outerh, outer, filth); \
filtl = vec_msum(filter_outerl, outer, filtl); \
} \
if (w == 4) \
filtl = filth; /* discard pixels 4-7 */ \
dstv = vec_packs(filth, filtl); \
dstv = vec_sra(dstv, c7)
static av_always_inline
void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int w, int is6tap)
{
LOAD_H_SUBPEL_FILTER(mx-1);
#if HAVE_BIGENDIAN == 1
vec_u8 align_vec0, align_vec8, permh0, permh8;
vec_u8 perm_6tap0, perm_6tap8, perml0, perml8;
vec_u8 b;
#endif
vec_u8 filt, a, pixh, pixl, outer;
vec_s16 f16h, f16l;
vec_s32 filth, filtl;
vec_u8 perm_inner6 = { 1,2,3,4, 2,3,4,5, 3,4,5,6, 4,5,6,7 };
vec_u8 perm_inner4 = { 0,1,2,3, 1,2,3,4, 2,3,4,5, 3,4,5,6 };
vec_u8 perm_inner = is6tap ? perm_inner6 : perm_inner4;
vec_u8 perm_outer = { 4,9, 0,5, 5,10, 1,6, 6,11, 2,7, 7,12, 3,8 };
vec_s32 c64 = vec_sl(vec_splat_s32(1), vec_splat_u32(6));
vec_u16 c7 = vec_splat_u16(7);
#if HAVE_BIGENDIAN == 1
align_vec0 = vec_lvsl( -is6tap-1, src);
align_vec8 = vec_lvsl(8-is6tap-1, src);
permh0 = vec_perm(align_vec0, align_vec0, perm_inner);
permh8 = vec_perm(align_vec8, align_vec8, perm_inner);
perm_inner = vec_add(perm_inner, vec_splat_u8(4));
perml0 = vec_perm(align_vec0, align_vec0, perm_inner);
perml8 = vec_perm(align_vec8, align_vec8, perm_inner);
perm_6tap0 = vec_perm(align_vec0, align_vec0, perm_outer);
perm_6tap8 = vec_perm(align_vec8, align_vec8, perm_outer);
#endif
while (h --> 0) {
FILTER_H(f16h, 0);
if (w == 16) {
FILTER_H(f16l, 8);
filt = vec_packsu(f16h, f16l);
vec_st(filt, 0, dst);
} else {
filt = vec_packsu(f16h, f16h);
vec_ste((vec_u32)filt, 0, (uint32_t*)dst);
if (w == 8)
vec_ste((vec_u32)filt, 4, (uint32_t*)dst);
}
src += src_stride;
dst += dst_stride;
}
}
// v subpel filter does a simple vertical multiply + add
static const vec_u8 v_subpel_filters[7] =
{
{ 0, 6, 123, 12, 1, 0 },
{ 2, 11, 108, 36, 8, 1 },
{ 0, 9, 93, 50, 6, 0 },
{ 3, 16, 77, 77, 16, 3 },
{ 0, 6, 50, 93, 9, 0 },
{ 1, 8, 36, 108, 11, 2 },
{ 0, 1, 12, 123, 6, 0 },
};
#define LOAD_V_SUBPEL_FILTER(i) \
vec_u8 subpel_filter = v_subpel_filters[i]; \
vec_u8 f0 = vec_splat(subpel_filter, 0); \
vec_u8 f1 = vec_splat(subpel_filter, 1); \
vec_u8 f2 = vec_splat(subpel_filter, 2); \
vec_u8 f3 = vec_splat(subpel_filter, 3); \
vec_u8 f4 = vec_splat(subpel_filter, 4); \
vec_u8 f5 = vec_splat(subpel_filter, 5)
#define FILTER_V(dstv, vec_mul) \
s1f = (vec_s16)vec_mul(s1, f1); \
s2f = (vec_s16)vec_mul(s2, f2); \
s3f = (vec_s16)vec_mul(s3, f3); \
s4f = (vec_s16)vec_mul(s4, f4); \
s2f = vec_subs(s2f, s1f); \
s3f = vec_subs(s3f, s4f); \
if (is6tap) { \
s0f = (vec_s16)vec_mul(s0, f0); \
s5f = (vec_s16)vec_mul(s5, f5); \
s2f = vec_adds(s2f, s0f); \
s3f = vec_adds(s3f, s5f); \
} \
dstv = vec_adds(s2f, s3f); \
dstv = vec_adds(dstv, c64); \
dstv = vec_sra(dstv, c7)
#if HAVE_BIGENDIAN == 1
#define LOAD_HL(off, s, perm) load_with_perm_vec(off, s, perm)
#else
#define LOAD_HL(off, s, perm) vec_mergeh(vec_vsx_ld(off,s), vec_vsx_ld(off+8,s))
#endif
static av_always_inline
void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int my, int w, int is6tap)
{
LOAD_V_SUBPEL_FILTER(my-1);
vec_u8 s0, s1, s2, s3, s4, s5, filt, align_vech, perm_vec, align_vecl;
vec_s16 s0f, s1f, s2f, s3f, s4f, s5f, f16h, f16l;
vec_s16 c64 = vec_sl(vec_splat_s16(1), vec_splat_u16(6));
vec_u16 c7 = vec_splat_u16(7);
#if HAVE_BIGENDIAN == 1
// we want pixels 0-7 to be in the even positions and 8-15 in the odd,
// so combine this permute with the alignment permute vector
align_vech = vec_lvsl(0, src);
align_vecl = vec_sld(align_vech, align_vech, 8);
if (w ==16)
perm_vec = vec_mergeh(align_vech, align_vecl);
else
perm_vec = vec_mergeh(align_vech, align_vech);
#endif
if (is6tap)
s0 = LOAD_HL(-2*src_stride, src, perm_vec);
s1 = LOAD_HL(-1*src_stride, src, perm_vec);
s2 = LOAD_HL( 0*src_stride, src, perm_vec);
s3 = LOAD_HL( 1*src_stride, src, perm_vec);
if (is6tap)
s4 = LOAD_HL( 2*src_stride, src, perm_vec);
src += (2+is6tap)*src_stride;
while (h --> 0) {
if (is6tap)
s5 = LOAD_HL(0, src, perm_vec);
else
s4 = LOAD_HL(0, src, perm_vec);
FILTER_V(f16h, vec_mule);
if (w == 16) {
FILTER_V(f16l, vec_mulo);
filt = vec_packsu(f16h, f16l);
vec_st(filt, 0, dst);
} else {
filt = vec_packsu(f16h, f16h);
if (w == 4)
filt = (vec_u8)vec_splat((vec_u32)filt, 0);
else
vec_ste((vec_u32)filt, 4, (uint32_t*)dst);
vec_ste((vec_u32)filt, 0, (uint32_t*)dst);
}
if (is6tap)
s0 = s1;
s1 = s2;
s2 = s3;
s3 = s4;
if (is6tap)
s4 = s5;
dst += dst_stride;
src += src_stride;
}
}
#define EPEL_FUNCS(WIDTH, TAPS) \
static av_noinline \
void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
{ \
put_vp8_epel_h_altivec_core(dst, dst_stride, src, src_stride, h, mx, WIDTH, TAPS == 6); \
} \
\
static av_noinline \
void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
{ \
put_vp8_epel_v_altivec_core(dst, dst_stride, src, src_stride, h, my, WIDTH, TAPS == 6); \
}
#define EPEL_HV(WIDTH, HTAPS, VTAPS) \
static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
{ \
DECLARE_ALIGNED(16, uint8_t, tmp)[(2*WIDTH+5)*16]; \
if (VTAPS == 6) { \
put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16, src-2*sstride, sstride, h+5, mx, my); \
put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, dstride, tmp+2*16, 16, h, mx, my); \
} else { \
put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16, src-sstride, sstride, h+4, mx, my); \
put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, dstride, tmp+16, 16, h, mx, my); \
} \
}
EPEL_FUNCS(16,6)
EPEL_FUNCS(8, 6)
EPEL_FUNCS(8, 4)
EPEL_FUNCS(4, 6)
EPEL_FUNCS(4, 4)
EPEL_HV(16, 6,6)
EPEL_HV(8, 6,6)
EPEL_HV(8, 4,6)
EPEL_HV(8, 6,4)
EPEL_HV(8, 4,4)
EPEL_HV(4, 6,6)
EPEL_HV(4, 4,6)
EPEL_HV(4, 6,4)
EPEL_HV(4, 4,4)
static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my)
{
register vector unsigned char perm;
int i;
register ptrdiff_t dstride2 = dstride << 1, sstride2 = sstride << 1;
register ptrdiff_t dstride3 = dstride2 + dstride, sstride3 = sstride + sstride2;
register ptrdiff_t dstride4 = dstride << 2, sstride4 = sstride << 2;
#if HAVE_BIGENDIAN == 1
perm = vec_lvsl(0, src);
#endif
// hand-unrolling the loop by 4 gains about 15%
// mininum execution time goes from 74 to 60 cycles
// it's faster than -funroll-loops, but using
// -funroll-loops w/ this is bad - 74 cycles again.
// all this is on a 7450, tuning for the 7450
for (i = 0; i < h; i += 4) {
vec_st(load_with_perm_vec(0, src, perm), 0, dst);
vec_st(load_with_perm_vec(sstride, src, perm), dstride, dst);
vec_st(load_with_perm_vec(sstride2, src, perm), dstride2, dst);
vec_st(load_with_perm_vec(sstride3, src, perm), dstride3, dst);
src += sstride4;
dst += dstride4;
}
}
#endif /* HAVE_ALTIVEC */
av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c)
{
#if HAVE_ALTIVEC == 1
if (!PPC_ALTIVEC(av_get_cpu_flags()))
return;
c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec;
c->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_altivec;
c->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_altivec;
c->put_vp8_epel_pixels_tab[0][2][2] = put_vp8_epel16_h6v6_altivec;
c->put_vp8_epel_pixels_tab[1][0][2] = put_vp8_epel8_h6_altivec;
c->put_vp8_epel_pixels_tab[1][2][0] = put_vp8_epel8_v6_altivec;
c->put_vp8_epel_pixels_tab[1][0][1] = put_vp8_epel8_h4_altivec;
c->put_vp8_epel_pixels_tab[1][1][0] = put_vp8_epel8_v4_altivec;
c->put_vp8_epel_pixels_tab[1][2][2] = put_vp8_epel8_h6v6_altivec;
c->put_vp8_epel_pixels_tab[1][1][1] = put_vp8_epel8_h4v4_altivec;
c->put_vp8_epel_pixels_tab[1][1][2] = put_vp8_epel8_h6v4_altivec;
c->put_vp8_epel_pixels_tab[1][2][1] = put_vp8_epel8_h4v6_altivec;
c->put_vp8_epel_pixels_tab[2][0][2] = put_vp8_epel4_h6_altivec;
c->put_vp8_epel_pixels_tab[2][2][0] = put_vp8_epel4_v6_altivec;
c->put_vp8_epel_pixels_tab[2][0][1] = put_vp8_epel4_h4_altivec;
c->put_vp8_epel_pixels_tab[2][1][0] = put_vp8_epel4_v4_altivec;
c->put_vp8_epel_pixels_tab[2][2][2] = put_vp8_epel4_h6v6_altivec;
c->put_vp8_epel_pixels_tab[2][1][1] = put_vp8_epel4_h4v4_altivec;
c->put_vp8_epel_pixels_tab[2][1][2] = put_vp8_epel4_h6v4_altivec;
c->put_vp8_epel_pixels_tab[2][2][1] = put_vp8_epel4_h4v6_altivec;
#endif /* HAVE_ALTIVEC */
}
+2
View File
@@ -13,6 +13,8 @@ if CONFIG['FFVPX_ASFLAGS']:
if CONFIG['CPU_ARCH'] == 'aarch64':
DIRS += ['aarch64']
elif CONFIG['CPU_ARCH'].startswith('ppc'):
DIRS += ['ppc']
SharedLibrary('mozavutil')
SOURCES += [
+165
View File
@@ -0,0 +1,165 @@
/*
* 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
*/
#include "config.h"
#ifdef __APPLE__
#include <sys/sysctl.h>
#elif defined(__linux__)
#include <asm/cputable.h>
#include <linux/auxvec.h>
#include <fcntl.h>
#if HAVE_UNISTD_H == 1
#include <unistd.h>
#endif
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/types.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
#elif defined(__AMIGAOS4__)
#include <exec/exec.h>
#include <interfaces/exec.h>
#include <proto/exec.h>
#endif /* __APPLE__ */
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/cpu_internal.h"
/**
* This function MAY rely on signal() or fork() in order to make sure AltiVec
* is present.
*/
int ff_get_cpu_flags_ppc(void)
{
#if HAVE_ALTIVEC == 1
#ifdef __AMIGAOS4__
ULONG result = 0;
extern struct ExecIFace *IExec;
IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
if (result == VECTORTYPE_ALTIVEC)
return AV_CPU_FLAG_ALTIVEC;
return 0;
#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__) || defined(__OpenBSD__)
int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
#else
int sels[2] = {CTL_HW, HW_VECTORUNIT};
#endif
int has_vu = 0;
size_t len = sizeof(has_vu);
int err;
err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
if (err == 0)
return has_vu ? AV_CPU_FLAG_ALTIVEC : 0;
return 0;
#elif defined(__linux__)
// The linux kernel could have the altivec support disabled
// even if the cpu has it.
int i, ret = 0;
int fd = open("/proc/self/auxv", O_RDONLY);
unsigned long buf[64] = { 0 };
ssize_t count;
if (fd < 0)
return 0;
while ((count = read(fd, buf, sizeof(buf))) > 0) {
for (i = 0; i < count / sizeof(*buf); i += 2) {
if (buf[i] == AT_NULL)
goto out;
if (buf[i] == AT_HWCAP) {
if (buf[i + 1] & PPC_FEATURE_HAS_ALTIVEC)
ret = AV_CPU_FLAG_ALTIVEC;
#ifdef PPC_FEATURE_HAS_VSX
if (buf[i + 1] & PPC_FEATURE_HAS_VSX)
ret |= AV_CPU_FLAG_VSX;
#endif
if (ret & AV_CPU_FLAG_VSX)
av_assert0(ret & AV_CPU_FLAG_ALTIVEC);
}
#ifdef AT_HWCAP2 /* not introduced until glibc 2.18 */
else if (buf[i] == AT_HWCAP2) {
#ifdef PPC_FEATURE2_ARCH_2_07
if (buf[i + 1] & PPC_FEATURE2_ARCH_2_07)
ret |= AV_CPU_FLAG_POWER8;
#endif
}
#endif /* AT_HWCAP2 */
}
}
out:
close(fd);
return ret;
#elif CONFIG_RUNTIME_CPUDETECT && defined(__linux__)
#define PVR_G4_7400 0x000C
#define PVR_G5_970 0x0039
#define PVR_G5_970FX 0x003C
#define PVR_G5_970MP 0x0044
#define PVR_G5_970GX 0x0045
#define PVR_POWER6 0x003E
#define PVR_POWER7 0x003F
#define PVR_POWER8 0x004B
#define PVR_CELL_PPU 0x0070
int ret = 0;
int proc_ver;
// Support of mfspr PVR emulation added in Linux 2.6.17.
__asm__ volatile("mfspr %0, 287" : "=r" (proc_ver));
proc_ver >>= 16;
if (proc_ver & 0x8000 ||
proc_ver == PVR_G4_7400 ||
proc_ver == PVR_G5_970 ||
proc_ver == PVR_G5_970FX ||
proc_ver == PVR_G5_970MP ||
proc_ver == PVR_G5_970GX ||
proc_ver == PVR_POWER6 ||
proc_ver == PVR_POWER7 ||
proc_ver == PVR_POWER8 ||
proc_ver == PVR_CELL_PPU)
ret = AV_CPU_FLAG_ALTIVEC;
if (proc_ver == PVR_POWER7 ||
proc_ver == PVR_POWER8)
ret |= AV_CPU_FLAG_VSX;
if (proc_ver == PVR_POWER8)
ret |= AV_CPU_FLAG_POWER8;
return ret;
#else
// Since we were compiled for AltiVec, just assume we have it
// until someone comes up with a proper way (not involving signal hacks).
return AV_CPU_FLAG_ALTIVEC;
#endif /* __AMIGAOS4__ */
#endif /* HAVE_ALTIVEC */
return 0;
}
size_t ff_get_cpu_max_align_ppc(void)
{
int flags = av_get_cpu_flags();
if (flags & (AV_CPU_FLAG_ALTIVEC |
AV_CPU_FLAG_VSX |
AV_CPU_FLAG_POWER8))
return 16;
return 8;
}
+29
View File
@@ -0,0 +1,29 @@
/*
* 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_PPC_CPU_H
#define AVUTIL_PPC_CPU_H
#include "libavutil/cpu.h"
#include "libavutil/cpu_internal.h"
#define PPC_ALTIVEC(flags) CPUEXT(flags, ALTIVEC)
#define PPC_VSX(flags) CPUEXT(flags, VSX)
#define PPC_POWER8(flags) CPUEXT(flags, POWER8)
#endif /* AVUTIL_PPC_CPU_H */
@@ -0,0 +1,124 @@
/*
* Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org>
*
* 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
*/
#include "util_altivec.h"
#include "float_dsp_altivec.h"
#if HAVE_ALTIVEC == 1
void ff_vector_fmul_altivec(float *dst, const float *src0, const float *src1,
int len)
{
int i;
vec_f d0, d1, s, zero = (vec_f)vec_splat_u32(0);
for (i = 0; i < len - 7; i += 8) {
d0 = vec_ld( 0, src0 + i);
s = vec_ld( 0, src1 + i);
d1 = vec_ld(16, src0 + i);
d0 = vec_madd(d0, s, zero);
d1 = vec_madd(d1, vec_ld(16, src1 + i), zero);
vec_st(d0, 0, dst + i);
vec_st(d1, 16, dst + i);
}
}
void ff_vector_fmul_window_altivec(float *dst, const float *src0,
const float *src1, const float *win, int len)
{
vec_f zero, t0, t1, s0, s1, wi, wj;
const vec_u8 reverse = vcprm(3, 2, 1, 0);
int i, j;
dst += len;
win += len;
src0 += len;
zero = (vec_f)vec_splat_u32(0);
for (i = -len * 4, j = len * 4 - 16; i < 0; i += 16, j -= 16) {
s0 = vec_ld(i, src0);
s1 = vec_ld(j, src1);
wi = vec_ld(i, win);
wj = vec_ld(j, win);
s1 = vec_perm(s1, s1, reverse);
wj = vec_perm(wj, wj, reverse);
t0 = vec_madd(s0, wj, zero);
t0 = vec_nmsub(s1, wi, t0);
t1 = vec_madd(s0, wi, zero);
t1 = vec_madd(s1, wj, t1);
t1 = vec_perm(t1, t1, reverse);
vec_st(t0, i, dst);
vec_st(t1, j, dst);
}
}
void ff_vector_fmul_add_altivec(float *dst, const float *src0,
const float *src1, const float *src2,
int len)
{
int i;
vec_f d, ss0, ss1, ss2, t0, t1, edges;
for (i = 0; i < len - 3; i += 4) {
t0 = vec_ld(0, dst + i);
t1 = vec_ld(15, dst + i);
ss0 = vec_ld(0, src0 + i);
ss1 = vec_ld(0, src1 + i);
ss2 = vec_ld(0, src2 + i);
edges = vec_perm(t1, t0, vcprm(0, 1, 2, 3));
d = vec_madd(ss0, ss1, ss2);
t1 = vec_perm(d, edges, vcprm(s0,s1,s2,s3));
t0 = vec_perm(edges, d, vcprm(s0,s1,s2,s3));
vec_st(t1, 15, dst + i);
vec_st(t0, 0, dst + i);
}
}
void ff_vector_fmul_reverse_altivec(float *dst, const float *src0,
const float *src1, int len)
{
int i;
vec_f d, s0, s1, h0, l0, s2, s3;
vec_f zero = (vec_f)vec_splat_u32(0);
src1 += len-4;
for(i = 0; i < len - 7; i += 8) {
s1 = vec_ld(0, src1 - i); // [a,b,c,d]
s0 = vec_ld(0, src0 + i);
l0 = vec_mergel(s1, s1); // [c,c,d,d]
s3 = vec_ld(-16, src1 - i);
h0 = vec_mergeh(s1, s1); // [a,a,b,b]
s2 = vec_ld(16, src0 + i);
s1 = vec_mergeh(vec_mergel(l0, h0), // [d,b,d,b]
vec_mergeh(l0, h0)); // [c,a,c,a]
// [d,c,b,a]
l0 = vec_mergel(s3, s3);
d = vec_madd(s0, s1, zero);
h0 = vec_mergeh(s3, s3);
vec_st(d, 0, dst + i);
s3 = vec_mergeh(vec_mergel(l0, h0),
vec_mergeh(l0, h0));
d = vec_madd(s2, s3, zero);
vec_st(d, 16, dst + i);
}
}
#endif
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org>
*
* 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_PPC_FLOAT_DSP_ALTIVEC_H
#define AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H
void ff_vector_fmul_altivec(float *dst, const float *src0,
const float *src1, int len);
void ff_vector_fmul_window_altivec(float *dst, const float *src0,
const float *src1, const float *win,
int len);
void ff_vector_fmul_add_altivec(float *dst, const float *src0,
const float *src1, const float *src2,
int len);
void ff_vector_fmul_reverse_altivec(float *dst, const float *src0,
const float *src1, int len);
#endif /* AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H */
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org>
*
* 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
*/
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/float_dsp.h"
#include "libavutil/ppc/cpu.h"
#include "float_dsp_altivec.h"
#include "float_dsp_vsx.h"
av_cold void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact)
{
if (PPC_ALTIVEC(av_get_cpu_flags())) {
fdsp->vector_fmul = ff_vector_fmul_altivec;
fdsp->vector_fmul_add = ff_vector_fmul_add_altivec;
fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_altivec;
if (!bit_exact) {
fdsp->vector_fmul_window = ff_vector_fmul_window_altivec;
}
}
// The disabled function below are near identical to altivec and have
// been disabled to reduce code duplication
if (PPC_VSX(av_get_cpu_flags())) {
// fdsp->vector_fmul = ff_vector_fmul_vsx;
fdsp->vector_fmul_add = ff_vector_fmul_add_vsx;
// fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_vsx;
// if (!bit_exact) {
// fdsp->vector_fmul_window = ff_vector_fmul_window_vsx;
// }
}
}
+119
View File
@@ -0,0 +1,119 @@
/*
* Copyright (c) 2015 Luca Barbato <lu_zero@gentoo.org>
*
* 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
*/
#include "util_altivec.h"
#include "float_dsp_vsx.h"
#if HAVE_DSP_VSX == 1
void ff_vector_fmul_vsx(float *dst,
const float *src0, const float *src1,
int len)
{
int i;
vec_f d0, d1, zero = (vec_f)vec_splat_u32(0);
for (i = 0; i < len - 7; i += 8) {
d0 = vec_vsx_ld( 0, src0 + i);
d1 = vec_vsx_ld(16, src0 + i);
d0 = vec_madd(d0, vec_vsx_ld( 0, src1 + i), zero);
d1 = vec_madd(d1, vec_vsx_ld(16, src1 + i), zero);
vec_vsx_st(d0, 0, dst + i);
vec_vsx_st(d1, 16, dst + i);
}
}
void ff_vector_fmul_window_vsx(float *dst, const float *src0,
const float *src1, const float *win,
int len)
{
vec_f zero, t0, t1, s0, s1, wi, wj;
const vec_u8 reverse = vcprm(3, 2, 1, 0);
int i, j;
dst += len;
win += len;
src0 += len;
zero = (vec_f)vec_splat_u32(0);
for (i = -len * 4, j = len * 4 - 16; i < 0; i += 16, j -= 16) {
s0 = vec_vsx_ld(i, src0);
s1 = vec_vsx_ld(j, src1);
wi = vec_vsx_ld(i, win);
wj = vec_vsx_ld(j, win);
s1 = vec_perm(s1, s1, reverse);
wj = vec_perm(wj, wj, reverse);
t0 = vec_madd(s0, wj, zero);
t0 = vec_nmsub(s1, wi, t0);
t1 = vec_madd(s0, wi, zero);
t1 = vec_madd(s1, wj, t1);
t1 = vec_perm(t1, t1, reverse);
vec_vsx_st(t0, i, dst);
vec_vsx_st(t1, j, dst);
}
}
void ff_vector_fmul_add_vsx(float *dst, const float *src0,
const float *src1, const float *src2,
int len)
{
int i;
vec_f d, s0, s1, s2;
for (i = 0; i < len - 3; i += 4) {
s0 = vec_vsx_ld(0, src0 + i);
s1 = vec_vsx_ld(0, src1 + i);
s2 = vec_vsx_ld(0, src2 + i);
d = vec_madd(s0, s1, s2);
vec_vsx_st(d, 0, dst + i);
}
}
void ff_vector_fmul_reverse_vsx(float *dst, const float *src0,
const float *src1, int len)
{
int i;
vec_f d, s0, s1, h0, l0, s2, s3;
vec_f zero = (vec_f)vec_splat_u32(0);
src1 += len - 4;
for (i = 0; i < len - 7; i += 8) {
s1 = vec_vsx_ld(0, src1 - i); // [a,b,c,d]
s0 = vec_vsx_ld(0, src0 + i);
l0 = vec_mergel(s1, s1); // [c,c,d,d]
s3 = vec_vsx_ld(-16, src1 - i);
h0 = vec_mergeh(s1, s1); // [a,a,b,b]
s2 = vec_vsx_ld(16, src0 + i);
s1 = vec_mergeh(vec_mergel(l0, h0), // [d,b,d,b]
vec_mergeh(l0, h0)); // [c,a,c,a]
// [d,c,b,a]
l0 = vec_mergel(s3, s3);
d = vec_madd(s0, s1, zero);
h0 = vec_mergeh(s3, s3);
vec_vsx_st(d, 0, dst + i);
s3 = vec_mergeh(vec_mergel(l0, h0),
vec_mergeh(l0, h0));
d = vec_madd(s2, s3, zero);
vec_vsx_st(d, 16, dst + i);
}
}
#endif
+38
View File
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2015 Luca Barbato <lu_zero@gentoo.org>
*
* 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_PPC_FLOAT_DSP_VSX_H
#define AVUTIL_PPC_FLOAT_DSP_VSX_H
void ff_vector_fmul_vsx(float *dst, const float *src0,
const float *src1, int len);
void ff_vector_fmul_window_vsx(float *dst, const float *src0,
const float *src1, const float *win,
int len);
void ff_vector_fmul_add_vsx(float *dst, const float *src0,
const float *src1, const float *src2,
int len);
void ff_vector_fmul_reverse_vsx(float *dst, const float *src0,
const float *src1, int len);
#endif /* AVUTIL_PPC_FLOAT_DSP_VSX_H */
+110
View File
@@ -0,0 +1,110 @@
/*
* Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
*
* 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_PPC_INTREADWRITE_H
#define AVUTIL_PPC_INTREADWRITE_H
#include <stdint.h>
#include "config.h"
#if HAVE_XFORM_ASM == 1
#if HAVE_BIGENDIAN == 1
#define AV_RL16 av_read_bswap16
#define AV_WL16 av_write_bswap16
#define AV_RL32 av_read_bswap32
#define AV_WL32 av_write_bswap32
#define AV_RL64 av_read_bswap64
#define AV_WL64 av_write_bswap64
#else
#define AV_RB16 av_read_bswap16
#define AV_WB16 av_write_bswap16
#define AV_RB32 av_read_bswap32
#define AV_WB32 av_write_bswap32
#define AV_RB64 av_read_bswap64
#define AV_WB64 av_write_bswap64
#endif
static av_always_inline uint16_t av_read_bswap16(const void *p)
{
uint16_t v;
__asm__ ("lhbrx %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
return v;
}
static av_always_inline void av_write_bswap16(void *p, uint16_t v)
{
__asm__ ("sthbrx %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));
}
static av_always_inline uint32_t av_read_bswap32(const void *p)
{
uint32_t v;
__asm__ ("lwbrx %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
return v;
}
static av_always_inline void av_write_bswap32(void *p, uint32_t v)
{
__asm__ ("stwbrx %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));
}
#if HAVE_LDBRX == 1
static av_always_inline uint64_t av_read_bswap64(const void *p)
{
uint64_t v;
__asm__ ("ldbrx %0, %y1" : "=r"(v) : "Z"(*(const uint64_t*)p));
return v;
}
static av_always_inline void av_write_bswap64(void *p, uint64_t v)
{
__asm__ ("stdbrx %1, %y0" : "=Z"(*(uint64_t*)p) : "r"(v));
}
#else
static av_always_inline uint64_t av_read_bswap64(const void *p)
{
union { uint64_t v; uint32_t hl[2]; } v;
__asm__ ("lwbrx %0, %y2 \n\t"
"lwbrx %1, %y3 \n\t"
: "=&r"(v.hl[1]), "=r"(v.hl[0])
: "Z"(*(const uint32_t*)p), "Z"(*((const uint32_t*)p+1)));
return v.v;
}
static av_always_inline void av_write_bswap64(void *p, uint64_t v)
{
union { uint64_t v; uint32_t hl[2]; } vv = { v };
__asm__ ("stwbrx %2, %y0 \n\t"
"stwbrx %3, %y1 \n\t"
: "=Z"(*(uint32_t*)p), "=Z"(*((uint32_t*)p+1))
: "r"(vv.hl[1]), "r"(vv.hl[0]));
}
#endif /* HAVE_LDBRX */
#endif /* HAVE_XFORM_ASM */
#endif /* AVUTIL_PPC_INTREADWRITE_H */
+15
View File
@@ -0,0 +1,15 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SOURCES += [
'cpu.c',
'float_dsp_altivec.c',
'float_dsp_init.c',
'float_dsp_vsx.c',
]
FINAL_LIBRARY = 'mozavutil'
include('/media/ffvpx/ffvpxcommon.mozbuild')
+48
View File
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2005 Luca Barbato <lu_zero@gentoo.org>
*
* 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_PPC_TIMER_H
#define AVUTIL_PPC_TIMER_H
#include <stdint.h>
#include "config.h"
#define AV_READ_TIME read_time
static inline uint64_t read_time(void)
{
uint32_t tbu, tbl, temp;
/* from section 2.2.1 of the 32-bit PowerPC PEM */
__asm__ volatile(
"mftbu %2\n"
"mftb %0\n"
"mftbu %1\n"
"cmpw %2,%1\n"
"bne $-0x10\n"
: "=r"(tbl), "=r"(tbu), "=r"(temp)
:
: "cc");
return (((uint64_t)tbu)<<32) | (uint64_t)tbl;
}
#endif /* AVUTIL_PPC_TIMER_H */
+195
View File
@@ -0,0 +1,195 @@
/*
* 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
* Contains misc utility macros and inline functions
*/
#ifndef AVUTIL_PPC_UTIL_ALTIVEC_H
#define AVUTIL_PPC_UTIL_ALTIVEC_H
#include <stdint.h>
#include "config.h"
/***********************************************************************
* Vector types
**********************************************************************/
#define vec_u8 vector unsigned char
#define vec_s8 vector signed char
#define vec_u16 vector unsigned short
#define vec_s16 vector signed short
#define vec_u32 vector unsigned int
#define vec_s32 vector signed int
#define vec_f vector float
/***********************************************************************
* Null vector
**********************************************************************/
#define LOAD_ZERO const vec_u8 zerov = vec_splat_u8( 0 )
#define zero_u8v (vec_u8) zerov
#define zero_s8v (vec_s8) zerov
#define zero_u16v (vec_u16) zerov
#define zero_s16v (vec_s16) zerov
#define zero_u32v (vec_u32) zerov
#define zero_s32v (vec_s32) zerov
#if HAVE_ALTIVEC == 1
#include <altivec.h>
// used to build registers permutation vectors (vcprm)
// the 's' are for words in the _s_econd vector
#define WORD_0 0x00,0x01,0x02,0x03
#define WORD_1 0x04,0x05,0x06,0x07
#define WORD_2 0x08,0x09,0x0a,0x0b
#define WORD_3 0x0c,0x0d,0x0e,0x0f
#define WORD_s0 0x10,0x11,0x12,0x13
#define WORD_s1 0x14,0x15,0x16,0x17
#define WORD_s2 0x18,0x19,0x1a,0x1b
#define WORD_s3 0x1c,0x1d,0x1e,0x1f
#define vcprm(a,b,c,d) (const vec_u8){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
#define SWP_W2S0 0x02,0x03,0x00,0x01
#define SWP_W2S1 0x06,0x07,0x04,0x05
#define SWP_W2S2 0x0a,0x0b,0x08,0x09
#define SWP_W2S3 0x0e,0x0f,0x0c,0x0d
#define SWP_W2Ss0 0x12,0x13,0x10,0x11
#define SWP_W2Ss1 0x16,0x17,0x14,0x15
#define SWP_W2Ss2 0x1a,0x1b,0x18,0x19
#define SWP_W2Ss3 0x1e,0x1f,0x1c,0x1d
#define vcswapi2s(a,b,c,d) (const vector unsigned char){SWP_W2S ## a, SWP_W2S ## b, SWP_W2S ## c, SWP_W2S ## d}
#define vcswapc() \
(const vector unsigned char){0x0f,0x0e,0x0d,0x0c,0x0b,0x0a,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00}
// Transpose 8x8 matrix of 16-bit elements (in-place)
#define TRANSPOSE8(a,b,c,d,e,f,g,h) \
do { \
vec_s16 A1, B1, C1, D1, E1, F1, G1, H1; \
vec_s16 A2, B2, C2, D2, E2, F2, G2, H2; \
\
A1 = vec_mergeh (a, e); \
B1 = vec_mergel (a, e); \
C1 = vec_mergeh (b, f); \
D1 = vec_mergel (b, f); \
E1 = vec_mergeh (c, g); \
F1 = vec_mergel (c, g); \
G1 = vec_mergeh (d, h); \
H1 = vec_mergel (d, h); \
\
A2 = vec_mergeh (A1, E1); \
B2 = vec_mergel (A1, E1); \
C2 = vec_mergeh (B1, F1); \
D2 = vec_mergel (B1, F1); \
E2 = vec_mergeh (C1, G1); \
F2 = vec_mergel (C1, G1); \
G2 = vec_mergeh (D1, H1); \
H2 = vec_mergel (D1, H1); \
\
a = vec_mergeh (A2, E2); \
b = vec_mergel (A2, E2); \
c = vec_mergeh (B2, F2); \
d = vec_mergel (B2, F2); \
e = vec_mergeh (C2, G2); \
f = vec_mergel (C2, G2); \
g = vec_mergeh (D2, H2); \
h = vec_mergel (D2, H2); \
} while (0)
#if HAVE_BIGENDIAN == 1
#define VEC_LD(offset,b) \
vec_perm(vec_ld(offset, b), vec_ld((offset)+15, b), vec_lvsl(offset, b))
#else
#define VEC_LD(offset,b) \
vec_vsx_ld(offset, b)
#endif
/** @brief loads unaligned vector @a *src with offset @a offset
and returns it */
#if HAVE_BIGENDIAN == 1
static inline vec_u8 unaligned_load(int offset, const uint8_t *src)
{
register vec_u8 first = vec_ld(offset, src);
register vec_u8 second = vec_ld(offset + 15, src);
register vec_u8 mask = vec_lvsl(offset, src);
return vec_perm(first, second, mask);
}
static inline vec_u8 load_with_perm_vec(int offset, const uint8_t *src, vec_u8 perm_vec)
{
vec_u8 a = vec_ld(offset, src);
vec_u8 b = vec_ld(offset + 15, src);
return vec_perm(a, b, perm_vec);
}
#else
#define unaligned_load(a,b) VEC_LD(a,b)
#define load_with_perm_vec(a,b,c) VEC_LD(a,b)
#endif
/**
* loads vector known misalignment
* @param perm_vec the align permute vector to combine the two loads from lvsl
*/
#define vec_unaligned_load(b) VEC_LD(0, b)
#if HAVE_BIGENDIAN == 1
#define VEC_MERGEH(a, b) vec_mergeh(a, b)
#define VEC_MERGEL(a, b) vec_mergel(a, b)
#else
#define VEC_MERGEH(a, b) vec_mergeh(b, a)
#define VEC_MERGEL(a, b) vec_mergel(b, a)
#endif
#if HAVE_BIGENDIAN == 1
#define VEC_ST(a,b,c) vec_st(a,b,c)
#else
#define VEC_ST(a,b,c) vec_vsx_st(a,b,c)
#endif
#if HAVE_BIGENDIAN == 1
#define VEC_SPLAT16(a,b) vec_splat((vec_s16)(a), b)
#else
#define VEC_SPLAT16(a,b) vec_splat((vec_s16)(vec_perm(a, a, vcswapi2s(0,1,2,3))), b)
#endif
#if HAVE_BIGENDIAN == 1
#define VEC_SLD16(a,b,c) vec_sld(a, b, c)
#else
#define VEC_SLD16(a,b,c) vec_sld(b, a, c)
#endif
#endif /* HAVE_ALTIVEC */
#if HAVE_VSX == 1
#if HAVE_BIGENDIAN == 1
#define vsx_ld_u8_s16(off, p) \
((vec_s16)vec_mergeh((vec_u8)vec_splat_u8(0), \
(vec_u8)vec_vsx_ld((off), (p))))
#else
#define vsx_ld_u8_s16(off, p) \
((vec_s16)vec_mergeh((vec_u8)vec_vsx_ld((off), (p)), \
(vec_u8)vec_splat_u8(0)))
#endif /* HAVE_BIGENDIAN */
#endif /* HAVE_VSX */
#endif /* AVUTIL_PPC_UTIL_ALTIVEC_H */
+11 -6
View File
@@ -3169,6 +3169,15 @@ nsCookieService::SetCookieInternal(nsIURI *aHostURI,
COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, savedCookieHeader, "invalid name character");
return newCookie;
}
// RFC 6265 *explicitly* forbids nameless cookies (5.2 step 5)
// Note: we ignore RFC 6265 (bis)'s conflicting stipulation and treat equal-less cookies
// as value-less cookies, not nameless ones.
// This aligns with webkit/Safari and avoids serious sec issues like CVE-2025-8037.
if (cookieAttributes.name.IsEmpty()) {
COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, savedCookieHeader, "nameless cookies are not allowed");
return newCookie;
}
// domain & path checks
if (!CheckDomain(cookieAttributes, aHostURI, aKey.mBaseDomain, aRequireHostMatch)) {
@@ -3618,15 +3627,11 @@ nsCookieService::ParseAttributes(nsDependentCString &aCookieHeader,
// extract cookie <NAME> & <VALUE> (first attribute), and copy the strings.
// if we find multiple cookies, return for processing
// note: if there's no '=', we assume token is <VALUE>. this is required by
// some sites (see bug 169091).
// XXX fix the parser to parse according to <VALUE> grammar for this case
// note: if there's no '=', we assume token is <NAME>.
newCookie = GetTokenValue(cookieStart, cookieEnd, tokenString, tokenValue, equalsFound);
aCookieAttributes.name = tokenString;
if (equalsFound) {
aCookieAttributes.name = tokenString;
aCookieAttributes.value = tokenValue;
} else {
aCookieAttributes.value = tokenString;
}
// extract remaining attributes
+4 -19
View File
@@ -3301,25 +3301,10 @@ dnl ========================================================
dnl = FFmpeg's ffvpx configuration
dnl ========================================================
MOZ_FFVPX=
MOZ_FFVPX=1
dnl Build ffvpx on 32-bit Windows and all supported 64-bit platforms.
dnl 32-bit *nix has performance issues due to not supporting assembly decoder.
case "$OS_ARCH:$CPU_ARCH" in
WINNT:x86)
MOZ_FFVPX=1
;;
*:x86_64)
MOZ_FFVPX=1
;;
*:aarch64)
MOZ_FFVPX=1
;;
*:arm*)
MOZ_FFVPX=1
;;
esac
dnl Build ffvpx on 32-bit Windows, 32-bit ARM, and all supported 64-bit platforms.
dnl 32-bit x86 *nix has performance issues due to not supporting assembly decoder.
dnl Detect if we can use yasm to enable FFmpeg's ffvpx assembly decoder.
@@ -3354,7 +3339,7 @@ if test -n "$MOZ_FFVPX" -a -n "$COMPILE_ENVIRONMENT"; then
fi
;;
*)
AC_MSG_ERROR([ffvpx's assembly routines are only available for 32-bit Windows or 64-bit platforms.])
AC_MSG_WARN([ffvpx's assembly routines are only available for 32-bit Windows, 32-bit ARM, and 64-bit platforms.])
;;
esac
fi
+1
View File
@@ -79,6 +79,7 @@ gyp_vars['nspr_lib_dir'] = CONFIG['NSPR_LIB_DIR']
gyp_vars['NSS_DISABLE_AVX2'] = 1
if CONFIG['CLANG_CXX']:
gyp_vars['cc_is_clang'] = 1
gyp_vars['disable_crypto_vsx'] = 1
GYP_DIRS += ['nss']
GYP_DIRS['nss'].input = 'nss/nss.gyp'
+3
View File
@@ -3119,6 +3119,9 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
#endif
#if defined(MOZ_WIDGET_GTK)
// Set up fontconfig.
FcInit();
// setup for private colormap. Ideally we'd like to do this
// in nsAppShell::Create, but we need to get in before gtk
// has been initialized to make sure everything is running