Compare commits
16 Commits
4283a3d3f7
...
speed-limi
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e7c8bed52 | |||
| 6cf21a3698 | |||
| adcffad276 | |||
| 6e7117b177 | |||
| 8ccdb47c88 | |||
| b84c268b6e | |||
| ffa9da2f97 | |||
| 5e7911e599 | |||
| 6fcd4b37ba | |||
| 8d5903b945 | |||
| cea8926604 | |||
| e98ae2f9d1 | |||
| 531b3edcd2 | |||
| f46339c949 | |||
| 21f71cbc37 | |||
| 9d5c838fe3 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,8 @@ prebuilt
|
|||||||
system/clearpilot/dev/on_start_brian.sh
|
system/clearpilot/dev/on_start_brian.sh
|
||||||
system/clearpilot/dev/id_rsa
|
system/clearpilot/dev/id_rsa
|
||||||
system/clearpilot/dev/id_rsa.pub
|
system/clearpilot/dev/id_rsa.pub
|
||||||
|
system/clearpilot/dev/id_ed25519
|
||||||
|
system/clearpilot/dev/id_ed25519.pub
|
||||||
venv/
|
venv/
|
||||||
.venv/
|
.venv/
|
||||||
.ci_cache
|
.ci_cache
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ chown -R comma:comma /data/openpilot
|
|||||||
|
|
||||||
### Git
|
### Git
|
||||||
|
|
||||||
- Remote: `git@git.internal.hanson.xyz:brianhansonxyz/comma.git`
|
- Remote: `git@git.hanson.xyz:brianhansonxyz/clearpilot.git`
|
||||||
- Branch: `clearpilot`
|
- Branch: `clearpilot`
|
||||||
- Large model files are tracked in git (intentional — this is a backup)
|
- Large model files are tracked in git (intentional — this is a backup)
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ export PYTHONPATH="$BASEDIR"
|
|||||||
sudo chgrp gpu /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 2>/dev/null
|
sudo chgrp gpu /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 2>/dev/null
|
||||||
sudo chmod 660 /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 2>/dev/null
|
sudo chmod 660 /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 2>/dev/null
|
||||||
|
|
||||||
|
# Preflight: create dirs git can't track
|
||||||
|
source "$BASEDIR/build_preflight.sh"
|
||||||
|
|
||||||
cd "$BASEDIR/selfdrive/manager"
|
cd "$BASEDIR/selfdrive/manager"
|
||||||
rm -f "$BASEDIR/prebuilt"
|
rm -f "$BASEDIR/prebuilt"
|
||||||
|
|
||||||
|
|||||||
11
build_preflight.sh
Normal file
11
build_preflight.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
# CLEARPILOT: build preflight — create directories and fix state that
|
||||||
|
# git cannot track but the build requires. Called by build_only.sh and
|
||||||
|
# launch_chffrplus.sh before scons runs.
|
||||||
|
|
||||||
|
BASEDIR="${BASEDIR:-/data/openpilot}"
|
||||||
|
|
||||||
|
# SConscript files write generated headers into obj/ directories at
|
||||||
|
# parse time — these must exist before scons starts.
|
||||||
|
mkdir -p "$BASEDIR/body/board/obj"
|
||||||
|
mkdir -p "$BASEDIR/panda/board/obj"
|
||||||
@@ -217,6 +217,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
|
|
||||||
// FrogPilot parameters
|
// FrogPilot parameters
|
||||||
{"AccelerationPath", PERSISTENT},
|
{"AccelerationPath", PERSISTENT},
|
||||||
|
{"BenchCruiseActive", CLEAR_ON_MANAGER_START},
|
||||||
{"BenchCruiseSpeed", CLEAR_ON_MANAGER_START},
|
{"BenchCruiseSpeed", CLEAR_ON_MANAGER_START},
|
||||||
{"ClpUiState", CLEAR_ON_MANAGER_START},
|
{"ClpUiState", CLEAR_ON_MANAGER_START},
|
||||||
{"BenchEngaged", CLEAR_ON_MANAGER_START},
|
{"BenchEngaged", CLEAR_ON_MANAGER_START},
|
||||||
@@ -250,7 +251,17 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
|
|
||||||
{"CarSpeedLimitWarning", PERSISTENT},
|
{"CarSpeedLimitWarning", PERSISTENT},
|
||||||
{"CarSpeedLimitLiteral", PERSISTENT},
|
{"CarSpeedLimitLiteral", PERSISTENT},
|
||||||
|
{"CarIsMetric", PERSISTENT},
|
||||||
|
|
||||||
|
{"ClearpilotSpeedDisplay", PERSISTENT},
|
||||||
|
{"ClearpilotSpeedLimitDisplay", PERSISTENT},
|
||||||
|
{"ClearpilotHasSpeed", PERSISTENT},
|
||||||
|
{"ClearpilotIsMetric", PERSISTENT},
|
||||||
|
{"ClearpilotSpeedUnit", PERSISTENT},
|
||||||
|
{"ClearpilotCruiseWarning", PERSISTENT},
|
||||||
|
{"ClearpilotCruiseWarningSpeed", PERSISTENT},
|
||||||
|
{"ClearpilotPlayDing", PERSISTENT},
|
||||||
|
|
||||||
// {"SpeedLimitLatDesired", PERSISTENT},
|
// {"SpeedLimitLatDesired", PERSISTENT},
|
||||||
// {"SpeedLimitVTSC", PERSISTENT},
|
// {"SpeedLimitVTSC", PERSISTENT},
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ function launch {
|
|||||||
# write tmux scrollback to a file
|
# write tmux scrollback to a file
|
||||||
tmux capture-pane -pq -S-1000 > /tmp/launch_log
|
tmux capture-pane -pq -S-1000 > /tmp/launch_log
|
||||||
|
|
||||||
|
# Preflight: create dirs git can't track
|
||||||
|
source "$DIR/build_preflight.sh"
|
||||||
|
|
||||||
# start manager
|
# start manager
|
||||||
cd selfdrive/manager
|
cd selfdrive/manager
|
||||||
if [ ! -f $DIR/prebuilt ]; then
|
if [ ! -f $DIR/prebuilt ]; then
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ def main():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
cloudlog.info("starting athena daemon")
|
cloudlog.info("starting athena daemon")
|
||||||
proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad', 'athenad'))
|
from openpilot.selfdrive.manager.process import _log_dir
|
||||||
|
log_path = _log_dir + "/athenad.log"
|
||||||
|
proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad', 'athenad', log_path))
|
||||||
proc.start()
|
proc.start()
|
||||||
proc.join()
|
proc.join()
|
||||||
cloudlog.event("athenad exited", exitcode=proc.exitcode)
|
cloudlog.event("athenad exited", exitcode=proc.exitcode)
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ class CarState(CarStateBase):
|
|||||||
|
|
||||||
# self.params_memory.put_int("CarSpeedLimitLiteral", self.calculate_speed_limit(cp, cp_cam))
|
# self.params_memory.put_int("CarSpeedLimitLiteral", self.calculate_speed_limit(cp, cp_cam))
|
||||||
self.params_memory.put_float("CarSpeedLimit", self.calculate_speed_limit(cp, cp_cam) * speed_conv)
|
self.params_memory.put_float("CarSpeedLimit", self.calculate_speed_limit(cp, cp_cam) * speed_conv)
|
||||||
|
self.params_memory.put("CarIsMetric", "1" if self.is_metric else "0")
|
||||||
self.params_memory.put_float("CarCruiseDisplayActual", cp_cruise.vl["SCC11"]["VSetDis"])
|
self.params_memory.put_float("CarCruiseDisplayActual", cp_cruise.vl["SCC11"]["VSetDis"])
|
||||||
|
|
||||||
|
|
||||||
@@ -420,6 +421,7 @@ class CarState(CarStateBase):
|
|||||||
# print(self.calculate_speed_limit(cp, cp_cam))
|
# print(self.calculate_speed_limit(cp, cp_cam))
|
||||||
# self.params_memory.put_float("CarSpeedLimitLiteral", self.calculate_speed_limit(cp, cp_cam))
|
# self.params_memory.put_float("CarSpeedLimitLiteral", self.calculate_speed_limit(cp, cp_cam))
|
||||||
self.params_memory.put_float("CarSpeedLimit", self.calculate_speed_limit(cp, cp_cam) * speed_factor)
|
self.params_memory.put_float("CarSpeedLimit", self.calculate_speed_limit(cp, cp_cam) * speed_factor)
|
||||||
|
self.params_memory.put("CarIsMetric", "1" if self.is_metric else "0")
|
||||||
|
|
||||||
# CLEARPILOT: telemetry logging — disabled, re-enable when needed
|
# CLEARPILOT: telemetry logging — disabled, re-enable when needed
|
||||||
# speed_limit_bus = cp if self.CP.flags & HyundaiFlags.CANFD_HDA2 else cp_cam
|
# speed_limit_bus = cp if self.CP.flags & HyundaiFlags.CANFD_HDA2 else cp_cam
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ Usage:
|
|||||||
python3 -m selfdrive.clearpilot.bench_cmd speed 20
|
python3 -m selfdrive.clearpilot.bench_cmd speed 20
|
||||||
python3 -m selfdrive.clearpilot.bench_cmd speedlimit 45
|
python3 -m selfdrive.clearpilot.bench_cmd speedlimit 45
|
||||||
python3 -m selfdrive.clearpilot.bench_cmd cruise 55
|
python3 -m selfdrive.clearpilot.bench_cmd cruise 55
|
||||||
|
python3 -m selfdrive.clearpilot.bench_cmd cruiseactive 0|1|2 (0=disabled, 1=active, 2=paused)
|
||||||
python3 -m selfdrive.clearpilot.bench_cmd engaged 1
|
python3 -m selfdrive.clearpilot.bench_cmd engaged 1
|
||||||
|
python3 -m selfdrive.clearpilot.bench_cmd ding (trigger speed limit ding sound)
|
||||||
python3 -m selfdrive.clearpilot.bench_cmd debugbutton (simulate LKAS debug button press)
|
python3 -m selfdrive.clearpilot.bench_cmd debugbutton (simulate LKAS debug button press)
|
||||||
python3 -m selfdrive.clearpilot.bench_cmd dump
|
python3 -m selfdrive.clearpilot.bench_cmd dump
|
||||||
python3 -m selfdrive.clearpilot.bench_cmd wait_ready
|
python3 -m selfdrive.clearpilot.bench_cmd wait_ready
|
||||||
@@ -89,6 +91,7 @@ def main():
|
|||||||
"speed": "BenchSpeed",
|
"speed": "BenchSpeed",
|
||||||
"speedlimit": "BenchSpeedLimit",
|
"speedlimit": "BenchSpeedLimit",
|
||||||
"cruise": "BenchCruiseSpeed",
|
"cruise": "BenchCruiseSpeed",
|
||||||
|
"cruiseactive": "BenchCruiseActive",
|
||||||
"engaged": "BenchEngaged",
|
"engaged": "BenchEngaged",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +109,10 @@ def main():
|
|||||||
elif cmd == "wait_ready":
|
elif cmd == "wait_ready":
|
||||||
wait_ready()
|
wait_ready()
|
||||||
|
|
||||||
|
elif cmd == "ding":
|
||||||
|
params.put("ClearpilotPlayDing", "1")
|
||||||
|
print("Ding triggered")
|
||||||
|
|
||||||
elif cmd == "debugbutton":
|
elif cmd == "debugbutton":
|
||||||
# Simulate LKAS debug button — same state machine as controlsd.clearpilot_state_control()
|
# Simulate LKAS debug button — same state machine as controlsd.clearpilot_state_control()
|
||||||
current = params.get_int("ScreenDisplayMode")
|
current = params.get_int("ScreenDisplayMode")
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ configurable vehicle state. Control values via params in /dev/shm/params:
|
|||||||
BenchSpeed - vehicle speed in mph (default: 0)
|
BenchSpeed - vehicle speed in mph (default: 0)
|
||||||
BenchSpeedLimit - speed limit in mph (default: 0, 0=hidden)
|
BenchSpeedLimit - speed limit in mph (default: 0, 0=hidden)
|
||||||
BenchCruiseSpeed - cruise set speed in mph (default: 0, 0=not set)
|
BenchCruiseSpeed - cruise set speed in mph (default: 0, 0=not set)
|
||||||
|
BenchCruiseActive - 0=disabled, 1=active, 2=paused/standstill (default: 0)
|
||||||
BenchGear - P, D, R, N (default: P)
|
BenchGear - P, D, R, N (default: P)
|
||||||
BenchEngaged - 0 or 1, cruise engaged (default: 0)
|
BenchEngaged - 0 or 1, cruise engaged (default: 0)
|
||||||
|
|
||||||
@@ -21,8 +22,8 @@ import time
|
|||||||
import cereal.messaging as messaging
|
import cereal.messaging as messaging
|
||||||
from cereal import log, car
|
from cereal import log, car
|
||||||
from openpilot.common.params import Params
|
from openpilot.common.params import Params
|
||||||
|
from openpilot.common.conversions import Conversions as CV
|
||||||
MS_PER_MPH = 0.44704
|
from openpilot.selfdrive.clearpilot.speed_logic import SpeedState
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -33,9 +34,13 @@ def main():
|
|||||||
params_mem.put("BenchSpeed", "0")
|
params_mem.put("BenchSpeed", "0")
|
||||||
params_mem.put("BenchSpeedLimit", "0")
|
params_mem.put("BenchSpeedLimit", "0")
|
||||||
params_mem.put("BenchCruiseSpeed", "0")
|
params_mem.put("BenchCruiseSpeed", "0")
|
||||||
|
params_mem.put("BenchCruiseActive", "0")
|
||||||
params_mem.put("BenchGear", "P")
|
params_mem.put("BenchGear", "P")
|
||||||
params_mem.put("BenchEngaged", "0")
|
params_mem.put("BenchEngaged", "0")
|
||||||
|
|
||||||
|
# ClearPilot speed processing
|
||||||
|
speed_state = SpeedState()
|
||||||
|
|
||||||
# thermald handles deviceState (reads our fake pandaStates for ignition)
|
# thermald handles deviceState (reads our fake pandaStates for ignition)
|
||||||
pm = messaging.PubMaster([
|
pm = messaging.PubMaster([
|
||||||
"pandaStates", "carState", "controlsState",
|
"pandaStates", "carState", "controlsState",
|
||||||
@@ -61,11 +66,25 @@ def main():
|
|||||||
speed_limit_mph = float((params_mem.get("BenchSpeedLimit", encoding="utf-8") or "0").strip())
|
speed_limit_mph = float((params_mem.get("BenchSpeedLimit", encoding="utf-8") or "0").strip())
|
||||||
cruise_mph = float((params_mem.get("BenchCruiseSpeed", encoding="utf-8") or "0").strip())
|
cruise_mph = float((params_mem.get("BenchCruiseSpeed", encoding="utf-8") or "0").strip())
|
||||||
gear_str = (params_mem.get("BenchGear", encoding="utf-8") or "P").strip().upper()
|
gear_str = (params_mem.get("BenchGear", encoding="utf-8") or "P").strip().upper()
|
||||||
|
cruise_active_str = (params_mem.get("BenchCruiseActive", encoding="utf-8") or "0").strip()
|
||||||
engaged = (params_mem.get("BenchEngaged", encoding="utf-8") or "0").strip() == "1"
|
engaged = (params_mem.get("BenchEngaged", encoding="utf-8") or "0").strip() == "1"
|
||||||
|
|
||||||
speed_ms = speed_mph * MS_PER_MPH
|
speed_ms = speed_mph * CV.MPH_TO_MS
|
||||||
|
speed_limit_ms = speed_limit_mph * CV.MPH_TO_MS
|
||||||
|
cruise_ms = cruise_mph * CV.MPH_TO_MS
|
||||||
gear = gear_map.get(gear_str, car.CarState.GearShifter.park)
|
gear = gear_map.get(gear_str, car.CarState.GearShifter.park)
|
||||||
|
|
||||||
|
# Cruise state: 0=disabled, 1=active, 2=paused
|
||||||
|
cruise_active = cruise_active_str == "1"
|
||||||
|
cruise_standstill = cruise_active_str == "2"
|
||||||
|
|
||||||
|
# ClearPilot speed processing (~2 Hz at 10 Hz loop)
|
||||||
|
if frame % 5 == 0:
|
||||||
|
has_speed = speed_mph > 0
|
||||||
|
speed_state.update(speed_ms, has_speed, speed_limit_ms, is_metric=False,
|
||||||
|
cruise_speed_ms=cruise_ms, cruise_active=cruise_active or cruise_standstill,
|
||||||
|
cruise_standstill=cruise_standstill)
|
||||||
|
|
||||||
# pandaStates — 10 Hz (thermald reads ignition from this)
|
# pandaStates — 10 Hz (thermald reads ignition from this)
|
||||||
if frame % 1 == 0:
|
if frame % 1 == 0:
|
||||||
dat = messaging.new_message("pandaStates", 1)
|
dat = messaging.new_message("pandaStates", 1)
|
||||||
@@ -82,7 +101,7 @@ def main():
|
|||||||
cs.standstill = speed_ms < 0.1
|
cs.standstill = speed_ms < 0.1
|
||||||
cs.cruiseState.available = True
|
cs.cruiseState.available = True
|
||||||
cs.cruiseState.enabled = engaged
|
cs.cruiseState.enabled = engaged
|
||||||
cs.cruiseState.speed = cruise_mph * MS_PER_MPH if cruise_mph > 0 else 0
|
cs.cruiseState.speed = cruise_mph * CV.MPH_TO_MS if cruise_mph > 0 else 0
|
||||||
pm.send("carState", dat)
|
pm.send("carState", dat)
|
||||||
|
|
||||||
# controlsState — 10 Hz
|
# controlsState — 10 Hz
|
||||||
|
|||||||
Binary file not shown.
BIN
selfdrive/clearpilot/sounds/ding.wav
Normal file
BIN
selfdrive/clearpilot/sounds/ding.wav
Normal file
Binary file not shown.
90
selfdrive/clearpilot/speed_logic.py
Normal file
90
selfdrive/clearpilot/speed_logic.py
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
"""
|
||||||
|
ClearPilot speed processing module.
|
||||||
|
|
||||||
|
Shared logic for converting raw speed and speed limit data into display-ready
|
||||||
|
values. Called from controlsd (live mode) and bench_onroad (bench mode).
|
||||||
|
|
||||||
|
Reads raw inputs, converts to display units (mph or kph based on car's CAN
|
||||||
|
unit setting), detects speed limit changes, and writes results to params_memory
|
||||||
|
for the onroad UI to read.
|
||||||
|
"""
|
||||||
|
import math
|
||||||
|
import time
|
||||||
|
from openpilot.common.params import Params
|
||||||
|
from openpilot.common.conversions import Conversions as CV
|
||||||
|
|
||||||
|
|
||||||
|
class SpeedState:
|
||||||
|
def __init__(self):
|
||||||
|
self.params_memory = Params("/dev/shm/params")
|
||||||
|
self.prev_speed_limit = 0
|
||||||
|
|
||||||
|
# Ding state tracking
|
||||||
|
self.last_ding_time = 0.0
|
||||||
|
self.prev_warning = ""
|
||||||
|
self.prev_warning_speed_limit = 0
|
||||||
|
|
||||||
|
def update(self, speed_ms: float, has_speed: bool, speed_limit_ms: float, is_metric: bool,
|
||||||
|
cruise_speed_ms: float = 0.0, cruise_active: bool = False, cruise_standstill: bool = False):
|
||||||
|
"""
|
||||||
|
Convert raw m/s values to display-ready strings and write to params_memory.
|
||||||
|
"""
|
||||||
|
now = time.monotonic()
|
||||||
|
|
||||||
|
if is_metric:
|
||||||
|
speed_display = speed_ms * CV.MS_TO_KPH
|
||||||
|
speed_limit_display = speed_limit_ms * CV.MS_TO_KPH
|
||||||
|
cruise_display = cruise_speed_ms * CV.MS_TO_KPH
|
||||||
|
unit = "km/h"
|
||||||
|
else:
|
||||||
|
speed_display = speed_ms * CV.MS_TO_MPH
|
||||||
|
speed_limit_display = speed_limit_ms * CV.MS_TO_MPH
|
||||||
|
cruise_display = cruise_speed_ms * CV.MS_TO_MPH
|
||||||
|
unit = "mph"
|
||||||
|
|
||||||
|
speed_int = int(math.floor(speed_display))
|
||||||
|
speed_limit_int = int(round(speed_limit_display))
|
||||||
|
cruise_int = int(round(cruise_display))
|
||||||
|
|
||||||
|
self.prev_speed_limit = speed_limit_int
|
||||||
|
|
||||||
|
# Write display-ready values to params_memory
|
||||||
|
self.params_memory.put("ClearpilotHasSpeed", "1" if has_speed and speed_int > 0 else "0")
|
||||||
|
self.params_memory.put("ClearpilotSpeedDisplay", str(speed_int) if has_speed and speed_int > 0 else "")
|
||||||
|
self.params_memory.put("ClearpilotSpeedLimitDisplay", str(speed_limit_int) if speed_limit_int > 0 else "0")
|
||||||
|
self.params_memory.put("ClearpilotSpeedUnit", unit)
|
||||||
|
self.params_memory.put("ClearpilotIsMetric", "1" if is_metric else "0")
|
||||||
|
|
||||||
|
# Cruise warning logic
|
||||||
|
warning = ""
|
||||||
|
warning_speed = ""
|
||||||
|
cruise_engaged = cruise_active and not cruise_standstill
|
||||||
|
|
||||||
|
if speed_limit_int >= 20 and cruise_engaged and cruise_int > 0:
|
||||||
|
over_threshold = 10 if speed_limit_int >= 50 else 7
|
||||||
|
if cruise_int >= speed_limit_int + over_threshold:
|
||||||
|
warning = "over"
|
||||||
|
warning_speed = str(cruise_int)
|
||||||
|
elif cruise_int <= speed_limit_int - 5:
|
||||||
|
warning = "under"
|
||||||
|
warning_speed = str(cruise_int)
|
||||||
|
|
||||||
|
self.params_memory.put("ClearpilotCruiseWarning", warning)
|
||||||
|
self.params_memory.put("ClearpilotCruiseWarningSpeed", warning_speed)
|
||||||
|
|
||||||
|
# Ding logic: play when warning sign appears or speed limit changes while visible
|
||||||
|
should_ding = False
|
||||||
|
if warning:
|
||||||
|
if not self.prev_warning:
|
||||||
|
# Warning sign just appeared
|
||||||
|
should_ding = True
|
||||||
|
elif speed_limit_int != self.prev_warning_speed_limit:
|
||||||
|
# Speed limit changed while warning sign is visible
|
||||||
|
should_ding = True
|
||||||
|
|
||||||
|
if should_ding and now - self.last_ding_time >= 30:
|
||||||
|
self.params_memory.put("ClearpilotPlayDing", "1")
|
||||||
|
self.last_ding_time = now
|
||||||
|
|
||||||
|
self.prev_warning = warning
|
||||||
|
self.prev_warning_speed_limit = speed_limit_int if warning else 0
|
||||||
@@ -38,6 +38,7 @@ from openpilot.selfdrive.frogpilot.controls.lib.frogpilot_functions import CRUIS
|
|||||||
|
|
||||||
from openpilot.selfdrive.frogpilot.controls.lib.model_manager import RADARLESS_MODELS
|
from openpilot.selfdrive.frogpilot.controls.lib.model_manager import RADARLESS_MODELS
|
||||||
from openpilot.selfdrive.clearpilot.telemetry import tlog
|
from openpilot.selfdrive.clearpilot.telemetry import tlog
|
||||||
|
from openpilot.selfdrive.clearpilot.speed_logic import SpeedState
|
||||||
from openpilot.selfdrive.frogpilot.controls.lib.speed_limit_controller import SpeedLimitController
|
from openpilot.selfdrive.frogpilot.controls.lib.speed_limit_controller import SpeedLimitController
|
||||||
|
|
||||||
SOFT_DISABLE_TIME = 3 # seconds
|
SOFT_DISABLE_TIME = 3 # seconds
|
||||||
@@ -80,6 +81,10 @@ class Controls:
|
|||||||
self.params_memory.put_bool("CPTLkasButtonAction", False)
|
self.params_memory.put_bool("CPTLkasButtonAction", False)
|
||||||
self.params_memory.put_int("ScreenDisplayMode", 0)
|
self.params_memory.put_int("ScreenDisplayMode", 0)
|
||||||
|
|
||||||
|
# ClearPilot speed processing
|
||||||
|
self.speed_state = SpeedState()
|
||||||
|
self.speed_state_frame = 0
|
||||||
|
|
||||||
self.radarless_model = self.params.get("Model", encoding='utf-8') in RADARLESS_MODELS
|
self.radarless_model = self.params.get("Model", encoding='utf-8') in RADARLESS_MODELS
|
||||||
|
|
||||||
with car.CarParams.from_bytes(self.params.get("CarParams", block=True)) as msg:
|
with car.CarParams.from_bytes(self.params.get("CarParams", block=True)) as msg:
|
||||||
@@ -108,8 +113,9 @@ class Controls:
|
|||||||
self.sm = messaging.SubMaster(['deviceState', 'pandaStates', 'peripheralState', 'modelV2', 'liveCalibration',
|
self.sm = messaging.SubMaster(['deviceState', 'pandaStates', 'peripheralState', 'modelV2', 'liveCalibration',
|
||||||
'carOutput', 'driverMonitoringState', 'longitudinalPlan', 'liveLocationKalman',
|
'carOutput', 'driverMonitoringState', 'longitudinalPlan', 'liveLocationKalman',
|
||||||
'managerState', 'liveParameters', 'radarState', 'liveTorqueParameters',
|
'managerState', 'liveParameters', 'radarState', 'liveTorqueParameters',
|
||||||
'testJoystick', 'frogpilotPlan'] + self.camera_packets + self.sensor_packets,
|
'testJoystick', 'frogpilotPlan', 'gpsLocation'] + self.camera_packets + self.sensor_packets,
|
||||||
ignore_alive=ignore, ignore_avg_freq=ignore+['radarState', 'testJoystick'], ignore_valid=['testJoystick', ],
|
ignore_alive=ignore+['gpsLocation'], ignore_avg_freq=ignore+['radarState', 'testJoystick', 'gpsLocation'],
|
||||||
|
ignore_valid=['testJoystick', 'gpsLocation'],
|
||||||
frequency=int(1/DT_CTRL))
|
frequency=int(1/DT_CTRL))
|
||||||
|
|
||||||
self.joystick_mode = self.params.get_bool("JoystickDebugMode")
|
self.joystick_mode = self.params.get_bool("JoystickDebugMode")
|
||||||
@@ -198,6 +204,8 @@ class Controls:
|
|||||||
self.always_on_lateral_main = self.always_on_lateral and self.params.get_bool("AlwaysOnLateralMain")
|
self.always_on_lateral_main = self.always_on_lateral and self.params.get_bool("AlwaysOnLateralMain")
|
||||||
|
|
||||||
self.drive_added = False
|
self.drive_added = False
|
||||||
|
self.driving_gear = False
|
||||||
|
self.was_driving_gear = False
|
||||||
self.fcw_random_event_triggered = False
|
self.fcw_random_event_triggered = False
|
||||||
self.holiday_theme_alerted = False
|
self.holiday_theme_alerted = False
|
||||||
self.onroad_distance_pressed = False
|
self.onroad_distance_pressed = False
|
||||||
@@ -1257,6 +1265,12 @@ class Controls:
|
|||||||
self.events.add(EventName.clpDebug)
|
self.events.add(EventName.clpDebug)
|
||||||
|
|
||||||
def clearpilot_state_control(self, CC, CS):
|
def clearpilot_state_control(self, CC, CS):
|
||||||
|
# CLEARPILOT: auto-reset display when shifting into drive from screen-off
|
||||||
|
if self.driving_gear and not self.was_driving_gear:
|
||||||
|
if self.params_memory.get_int("ScreenDisplayMode") == 3:
|
||||||
|
self.params_memory.put_int("ScreenDisplayMode", 0)
|
||||||
|
self.was_driving_gear = self.driving_gear
|
||||||
|
|
||||||
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
|
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
|
||||||
current = self.params_memory.get_int("ScreenDisplayMode")
|
current = self.params_memory.get_int("ScreenDisplayMode")
|
||||||
|
|
||||||
@@ -1269,6 +1283,21 @@ class Controls:
|
|||||||
new_mode = 0 if current == 3 else 3
|
new_mode = 0 if current == 3 else 3
|
||||||
|
|
||||||
self.params_memory.put_int("ScreenDisplayMode", new_mode)
|
self.params_memory.put_int("ScreenDisplayMode", new_mode)
|
||||||
|
|
||||||
|
# ClearPilot speed processing (~2 Hz at 100 Hz loop)
|
||||||
|
self.speed_state_frame += 1
|
||||||
|
if self.speed_state_frame % 50 == 0:
|
||||||
|
gps = self.sm['gpsLocation']
|
||||||
|
has_gps = self.sm.valid['gpsLocation'] and gps.hasFix
|
||||||
|
speed_ms = gps.speed if has_gps else 0.0
|
||||||
|
speed_limit_ms = self.params_memory.get_float("CarSpeedLimit")
|
||||||
|
is_metric = (self.params_memory.get("CarIsMetric", encoding="utf-8") or "0") == "1"
|
||||||
|
cruise_speed_ms = CS.cruiseState.speed
|
||||||
|
cruise_active = CS.cruiseState.enabled
|
||||||
|
cruise_standstill = CS.cruiseState.standstill
|
||||||
|
self.speed_state.update(speed_ms, has_gps, speed_limit_ms, is_metric,
|
||||||
|
cruise_speed_ms, cruise_active, cruise_standstill)
|
||||||
|
|
||||||
return CC
|
return CC
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -89,6 +89,15 @@ def manager_init(frogpilot_functions) -> None:
|
|||||||
params_memory.put("VpnEnabled", "1")
|
params_memory.put("VpnEnabled", "1")
|
||||||
params_memory.put("ModelStandby", "0")
|
params_memory.put("ModelStandby", "0")
|
||||||
params_memory.put("ModelStandbyTs", "0")
|
params_memory.put("ModelStandbyTs", "0")
|
||||||
|
params_memory.put("CarIsMetric", "0")
|
||||||
|
params_memory.put("ClearpilotSpeedDisplay", "")
|
||||||
|
params_memory.put("ClearpilotSpeedLimitDisplay", "0")
|
||||||
|
params_memory.put("ClearpilotHasSpeed", "0")
|
||||||
|
params_memory.put("ClearpilotIsMetric", "0")
|
||||||
|
params_memory.put("ClearpilotSpeedUnit", "mph")
|
||||||
|
params_memory.put("ClearpilotCruiseWarning", "")
|
||||||
|
params_memory.put("ClearpilotCruiseWarningSpeed", "")
|
||||||
|
params_memory.put("ClearpilotPlayDing", "0")
|
||||||
params.clear_all(ParamKeyType.CLEAR_ON_ONROAD_TRANSITION)
|
params.clear_all(ParamKeyType.CLEAR_ON_ONROAD_TRANSITION)
|
||||||
params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION)
|
params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION)
|
||||||
if is_release_branch():
|
if is_release_branch():
|
||||||
|
|||||||
@@ -248,7 +248,8 @@ def main(demo=False):
|
|||||||
lat_active = sm['carControl'].latActive
|
lat_active = sm['carControl'].latActive
|
||||||
lane_changing = params_memory.get_bool("no_lat_lane_change")
|
lane_changing = params_memory.get_bool("no_lat_lane_change")
|
||||||
standstill = sm['carState'].standstill
|
standstill = sm['carState'].standstill
|
||||||
full_rate = lat_active or lane_changing
|
calibrating = sm['liveCalibration'].calStatus != log.LiveCalibrationData.Status.calibrated
|
||||||
|
full_rate = lat_active or lane_changing or calibrating
|
||||||
|
|
||||||
# Standby transitions (standstill only)
|
# Standby transitions (standstill only)
|
||||||
should_standby = standstill and not full_rate
|
should_standby = standstill and not full_rate
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
from openpilot.common.realtime import DT_TRML
|
from openpilot.common.realtime import DT_TRML
|
||||||
@@ -6,6 +7,8 @@ from openpilot.common.numpy_fast import interp
|
|||||||
from openpilot.common.swaglog import cloudlog
|
from openpilot.common.swaglog import cloudlog
|
||||||
from openpilot.selfdrive.controls.lib.pid import PIDController
|
from openpilot.selfdrive.controls.lib.pid import PIDController
|
||||||
|
|
||||||
|
BENCH_MODE = os.environ.get("BENCH_MODE") == "1"
|
||||||
|
|
||||||
class BaseFanController(ABC):
|
class BaseFanController(ABC):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def update(self, cur_temp: float, ignition: bool, standstill: bool = False) -> int:
|
def update(self, cur_temp: float, ignition: bool, standstill: bool = False) -> int:
|
||||||
@@ -21,10 +24,14 @@ class TiciFanController(BaseFanController):
|
|||||||
self.controller = PIDController(k_p=0, k_i=4e-3, k_f=1, rate=(1 / DT_TRML))
|
self.controller = PIDController(k_p=0, k_i=4e-3, k_f=1, rate=(1 / DT_TRML))
|
||||||
|
|
||||||
def update(self, cur_temp: float, ignition: bool, standstill: bool = False) -> int:
|
def update(self, cur_temp: float, ignition: bool, standstill: bool = False) -> int:
|
||||||
# CLEARPILOT: at standstill below 74°C, clamp to 0-10% (near silent)
|
# CLEARPILOT: bench mode always uses normal onroad fan range (30-100%)
|
||||||
|
if BENCH_MODE and ignition:
|
||||||
|
self.controller.neg_limit = -100
|
||||||
|
self.controller.pos_limit = -30
|
||||||
|
# CLEARPILOT: at standstill below 74°C, clamp to 0-30% (quiet)
|
||||||
# at standstill above 74°C, allow full 0-100% range
|
# at standstill above 74°C, allow full 0-100% range
|
||||||
if ignition and standstill and cur_temp < 74:
|
elif ignition and standstill and cur_temp < 74:
|
||||||
self.controller.neg_limit = -10
|
self.controller.neg_limit = -30
|
||||||
self.controller.pos_limit = 0
|
self.controller.pos_limit = 0
|
||||||
elif ignition and standstill:
|
elif ignition and standstill:
|
||||||
self.controller.neg_limit = -100
|
self.controller.neg_limit = -100
|
||||||
|
|||||||
@@ -77,20 +77,11 @@ qt_env.Program("_text", ["qt/text.cc"], LIBS=qt_libs)
|
|||||||
qt_env.Program("_spinner", ["qt/spinner.cc"], LIBS=qt_libs)
|
qt_env.Program("_spinner", ["qt/spinner.cc"], LIBS=qt_libs)
|
||||||
|
|
||||||
|
|
||||||
# Clearpilot
|
# Clearpilot tools
|
||||||
# Add qtwebengine to build paths
|
|
||||||
qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebEngine"]
|
|
||||||
qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebEngineCore"]
|
|
||||||
qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebEngineWidgets"]
|
|
||||||
qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebChannel"]
|
|
||||||
qt_webengine_libs = qt_libs + ['Qt5WebEngineWidgets']
|
|
||||||
|
|
||||||
# Create clearpilot tools
|
|
||||||
qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_shell", ["/data/openpilot/system/clearpilot/tools/qt_shell.cc"], LIBS=qt_libs)
|
qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_shell", ["/data/openpilot/system/clearpilot/tools/qt_shell.cc"], LIBS=qt_libs)
|
||||||
# qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_webview", ["/data/openpilot/system/clearpilot/tools/qt_webview.cc"], LIBS=qt_webengine_libs)
|
|
||||||
|
|
||||||
# build main UI
|
# build main UI
|
||||||
qt_env.Program("ui", qt_src + [asset_obj], LIBS=qt_webengine_libs)
|
qt_env.Program("ui", qt_src + [asset_obj], LIBS=qt_libs)
|
||||||
if GetOption('extras'):
|
if GetOption('extras'):
|
||||||
qt_src.remove("main.cc") # replaced by test_runner
|
qt_src.remove("main.cc") # replaced by test_runner
|
||||||
qt_env.Program('tests/test_translations', [asset_obj, 'tests/test_runner.cc', 'tests/test_translations.cc'] + qt_src, LIBS=qt_libs)
|
qt_env.Program('tests/test_translations', [asset_obj, 'tests/test_runner.cc', 'tests/test_translations.cc'] + qt_src, LIBS=qt_libs)
|
||||||
|
|||||||
@@ -355,14 +355,15 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
|
|||||||
setSpeed *= KM_TO_MILE;
|
setSpeed *= KM_TO_MILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CLEARPILOT: use GPS speed if available, hide speed display if no GPS fix
|
// CLEARPILOT: read speed and speed limit from params (written by speed_logic.py ~2Hz)
|
||||||
has_gps_speed = sm.valid("gpsLocation") && sm["gpsLocation"].getGpsLocation().getHasFix();
|
clpParamFrame++;
|
||||||
if (has_gps_speed) {
|
if (clpParamFrame % 10 == 0) { // ~2Hz at 20Hz UI update rate
|
||||||
float gps_speed_ms = sm["gpsLocation"].getGpsLocation().getSpeed();
|
clpHasSpeed = paramsMemory.get("ClearpilotHasSpeed") == "1";
|
||||||
speed = std::max<float>(0.0, gps_speed_ms);
|
clpSpeedDisplay = QString::fromStdString(paramsMemory.get("ClearpilotSpeedDisplay"));
|
||||||
speed *= s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH;
|
clpSpeedLimitDisplay = QString::fromStdString(paramsMemory.get("ClearpilotSpeedLimitDisplay"));
|
||||||
} else {
|
clpSpeedUnit = QString::fromStdString(paramsMemory.get("ClearpilotSpeedUnit"));
|
||||||
speed = 0.0;
|
clpCruiseWarning = QString::fromStdString(paramsMemory.get("ClearpilotCruiseWarning"));
|
||||||
|
clpCruiseWarningSpeed = QString::fromStdString(paramsMemory.get("ClearpilotCruiseWarningSpeed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// auto speed_limit_sign = nav_instruction.getSpeedLimitSign();
|
// auto speed_limit_sign = nav_instruction.getSpeedLimitSign();
|
||||||
@@ -431,7 +432,7 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
|||||||
|
|
||||||
// QString speedLimitStr = (speedLimit > 1) ? QString::number(std::nearbyint(speedLimit)) : "–";
|
// QString speedLimitStr = (speedLimit > 1) ? QString::number(std::nearbyint(speedLimit)) : "–";
|
||||||
// QString speedLimitOffsetStr = slcSpeedLimitOffset == 0 ? "–" : QString::number(slcSpeedLimitOffset, 'f', 0).prepend(slcSpeedLimitOffset > 0 ? "+" : "");
|
// QString speedLimitOffsetStr = slcSpeedLimitOffset == 0 ? "–" : QString::number(slcSpeedLimitOffset, 'f', 0).prepend(slcSpeedLimitOffset > 0 ? "+" : "");
|
||||||
QString speedStr = QString::number(std::nearbyint(speed));
|
// QString speedStr = QString::number(std::nearbyint(speed));
|
||||||
QString setSpeedStr = is_cruise_set ? QString::number(std::nearbyint(setSpeed - cruiseAdjustment)) : "–";
|
QString setSpeedStr = is_cruise_set ? QString::number(std::nearbyint(setSpeed - cruiseAdjustment)) : "–";
|
||||||
|
|
||||||
p.restore();
|
p.restore();
|
||||||
@@ -455,14 +456,18 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
|||||||
// Todo: lead speed
|
// Todo: lead speed
|
||||||
// Todo: Experimental speed
|
// Todo: Experimental speed
|
||||||
|
|
||||||
// CLEARPILOT: show GPS speed, hide when no fix
|
// CLEARPILOT: show speed from speed_logic params, hide when no speed or speed=0
|
||||||
if (has_gps_speed && !scene.hide_speed) {
|
if (clpHasSpeed && !clpSpeedDisplay.isEmpty() && !scene.hide_speed) {
|
||||||
p.setFont(InterFont(140, QFont::Bold));
|
p.setFont(InterFont(140, QFont::Bold));
|
||||||
drawText(p, rect().center().x(), 210, speedStr);
|
drawText(p, rect().center().x(), 210, clpSpeedDisplay);
|
||||||
p.setFont(InterFont(50));
|
p.setFont(InterFont(50));
|
||||||
drawText(p, rect().center().x(), 290, speedUnit, 200);
|
drawText(p, rect().center().x(), 290, clpSpeedUnit, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CLEARPILOT: speed limit sign in lower-left, cruise warning above it
|
||||||
|
drawSpeedLimitSign(p);
|
||||||
|
drawCruiseWarningSign(p);
|
||||||
|
|
||||||
// Draw FrogPilot widgets
|
// Draw FrogPilot widgets
|
||||||
paintFrogPilotWidgets(p);
|
paintFrogPilotWidgets(p);
|
||||||
}
|
}
|
||||||
@@ -556,6 +561,164 @@ void AnnotatedCameraWidget::drawSpeedWidget(QPainter &p, int x, int y, const QSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AnnotatedCameraWidget::drawSpeedLimitSign(QPainter &p) {
|
||||||
|
// Hide when no speed limit or speed limit is 0
|
||||||
|
if (clpSpeedLimitDisplay.isEmpty() || clpSpeedLimitDisplay == "0") return;
|
||||||
|
|
||||||
|
p.save();
|
||||||
|
|
||||||
|
const int signW = 189;
|
||||||
|
const int signH = 239;
|
||||||
|
const int margin = 20;
|
||||||
|
const int borderW = 6;
|
||||||
|
const int innerBorderW = 4;
|
||||||
|
const int innerMargin = 10;
|
||||||
|
const int cornerR = 15;
|
||||||
|
|
||||||
|
// Position: 20px from lower-left corner
|
||||||
|
QRect signRect(margin, height() - signH - margin, signW, signH);
|
||||||
|
|
||||||
|
if (nightriderMode) {
|
||||||
|
// Nightrider: black background, light gray-blue border and text
|
||||||
|
QColor borderColor(160, 180, 210);
|
||||||
|
QColor textColor(160, 180, 210);
|
||||||
|
|
||||||
|
// Outer border
|
||||||
|
p.setPen(QPen(borderColor, borderW));
|
||||||
|
p.setBrush(QColor(0, 0, 0, 220));
|
||||||
|
p.drawRoundedRect(signRect, cornerR, cornerR);
|
||||||
|
|
||||||
|
// Inner border
|
||||||
|
QRect innerRect = signRect.adjusted(innerMargin, innerMargin, -innerMargin, -innerMargin);
|
||||||
|
p.setPen(QPen(borderColor, innerBorderW));
|
||||||
|
p.setBrush(Qt::NoBrush);
|
||||||
|
p.drawRoundedRect(innerRect, cornerR - 4, cornerR - 4);
|
||||||
|
|
||||||
|
// "SPEED" text
|
||||||
|
p.setPen(textColor);
|
||||||
|
p.setFont(InterFont(30, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 15, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "SPEED");
|
||||||
|
|
||||||
|
// "LIMIT" text
|
||||||
|
p.setFont(InterFont(30, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 48, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "LIMIT");
|
||||||
|
|
||||||
|
// Speed limit number
|
||||||
|
p.setFont(InterFont(90, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 42, 0, 0), Qt::AlignCenter, clpSpeedLimitDisplay);
|
||||||
|
} else {
|
||||||
|
// Normal: white background, black border and text
|
||||||
|
QColor borderColor(0, 0, 0);
|
||||||
|
QColor textColor(0, 0, 0);
|
||||||
|
|
||||||
|
// Outer border
|
||||||
|
p.setPen(QPen(borderColor, borderW));
|
||||||
|
p.setBrush(QColor(255, 255, 255, 240));
|
||||||
|
p.drawRoundedRect(signRect, cornerR, cornerR);
|
||||||
|
|
||||||
|
// Inner border
|
||||||
|
QRect innerRect = signRect.adjusted(innerMargin, innerMargin, -innerMargin, -innerMargin);
|
||||||
|
p.setPen(QPen(borderColor, innerBorderW));
|
||||||
|
p.setBrush(Qt::NoBrush);
|
||||||
|
p.drawRoundedRect(innerRect, cornerR - 4, cornerR - 4);
|
||||||
|
|
||||||
|
// "SPEED" text
|
||||||
|
p.setPen(textColor);
|
||||||
|
p.setFont(InterFont(30, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 15, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "SPEED");
|
||||||
|
|
||||||
|
// "LIMIT" text
|
||||||
|
p.setFont(InterFont(30, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 48, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "LIMIT");
|
||||||
|
|
||||||
|
// Speed limit number
|
||||||
|
p.setFont(InterFont(90, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 42, 0, 0), Qt::AlignCenter, clpSpeedLimitDisplay);
|
||||||
|
}
|
||||||
|
|
||||||
|
p.restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnnotatedCameraWidget::drawCruiseWarningSign(QPainter &p) {
|
||||||
|
// Only show when there's an active warning and the speed limit sign is visible
|
||||||
|
if (clpCruiseWarning.isEmpty() || clpCruiseWarningSpeed.isEmpty()) return;
|
||||||
|
if (clpSpeedLimitDisplay.isEmpty() || clpSpeedLimitDisplay == "0") return;
|
||||||
|
|
||||||
|
bool isOver = (clpCruiseWarning == "over");
|
||||||
|
if (!isOver && clpCruiseWarning != "under") return;
|
||||||
|
|
||||||
|
p.save();
|
||||||
|
|
||||||
|
// Same dimensions as speed limit sign
|
||||||
|
const int signW = 189;
|
||||||
|
const int signH = 239;
|
||||||
|
const int margin = 20;
|
||||||
|
const int borderW = 6;
|
||||||
|
const int innerBorderW = 4;
|
||||||
|
const int innerMargin = 10;
|
||||||
|
const int cornerR = 15;
|
||||||
|
const int gap = 20;
|
||||||
|
|
||||||
|
// Position: directly above the speed limit sign
|
||||||
|
int speedLimitY = height() - signH - margin;
|
||||||
|
QRect signRect(margin, speedLimitY - signH - gap, signW, signH);
|
||||||
|
|
||||||
|
if (nightriderMode) {
|
||||||
|
// Nightrider: black background with colored border/text
|
||||||
|
QColor accentColor = isOver ? QColor(220, 50, 50) : QColor(50, 180, 80);
|
||||||
|
|
||||||
|
p.setPen(QPen(accentColor, borderW));
|
||||||
|
p.setBrush(QColor(0, 0, 0, 220));
|
||||||
|
p.drawRoundedRect(signRect, cornerR, cornerR);
|
||||||
|
|
||||||
|
QRect innerRect = signRect.adjusted(innerMargin, innerMargin, -innerMargin, -innerMargin);
|
||||||
|
p.setPen(QPen(accentColor, innerBorderW));
|
||||||
|
p.setBrush(Qt::NoBrush);
|
||||||
|
p.drawRoundedRect(innerRect, cornerR - 4, cornerR - 4);
|
||||||
|
|
||||||
|
// "CRUISE" text
|
||||||
|
p.setPen(accentColor);
|
||||||
|
p.setFont(InterFont(26, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 15, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "CRUISE");
|
||||||
|
|
||||||
|
// "SET" text
|
||||||
|
p.setFont(InterFont(26, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 45, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "SET");
|
||||||
|
|
||||||
|
// Cruise speed number
|
||||||
|
p.setFont(InterFont(90, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 42, 0, 0), Qt::AlignCenter, clpCruiseWarningSpeed);
|
||||||
|
} else {
|
||||||
|
// Normal: colored background with white border/text
|
||||||
|
QColor bgColor = isOver ? QColor(200, 30, 30, 240) : QColor(40, 160, 60, 240);
|
||||||
|
QColor fgColor(255, 255, 255);
|
||||||
|
|
||||||
|
p.setPen(QPen(fgColor, borderW));
|
||||||
|
p.setBrush(bgColor);
|
||||||
|
p.drawRoundedRect(signRect, cornerR, cornerR);
|
||||||
|
|
||||||
|
QRect innerRect = signRect.adjusted(innerMargin, innerMargin, -innerMargin, -innerMargin);
|
||||||
|
p.setPen(QPen(fgColor, innerBorderW));
|
||||||
|
p.setBrush(Qt::NoBrush);
|
||||||
|
p.drawRoundedRect(innerRect, cornerR - 4, cornerR - 4);
|
||||||
|
|
||||||
|
// "CRUISE" text
|
||||||
|
p.setPen(fgColor);
|
||||||
|
p.setFont(InterFont(26, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 15, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "CRUISE");
|
||||||
|
|
||||||
|
// "SET" text
|
||||||
|
p.setFont(InterFont(26, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 45, 0, 0), Qt::AlignTop | Qt::AlignHCenter, "SET");
|
||||||
|
|
||||||
|
// Cruise speed number
|
||||||
|
p.setFont(InterFont(90, QFont::Bold));
|
||||||
|
p.drawText(innerRect.adjusted(0, 42, 0, 0), Qt::AlignCenter, clpCruiseWarningSpeed);
|
||||||
|
}
|
||||||
|
|
||||||
|
p.restore();
|
||||||
|
}
|
||||||
|
|
||||||
void AnnotatedCameraWidget::drawText(QPainter &p, int x, int y, const QString &text, int alpha) {
|
void AnnotatedCameraWidget::drawText(QPainter &p, int x, int y, const QString &text, int alpha) {
|
||||||
QRect real_rect = p.fontMetrics().boundingRect(text);
|
QRect real_rect = p.fontMetrics().boundingRect(text);
|
||||||
real_rect.moveCenter({x, y - real_rect.height() / 2});
|
real_rect.moveCenter({x, y - real_rect.height() / 2});
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
void drawText(QPainter &p, int x, int y, const QString &text, int alpha = 255);
|
void drawText(QPainter &p, int x, int y, const QString &text, int alpha = 255);
|
||||||
void drawSpeedWidget(QPainter &p, int x, int y, const QString &title, const QString &speedLimitStr, QColor colorSpeed, int width = 176);
|
void drawSpeedWidget(QPainter &p, int x, int y, const QString &title, const QString &speedLimitStr, QColor colorSpeed, int width = 176);
|
||||||
|
void drawSpeedLimitSign(QPainter &p);
|
||||||
|
void drawCruiseWarningSign(QPainter &p);
|
||||||
|
|
||||||
QVBoxLayout *main_layout;
|
QVBoxLayout *main_layout;
|
||||||
QPixmap dm_img;
|
QPixmap dm_img;
|
||||||
@@ -59,6 +61,16 @@ private:
|
|||||||
bool nightriderMode = false;
|
bool nightriderMode = false;
|
||||||
int displayMode = 0;
|
int displayMode = 0;
|
||||||
QString speedUnit;
|
QString speedUnit;
|
||||||
|
|
||||||
|
// ClearPilot speed state (from params_memory, updated ~2Hz)
|
||||||
|
bool clpHasSpeed = false;
|
||||||
|
QString clpSpeedDisplay;
|
||||||
|
QString clpSpeedLimitDisplay;
|
||||||
|
QString clpSpeedUnit;
|
||||||
|
QString clpCruiseWarning;
|
||||||
|
QString clpCruiseWarningSpeed;
|
||||||
|
int clpParamFrame = 0;
|
||||||
|
|
||||||
float setSpeed;
|
float setSpeed;
|
||||||
float speedLimit;
|
float speedLimit;
|
||||||
bool is_cruise_set = false;
|
bool is_cruise_set = false;
|
||||||
|
|||||||
Binary file not shown.
@@ -93,6 +93,27 @@ class Soundd:
|
|||||||
|
|
||||||
self.spl_filter_weighted = FirstOrderFilter(0, 2.5, FILTER_DT, initialized=False)
|
self.spl_filter_weighted = FirstOrderFilter(0, 2.5, FILTER_DT, initialized=False)
|
||||||
|
|
||||||
|
# ClearPilot ding (plays independently of alerts)
|
||||||
|
self.ding_sound = None
|
||||||
|
self.ding_frame = 0
|
||||||
|
self.ding_playing = False
|
||||||
|
self.ding_check_counter = 0
|
||||||
|
self._load_ding()
|
||||||
|
|
||||||
|
def _load_ding(self):
|
||||||
|
ding_path = BASEDIR + "/selfdrive/clearpilot/sounds/ding.wav"
|
||||||
|
try:
|
||||||
|
wavefile = wave.open(ding_path, 'r')
|
||||||
|
assert wavefile.getnchannels() == 1
|
||||||
|
assert wavefile.getsampwidth() == 2
|
||||||
|
assert wavefile.getframerate() == SAMPLE_RATE
|
||||||
|
length = wavefile.getnframes()
|
||||||
|
self.ding_sound = np.frombuffer(wavefile.readframes(length), dtype=np.int16).astype(np.float32) / (2**16/2)
|
||||||
|
cloudlog.info(f"ClearPilot ding loaded: {length} frames")
|
||||||
|
except Exception as e:
|
||||||
|
cloudlog.error(f"Failed to load ding sound: {e}")
|
||||||
|
self.ding_sound = None
|
||||||
|
|
||||||
def load_sounds(self):
|
def load_sounds(self):
|
||||||
self.loaded_sounds: dict[int, np.ndarray] = {}
|
self.loaded_sounds: dict[int, np.ndarray] = {}
|
||||||
|
|
||||||
@@ -137,7 +158,20 @@ class Soundd:
|
|||||||
written_frames += frames_to_write
|
written_frames += frames_to_write
|
||||||
self.current_sound_frame += frames_to_write
|
self.current_sound_frame += frames_to_write
|
||||||
|
|
||||||
return ret * self.current_volume
|
ret = ret * self.current_volume
|
||||||
|
|
||||||
|
# Mix in ClearPilot ding (independent of alerts, always max volume)
|
||||||
|
if self.ding_playing and self.ding_sound is not None:
|
||||||
|
ding_remaining = len(self.ding_sound) - self.ding_frame
|
||||||
|
if ding_remaining > 0:
|
||||||
|
frames_to_write = min(ding_remaining, frames)
|
||||||
|
ret[:frames_to_write] += self.ding_sound[self.ding_frame:self.ding_frame + frames_to_write] * MAX_VOLUME
|
||||||
|
self.ding_frame += frames_to_write
|
||||||
|
else:
|
||||||
|
self.ding_playing = False
|
||||||
|
self.ding_frame = 0
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
||||||
def callback(self, data_out: np.ndarray, frames: int, time, status) -> None:
|
def callback(self, data_out: np.ndarray, frames: int, time, status) -> None:
|
||||||
if status:
|
if status:
|
||||||
@@ -197,6 +231,14 @@ class Soundd:
|
|||||||
|
|
||||||
self.get_audible_alert(sm)
|
self.get_audible_alert(sm)
|
||||||
|
|
||||||
|
# ClearPilot: check for ding trigger at ~2Hz
|
||||||
|
self.ding_check_counter += 1
|
||||||
|
if self.ding_check_counter % 10 == 0 and self.ding_sound is not None:
|
||||||
|
if self.params_memory.get("ClearpilotPlayDing") == b"1":
|
||||||
|
self.params_memory.put("ClearpilotPlayDing", "0")
|
||||||
|
self.ding_playing = True
|
||||||
|
self.ding_frame = 0
|
||||||
|
|
||||||
rk.keep_time()
|
rk.keep_time()
|
||||||
|
|
||||||
assert stream.active
|
assert stream.active
|
||||||
|
|||||||
@@ -565,7 +565,10 @@ void Device::updateWakefulness(const UIState &s) {
|
|||||||
emit interactiveTimeout();
|
emit interactiveTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.scene.screen_brightness_onroad != 0) {
|
// CLEARPILOT: ScreenDisplayMode 3 = screen off — override awake state
|
||||||
|
if (paramsMemory.getInt("ScreenDisplayMode") == 3) {
|
||||||
|
setAwake(false);
|
||||||
|
} else if (s.scene.screen_brightness_onroad != 0) {
|
||||||
setAwake(s.scene.ignition || interactive_timeout > 0);
|
setAwake(s.scene.ignition || interactive_timeout > 0);
|
||||||
} else {
|
} else {
|
||||||
setAwake(interactive_timeout > 0);
|
setAwake(interactive_timeout > 0);
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
dongle_id=$(cat /data/params/d/DongleId)
|
# Uses hardware serial as identity check and encryption key
|
||||||
if [[ ! $dongle_id == 90bb71* ]]; then
|
serial=$(sed 's/.*androidboot.serialno=\([^ ]*\).*/\1/' /proc/cmdline)
|
||||||
|
if [[ $serial != 3889765b ]]; then
|
||||||
|
echo "Wrong device (serial=$serial)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Encrypt SSH keys if source files exist using the custom encrypt tool
|
# Encrypt SSH keys if source files exist using the custom encrypt tool
|
||||||
if [ -f /data/openpilot/system/clearpilot/dev/id_rsa.pub ]; then
|
if [ -f /data/openpilot/system/clearpilot/dev/id_ed25519.pub ]; then
|
||||||
bash /data/openpilot/system/clearpilot/tools/encrypt /data/openpilot/system/clearpilot/dev/id_rsa.pub /data/openpilot/system/clearpilot/dev/id_rsa.pub.cpt
|
bash /data/openpilot/system/clearpilot/tools/encrypt /data/openpilot/system/clearpilot/dev/id_ed25519.pub /data/openpilot/system/clearpilot/dev/id_ed25519.pub.cpt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /data/openpilot/system/clearpilot/dev/id_rsa ]; then
|
if [ -f /data/openpilot/system/clearpilot/dev/id_ed25519 ]; then
|
||||||
bash /data/openpilot/system/clearpilot/tools/encrypt /data/openpilot/system/clearpilot/dev/id_rsa /data/openpilot/system/clearpilot/dev/id_rsa.cpt
|
bash /data/openpilot/system/clearpilot/tools/encrypt /data/openpilot/system/clearpilot/dev/id_ed25519 /data/openpilot/system/clearpilot/dev/id_ed25519.cpt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /data/openpilot/system/clearpilot/dev/reverse_ssh ]; then
|
if [ -f /data/openpilot/system/clearpilot/dev/reverse_ssh ]; then
|
||||||
|
|||||||
BIN
system/clearpilot/dev/id_ed25519.cpt
Normal file
BIN
system/clearpilot/dev/id_ed25519.cpt
Normal file
Binary file not shown.
2
system/clearpilot/dev/id_ed25519.pub.cpt
Normal file
2
system/clearpilot/dev/id_ed25519.pub.cpt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
•í-À‘-j¦ñqã A†3ä"|}ôÚÁñžš.\ñ`þQ¥¶ßA^´Ð×~LìbýÊ ÞÔm!Òzï[®<>Wí(¯«rýfo¼À˜¦Miê[&ÄoúÏV=<3D>ˆQ<CB86>"2<>A“i8ÐpÀ"Á!þ1“æ–G:š4ïá<-Ý
|
||||||
|
#
|
||||||
@@ -9,10 +9,39 @@ echo -n 1 > /data/params/d/SshEnabled
|
|||||||
sudo systemctl enable ssh 2>/dev/null
|
sudo systemctl enable ssh 2>/dev/null
|
||||||
sudo systemctl start ssh
|
sudo systemctl start ssh
|
||||||
|
|
||||||
|
# Decrypt and install SSH identity keys for root (git auth)
|
||||||
|
serial=$(sed 's/.*androidboot.serialno=\([^ ]*\).*/\1/' /proc/cmdline)
|
||||||
|
ssh_dir="/root/.ssh"
|
||||||
|
if [[ $serial == 3889765b ]] && [[ ! -f "$ssh_dir/id_ed25519" || ! -f "$ssh_dir/id_ed25519.pub" ]]; then
|
||||||
|
echo "Decrypting SSH identity keys for root (serial=$serial)..."
|
||||||
|
tmpdir=$(mktemp -d)
|
||||||
|
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_ed25519.cpt "$tmpdir/id_ed25519"
|
||||||
|
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_ed25519.pub.cpt "$tmpdir/id_ed25519.pub"
|
||||||
|
sudo mkdir -p "$ssh_dir"
|
||||||
|
sudo cp "$tmpdir/id_ed25519" "$tmpdir/id_ed25519.pub" "$ssh_dir/"
|
||||||
|
rm -rf "$tmpdir"
|
||||||
|
sudo chmod 700 "$ssh_dir"
|
||||||
|
sudo chmod 600 "$ssh_dir/id_ed25519"
|
||||||
|
sudo chmod 644 "$ssh_dir/id_ed25519.pub"
|
||||||
|
echo "SSH identity keys installed to $ssh_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure root SSH config has git.hanson.xyz entry
|
||||||
|
if ! grep -q "Host git.hanson.xyz" "$ssh_dir/config" 2>/dev/null; then
|
||||||
|
sudo tee -a "$ssh_dir/config" > /dev/null <<'SSHCFG'
|
||||||
|
|
||||||
|
Host git.hanson.xyz
|
||||||
|
IdentityFile /root/.ssh/id_ed25519
|
||||||
|
StrictHostKeyChecking no
|
||||||
|
SSHCFG
|
||||||
|
sudo chmod 600 "$ssh_dir/config"
|
||||||
|
echo "SSH config updated for git.hanson.xyz"
|
||||||
|
fi
|
||||||
|
|
||||||
# Always ensure WiFi radio is on
|
# Always ensure WiFi radio is on
|
||||||
nmcli radio wifi on 2>/dev/null
|
nmcli radio wifi on 2>/dev/null
|
||||||
|
|
||||||
# Provision (packages, git pull, build) if no quick_boot flag
|
# Provision (packages, git pull, build) if no quick_boot flag
|
||||||
if [ ! -f /data/quick_boot ]; then
|
if [ ! -f /data/quick_boot ]; then
|
||||||
bash /data/openpilot/system/clearpilot/provision.sh
|
sudo bash /data/openpilot/system/clearpilot/provision.sh
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -32,34 +32,30 @@ sudo mount -o remount,rw /
|
|||||||
echo "Installing packages..."
|
echo "Installing packages..."
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y openvpn curl ccrypt
|
sudo apt-get install -y openvpn curl ccrypt
|
||||||
echo "Installing Node.js 18..."
|
#echo "Installing Node.js 20..."
|
||||||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
#curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
sudo apt-get install -y nodejs
|
sudo apt-get install -y nodejs
|
||||||
node -v
|
|
||||||
sudo apt-get install -y npm
|
|
||||||
mount -o rw,remount /
|
mount -o rw,remount /
|
||||||
echo "Installing Claude Code..."
|
echo "Installing Claude Code..."
|
||||||
curl -fsSL https://claude.ai/install.sh | bash
|
curl -fsSL https://claude.ai/install.sh | bash
|
||||||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
|
cat > /usr/local/bin/claude <<'WRAPPER'
|
||||||
|
#!/bin/bash
|
||||||
|
sudo mount -o rw,remount /
|
||||||
|
exec /root/.local/bin/claude "$@"
|
||||||
|
WRAPPER
|
||||||
|
chmod +x /usr/local/bin/claude
|
||||||
echo "Packages installed"
|
echo "Packages installed"
|
||||||
|
# 4. Ensure git remote uses SSH (not HTTPS)
|
||||||
# Decrypt and install SSH identity keys (for git auth)
|
cd /data/openpilot
|
||||||
dongle_id=$(cat /data/params/d/DongleId 2>/dev/null)
|
EXPECTED_REMOTE="git@git.hanson.xyz:brianhansonxyz/clearpilot.git"
|
||||||
ssh_dir="/data/ssh/.ssh"
|
CURRENT_REMOTE=$(git remote get-url origin 2>/dev/null)
|
||||||
if [[ $dongle_id == 90bb71* ]] && [[ ! -f "$ssh_dir/id_rsa" || ! -f "$ssh_dir/id_rsa.pub" ]]; then
|
if [ "$CURRENT_REMOTE" != "$EXPECTED_REMOTE" ]; then
|
||||||
echo "Decrypting SSH identity keys..."
|
echo "Fixing git remote: $CURRENT_REMOTE -> $EXPECTED_REMOTE"
|
||||||
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_rsa.cpt /data/openpilot/system/clearpilot/dev/id_rsa
|
git remote set-url origin "$EXPECTED_REMOTE"
|
||||||
bash /data/openpilot/system/clearpilot/tools/decrypt /data/openpilot/system/clearpilot/dev/id_rsa.pub.cpt /data/openpilot/system/clearpilot/dev/id_rsa.pub
|
|
||||||
mkdir -p "$ssh_dir"
|
|
||||||
cp /data/openpilot/system/clearpilot/dev/id_rsa /data/openpilot/system/clearpilot/dev/id_rsa.pub "$ssh_dir"
|
|
||||||
chmod 700 "$ssh_dir"
|
|
||||||
chmod 600 "$ssh_dir/id_rsa" "$ssh_dir/id_rsa.pub"
|
|
||||||
echo "SSH identity keys installed to $ssh_dir"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 4. Pull latest from remote (remote always wins)
|
# 5. Pull latest from remote (remote always wins)
|
||||||
echo "Checking for updates..."
|
echo "Checking for updates..."
|
||||||
cd /data/openpilot
|
|
||||||
git fetch origin clearpilot
|
git fetch origin clearpilot
|
||||||
LOCAL=$(git rev-parse HEAD)
|
LOCAL=$(git rev-parse HEAD)
|
||||||
REMOTE=$(git rev-parse origin/clearpilot)
|
REMOTE=$(git rev-parse origin/clearpilot)
|
||||||
@@ -74,15 +70,8 @@ fi
|
|||||||
|
|
||||||
# 5. Build
|
# 5. Build
|
||||||
echo ""
|
echo ""
|
||||||
echo "Starting build..."
|
sudo chown -R comma:comma /data/openpilot
|
||||||
sudo su - comma -c "bash /data/openpilot/build_only.sh"
|
touch /data/quick_boot
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "Build succeeded"
|
|
||||||
touch /data/quick_boot
|
|
||||||
else
|
|
||||||
echo "Build failed"
|
|
||||||
sleep 10
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Provision complete"
|
echo "Provision complete"
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ fi
|
|||||||
src="$1"
|
src="$1"
|
||||||
dest="$2"
|
dest="$2"
|
||||||
|
|
||||||
# Read DongleId for decryption key
|
# Use hardware serial as decryption key
|
||||||
dongle_id=/data/params/d/DongleId
|
serial=$(sed 's/.*androidboot.serialno=\([^ ]*\).*/\1/' /proc/cmdline)
|
||||||
|
keyfile=$(mktemp)
|
||||||
|
echo -n "$serial" > "$keyfile"
|
||||||
|
|
||||||
# Decrypt the file
|
# Decrypt the file
|
||||||
cat "$src" | ccrypt -d -k "$dongle_id" > "$dest"
|
cat "$src" | ccrypt -d -k "$keyfile" > "$dest"
|
||||||
|
rm -f "$keyfile"
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ fi
|
|||||||
src="$1"
|
src="$1"
|
||||||
dest="$2"
|
dest="$2"
|
||||||
|
|
||||||
# Read DongleId for encryption key
|
# Use hardware serial as encryption key
|
||||||
dongle_id=/data/params/d/DongleId
|
serial=$(sed 's/.*androidboot.serialno=\([^ ]*\).*/\1/' /proc/cmdline)
|
||||||
|
keyfile=$(mktemp)
|
||||||
|
echo -n "$serial" > "$keyfile"
|
||||||
|
|
||||||
# Encrypt the file
|
# Encrypt the file
|
||||||
cat "$src" | ccrypt -e -k "$dongle_id" > "$dest"
|
cat "$src" | ccrypt -e -k "$keyfile" > "$dest"
|
||||||
|
rm -f "$keyfile"
|
||||||
|
|||||||
BIN
third_party/acados/larch64/lib/libacados.so
vendored
Executable file
BIN
third_party/acados/larch64/lib/libacados.so
vendored
Executable file
Binary file not shown.
BIN
third_party/acados/larch64/lib/libblasfeo.so
vendored
Executable file
BIN
third_party/acados/larch64/lib/libblasfeo.so
vendored
Executable file
Binary file not shown.
BIN
third_party/acados/larch64/lib/libhpipm.so
vendored
Executable file
BIN
third_party/acados/larch64/lib/libhpipm.so
vendored
Executable file
Binary file not shown.
BIN
third_party/acados/larch64/lib/libqpOASES_e.so
vendored
Executable file
BIN
third_party/acados/larch64/lib/libqpOASES_e.so
vendored
Executable file
Binary file not shown.
BIN
third_party/acados/larch64/lib/libqpOASES_e.so.3.1
vendored
Executable file
BIN
third_party/acados/larch64/lib/libqpOASES_e.so.3.1
vendored
Executable file
Binary file not shown.
BIN
third_party/acados/x86_64/lib/libacados.so
vendored
Normal file
BIN
third_party/acados/x86_64/lib/libacados.so
vendored
Normal file
Binary file not shown.
BIN
third_party/acados/x86_64/lib/libblasfeo.so
vendored
Normal file
BIN
third_party/acados/x86_64/lib/libblasfeo.so
vendored
Normal file
Binary file not shown.
BIN
third_party/acados/x86_64/lib/libhpipm.so
vendored
Normal file
BIN
third_party/acados/x86_64/lib/libhpipm.so
vendored
Normal file
Binary file not shown.
BIN
third_party/acados/x86_64/lib/libqpOASES_e.so
vendored
Normal file
BIN
third_party/acados/x86_64/lib/libqpOASES_e.so
vendored
Normal file
Binary file not shown.
BIN
third_party/acados/x86_64/lib/libqpOASES_e.so.3.1
vendored
Normal file
BIN
third_party/acados/x86_64/lib/libqpOASES_e.so.3.1
vendored
Normal file
Binary file not shown.
BIN
third_party/libyuv/larch64/lib/libyuv.a
vendored
Normal file
BIN
third_party/libyuv/larch64/lib/libyuv.a
vendored
Normal file
Binary file not shown.
1
third_party/libyuv/x86_64/include
vendored
1
third_party/libyuv/x86_64/include
vendored
@@ -1 +0,0 @@
|
|||||||
../include
|
|
||||||
32
third_party/libyuv/x86_64/include/libyuv.h
vendored
Executable file
32
third_party/libyuv/x86_64/include/libyuv.h
vendored
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_H_
|
||||||
|
#define INCLUDE_LIBYUV_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
#include "libyuv/compare.h"
|
||||||
|
#include "libyuv/convert.h"
|
||||||
|
#include "libyuv/convert_argb.h"
|
||||||
|
#include "libyuv/convert_from.h"
|
||||||
|
#include "libyuv/convert_from_argb.h"
|
||||||
|
#include "libyuv/cpu_id.h"
|
||||||
|
#include "libyuv/mjpeg_decoder.h"
|
||||||
|
#include "libyuv/planar_functions.h"
|
||||||
|
#include "libyuv/rotate.h"
|
||||||
|
#include "libyuv/rotate_argb.h"
|
||||||
|
#include "libyuv/row.h"
|
||||||
|
#include "libyuv/scale.h"
|
||||||
|
#include "libyuv/scale_argb.h"
|
||||||
|
#include "libyuv/scale_row.h"
|
||||||
|
#include "libyuv/version.h"
|
||||||
|
#include "libyuv/video_common.h"
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_H_
|
||||||
118
third_party/libyuv/x86_64/include/libyuv/basic_types.h
vendored
Executable file
118
third_party/libyuv/x86_64/include/libyuv/basic_types.h
vendored
Executable file
@@ -0,0 +1,118 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_
|
||||||
|
#define INCLUDE_LIBYUV_BASIC_TYPES_H_
|
||||||
|
|
||||||
|
#include <stddef.h> // for NULL, size_t
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||||
|
#include <sys/types.h> // for uintptr_t on x86
|
||||||
|
#else
|
||||||
|
#include <stdint.h> // for uintptr_t
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef GG_LONGLONG
|
||||||
|
#ifndef INT_TYPES_DEFINED
|
||||||
|
#define INT_TYPES_DEFINED
|
||||||
|
#ifdef COMPILER_MSVC
|
||||||
|
typedef unsigned __int64 uint64;
|
||||||
|
typedef __int64 int64;
|
||||||
|
#ifndef INT64_C
|
||||||
|
#define INT64_C(x) x ## I64
|
||||||
|
#endif
|
||||||
|
#ifndef UINT64_C
|
||||||
|
#define UINT64_C(x) x ## UI64
|
||||||
|
#endif
|
||||||
|
#define INT64_F "I64"
|
||||||
|
#else // COMPILER_MSVC
|
||||||
|
#if defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__)
|
||||||
|
typedef unsigned long uint64; // NOLINT
|
||||||
|
typedef long int64; // NOLINT
|
||||||
|
#ifndef INT64_C
|
||||||
|
#define INT64_C(x) x ## L
|
||||||
|
#endif
|
||||||
|
#ifndef UINT64_C
|
||||||
|
#define UINT64_C(x) x ## UL
|
||||||
|
#endif
|
||||||
|
#define INT64_F "l"
|
||||||
|
#else // defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__)
|
||||||
|
typedef unsigned long long uint64; // NOLINT
|
||||||
|
typedef long long int64; // NOLINT
|
||||||
|
#ifndef INT64_C
|
||||||
|
#define INT64_C(x) x ## LL
|
||||||
|
#endif
|
||||||
|
#ifndef UINT64_C
|
||||||
|
#define UINT64_C(x) x ## ULL
|
||||||
|
#endif
|
||||||
|
#define INT64_F "ll"
|
||||||
|
#endif // __LP64__
|
||||||
|
#endif // COMPILER_MSVC
|
||||||
|
typedef unsigned int uint32;
|
||||||
|
typedef int int32;
|
||||||
|
typedef unsigned short uint16; // NOLINT
|
||||||
|
typedef short int16; // NOLINT
|
||||||
|
typedef unsigned char uint8;
|
||||||
|
typedef signed char int8;
|
||||||
|
#endif // INT_TYPES_DEFINED
|
||||||
|
#endif // GG_LONGLONG
|
||||||
|
|
||||||
|
// Detect compiler is for x86 or x64.
|
||||||
|
#if defined(__x86_64__) || defined(_M_X64) || \
|
||||||
|
defined(__i386__) || defined(_M_IX86)
|
||||||
|
#define CPU_X86 1
|
||||||
|
#endif
|
||||||
|
// Detect compiler is for ARM.
|
||||||
|
#if defined(__arm__) || defined(_M_ARM)
|
||||||
|
#define CPU_ARM 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ALIGNP
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define ALIGNP(p, t) \
|
||||||
|
(reinterpret_cast<uint8*>(((reinterpret_cast<uintptr_t>(p) + \
|
||||||
|
((t) - 1)) & ~((t) - 1))))
|
||||||
|
#else
|
||||||
|
#define ALIGNP(p, t) \
|
||||||
|
((uint8*)((((uintptr_t)(p) + ((t) - 1)) & ~((t) - 1)))) /* NOLINT */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(LIBYUV_API)
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
#if defined(LIBYUV_BUILDING_SHARED_LIBRARY)
|
||||||
|
#define LIBYUV_API __declspec(dllexport)
|
||||||
|
#elif defined(LIBYUV_USING_SHARED_LIBRARY)
|
||||||
|
#define LIBYUV_API __declspec(dllimport)
|
||||||
|
#else
|
||||||
|
#define LIBYUV_API
|
||||||
|
#endif // LIBYUV_BUILDING_SHARED_LIBRARY
|
||||||
|
#elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \
|
||||||
|
(defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \
|
||||||
|
defined(LIBYUV_USING_SHARED_LIBRARY))
|
||||||
|
#define LIBYUV_API __attribute__ ((visibility ("default")))
|
||||||
|
#else
|
||||||
|
#define LIBYUV_API
|
||||||
|
#endif // __GNUC__
|
||||||
|
#endif // LIBYUV_API
|
||||||
|
|
||||||
|
#define LIBYUV_BOOL int
|
||||||
|
#define LIBYUV_FALSE 0
|
||||||
|
#define LIBYUV_TRUE 1
|
||||||
|
|
||||||
|
// Visual C x86 or GCC little endian.
|
||||||
|
#if defined(__x86_64__) || defined(_M_X64) || \
|
||||||
|
defined(__i386__) || defined(_M_IX86) || \
|
||||||
|
defined(__arm__) || defined(_M_ARM) || \
|
||||||
|
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||||
|
#define LIBYUV_LITTLE_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_
|
||||||
78
third_party/libyuv/x86_64/include/libyuv/compare.h
vendored
Executable file
78
third_party/libyuv/x86_64/include/libyuv/compare.h
vendored
Executable file
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_COMPARE_H_
|
||||||
|
#define INCLUDE_LIBYUV_COMPARE_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Compute a hash for specified memory. Seed of 5381 recommended.
|
||||||
|
LIBYUV_API
|
||||||
|
uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed);
|
||||||
|
|
||||||
|
// Scan an opaque argb image and return fourcc based on alpha offset.
|
||||||
|
// Returns FOURCC_ARGB, FOURCC_BGRA, or 0 if unknown.
|
||||||
|
LIBYUV_API
|
||||||
|
uint32 ARGBDetect(const uint8* argb, int stride_argb, int width, int height);
|
||||||
|
|
||||||
|
// Sum Square Error - used to compute Mean Square Error or PSNR.
|
||||||
|
LIBYUV_API
|
||||||
|
uint64 ComputeSumSquareError(const uint8* src_a,
|
||||||
|
const uint8* src_b, int count);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a,
|
||||||
|
const uint8* src_b, int stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
static const int kMaxPsnr = 128;
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
double SumSquareErrorToPsnr(uint64 sse, uint64 count);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
double CalcFramePsnr(const uint8* src_a, int stride_a,
|
||||||
|
const uint8* src_b, int stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
double I420Psnr(const uint8* src_y_a, int stride_y_a,
|
||||||
|
const uint8* src_u_a, int stride_u_a,
|
||||||
|
const uint8* src_v_a, int stride_v_a,
|
||||||
|
const uint8* src_y_b, int stride_y_b,
|
||||||
|
const uint8* src_u_b, int stride_u_b,
|
||||||
|
const uint8* src_v_b, int stride_v_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
double CalcFrameSsim(const uint8* src_a, int stride_a,
|
||||||
|
const uint8* src_b, int stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
double I420Ssim(const uint8* src_y_a, int stride_y_a,
|
||||||
|
const uint8* src_u_a, int stride_u_a,
|
||||||
|
const uint8* src_v_a, int stride_v_a,
|
||||||
|
const uint8* src_y_b, int stride_y_b,
|
||||||
|
const uint8* src_u_b, int stride_u_b,
|
||||||
|
const uint8* src_v_b, int stride_v_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_COMPARE_H_
|
||||||
84
third_party/libyuv/x86_64/include/libyuv/compare_row.h
vendored
Executable file
84
third_party/libyuv/x86_64/include/libyuv/compare_row.h
vendored
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_COMPARE_ROW_H_
|
||||||
|
#define INCLUDE_LIBYUV_COMPARE_ROW_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__pnacl__) || defined(__CLR_VER) || \
|
||||||
|
(defined(__i386__) && !defined(__SSE2__))
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
// MemorySanitizer does not support assembly code yet. http://crbug.com/344505
|
||||||
|
#if defined(__has_feature)
|
||||||
|
#if __has_feature(memory_sanitizer)
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Visual C 2012 required for AVX2.
|
||||||
|
#if defined(_M_IX86) && !defined(__clang__) && \
|
||||||
|
defined(_MSC_VER) && _MSC_VER >= 1700
|
||||||
|
#define VISUALC_HAS_AVX2 1
|
||||||
|
#endif // VisualStudio >= 2012
|
||||||
|
|
||||||
|
// clang >= 3.4.0 required for AVX2.
|
||||||
|
#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
|
||||||
|
#if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4))
|
||||||
|
#define CLANG_HAS_AVX2 1
|
||||||
|
#endif // clang >= 3.4
|
||||||
|
#endif // __clang__
|
||||||
|
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||||
|
defined(_M_IX86) && (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
|
||||||
|
#define HAS_HASHDJB2_AVX2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available for Visual C and GCC:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||||
|
(defined(__x86_64__) || (defined(__i386__) || defined(_M_IX86)))
|
||||||
|
#define HAS_HASHDJB2_SSE41
|
||||||
|
#define HAS_SUMSQUAREERROR_SSE2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available for Visual C and clangcl 32 bit:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
|
||||||
|
(defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
|
||||||
|
#define HAS_HASHDJB2_AVX2
|
||||||
|
#define HAS_SUMSQUAREERROR_AVX2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available for Neon:
|
||||||
|
#if !defined(LIBYUV_DISABLE_NEON) && \
|
||||||
|
(defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
|
||||||
|
#define HAS_SUMSQUAREERROR_NEON
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint32 SumSquareError_C(const uint8* src_a, const uint8* src_b, int count);
|
||||||
|
uint32 SumSquareError_SSE2(const uint8* src_a, const uint8* src_b, int count);
|
||||||
|
uint32 SumSquareError_AVX2(const uint8* src_a, const uint8* src_b, int count);
|
||||||
|
uint32 SumSquareError_NEON(const uint8* src_a, const uint8* src_b, int count);
|
||||||
|
|
||||||
|
uint32 HashDjb2_C(const uint8* src, int count, uint32 seed);
|
||||||
|
uint32 HashDjb2_SSE41(const uint8* src, int count, uint32 seed);
|
||||||
|
uint32 HashDjb2_AVX2(const uint8* src, int count, uint32 seed);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_COMPARE_ROW_H_
|
||||||
259
third_party/libyuv/x86_64/include/libyuv/convert.h
vendored
Executable file
259
third_party/libyuv/x86_64/include/libyuv/convert.h
vendored
Executable file
@@ -0,0 +1,259 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_CONVERT_H_
|
||||||
|
#define INCLUDE_LIBYUV_CONVERT_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#include "libyuv/rotate.h" // For enum RotationMode.
|
||||||
|
|
||||||
|
// TODO(fbarchard): fix WebRTC source to include following libyuv headers:
|
||||||
|
#include "libyuv/convert_argb.h" // For WebRTC I420ToARGB. b/620
|
||||||
|
#include "libyuv/convert_from.h" // For WebRTC ConvertFromI420. b/620
|
||||||
|
#include "libyuv/planar_functions.h" // For WebRTC I420Rect, CopyPlane. b/618
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Convert I444 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int I444ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I422 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int I422ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I411 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int I411ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Copy I420 to I420.
|
||||||
|
#define I420ToI420 I420Copy
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Copy(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I400 (grey) to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int I400ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#define J400ToJ420 I400ToI420
|
||||||
|
|
||||||
|
// Convert NV12 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int NV12ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_uv, int src_stride_uv,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert NV21 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int NV21ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_vu, int src_stride_vu,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert YUY2 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert UYVY to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert M420 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int M420ToI420(const uint8* src_m420, int src_stride_m420,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert Android420 to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int Android420ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
int pixel_stride_uv,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// ARGB little endian (bgra in memory) to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// BGRA little endian (argb in memory) to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int BGRAToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// ABGR little endian (rgba in memory) to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int ABGRToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGBA little endian (abgr in memory) to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGBAToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB little endian (bgr in memory) to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGB24ToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB big endian (rgb in memory) to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int RAWToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB16 (RGBP fourcc) little endian to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGB565ToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB15 (RGBO fourcc) little endian to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGB1555ToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB12 (R444 fourcc) little endian to I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGB4444ToI420(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#ifdef HAVE_JPEG
|
||||||
|
// src_width/height provided by capture.
|
||||||
|
// dst_width/height for clipping determine final size.
|
||||||
|
LIBYUV_API
|
||||||
|
int MJPGToI420(const uint8* sample, size_t sample_size,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int src_width, int src_height,
|
||||||
|
int dst_width, int dst_height);
|
||||||
|
|
||||||
|
// Query size of MJPG in pixels.
|
||||||
|
LIBYUV_API
|
||||||
|
int MJPGSize(const uint8* sample, size_t sample_size,
|
||||||
|
int* width, int* height);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Convert camera sample to I420 with cropping, rotation and vertical flip.
|
||||||
|
// "src_size" is needed to parse MJPG.
|
||||||
|
// "dst_stride_y" number of bytes in a row of the dst_y plane.
|
||||||
|
// Normally this would be the same as dst_width, with recommended alignment
|
||||||
|
// to 16 bytes for better efficiency.
|
||||||
|
// If rotation of 90 or 270 is used, stride is affected. The caller should
|
||||||
|
// allocate the I420 buffer according to rotation.
|
||||||
|
// "dst_stride_u" number of bytes in a row of the dst_u plane.
|
||||||
|
// Normally this would be the same as (dst_width + 1) / 2, with
|
||||||
|
// recommended alignment to 16 bytes for better efficiency.
|
||||||
|
// If rotation of 90 or 270 is used, stride is affected.
|
||||||
|
// "crop_x" and "crop_y" are starting position for cropping.
|
||||||
|
// To center, crop_x = (src_width - dst_width) / 2
|
||||||
|
// crop_y = (src_height - dst_height) / 2
|
||||||
|
// "src_width" / "src_height" is size of src_frame in pixels.
|
||||||
|
// "src_height" can be negative indicating a vertically flipped image source.
|
||||||
|
// "crop_width" / "crop_height" is the size to crop the src to.
|
||||||
|
// Must be less than or equal to src_width/src_height
|
||||||
|
// Cropping parameters are pre-rotation.
|
||||||
|
// "rotation" can be 0, 90, 180 or 270.
|
||||||
|
// "format" is a fourcc. ie 'I420', 'YUY2'
|
||||||
|
// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure.
|
||||||
|
LIBYUV_API
|
||||||
|
int ConvertToI420(const uint8* src_frame, size_t src_size,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int crop_x, int crop_y,
|
||||||
|
int src_width, int src_height,
|
||||||
|
int crop_width, int crop_height,
|
||||||
|
enum RotationMode rotation,
|
||||||
|
uint32 format);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_CONVERT_H_
|
||||||
319
third_party/libyuv/x86_64/include/libyuv/convert_argb.h
vendored
Executable file
319
third_party/libyuv/x86_64/include/libyuv/convert_argb.h
vendored
Executable file
@@ -0,0 +1,319 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_CONVERT_ARGB_H_
|
||||||
|
#define INCLUDE_LIBYUV_CONVERT_ARGB_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#include "libyuv/rotate.h" // For enum RotationMode.
|
||||||
|
|
||||||
|
// TODO(fbarchard): This set of functions should exactly match convert.h
|
||||||
|
// TODO(fbarchard): Add tests. Create random content of right size and convert
|
||||||
|
// with C vs Opt and or to I420 and compare.
|
||||||
|
// TODO(fbarchard): Some of these functions lack parameter setting.
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Alias.
|
||||||
|
#define ARGBToARGB ARGBCopy
|
||||||
|
|
||||||
|
// Copy ARGB to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBCopy(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I420 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Duplicate prototype for function in convert_from.h for remoting.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I422 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int I422ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I444 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int I444ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert J444 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int J444ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I444 to ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int I444ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I411 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int I411ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I420 with Alpha to preattenuated ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420AlphaToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
const uint8* src_a, int src_stride_a,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height, int attenuate);
|
||||||
|
|
||||||
|
// Convert I420 with Alpha to preattenuated ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420AlphaToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
const uint8* src_a, int src_stride_a,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height, int attenuate);
|
||||||
|
|
||||||
|
// Convert I400 (grey) to ARGB. Reverse of ARGBToI400.
|
||||||
|
LIBYUV_API
|
||||||
|
int I400ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert J400 (jpeg grey) to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int J400ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Alias.
|
||||||
|
#define YToARGB I400ToARGB
|
||||||
|
|
||||||
|
// Convert NV12 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int NV12ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_uv, int src_stride_uv,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert NV21 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int NV21ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_vu, int src_stride_vu,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert M420 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int M420ToARGB(const uint8* src_m420, int src_stride_m420,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert YUY2 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert UYVY to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert J420 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int J420ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert J422 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int J422ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert J420 to ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int J420ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert J422 to ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int J422ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert H420 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int H420ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert H422 to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int H422ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert H420 to ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int H420ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert H422 to ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int H422ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// BGRA little endian (argb in memory) to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int BGRAToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// ABGR little endian (rgba in memory) to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ABGRToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGBA little endian (abgr in memory) to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGBAToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Deprecated function name.
|
||||||
|
#define BG24ToARGB RGB24ToARGB
|
||||||
|
|
||||||
|
// RGB little endian (bgr in memory) to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGB24ToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB big endian (rgb in memory) to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int RAWToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB16 (RGBP fourcc) little endian to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGB565ToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB15 (RGBO fourcc) little endian to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGB1555ToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// RGB12 (R444 fourcc) little endian to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGB4444ToARGB(const uint8* src_frame, int src_stride_frame,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#ifdef HAVE_JPEG
|
||||||
|
// src_width/height provided by capture
|
||||||
|
// dst_width/height for clipping determine final size.
|
||||||
|
LIBYUV_API
|
||||||
|
int MJPGToARGB(const uint8* sample, size_t sample_size,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int src_width, int src_height,
|
||||||
|
int dst_width, int dst_height);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Convert camera sample to ARGB with cropping, rotation and vertical flip.
|
||||||
|
// "src_size" is needed to parse MJPG.
|
||||||
|
// "dst_stride_argb" number of bytes in a row of the dst_argb plane.
|
||||||
|
// Normally this would be the same as dst_width, with recommended alignment
|
||||||
|
// to 16 bytes for better efficiency.
|
||||||
|
// If rotation of 90 or 270 is used, stride is affected. The caller should
|
||||||
|
// allocate the I420 buffer according to rotation.
|
||||||
|
// "dst_stride_u" number of bytes in a row of the dst_u plane.
|
||||||
|
// Normally this would be the same as (dst_width + 1) / 2, with
|
||||||
|
// recommended alignment to 16 bytes for better efficiency.
|
||||||
|
// If rotation of 90 or 270 is used, stride is affected.
|
||||||
|
// "crop_x" and "crop_y" are starting position for cropping.
|
||||||
|
// To center, crop_x = (src_width - dst_width) / 2
|
||||||
|
// crop_y = (src_height - dst_height) / 2
|
||||||
|
// "src_width" / "src_height" is size of src_frame in pixels.
|
||||||
|
// "src_height" can be negative indicating a vertically flipped image source.
|
||||||
|
// "crop_width" / "crop_height" is the size to crop the src to.
|
||||||
|
// Must be less than or equal to src_width/src_height
|
||||||
|
// Cropping parameters are pre-rotation.
|
||||||
|
// "rotation" can be 0, 90, 180 or 270.
|
||||||
|
// "format" is a fourcc. ie 'I420', 'YUY2'
|
||||||
|
// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure.
|
||||||
|
LIBYUV_API
|
||||||
|
int ConvertToARGB(const uint8* src_frame, size_t src_size,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int crop_x, int crop_y,
|
||||||
|
int src_width, int src_height,
|
||||||
|
int crop_width, int crop_height,
|
||||||
|
enum RotationMode rotation,
|
||||||
|
uint32 format);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_CONVERT_ARGB_H_
|
||||||
179
third_party/libyuv/x86_64/include/libyuv/convert_from.h
vendored
Executable file
179
third_party/libyuv/x86_64/include/libyuv/convert_from.h
vendored
Executable file
@@ -0,0 +1,179 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_CONVERT_FROM_H_
|
||||||
|
#define INCLUDE_LIBYUV_CONVERT_FROM_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
#include "libyuv/rotate.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// See Also convert.h for conversions from formats to I420.
|
||||||
|
|
||||||
|
// I420Copy in convert to I420ToI420.
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToI422(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToI444(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToI411(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Copy to I400. Source can be I420, I422, I444, I400, NV12 or NV21.
|
||||||
|
LIBYUV_API
|
||||||
|
int I400Copy(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToNV12(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_uv, int dst_stride_uv,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToNV21(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_vu, int dst_stride_vu,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToYUY2(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToUYVY(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToBGRA(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToRGBA(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_rgba, int dst_stride_rgba,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToRGB24(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToRAW(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToRGB565(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I420 To RGB565 with 4x4 dither matrix (16 bytes).
|
||||||
|
// Values in dither matrix from 0 to 7 recommended.
|
||||||
|
// The order of the dither matrix is first byte is upper left.
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToRGB565Dither(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
const uint8* dither4x4, int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToARGB1555(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToARGB4444(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I420 to specified format.
|
||||||
|
// "dst_sample_stride" is bytes in a row for the destination. Pass 0 if the
|
||||||
|
// buffer has contiguous rows. Can be negative. A multiple of 16 is optimal.
|
||||||
|
LIBYUV_API
|
||||||
|
int ConvertFromI420(const uint8* y, int y_stride,
|
||||||
|
const uint8* u, int u_stride,
|
||||||
|
const uint8* v, int v_stride,
|
||||||
|
uint8* dst_sample, int dst_sample_stride,
|
||||||
|
int width, int height,
|
||||||
|
uint32 format);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_CONVERT_FROM_H_
|
||||||
190
third_party/libyuv/x86_64/include/libyuv/convert_from_argb.h
vendored
Executable file
190
third_party/libyuv/x86_64/include/libyuv/convert_from_argb.h
vendored
Executable file
@@ -0,0 +1,190 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
|
||||||
|
#define INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Copy ARGB to ARGB.
|
||||||
|
#define ARGBToARGB ARGBCopy
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBCopy(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To BGRA.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToBGRA(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_bgra, int dst_stride_bgra,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToABGR(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To RGBA.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToRGBA(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_rgba, int dst_stride_rgba,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To RGB24.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToRGB24(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_rgb24, int dst_stride_rgb24,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To RAW.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToRAW(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_rgb, int dst_stride_rgb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To RGB565.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToRGB565(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_rgb565, int dst_stride_rgb565,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To RGB565 with 4x4 dither matrix (16 bytes).
|
||||||
|
// Values in dither matrix from 0 to 7 recommended.
|
||||||
|
// The order of the dither matrix is first byte is upper left.
|
||||||
|
// TODO(fbarchard): Consider pointer to 2d array for dither4x4.
|
||||||
|
// const uint8(*dither)[4][4];
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_rgb565, int dst_stride_rgb565,
|
||||||
|
const uint8* dither4x4, int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To ARGB1555.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb1555, int dst_stride_argb1555,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To ARGB4444.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb4444, int dst_stride_argb4444,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To I444.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToI444(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To I422.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToI422(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To I420. (also in convert.h)
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToI420(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB to J420. (JPeg full range I420).
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToJ420(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_yj, int dst_stride_yj,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB to J422.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToJ422(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_yj, int dst_stride_yj,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To I411.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToI411(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB to J400. (JPeg full range).
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToJ400(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_yj, int dst_stride_yj,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB to I400.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToI400(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB to G. (Reverse of J400toARGB, which replicates G back to ARGB)
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToG(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_g, int dst_stride_g,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To NV12.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToNV12(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_uv, int dst_stride_uv,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To NV21.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_vu, int dst_stride_vu,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To NV21.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_vu, int dst_stride_vu,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To YUY2.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToYUY2(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_yuy2, int dst_stride_yuy2,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert ARGB To UYVY.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBToUYVY(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_uyvy, int dst_stride_uyvy,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
|
||||||
81
third_party/libyuv/x86_64/include/libyuv/cpu_id.h
vendored
Executable file
81
third_party/libyuv/x86_64/include/libyuv/cpu_id.h
vendored
Executable file
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_CPU_ID_H_
|
||||||
|
#define INCLUDE_LIBYUV_CPU_ID_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Internal flag to indicate cpuid requires initialization.
|
||||||
|
static const int kCpuInitialized = 0x1;
|
||||||
|
|
||||||
|
// These flags are only valid on ARM processors.
|
||||||
|
static const int kCpuHasARM = 0x2;
|
||||||
|
static const int kCpuHasNEON = 0x4;
|
||||||
|
// 0x8 reserved for future ARM flag.
|
||||||
|
|
||||||
|
// These flags are only valid on x86 processors.
|
||||||
|
static const int kCpuHasX86 = 0x10;
|
||||||
|
static const int kCpuHasSSE2 = 0x20;
|
||||||
|
static const int kCpuHasSSSE3 = 0x40;
|
||||||
|
static const int kCpuHasSSE41 = 0x80;
|
||||||
|
static const int kCpuHasSSE42 = 0x100;
|
||||||
|
static const int kCpuHasAVX = 0x200;
|
||||||
|
static const int kCpuHasAVX2 = 0x400;
|
||||||
|
static const int kCpuHasERMS = 0x800;
|
||||||
|
static const int kCpuHasFMA3 = 0x1000;
|
||||||
|
static const int kCpuHasAVX3 = 0x2000;
|
||||||
|
// 0x2000, 0x4000, 0x8000 reserved for future X86 flags.
|
||||||
|
|
||||||
|
// These flags are only valid on MIPS processors.
|
||||||
|
static const int kCpuHasMIPS = 0x10000;
|
||||||
|
static const int kCpuHasDSPR2 = 0x20000;
|
||||||
|
static const int kCpuHasMSA = 0x40000;
|
||||||
|
|
||||||
|
// Internal function used to auto-init.
|
||||||
|
LIBYUV_API
|
||||||
|
int InitCpuFlags(void);
|
||||||
|
|
||||||
|
// Internal function for parsing /proc/cpuinfo.
|
||||||
|
LIBYUV_API
|
||||||
|
int ArmCpuCaps(const char* cpuinfo_name);
|
||||||
|
|
||||||
|
// Detect CPU has SSE2 etc.
|
||||||
|
// Test_flag parameter should be one of kCpuHas constants above.
|
||||||
|
// returns non-zero if instruction set is detected
|
||||||
|
static __inline int TestCpuFlag(int test_flag) {
|
||||||
|
LIBYUV_API extern int cpu_info_;
|
||||||
|
return (!cpu_info_ ? InitCpuFlags() : cpu_info_) & test_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For testing, allow CPU flags to be disabled.
|
||||||
|
// ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3.
|
||||||
|
// MaskCpuFlags(-1) to enable all cpu specific optimizations.
|
||||||
|
// MaskCpuFlags(1) to disable all cpu specific optimizations.
|
||||||
|
LIBYUV_API
|
||||||
|
void MaskCpuFlags(int enable_flags);
|
||||||
|
|
||||||
|
// Low level cpuid for X86. Returns zeros on other CPUs.
|
||||||
|
// eax is the info type that you want.
|
||||||
|
// ecx is typically the cpu number, and should normally be zero.
|
||||||
|
LIBYUV_API
|
||||||
|
void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_CPU_ID_H_
|
||||||
76
third_party/libyuv/x86_64/include/libyuv/macros_msa.h
vendored
Executable file
76
third_party/libyuv/x86_64/include/libyuv/macros_msa.h
vendored
Executable file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2016 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_MACROS_MSA_H_
|
||||||
|
#define INCLUDE_LIBYUV_MACROS_MSA_H_
|
||||||
|
|
||||||
|
#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <msa.h>
|
||||||
|
|
||||||
|
#define LD_B(RTYPE, psrc) *((RTYPE*)(psrc)) /* NOLINT */
|
||||||
|
#define LD_UB(...) LD_B(v16u8, __VA_ARGS__)
|
||||||
|
|
||||||
|
#define ST_B(RTYPE, in, pdst) *((RTYPE*)(pdst)) = (in) /* NOLINT */
|
||||||
|
#define ST_UB(...) ST_B(v16u8, __VA_ARGS__)
|
||||||
|
|
||||||
|
/* Description : Load two vectors with 16 'byte' sized elements
|
||||||
|
Arguments : Inputs - psrc, stride
|
||||||
|
Outputs - out0, out1
|
||||||
|
Return Type - as per RTYPE
|
||||||
|
Details : Load 16 byte elements in 'out0' from (psrc)
|
||||||
|
Load 16 byte elements in 'out1' from (psrc + stride)
|
||||||
|
*/
|
||||||
|
#define LD_B2(RTYPE, psrc, stride, out0, out1) { \
|
||||||
|
out0 = LD_B(RTYPE, (psrc)); \
|
||||||
|
out1 = LD_B(RTYPE, (psrc) + stride); \
|
||||||
|
}
|
||||||
|
#define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__)
|
||||||
|
|
||||||
|
#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) { \
|
||||||
|
LD_B2(RTYPE, (psrc), stride, out0, out1); \
|
||||||
|
LD_B2(RTYPE, (psrc) + 2 * stride , stride, out2, out3); \
|
||||||
|
}
|
||||||
|
#define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__)
|
||||||
|
|
||||||
|
/* Description : Store two vectors with stride each having 16 'byte' sized
|
||||||
|
elements
|
||||||
|
Arguments : Inputs - in0, in1, pdst, stride
|
||||||
|
Details : Store 16 byte elements from 'in0' to (pdst)
|
||||||
|
Store 16 byte elements from 'in1' to (pdst + stride)
|
||||||
|
*/
|
||||||
|
#define ST_B2(RTYPE, in0, in1, pdst, stride) { \
|
||||||
|
ST_B(RTYPE, in0, (pdst)); \
|
||||||
|
ST_B(RTYPE, in1, (pdst) + stride); \
|
||||||
|
}
|
||||||
|
#define ST_UB2(...) ST_B2(v16u8, __VA_ARGS__)
|
||||||
|
#
|
||||||
|
#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) { \
|
||||||
|
ST_B2(RTYPE, in0, in1, (pdst), stride); \
|
||||||
|
ST_B2(RTYPE, in2, in3, (pdst) + 2 * stride, stride); \
|
||||||
|
}
|
||||||
|
#define ST_UB4(...) ST_B4(v16u8, __VA_ARGS__)
|
||||||
|
#
|
||||||
|
/* Description : Shuffle byte vector elements as per mask vector
|
||||||
|
Arguments : Inputs - in0, in1, in2, in3, mask0, mask1
|
||||||
|
Outputs - out0, out1
|
||||||
|
Return Type - as per RTYPE
|
||||||
|
Details : Byte elements from 'in0' & 'in1' are copied selectively to
|
||||||
|
'out0' as per control vector 'mask0'
|
||||||
|
*/
|
||||||
|
#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) { \
|
||||||
|
out0 = (RTYPE) __msa_vshf_b((v16i8) mask0, (v16i8) in1, (v16i8) in0); \
|
||||||
|
out1 = (RTYPE) __msa_vshf_b((v16i8) mask1, (v16i8) in3, (v16i8) in2); \
|
||||||
|
}
|
||||||
|
#define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__)
|
||||||
|
|
||||||
|
#endif /* !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) */
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_MACROS_MSA_H_
|
||||||
192
third_party/libyuv/x86_64/include/libyuv/mjpeg_decoder.h
vendored
Executable file
192
third_party/libyuv/x86_64/include/libyuv/mjpeg_decoder.h
vendored
Executable file
@@ -0,0 +1,192 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_MJPEG_DECODER_H_
|
||||||
|
#define INCLUDE_LIBYUV_MJPEG_DECODER_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
// NOTE: For a simplified public API use convert.h MJPGToI420().
|
||||||
|
|
||||||
|
struct jpeg_common_struct;
|
||||||
|
struct jpeg_decompress_struct;
|
||||||
|
struct jpeg_source_mgr;
|
||||||
|
|
||||||
|
namespace libyuv {
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LIBYUV_BOOL ValidateJpeg(const uint8* sample, size_t sample_size);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const uint32 kUnknownDataSize = 0xFFFFFFFF;
|
||||||
|
|
||||||
|
enum JpegSubsamplingType {
|
||||||
|
kJpegYuv420,
|
||||||
|
kJpegYuv422,
|
||||||
|
kJpegYuv411,
|
||||||
|
kJpegYuv444,
|
||||||
|
kJpegYuv400,
|
||||||
|
kJpegUnknown
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Buffer {
|
||||||
|
const uint8* data;
|
||||||
|
int len;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BufferVector {
|
||||||
|
Buffer* buffers;
|
||||||
|
int len;
|
||||||
|
int pos;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SetJmpErrorMgr;
|
||||||
|
|
||||||
|
// MJPEG ("Motion JPEG") is a pseudo-standard video codec where the frames are
|
||||||
|
// simply independent JPEG images with a fixed huffman table (which is omitted).
|
||||||
|
// It is rarely used in video transmission, but is common as a camera capture
|
||||||
|
// format, especially in Logitech devices. This class implements a decoder for
|
||||||
|
// MJPEG frames.
|
||||||
|
//
|
||||||
|
// See http://tools.ietf.org/html/rfc2435
|
||||||
|
class LIBYUV_API MJpegDecoder {
|
||||||
|
public:
|
||||||
|
typedef void (*CallbackFunction)(void* opaque,
|
||||||
|
const uint8* const* data,
|
||||||
|
const int* strides,
|
||||||
|
int rows);
|
||||||
|
|
||||||
|
static const int kColorSpaceUnknown;
|
||||||
|
static const int kColorSpaceGrayscale;
|
||||||
|
static const int kColorSpaceRgb;
|
||||||
|
static const int kColorSpaceYCbCr;
|
||||||
|
static const int kColorSpaceCMYK;
|
||||||
|
static const int kColorSpaceYCCK;
|
||||||
|
|
||||||
|
MJpegDecoder();
|
||||||
|
~MJpegDecoder();
|
||||||
|
|
||||||
|
// Loads a new frame, reads its headers, and determines the uncompressed
|
||||||
|
// image format.
|
||||||
|
// Returns LIBYUV_TRUE if image looks valid and format is supported.
|
||||||
|
// If return value is LIBYUV_TRUE, then the values for all the following
|
||||||
|
// getters are populated.
|
||||||
|
// src_len is the size of the compressed mjpeg frame in bytes.
|
||||||
|
LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len);
|
||||||
|
|
||||||
|
// Returns width of the last loaded frame in pixels.
|
||||||
|
int GetWidth();
|
||||||
|
|
||||||
|
// Returns height of the last loaded frame in pixels.
|
||||||
|
int GetHeight();
|
||||||
|
|
||||||
|
// Returns format of the last loaded frame. The return value is one of the
|
||||||
|
// kColorSpace* constants.
|
||||||
|
int GetColorSpace();
|
||||||
|
|
||||||
|
// Number of color components in the color space.
|
||||||
|
int GetNumComponents();
|
||||||
|
|
||||||
|
// Sample factors of the n-th component.
|
||||||
|
int GetHorizSampFactor(int component);
|
||||||
|
|
||||||
|
int GetVertSampFactor(int component);
|
||||||
|
|
||||||
|
int GetHorizSubSampFactor(int component);
|
||||||
|
|
||||||
|
int GetVertSubSampFactor(int component);
|
||||||
|
|
||||||
|
// Public for testability.
|
||||||
|
int GetImageScanlinesPerImcuRow();
|
||||||
|
|
||||||
|
// Public for testability.
|
||||||
|
int GetComponentScanlinesPerImcuRow(int component);
|
||||||
|
|
||||||
|
// Width of a component in bytes.
|
||||||
|
int GetComponentWidth(int component);
|
||||||
|
|
||||||
|
// Height of a component.
|
||||||
|
int GetComponentHeight(int component);
|
||||||
|
|
||||||
|
// Width of a component in bytes with padding for DCTSIZE. Public for testing.
|
||||||
|
int GetComponentStride(int component);
|
||||||
|
|
||||||
|
// Size of a component in bytes.
|
||||||
|
int GetComponentSize(int component);
|
||||||
|
|
||||||
|
// Call this after LoadFrame() if you decide you don't want to decode it
|
||||||
|
// after all.
|
||||||
|
LIBYUV_BOOL UnloadFrame();
|
||||||
|
|
||||||
|
// Decodes the entire image into a one-buffer-per-color-component format.
|
||||||
|
// dst_width must match exactly. dst_height must be <= to image height; if
|
||||||
|
// less, the image is cropped. "planes" must have size equal to at least
|
||||||
|
// GetNumComponents() and they must point to non-overlapping buffers of size
|
||||||
|
// at least GetComponentSize(i). The pointers in planes are incremented
|
||||||
|
// to point to after the end of the written data.
|
||||||
|
// TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
|
||||||
|
LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height);
|
||||||
|
|
||||||
|
// Decodes the entire image and passes the data via repeated calls to a
|
||||||
|
// callback function. Each call will get the data for a whole number of
|
||||||
|
// image scanlines.
|
||||||
|
// TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded.
|
||||||
|
LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque,
|
||||||
|
int dst_width, int dst_height);
|
||||||
|
|
||||||
|
// The helper function which recognizes the jpeg sub-sampling type.
|
||||||
|
static JpegSubsamplingType JpegSubsamplingTypeHelper(
|
||||||
|
int* subsample_x, int* subsample_y, int number_of_components);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void AllocOutputBuffers(int num_outbufs);
|
||||||
|
void DestroyOutputBuffers();
|
||||||
|
|
||||||
|
LIBYUV_BOOL StartDecode();
|
||||||
|
LIBYUV_BOOL FinishDecode();
|
||||||
|
|
||||||
|
void SetScanlinePointers(uint8** data);
|
||||||
|
LIBYUV_BOOL DecodeImcuRow();
|
||||||
|
|
||||||
|
int GetComponentScanlinePadding(int component);
|
||||||
|
|
||||||
|
// A buffer holding the input data for a frame.
|
||||||
|
Buffer buf_;
|
||||||
|
BufferVector buf_vec_;
|
||||||
|
|
||||||
|
jpeg_decompress_struct* decompress_struct_;
|
||||||
|
jpeg_source_mgr* source_mgr_;
|
||||||
|
SetJmpErrorMgr* error_mgr_;
|
||||||
|
|
||||||
|
// LIBYUV_TRUE iff at least one component has scanline padding. (i.e.,
|
||||||
|
// GetComponentScanlinePadding() != 0.)
|
||||||
|
LIBYUV_BOOL has_scanline_padding_;
|
||||||
|
|
||||||
|
// Temporaries used to point to scanline outputs.
|
||||||
|
int num_outbufs_; // Outermost size of all arrays below.
|
||||||
|
uint8*** scanlines_;
|
||||||
|
int* scanlines_sizes_;
|
||||||
|
// Temporary buffer used for decoding when we can't decode directly to the
|
||||||
|
// output buffers. Large enough for just one iMCU row.
|
||||||
|
uint8** databuf_;
|
||||||
|
int* databuf_strides_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace libyuv
|
||||||
|
|
||||||
|
#endif // __cplusplus
|
||||||
|
#endif // INCLUDE_LIBYUV_MJPEG_DECODER_H_
|
||||||
529
third_party/libyuv/x86_64/include/libyuv/planar_functions.h
vendored
Executable file
529
third_party/libyuv/x86_64/include/libyuv/planar_functions.h
vendored
Executable file
@@ -0,0 +1,529 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_
|
||||||
|
#define INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
// TODO(fbarchard): Remove the following headers includes.
|
||||||
|
#include "libyuv/convert.h"
|
||||||
|
#include "libyuv/convert_argb.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Copy a plane of data.
|
||||||
|
LIBYUV_API
|
||||||
|
void CopyPlane(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
void CopyPlane_16(const uint16* src_y, int src_stride_y,
|
||||||
|
uint16* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Set a plane of data to a 32 bit value.
|
||||||
|
LIBYUV_API
|
||||||
|
void SetPlane(uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height,
|
||||||
|
uint32 value);
|
||||||
|
|
||||||
|
// Split interleaved UV plane into separate U and V planes.
|
||||||
|
LIBYUV_API
|
||||||
|
void SplitUVPlane(const uint8* src_uv, int src_stride_uv,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Merge separate U and V planes into one interleaved UV plane.
|
||||||
|
LIBYUV_API
|
||||||
|
void MergeUVPlane(const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_uv, int dst_stride_uv,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Copy I400. Supports inverting.
|
||||||
|
LIBYUV_API
|
||||||
|
int I400ToI400(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#define J400ToJ400 I400ToI400
|
||||||
|
|
||||||
|
// Copy I422 to I422.
|
||||||
|
#define I422ToI422 I422Copy
|
||||||
|
LIBYUV_API
|
||||||
|
int I422Copy(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Copy I444 to I444.
|
||||||
|
#define I444ToI444 I444Copy
|
||||||
|
LIBYUV_API
|
||||||
|
int I444Copy(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert YUY2 to I422.
|
||||||
|
LIBYUV_API
|
||||||
|
int YUY2ToI422(const uint8* src_yuy2, int src_stride_yuy2,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert UYVY to I422.
|
||||||
|
LIBYUV_API
|
||||||
|
int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int YUY2ToNV12(const uint8* src_yuy2, int src_stride_yuy2,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_uv, int dst_stride_uv,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int UYVYToNV12(const uint8* src_uyvy, int src_stride_uyvy,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_uv, int dst_stride_uv,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I420 to I400. (calls CopyPlane ignoring u/v).
|
||||||
|
LIBYUV_API
|
||||||
|
int I420ToI400(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Alias
|
||||||
|
#define J420ToJ400 I420ToI400
|
||||||
|
#define I420ToI420Mirror I420Mirror
|
||||||
|
|
||||||
|
// I420 mirror.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Mirror(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Alias
|
||||||
|
#define I400ToI400Mirror I400Mirror
|
||||||
|
|
||||||
|
// I400 mirror. A single plane is mirrored horizontally.
|
||||||
|
// Pass negative height to achieve 180 degree rotation.
|
||||||
|
LIBYUV_API
|
||||||
|
int I400Mirror(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Alias
|
||||||
|
#define ARGBToARGBMirror ARGBMirror
|
||||||
|
|
||||||
|
// ARGB mirror.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBMirror(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert NV12 to RGB565.
|
||||||
|
LIBYUV_API
|
||||||
|
int NV12ToRGB565(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_uv, int src_stride_uv,
|
||||||
|
uint8* dst_rgb565, int dst_stride_rgb565,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// I422ToARGB is in convert_argb.h
|
||||||
|
// Convert I422 to BGRA.
|
||||||
|
LIBYUV_API
|
||||||
|
int I422ToBGRA(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_bgra, int dst_stride_bgra,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I422 to ABGR.
|
||||||
|
LIBYUV_API
|
||||||
|
int I422ToABGR(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_abgr, int dst_stride_abgr,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I422 to RGBA.
|
||||||
|
LIBYUV_API
|
||||||
|
int I422ToRGBA(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_rgba, int dst_stride_rgba,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Alias
|
||||||
|
#define RGB24ToRAW RAWToRGB24
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int RAWToRGB24(const uint8* src_raw, int src_stride_raw,
|
||||||
|
uint8* dst_rgb24, int dst_stride_rgb24,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Draw a rectangle into I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Rect(uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int x, int y, int width, int height,
|
||||||
|
int value_y, int value_u, int value_v);
|
||||||
|
|
||||||
|
// Draw a rectangle into ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBRect(uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int x, int y, int width, int height, uint32 value);
|
||||||
|
|
||||||
|
// Convert ARGB to gray scale ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBGrayTo(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Make a rectangle of ARGB gray scale.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBGray(uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// Make a rectangle of ARGB Sepia tone.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBSepia(uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// Apply a matrix rotation to each ARGB pixel.
|
||||||
|
// matrix_argb is 4 signed ARGB values. -128 to 127 representing -2 to 2.
|
||||||
|
// The first 4 coefficients apply to B, G, R, A and produce B of the output.
|
||||||
|
// The next 4 coefficients apply to B, G, R, A and produce G of the output.
|
||||||
|
// The next 4 coefficients apply to B, G, R, A and produce R of the output.
|
||||||
|
// The last 4 coefficients apply to B, G, R, A and produce A of the output.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBColorMatrix(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
const int8* matrix_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Deprecated. Use ARGBColorMatrix instead.
|
||||||
|
// Apply a matrix rotation to each ARGB pixel.
|
||||||
|
// matrix_argb is 3 signed ARGB values. -128 to 127 representing -1 to 1.
|
||||||
|
// The first 4 coefficients apply to B, G, R, A and produce B of the output.
|
||||||
|
// The next 4 coefficients apply to B, G, R, A and produce G of the output.
|
||||||
|
// The last 4 coefficients apply to B, G, R, A and produce R of the output.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGBColorMatrix(uint8* dst_argb, int dst_stride_argb,
|
||||||
|
const int8* matrix_rgb,
|
||||||
|
int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// Apply a color table each ARGB pixel.
|
||||||
|
// Table contains 256 ARGB values.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBColorTable(uint8* dst_argb, int dst_stride_argb,
|
||||||
|
const uint8* table_argb,
|
||||||
|
int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// Apply a color table each ARGB pixel but preserve destination alpha.
|
||||||
|
// Table contains 256 ARGB values.
|
||||||
|
LIBYUV_API
|
||||||
|
int RGBColorTable(uint8* dst_argb, int dst_stride_argb,
|
||||||
|
const uint8* table_argb,
|
||||||
|
int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// Apply a luma/color table each ARGB pixel but preserve destination alpha.
|
||||||
|
// Table contains 32768 values indexed by [Y][C] where 7 it 7 bit luma from
|
||||||
|
// RGB (YJ style) and C is an 8 bit color component (R, G or B).
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBLumaColorTable(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
const uint8* luma_rgb_table,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Apply a 3 term polynomial to ARGB values.
|
||||||
|
// poly points to a 4x4 matrix. The first row is constants. The 2nd row is
|
||||||
|
// coefficients for b, g, r and a. The 3rd row is coefficients for b squared,
|
||||||
|
// g squared, r squared and a squared. The 4rd row is coefficients for b to
|
||||||
|
// the 3, g to the 3, r to the 3 and a to the 3. The values are summed and
|
||||||
|
// result clamped to 0 to 255.
|
||||||
|
// A polynomial approximation can be dirived using software such as 'R'.
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBPolynomial(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
const float* poly,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert plane of 16 bit shorts to half floats.
|
||||||
|
// Source values are multiplied by scale before storing as half float.
|
||||||
|
LIBYUV_API
|
||||||
|
int HalfFloatPlane(const uint16* src_y, int src_stride_y,
|
||||||
|
uint16* dst_y, int dst_stride_y,
|
||||||
|
float scale,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Quantize a rectangle of ARGB. Alpha unaffected.
|
||||||
|
// scale is a 16 bit fractional fixed point scaler between 0 and 65535.
|
||||||
|
// interval_size should be a value between 1 and 255.
|
||||||
|
// interval_offset should be a value between 0 and 255.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBQuantize(uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int scale, int interval_size, int interval_offset,
|
||||||
|
int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// Copy ARGB to ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBCopy(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Copy Alpha channel of ARGB to alpha of ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBCopyAlpha(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Extract the alpha channel from ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBExtractAlpha(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Copy Y channel to Alpha of ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBCopyYToAlpha(const uint8* src_y, int src_stride_y,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
typedef void (*ARGBBlendRow)(const uint8* src_argb0, const uint8* src_argb1,
|
||||||
|
uint8* dst_argb, int width);
|
||||||
|
|
||||||
|
// Get function to Alpha Blend ARGB pixels and store to destination.
|
||||||
|
LIBYUV_API
|
||||||
|
ARGBBlendRow GetARGBBlend();
|
||||||
|
|
||||||
|
// Alpha Blend ARGB images and store to destination.
|
||||||
|
// Source is pre-multiplied by alpha using ARGBAttenuate.
|
||||||
|
// Alpha of destination is set to 255.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBBlend(const uint8* src_argb0, int src_stride_argb0,
|
||||||
|
const uint8* src_argb1, int src_stride_argb1,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Alpha Blend plane and store to destination.
|
||||||
|
// Source is not pre-multiplied by alpha.
|
||||||
|
LIBYUV_API
|
||||||
|
int BlendPlane(const uint8* src_y0, int src_stride_y0,
|
||||||
|
const uint8* src_y1, int src_stride_y1,
|
||||||
|
const uint8* alpha, int alpha_stride,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Alpha Blend YUV images and store to destination.
|
||||||
|
// Source is not pre-multiplied by alpha.
|
||||||
|
// Alpha is full width x height and subsampled to half size to apply to UV.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Blend(const uint8* src_y0, int src_stride_y0,
|
||||||
|
const uint8* src_u0, int src_stride_u0,
|
||||||
|
const uint8* src_v0, int src_stride_v0,
|
||||||
|
const uint8* src_y1, int src_stride_y1,
|
||||||
|
const uint8* src_u1, int src_stride_u1,
|
||||||
|
const uint8* src_v1, int src_stride_v1,
|
||||||
|
const uint8* alpha, int alpha_stride,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Multiply ARGB image by ARGB image. Shifted down by 8. Saturates to 255.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBMultiply(const uint8* src_argb0, int src_stride_argb0,
|
||||||
|
const uint8* src_argb1, int src_stride_argb1,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Add ARGB image with ARGB image. Saturates to 255.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBAdd(const uint8* src_argb0, int src_stride_argb0,
|
||||||
|
const uint8* src_argb1, int src_stride_argb1,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Subtract ARGB image (argb1) from ARGB image (argb0). Saturates to 0.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBSubtract(const uint8* src_argb0, int src_stride_argb0,
|
||||||
|
const uint8* src_argb1, int src_stride_argb1,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I422 to YUY2.
|
||||||
|
LIBYUV_API
|
||||||
|
int I422ToYUY2(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert I422 to UYVY.
|
||||||
|
LIBYUV_API
|
||||||
|
int I422ToUYVY(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert unattentuated ARGB to preattenuated ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBAttenuate(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Convert preattentuated ARGB to unattenuated ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBUnattenuate(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Internal function - do not call directly.
|
||||||
|
// Computes table of cumulative sum for image where the value is the sum
|
||||||
|
// of all values above and to the left of the entry. Used by ARGBBlur.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBComputeCumulativeSum(const uint8* src_argb, int src_stride_argb,
|
||||||
|
int32* dst_cumsum, int dst_stride32_cumsum,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Blur ARGB image.
|
||||||
|
// dst_cumsum table of width * (height + 1) * 16 bytes aligned to
|
||||||
|
// 16 byte boundary.
|
||||||
|
// dst_stride32_cumsum is number of ints in a row (width * 4).
|
||||||
|
// radius is number of pixels around the center. e.g. 1 = 3x3. 2=5x5.
|
||||||
|
// Blur is optimized for radius of 5 (11x11) or less.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBBlur(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int32* dst_cumsum, int dst_stride32_cumsum,
|
||||||
|
int width, int height, int radius);
|
||||||
|
|
||||||
|
// Multiply ARGB image by ARGB value.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBShade(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height, uint32 value);
|
||||||
|
|
||||||
|
// Interpolate between two images using specified amount of interpolation
|
||||||
|
// (0 to 255) and store to destination.
|
||||||
|
// 'interpolation' is specified as 8 bit fraction where 0 means 100% src0
|
||||||
|
// and 255 means 1% src0 and 99% src1.
|
||||||
|
LIBYUV_API
|
||||||
|
int InterpolatePlane(const uint8* src0, int src_stride0,
|
||||||
|
const uint8* src1, int src_stride1,
|
||||||
|
uint8* dst, int dst_stride,
|
||||||
|
int width, int height, int interpolation);
|
||||||
|
|
||||||
|
// Interpolate between two ARGB images using specified amount of interpolation
|
||||||
|
// Internally calls InterpolatePlane with width * 4 (bpp).
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0,
|
||||||
|
const uint8* src_argb1, int src_stride_argb1,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height, int interpolation);
|
||||||
|
|
||||||
|
// Interpolate between two YUV images using specified amount of interpolation
|
||||||
|
// Internally calls InterpolatePlane on each plane where the U and V planes
|
||||||
|
// are half width and half height.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Interpolate(const uint8* src0_y, int src0_stride_y,
|
||||||
|
const uint8* src0_u, int src0_stride_u,
|
||||||
|
const uint8* src0_v, int src0_stride_v,
|
||||||
|
const uint8* src1_y, int src1_stride_y,
|
||||||
|
const uint8* src1_u, int src1_stride_u,
|
||||||
|
const uint8* src1_v, int src1_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int width, int height, int interpolation);
|
||||||
|
|
||||||
|
#if defined(__pnacl__) || defined(__CLR_VER) || \
|
||||||
|
(defined(__i386__) && !defined(__SSE2__))
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
// MemorySanitizer does not support assembly code yet. http://crbug.com/344505
|
||||||
|
#if defined(__has_feature)
|
||||||
|
#if __has_feature(memory_sanitizer)
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
// The following are available on all x86 platforms:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||||
|
(defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
|
||||||
|
#define HAS_ARGBAFFINEROW_SSE2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Row function for copying pixels from a source with a slope to a row
|
||||||
|
// of destination. Useful for scaling, rotation, mirror, texture mapping.
|
||||||
|
LIBYUV_API
|
||||||
|
void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
|
||||||
|
uint8* dst_argb, const float* uv_dudv, int width);
|
||||||
|
LIBYUV_API
|
||||||
|
void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
|
||||||
|
uint8* dst_argb, const float* uv_dudv, int width);
|
||||||
|
|
||||||
|
// Shuffle ARGB channel order. e.g. BGRA to ARGB.
|
||||||
|
// shuffler is 16 bytes and must be aligned.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBShuffle(const uint8* src_bgra, int src_stride_bgra,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
const uint8* shuffler, int width, int height);
|
||||||
|
|
||||||
|
// Sobel ARGB effect with planar output.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBSobelToPlane(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Sobel ARGB effect.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBSobel(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Sobel ARGB effect w/ Sobel X, Sobel, Sobel Y in ARGB.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBSobelXY(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_
|
||||||
117
third_party/libyuv/x86_64/include/libyuv/rotate.h
vendored
Executable file
117
third_party/libyuv/x86_64/include/libyuv/rotate.h
vendored
Executable file
@@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_ROTATE_H_
|
||||||
|
#define INCLUDE_LIBYUV_ROTATE_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Supported rotation.
|
||||||
|
typedef enum RotationMode {
|
||||||
|
kRotate0 = 0, // No rotation.
|
||||||
|
kRotate90 = 90, // Rotate 90 degrees clockwise.
|
||||||
|
kRotate180 = 180, // Rotate 180 degrees.
|
||||||
|
kRotate270 = 270, // Rotate 270 degrees clockwise.
|
||||||
|
|
||||||
|
// Deprecated.
|
||||||
|
kRotateNone = 0,
|
||||||
|
kRotateClockwise = 90,
|
||||||
|
kRotateCounterClockwise = 270,
|
||||||
|
} RotationModeEnum;
|
||||||
|
|
||||||
|
// Rotate I420 frame.
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Rotate(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int src_width, int src_height, enum RotationMode mode);
|
||||||
|
|
||||||
|
// Rotate NV12 input and store in I420.
|
||||||
|
LIBYUV_API
|
||||||
|
int NV12ToI420Rotate(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_uv, int src_stride_uv,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int src_width, int src_height, enum RotationMode mode);
|
||||||
|
|
||||||
|
// Rotate a plane by 0, 90, 180, or 270.
|
||||||
|
LIBYUV_API
|
||||||
|
int RotatePlane(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride,
|
||||||
|
int src_width, int src_height, enum RotationMode mode);
|
||||||
|
|
||||||
|
// Rotate planes by 90, 180, 270. Deprecated.
|
||||||
|
LIBYUV_API
|
||||||
|
void RotatePlane90(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
void RotatePlane180(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
void RotatePlane270(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
void RotateUV90(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// Rotations for when U and V are interleaved.
|
||||||
|
// These functions take one input pointer and
|
||||||
|
// split the data into two buffers while
|
||||||
|
// rotating them. Deprecated.
|
||||||
|
LIBYUV_API
|
||||||
|
void RotateUV180(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
void RotateUV270(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
// The 90 and 270 functions are based on transposes.
|
||||||
|
// Doing a transpose with reversing the read/write
|
||||||
|
// order will result in a rotation by +- 90 degrees.
|
||||||
|
// Deprecated.
|
||||||
|
LIBYUV_API
|
||||||
|
void TransposePlane(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
void TransposeUV(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_ROTATE_H_
|
||||||
33
third_party/libyuv/x86_64/include/libyuv/rotate_argb.h
vendored
Executable file
33
third_party/libyuv/x86_64/include/libyuv/rotate_argb.h
vendored
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_
|
||||||
|
#define INCLUDE_LIBYUV_ROTATE_ARGB_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
#include "libyuv/rotate.h" // For RotationMode.
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Rotate ARGB frame
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBRotate(const uint8* src_argb, int src_stride_argb,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int src_width, int src_height, enum RotationMode mode);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_
|
||||||
121
third_party/libyuv/x86_64/include/libyuv/rotate_row.h
vendored
Executable file
121
third_party/libyuv/x86_64/include/libyuv/rotate_row.h
vendored
Executable file
@@ -0,0 +1,121 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_
|
||||||
|
#define INCLUDE_LIBYUV_ROTATE_ROW_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__pnacl__) || defined(__CLR_VER) || \
|
||||||
|
(defined(__i386__) && !defined(__SSE2__))
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
// MemorySanitizer does not support assembly code yet. http://crbug.com/344505
|
||||||
|
#if defined(__has_feature)
|
||||||
|
#if __has_feature(memory_sanitizer)
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
// The following are available for Visual C and clangcl 32 bit:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86)
|
||||||
|
#define HAS_TRANSPOSEWX8_SSSE3
|
||||||
|
#define HAS_TRANSPOSEUVWX8_SSE2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available for GCC 32 or 64 bit but not NaCL for 64 bit:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||||
|
(defined(__i386__) || (defined(__x86_64__) && !defined(__native_client__)))
|
||||||
|
#define HAS_TRANSPOSEWX8_SSSE3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available for 64 bit GCC but not NaCL:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && !defined(__native_client__) && \
|
||||||
|
defined(__x86_64__)
|
||||||
|
#define HAS_TRANSPOSEWX8_FAST_SSSE3
|
||||||
|
#define HAS_TRANSPOSEUVWX8_SSE2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \
|
||||||
|
(defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
|
||||||
|
#define HAS_TRANSPOSEWX8_NEON
|
||||||
|
#define HAS_TRANSPOSEUVWX8_NEON
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \
|
||||||
|
defined(__mips__) && \
|
||||||
|
defined(__mips_dsp) && (__mips_dsp_rev >= 2)
|
||||||
|
#define HAS_TRANSPOSEWX8_DSPR2
|
||||||
|
#define HAS_TRANSPOSEUVWX8_DSPR2
|
||||||
|
#endif // defined(__mips__)
|
||||||
|
|
||||||
|
void TransposeWxH_C(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width, int height);
|
||||||
|
|
||||||
|
void TransposeWx8_C(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_NEON(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_SSSE3(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_Fast_SSSE3(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_DSPR2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_Fast_DSPR2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
|
||||||
|
void TransposeWx8_Any_NEON(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_Any_SSSE3(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_Fast_Any_SSSE3(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
void TransposeWx8_Any_DSPR2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst, int dst_stride, int width);
|
||||||
|
|
||||||
|
void TransposeUVWxH_C(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
void TransposeUVWx8_C(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
void TransposeUVWx8_SSE2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
void TransposeUVWx8_NEON(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
void TransposeUVWx8_DSPR2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
|
||||||
|
void TransposeUVWx8_Any_SSE2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
void TransposeUVWx8_Any_NEON(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
void TransposeUVWx8_Any_DSPR2(const uint8* src, int src_stride,
|
||||||
|
uint8* dst_a, int dst_stride_a,
|
||||||
|
uint8* dst_b, int dst_stride_b, int width);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_ROTATE_ROW_H_
|
||||||
1963
third_party/libyuv/x86_64/include/libyuv/row.h
vendored
Executable file
1963
third_party/libyuv/x86_64/include/libyuv/row.h
vendored
Executable file
File diff suppressed because it is too large
Load Diff
103
third_party/libyuv/x86_64/include/libyuv/scale.h
vendored
Executable file
103
third_party/libyuv/x86_64/include/libyuv/scale.h
vendored
Executable file
@@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_SCALE_H_
|
||||||
|
#define INCLUDE_LIBYUV_SCALE_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Supported filtering.
|
||||||
|
typedef enum FilterMode {
|
||||||
|
kFilterNone = 0, // Point sample; Fastest.
|
||||||
|
kFilterLinear = 1, // Filter horizontally only.
|
||||||
|
kFilterBilinear = 2, // Faster than box, but lower quality scaling down.
|
||||||
|
kFilterBox = 3 // Highest quality.
|
||||||
|
} FilterModeEnum;
|
||||||
|
|
||||||
|
// Scale a YUV plane.
|
||||||
|
LIBYUV_API
|
||||||
|
void ScalePlane(const uint8* src, int src_stride,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint8* dst, int dst_stride,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
void ScalePlane_16(const uint16* src, int src_stride,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint16* dst, int dst_stride,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
// Scales a YUV 4:2:0 image from the src width and height to the
|
||||||
|
// dst width and height.
|
||||||
|
// If filtering is kFilterNone, a simple nearest-neighbor algorithm is
|
||||||
|
// used. This produces basic (blocky) quality at the fastest speed.
|
||||||
|
// If filtering is kFilterBilinear, interpolation is used to produce a better
|
||||||
|
// quality image, at the expense of speed.
|
||||||
|
// If filtering is kFilterBox, averaging is used to produce ever better
|
||||||
|
// quality image, at further expense of speed.
|
||||||
|
// Returns 0 if successful.
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Scale(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint8* dst_y, int dst_stride_y,
|
||||||
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
uint8* dst_v, int dst_stride_v,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int I420Scale_16(const uint16* src_y, int src_stride_y,
|
||||||
|
const uint16* src_u, int src_stride_u,
|
||||||
|
const uint16* src_v, int src_stride_v,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint16* dst_y, int dst_stride_y,
|
||||||
|
uint16* dst_u, int dst_stride_u,
|
||||||
|
uint16* dst_v, int dst_stride_v,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
// Legacy API. Deprecated.
|
||||||
|
LIBYUV_API
|
||||||
|
int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v,
|
||||||
|
int src_stride_y, int src_stride_u, int src_stride_v,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint8* dst_y, uint8* dst_u, uint8* dst_v,
|
||||||
|
int dst_stride_y, int dst_stride_u, int dst_stride_v,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
LIBYUV_BOOL interpolate);
|
||||||
|
|
||||||
|
// Legacy API. Deprecated.
|
||||||
|
LIBYUV_API
|
||||||
|
int ScaleOffset(const uint8* src_i420, int src_width, int src_height,
|
||||||
|
uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset,
|
||||||
|
LIBYUV_BOOL interpolate);
|
||||||
|
|
||||||
|
// For testing, allow disabling of specialized scalers.
|
||||||
|
LIBYUV_API
|
||||||
|
void SetUseReferenceImpl(LIBYUV_BOOL use);
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_SCALE_H_
|
||||||
56
third_party/libyuv/x86_64/include/libyuv/scale_argb.h
vendored
Executable file
56
third_party/libyuv/x86_64/include/libyuv/scale_argb.h
vendored
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_SCALE_ARGB_H_
|
||||||
|
#define INCLUDE_LIBYUV_SCALE_ARGB_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
#include "libyuv/scale.h" // For FilterMode
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBScale(const uint8* src_argb, int src_stride_argb,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
// Clipped scale takes destination rectangle coordinates for clip values.
|
||||||
|
LIBYUV_API
|
||||||
|
int ARGBScaleClip(const uint8* src_argb, int src_stride_argb,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
int clip_x, int clip_y, int clip_width, int clip_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
// Scale with YUV conversion to ARGB and clipping.
|
||||||
|
LIBYUV_API
|
||||||
|
int YUVToARGBScaleClip(const uint8* src_y, int src_stride_y,
|
||||||
|
const uint8* src_u, int src_stride_u,
|
||||||
|
const uint8* src_v, int src_stride_v,
|
||||||
|
uint32 src_fourcc,
|
||||||
|
int src_width, int src_height,
|
||||||
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
|
uint32 dst_fourcc,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
int clip_x, int clip_y, int clip_width, int clip_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_SCALE_ARGB_H_
|
||||||
503
third_party/libyuv/x86_64/include/libyuv/scale_row.h
vendored
Executable file
503
third_party/libyuv/x86_64/include/libyuv/scale_row.h
vendored
Executable file
@@ -0,0 +1,503 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_SCALE_ROW_H_
|
||||||
|
#define INCLUDE_LIBYUV_SCALE_ROW_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
#include "libyuv/scale.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__pnacl__) || defined(__CLR_VER) || \
|
||||||
|
(defined(__i386__) && !defined(__SSE2__))
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
// MemorySanitizer does not support assembly code yet. http://crbug.com/344505
|
||||||
|
#if defined(__has_feature)
|
||||||
|
#if __has_feature(memory_sanitizer)
|
||||||
|
#define LIBYUV_DISABLE_X86
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// GCC >= 4.7.0 required for AVX2.
|
||||||
|
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
|
||||||
|
#if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7))
|
||||||
|
#define GCC_HAS_AVX2 1
|
||||||
|
#endif // GNUC >= 4.7
|
||||||
|
#endif // __GNUC__
|
||||||
|
|
||||||
|
// clang >= 3.4.0 required for AVX2.
|
||||||
|
#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
|
||||||
|
#if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4))
|
||||||
|
#define CLANG_HAS_AVX2 1
|
||||||
|
#endif // clang >= 3.4
|
||||||
|
#endif // __clang__
|
||||||
|
|
||||||
|
// Visual C 2012 required for AVX2.
|
||||||
|
#if defined(_M_IX86) && !defined(__clang__) && \
|
||||||
|
defined(_MSC_VER) && _MSC_VER >= 1700
|
||||||
|
#define VISUALC_HAS_AVX2 1
|
||||||
|
#endif // VisualStudio >= 2012
|
||||||
|
|
||||||
|
// The following are available on all x86 platforms:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||||
|
(defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
|
||||||
|
#define HAS_FIXEDDIV1_X86
|
||||||
|
#define HAS_FIXEDDIV_X86
|
||||||
|
#define HAS_SCALEARGBCOLS_SSE2
|
||||||
|
#define HAS_SCALEARGBCOLSUP2_SSE2
|
||||||
|
#define HAS_SCALEARGBFILTERCOLS_SSSE3
|
||||||
|
#define HAS_SCALEARGBROWDOWN2_SSE2
|
||||||
|
#define HAS_SCALEARGBROWDOWNEVEN_SSE2
|
||||||
|
#define HAS_SCALECOLSUP2_SSE2
|
||||||
|
#define HAS_SCALEFILTERCOLS_SSSE3
|
||||||
|
#define HAS_SCALEROWDOWN2_SSSE3
|
||||||
|
#define HAS_SCALEROWDOWN34_SSSE3
|
||||||
|
#define HAS_SCALEROWDOWN38_SSSE3
|
||||||
|
#define HAS_SCALEROWDOWN4_SSSE3
|
||||||
|
#define HAS_SCALEADDROW_SSE2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available on all x86 platforms, but
|
||||||
|
// require VS2012, clang 3.4 or gcc 4.7.
|
||||||
|
// The code supports NaCL but requires a new compiler and validator.
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \
|
||||||
|
defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2))
|
||||||
|
#define HAS_SCALEADDROW_AVX2
|
||||||
|
#define HAS_SCALEROWDOWN2_AVX2
|
||||||
|
#define HAS_SCALEROWDOWN4_AVX2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available on Neon platforms:
|
||||||
|
#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \
|
||||||
|
(defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
|
||||||
|
#define HAS_SCALEARGBCOLS_NEON
|
||||||
|
#define HAS_SCALEARGBROWDOWN2_NEON
|
||||||
|
#define HAS_SCALEARGBROWDOWNEVEN_NEON
|
||||||
|
#define HAS_SCALEFILTERCOLS_NEON
|
||||||
|
#define HAS_SCALEROWDOWN2_NEON
|
||||||
|
#define HAS_SCALEROWDOWN34_NEON
|
||||||
|
#define HAS_SCALEROWDOWN38_NEON
|
||||||
|
#define HAS_SCALEROWDOWN4_NEON
|
||||||
|
#define HAS_SCALEARGBFILTERCOLS_NEON
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The following are available on Mips platforms:
|
||||||
|
#if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \
|
||||||
|
defined(__mips__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2)
|
||||||
|
#define HAS_SCALEROWDOWN2_DSPR2
|
||||||
|
#define HAS_SCALEROWDOWN4_DSPR2
|
||||||
|
#define HAS_SCALEROWDOWN34_DSPR2
|
||||||
|
#define HAS_SCALEROWDOWN38_DSPR2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Scale ARGB vertically with bilinear interpolation.
|
||||||
|
void ScalePlaneVertical(int src_height,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
int src_stride, int dst_stride,
|
||||||
|
const uint8* src_argb, uint8* dst_argb,
|
||||||
|
int x, int y, int dy,
|
||||||
|
int bpp, enum FilterMode filtering);
|
||||||
|
|
||||||
|
void ScalePlaneVertical_16(int src_height,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
int src_stride, int dst_stride,
|
||||||
|
const uint16* src_argb, uint16* dst_argb,
|
||||||
|
int x, int y, int dy,
|
||||||
|
int wpp, enum FilterMode filtering);
|
||||||
|
|
||||||
|
// Simplify the filtering based on scale factors.
|
||||||
|
enum FilterMode ScaleFilterReduce(int src_width, int src_height,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
enum FilterMode filtering);
|
||||||
|
|
||||||
|
// Divide num by div and return as 16.16 fixed point result.
|
||||||
|
int FixedDiv_C(int num, int div);
|
||||||
|
int FixedDiv_X86(int num, int div);
|
||||||
|
// Divide num - 1 by div - 1 and return as 16.16 fixed point result.
|
||||||
|
int FixedDiv1_C(int num, int div);
|
||||||
|
int FixedDiv1_X86(int num, int div);
|
||||||
|
#ifdef HAS_FIXEDDIV_X86
|
||||||
|
#define FixedDiv FixedDiv_X86
|
||||||
|
#define FixedDiv1 FixedDiv1_X86
|
||||||
|
#else
|
||||||
|
#define FixedDiv FixedDiv_C
|
||||||
|
#define FixedDiv1 FixedDiv1_C
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Compute slope values for stepping.
|
||||||
|
void ScaleSlope(int src_width, int src_height,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
enum FilterMode filtering,
|
||||||
|
int* x, int* y, int* dx, int* dy);
|
||||||
|
|
||||||
|
void ScaleRowDown2_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Box_Odd_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst, int dst_width);
|
||||||
|
void ScaleRowDown4_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown4_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst, int dst_width);
|
||||||
|
void ScaleRowDown4Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown4Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst, int dst_width);
|
||||||
|
void ScaleRowDown34_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown34_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst, int dst_width);
|
||||||
|
void ScaleRowDown34_0_Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* d, int dst_width);
|
||||||
|
void ScaleRowDown34_0_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* d, int dst_width);
|
||||||
|
void ScaleRowDown34_1_Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* d, int dst_width);
|
||||||
|
void ScaleRowDown34_1_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* d, int dst_width);
|
||||||
|
void ScaleCols_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleCols_16_C(uint16* dst_ptr, const uint16* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleColsUp2_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int, int);
|
||||||
|
void ScaleColsUp2_16_C(uint16* dst_ptr, const uint16* src_ptr,
|
||||||
|
int dst_width, int, int);
|
||||||
|
void ScaleFilterCols_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleFilterCols_16_C(uint16* dst_ptr, const uint16* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleFilterCols64_C(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleFilterCols64_16_C(uint16* dst_ptr, const uint16* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleRowDown38_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown38_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst, int dst_width);
|
||||||
|
void ScaleRowDown38_3_Box_C(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_3_Box_16_C(const uint16* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint16* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_2_Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_2_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint16* dst_ptr, int dst_width);
|
||||||
|
void ScaleAddRow_C(const uint8* src_ptr, uint16* dst_ptr, int src_width);
|
||||||
|
void ScaleAddRow_16_C(const uint16* src_ptr, uint32* dst_ptr, int src_width);
|
||||||
|
void ScaleARGBRowDown2_C(const uint8* src_argb,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Linear_C(const uint8* src_argb,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Box_C(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEven_C(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEvenBox_C(const uint8* src_argb,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBCols_C(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBCols64_C(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBColsUp2_C(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int, int);
|
||||||
|
void ScaleARGBFilterCols_C(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBFilterCols64_C(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
|
||||||
|
// Specialized scalers for x86.
|
||||||
|
void ScaleRowDown2_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Box_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4Box_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
void ScaleRowDown34_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_1_Box_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_0_Box_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_3_Box_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_2_Box_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Box_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Box_Odd_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Box_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown2Box_Odd_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4Box_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4Box_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
void ScaleRowDown34_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_1_Box_Any_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_0_Box_Any_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_3_Box_Any_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_2_Box_Any_SSSE3(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
void ScaleAddRow_SSE2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
|
||||||
|
void ScaleAddRow_AVX2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
|
||||||
|
void ScaleAddRow_Any_SSE2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
|
||||||
|
void ScaleAddRow_Any_AVX2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
|
||||||
|
|
||||||
|
void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleColsUp2_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
|
||||||
|
|
||||||
|
// ARGB Column functions
|
||||||
|
void ScaleARGBCols_SSE2(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBFilterCols_SSSE3(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBColsUp2_SSE2(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBFilterCols_NEON(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBCols_NEON(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBFilterCols_Any_NEON(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
void ScaleARGBCols_Any_NEON(uint8* dst_argb, const uint8* src_argb,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
|
||||||
|
// ARGB Row functions
|
||||||
|
void ScaleARGBRowDown2_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Linear_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Box_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Linear_NEON(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleARGBRowDown2_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Linear_Any_SSE2(const uint8* src_argb,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Box_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Linear_Any_NEON(const uint8* src_argb,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDown2Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
|
||||||
|
void ScaleARGBRowDownEven_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
int src_stepx, uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEven_NEON(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEven_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEvenBox_Any_SSE2(const uint8* src_argb,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEven_Any_NEON(const uint8* src_argb, ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
void ScaleARGBRowDownEvenBox_Any_NEON(const uint8* src_argb,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
int src_stepx,
|
||||||
|
uint8* dst_argb, int dst_width);
|
||||||
|
|
||||||
|
// ScaleRowDown2Box also used by planar functions
|
||||||
|
// NEON downscalers with interpolation.
|
||||||
|
|
||||||
|
// Note - not static due to reuse in convert for 444 to 420.
|
||||||
|
void ScaleRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
|
||||||
|
void ScaleRowDown4_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
// Down scale from 4 to 3 pixels. Use the neon multilane read/write
|
||||||
|
// to load up the every 4th pixel into a 4 different registers.
|
||||||
|
// Point samples 32 pixels to 24 pixels.
|
||||||
|
void ScaleRowDown34_NEON(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_0_Box_NEON(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_1_Box_NEON(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
// 32 -> 12
|
||||||
|
void ScaleRowDown38_NEON(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
// 32x3 -> 12x1
|
||||||
|
void ScaleRowDown38_3_Box_NEON(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
// 32x2 -> 12x1
|
||||||
|
void ScaleRowDown38_2_Box_NEON(const uint8* src_ptr,
|
||||||
|
ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
void ScaleRowDown2_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Linear_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Box_Odd_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown4_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown4Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_0_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown34_1_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
// 32 -> 12
|
||||||
|
void ScaleRowDown38_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
// 32x3 -> 12x1
|
||||||
|
void ScaleRowDown38_3_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
// 32x2 -> 12x1
|
||||||
|
void ScaleRowDown38_2_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
void ScaleAddRow_NEON(const uint8* src_ptr, uint16* dst_ptr, int src_width);
|
||||||
|
void ScaleAddRow_Any_NEON(const uint8* src_ptr, uint16* dst_ptr, int src_width);
|
||||||
|
|
||||||
|
void ScaleFilterCols_NEON(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
|
||||||
|
void ScaleFilterCols_Any_NEON(uint8* dst_ptr, const uint8* src_ptr,
|
||||||
|
int dst_width, int x, int dx);
|
||||||
|
|
||||||
|
void ScaleRowDown2_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown2Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown4_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown4Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown34_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown34_0_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* d, int dst_width);
|
||||||
|
void ScaleRowDown34_1_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* d, int dst_width);
|
||||||
|
void ScaleRowDown38_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst, int dst_width);
|
||||||
|
void ScaleRowDown38_2_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
void ScaleRowDown38_3_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
||||||
|
uint8* dst_ptr, int dst_width);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_SCALE_ROW_H_
|
||||||
16
third_party/libyuv/x86_64/include/libyuv/version.h
vendored
Executable file
16
third_party/libyuv/x86_64/include/libyuv/version.h
vendored
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
|
#define LIBYUV_VERSION 1622
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||||
184
third_party/libyuv/x86_64/include/libyuv/video_common.h
vendored
Executable file
184
third_party/libyuv/x86_64/include/libyuv/video_common.h
vendored
Executable file
@@ -0,0 +1,184 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Common definitions for video, including fourcc and VideoFormat.
|
||||||
|
|
||||||
|
#ifndef INCLUDE_LIBYUV_VIDEO_COMMON_H_
|
||||||
|
#define INCLUDE_LIBYUV_VIDEO_COMMON_H_
|
||||||
|
|
||||||
|
#include "libyuv/basic_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace libyuv {
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Definition of FourCC codes
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Convert four characters to a FourCC code.
|
||||||
|
// Needs to be a macro otherwise the OS X compiler complains when the kFormat*
|
||||||
|
// constants are used in a switch.
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define FOURCC(a, b, c, d) ( \
|
||||||
|
(static_cast<uint32>(a)) | (static_cast<uint32>(b) << 8) | \
|
||||||
|
(static_cast<uint32>(c) << 16) | (static_cast<uint32>(d) << 24))
|
||||||
|
#else
|
||||||
|
#define FOURCC(a, b, c, d) ( \
|
||||||
|
((uint32)(a)) | ((uint32)(b) << 8) | /* NOLINT */ \
|
||||||
|
((uint32)(c) << 16) | ((uint32)(d) << 24)) /* NOLINT */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Some pages discussing FourCC codes:
|
||||||
|
// http://www.fourcc.org/yuv.php
|
||||||
|
// http://v4l2spec.bytesex.org/spec/book1.htm
|
||||||
|
// http://developer.apple.com/quicktime/icefloe/dispatch020.html
|
||||||
|
// http://msdn.microsoft.com/library/windows/desktop/dd206750.aspx#nv12
|
||||||
|
// http://people.xiph.org/~xiphmont/containers/nut/nut4cc.txt
|
||||||
|
|
||||||
|
// FourCC codes grouped according to implementation efficiency.
|
||||||
|
// Primary formats should convert in 1 efficient step.
|
||||||
|
// Secondary formats are converted in 2 steps.
|
||||||
|
// Auxilliary formats call primary converters.
|
||||||
|
enum FourCC {
|
||||||
|
// 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed.
|
||||||
|
FOURCC_I420 = FOURCC('I', '4', '2', '0'),
|
||||||
|
FOURCC_I422 = FOURCC('I', '4', '2', '2'),
|
||||||
|
FOURCC_I444 = FOURCC('I', '4', '4', '4'),
|
||||||
|
FOURCC_I411 = FOURCC('I', '4', '1', '1'),
|
||||||
|
FOURCC_I400 = FOURCC('I', '4', '0', '0'),
|
||||||
|
FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
|
||||||
|
FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
|
||||||
|
FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
|
||||||
|
FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
|
||||||
|
|
||||||
|
// 2 Secondary YUV formats: row biplanar.
|
||||||
|
FOURCC_M420 = FOURCC('M', '4', '2', '0'),
|
||||||
|
FOURCC_Q420 = FOURCC('Q', '4', '2', '0'), // deprecated.
|
||||||
|
|
||||||
|
// 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp.
|
||||||
|
FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
|
||||||
|
FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
|
||||||
|
FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
|
||||||
|
FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
|
||||||
|
FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
|
||||||
|
FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'),
|
||||||
|
FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE.
|
||||||
|
FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE.
|
||||||
|
FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE.
|
||||||
|
|
||||||
|
// 4 Secondary RGB formats: 4 Bayer Patterns. deprecated.
|
||||||
|
FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'),
|
||||||
|
FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'),
|
||||||
|
FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'),
|
||||||
|
FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'),
|
||||||
|
|
||||||
|
// 1 Primary Compressed YUV format.
|
||||||
|
FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
|
||||||
|
|
||||||
|
// 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
|
||||||
|
FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
|
||||||
|
FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
|
||||||
|
FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
|
||||||
|
FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420.
|
||||||
|
FOURCC_J420 = FOURCC('J', '4', '2', '0'),
|
||||||
|
FOURCC_J400 = FOURCC('J', '4', '0', '0'), // unofficial fourcc
|
||||||
|
FOURCC_H420 = FOURCC('H', '4', '2', '0'), // unofficial fourcc
|
||||||
|
|
||||||
|
// 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc.
|
||||||
|
FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
|
||||||
|
FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
|
||||||
|
FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
|
||||||
|
FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
|
||||||
|
FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
|
||||||
|
FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
|
||||||
|
FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac.
|
||||||
|
FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
|
||||||
|
FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
|
||||||
|
FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
|
||||||
|
FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
|
||||||
|
FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
|
||||||
|
FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB
|
||||||
|
FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB
|
||||||
|
FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO.
|
||||||
|
FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP.
|
||||||
|
FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO.
|
||||||
|
|
||||||
|
// 1 Auxiliary compressed YUV format set aside for capturer.
|
||||||
|
FOURCC_H264 = FOURCC('H', '2', '6', '4'),
|
||||||
|
|
||||||
|
// Match any fourcc.
|
||||||
|
FOURCC_ANY = -1,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum FourCCBpp {
|
||||||
|
// Canonical fourcc codes used in our code.
|
||||||
|
FOURCC_BPP_I420 = 12,
|
||||||
|
FOURCC_BPP_I422 = 16,
|
||||||
|
FOURCC_BPP_I444 = 24,
|
||||||
|
FOURCC_BPP_I411 = 12,
|
||||||
|
FOURCC_BPP_I400 = 8,
|
||||||
|
FOURCC_BPP_NV21 = 12,
|
||||||
|
FOURCC_BPP_NV12 = 12,
|
||||||
|
FOURCC_BPP_YUY2 = 16,
|
||||||
|
FOURCC_BPP_UYVY = 16,
|
||||||
|
FOURCC_BPP_M420 = 12,
|
||||||
|
FOURCC_BPP_Q420 = 12,
|
||||||
|
FOURCC_BPP_ARGB = 32,
|
||||||
|
FOURCC_BPP_BGRA = 32,
|
||||||
|
FOURCC_BPP_ABGR = 32,
|
||||||
|
FOURCC_BPP_RGBA = 32,
|
||||||
|
FOURCC_BPP_24BG = 24,
|
||||||
|
FOURCC_BPP_RAW = 24,
|
||||||
|
FOURCC_BPP_RGBP = 16,
|
||||||
|
FOURCC_BPP_RGBO = 16,
|
||||||
|
FOURCC_BPP_R444 = 16,
|
||||||
|
FOURCC_BPP_RGGB = 8,
|
||||||
|
FOURCC_BPP_BGGR = 8,
|
||||||
|
FOURCC_BPP_GRBG = 8,
|
||||||
|
FOURCC_BPP_GBRG = 8,
|
||||||
|
FOURCC_BPP_YV12 = 12,
|
||||||
|
FOURCC_BPP_YV16 = 16,
|
||||||
|
FOURCC_BPP_YV24 = 24,
|
||||||
|
FOURCC_BPP_YU12 = 12,
|
||||||
|
FOURCC_BPP_J420 = 12,
|
||||||
|
FOURCC_BPP_J400 = 8,
|
||||||
|
FOURCC_BPP_H420 = 12,
|
||||||
|
FOURCC_BPP_MJPG = 0, // 0 means unknown.
|
||||||
|
FOURCC_BPP_H264 = 0,
|
||||||
|
FOURCC_BPP_IYUV = 12,
|
||||||
|
FOURCC_BPP_YU16 = 16,
|
||||||
|
FOURCC_BPP_YU24 = 24,
|
||||||
|
FOURCC_BPP_YUYV = 16,
|
||||||
|
FOURCC_BPP_YUVS = 16,
|
||||||
|
FOURCC_BPP_HDYC = 16,
|
||||||
|
FOURCC_BPP_2VUY = 16,
|
||||||
|
FOURCC_BPP_JPEG = 1,
|
||||||
|
FOURCC_BPP_DMB1 = 1,
|
||||||
|
FOURCC_BPP_BA81 = 8,
|
||||||
|
FOURCC_BPP_RGB3 = 24,
|
||||||
|
FOURCC_BPP_BGR3 = 24,
|
||||||
|
FOURCC_BPP_CM32 = 32,
|
||||||
|
FOURCC_BPP_CM24 = 24,
|
||||||
|
|
||||||
|
// Match any fourcc.
|
||||||
|
FOURCC_BPP_ANY = 0, // 0 means unknown.
|
||||||
|
};
|
||||||
|
|
||||||
|
// Converts fourcc aliases into canonical ones.
|
||||||
|
LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
} // namespace libyuv
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDE_LIBYUV_VIDEO_COMMON_H_
|
||||||
BIN
third_party/libyuv/x86_64/lib/libyuv.a
vendored
Normal file
BIN
third_party/libyuv/x86_64/lib/libyuv.a
vendored
Normal file
Binary file not shown.
1
third_party/maplibre-native-qt/aarch64
vendored
1
third_party/maplibre-native-qt/aarch64
vendored
@@ -1 +0,0 @@
|
|||||||
larch64/
|
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Export
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Export
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "export_core.hpp"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/LayerParameter
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/LayerParameter
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "layer_parameter.hpp"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Map
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Map
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "map.hpp"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/QMapLibre
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/QMapLibre
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "qmaplibre"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Settings
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Settings
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "settings.hpp"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/SourceParameter
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/SourceParameter
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "source_parameter.hpp"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/StyleParameter
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/StyleParameter
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "style_parameter.hpp"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Types
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Types
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "types.hpp"
|
||||||
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Utils
vendored
Executable file
1
third_party/maplibre-native-qt/aarch64/include/QMapLibre/Utils
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "utils.hpp"
|
||||||
BIN
third_party/maplibre-native-qt/aarch64/lib/libQMapLibre.so.3.0.0
vendored
Executable file
BIN
third_party/maplibre-native-qt/aarch64/lib/libQMapLibre.so.3.0.0
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libPlatformValidatorShared.so
vendored
Executable file
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libPlatformValidatorShared.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libSNPE.so
vendored
Executable file
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libSNPE.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libcalculator.so
vendored
Executable file
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libcalculator.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libhta.so
vendored
Executable file
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libhta.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libsnpe_dsp_domains_v2.so
vendored
Executable file
BIN
third_party/snpe/aarch64-ubuntu-gcc7.5/libsnpe_dsp_domains_v2.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/dsp/libcalculator_skel.so
vendored
Executable file
BIN
third_party/snpe/dsp/libcalculator_skel.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so
vendored
Executable file
BIN
third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so
vendored
Executable file
BIN
third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/dsp/libsnpe_dsp_v68_domains_v3_skel.so
vendored
Executable file
BIN
third_party/snpe/dsp/libsnpe_dsp_v68_domains_v3_skel.so
vendored
Executable file
Binary file not shown.
1
third_party/snpe/larch64
vendored
1
third_party/snpe/larch64
vendored
@@ -1 +0,0 @@
|
|||||||
aarch64-ubuntu-gcc7.5
|
|
||||||
BIN
third_party/snpe/larch64/libPlatformValidatorShared.so
vendored
Executable file
BIN
third_party/snpe/larch64/libPlatformValidatorShared.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/larch64/libSNPE.so
vendored
Executable file
BIN
third_party/snpe/larch64/libSNPE.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/larch64/libcalculator.so
vendored
Executable file
BIN
third_party/snpe/larch64/libcalculator.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/larch64/libhta.so
vendored
Executable file
BIN
third_party/snpe/larch64/libhta.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/larch64/libsnpe_dsp_domains_v2.so
vendored
Executable file
BIN
third_party/snpe/larch64/libsnpe_dsp_domains_v2.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/x86_64-linux-clang/libHtpPrepare.so
vendored
Normal file
BIN
third_party/snpe/x86_64-linux-clang/libHtpPrepare.so
vendored
Normal file
Binary file not shown.
BIN
third_party/snpe/x86_64-linux-clang/libSNPE.so
vendored
Normal file
BIN
third_party/snpe/x86_64-linux-clang/libSNPE.so
vendored
Normal file
Binary file not shown.
BIN
third_party/snpe/x86_64-linux-clang/libomp.so
vendored
Executable file
BIN
third_party/snpe/x86_64-linux-clang/libomp.so
vendored
Executable file
Binary file not shown.
BIN
third_party/snpe/x86_64/libHtpPrepare.so
vendored
Normal file
BIN
third_party/snpe/x86_64/libHtpPrepare.so
vendored
Normal file
Binary file not shown.
BIN
third_party/snpe/x86_64/libSNPE.so
vendored
Normal file
BIN
third_party/snpe/x86_64/libSNPE.so
vendored
Normal file
Binary file not shown.
BIN
third_party/snpe/x86_64/libomp.so
vendored
Executable file
BIN
third_party/snpe/x86_64/libomp.so
vendored
Executable file
Binary file not shown.
Reference in New Issue
Block a user