summaryrefslogtreecommitdiff
path: root/ffmpeg/libavfilter/libmpcodecs
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-12-29 12:19:38 +0000
committerTim Redfern <tim@eclectronics.org>2013-12-29 12:19:38 +0000
commitf7813a5324be39d13ab536c245d15dfc602a7849 (patch)
treefad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavfilter/libmpcodecs
parentb7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff)
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavfilter/libmpcodecs')
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/help_mp.h2126
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/mpbswap.h34
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/pullup.c823
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/pullup.h102
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_detc.c453
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_dint.c214
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_divtc.c722
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_down3dright.c166
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_eq.c2
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_fil.c116
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_filmdint.c1461
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_ivtc.c550
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_mcdeint.c340
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_noise.c475
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_ow.c322
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_perspective.c345
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_phase.c303
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_pullup.c316
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_qp.c178
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_sab.c324
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_scale.h34
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_spp.c621
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_telecine.c158
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_tinterlace.c235
-rw-r--r--ffmpeg/libavfilter/libmpcodecs/vf_uspp.c4
25 files changed, 3 insertions, 10421 deletions
diff --git a/ffmpeg/libavfilter/libmpcodecs/help_mp.h b/ffmpeg/libavfilter/libmpcodecs/help_mp.h
deleted file mode 100644
index 6ceb630..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/help_mp.h
+++ /dev/null
@@ -1,2126 +0,0 @@
-/* WARNING! This is a generated file, do NOT edit.
- * See the help/ subdirectory for the editable files. */
-
-#ifndef MPLAYER_HELP_MP_H
-#define MPLAYER_HELP_MP_H
-
-// $Revision: 32397 $
-// MASTER FILE. Use this file as base for translations.
-// Translated files should be sent to the mplayer-DOCS mailing list or
-// to the help messages maintainer, see DOCS/tech/MAINTAINERS.
-// The header of the translated file should contain credits and contact
-// information. Before major releases we will notify all translators to update
-// their files. Please do not simply translate and forget this, outdated
-// translations quickly become worthless. To help us spot outdated files put a
-// note like "sync'ed with help_mp-en.h XXX" in the header of the translation.
-// Do NOT translate the above lines, just follow the instructions.
-
-
-// ========================= MPlayer help ===========================
-
-static const char help_text[]=
-"Usage: mplayer [options] [url|path/]filename\n"
-"\n"
-"Basic options: (complete list in the man page)\n"
-" -vo <drv> select video output driver ('-vo help' for a list)\n"
-" -ao <drv> select audio output driver ('-ao help' for a list)\n"
-#ifdef CONFIG_VCD
-" vcd://<trackno> play (S)VCD (Super Video CD) track (raw device, no mount)\n"
-#endif
-#ifdef CONFIG_DVDREAD
-" dvd://<titleno> play DVD title from device instead of plain file\n"
-#endif
-" -alang/-slang select DVD audio/subtitle language (by 2-char country code)\n"
-" -ss <position> seek to given (seconds or hh:mm:ss) position\n"
-" -nosound do not play sound\n"
-" -fs fullscreen playback (or -vm, -zoom, details in the man page)\n"
-" -x <x> -y <y> set display resolution (for use with -vm or -zoom)\n"
-" -sub <file> specify subtitle file to use (also see -subfps, -subdelay)\n"
-" -playlist <file> specify playlist file\n"
-" -vid x -aid y select video (x) and audio (y) stream to play\n"
-" -fps x -srate y change video (x fps) and audio (y Hz) rate\n"
-" -pp <quality> enable postprocessing filter (details in the man page)\n"
-" -framedrop enable frame dropping (for slow machines)\n"
-"\n"
-"Basic keys: (complete list in the man page, also check input.conf)\n"
-" <- or -> seek backward/forward 10 seconds\n"
-" down or up seek backward/forward 1 minute\n"
-" pgdown or pgup seek backward/forward 10 minutes\n"
-" < or > step backward/forward in playlist\n"
-" p or SPACE pause movie (press any key to continue)\n"
-" q or ESC stop playing and quit program\n"
-" + or - adjust audio delay by +/- 0.1 second\n"
-" o cycle OSD mode: none / seekbar / seekbar + timer\n"
-" * or / increase or decrease PCM volume\n"
-" x or z adjust subtitle delay by +/- 0.1 second\n"
-" r or t adjust subtitle position up/down, also see -vf expand\n"
-"\n"
-" * * * SEE THE MAN PAGE FOR DETAILS, FURTHER (ADVANCED) OPTIONS AND KEYS * * *\n"
-"\n";
-
-// ========================= MPlayer messages ===========================
-
-// mplayer.c
-#define MSGTR_Exiting "\nExiting...\n"
-#define MSGTR_ExitingHow "\nExiting... (%s)\n"
-#define MSGTR_Exit_quit "Quit"
-#define MSGTR_Exit_eof "End of file"
-#define MSGTR_Exit_error "Fatal error"
-#define MSGTR_IntBySignal "\nMPlayer interrupted by signal %d in module: %s\n"
-#define MSGTR_NoHomeDir "Cannot find HOME directory.\n"
-#define MSGTR_GetpathProblem "get_path(\"config\") problem\n"
-#define MSGTR_CreatingCfgFile "Creating config file: %s\n"
-#define MSGTR_CantLoadFont "Cannot load bitmap font '%s'.\n"
-#define MSGTR_CantLoadSub "Cannot load subtitles '%s'.\n"
-#define MSGTR_DumpSelectedStreamMissing "dump: FATAL: Selected stream missing!\n"
-#define MSGTR_CantOpenDumpfile "Cannot open dump file.\n"
-#define MSGTR_CoreDumped "Core dumped ;)\n"
-#define MSGTR_DumpBytesWrittenPercent "dump: %"PRIu64" bytes written (~%.1f%%)\r"
-#define MSGTR_DumpBytesWritten "dump: %"PRIu64" bytes written\r"
-#define MSGTR_DumpBytesWrittenTo "dump: %"PRIu64" bytes written to '%s'.\n"
-#define MSGTR_FPSnotspecified "FPS not specified in the header or invalid, use the -fps option.\n"
-#define MSGTR_TryForceAudioFmtStr "Trying to force audio codec driver family %s...\n"
-#define MSGTR_CantFindAudioCodec "Cannot find codec for audio format 0x%X.\n"
-#define MSGTR_TryForceVideoFmtStr "Trying to force video codec driver family %s...\n"
-#define MSGTR_CantFindVideoCodec "Cannot find codec matching selected -vo and video format 0x%X.\n"
-#define MSGTR_CannotInitVO "FATAL: Cannot initialize video driver.\n"
-#define MSGTR_CannotInitAO "Could not open/initialize audio device -> no sound.\n"
-#define MSGTR_StartPlaying "Starting playback...\n"
-
-#define MSGTR_SystemTooSlow "\n\n"\
-" ************************************************\n"\
-" **** Your system is too SLOW to play this! ****\n"\
-" ************************************************\n\n"\
-"Possible reasons, problems, workarounds:\n"\
-"- Most common: broken/buggy _audio_ driver\n"\
-" - Try -ao sdl or use the OSS emulation of ALSA.\n"\
-" - Experiment with different values for -autosync, 30 is a good start.\n"\
-"- Slow video output\n"\
-" - Try a different -vo driver (-vo help for a list) or try -framedrop!\n"\
-"- Slow CPU\n"\
-" - Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,\n"\
-" e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.\n"\
-"- Broken file\n"\
-" - Try various combinations of -nobps -ni -forceidx -mc 0.\n"\
-"- Slow media (NFS/SMB mounts, DVD, VCD etc)\n"\
-" - Try -cache 8192.\n"\
-"- Are you using -cache to play a non-interleaved AVI file?\n"\
-" - Try -nocache.\n"\
-"Read DOCS/HTML/en/video.html for tuning/speedup tips.\n"\
-"If none of this helps you, read DOCS/HTML/en/bugreports.html.\n\n"
-
-#define MSGTR_NoGui "MPlayer was compiled WITHOUT GUI support.\n"
-#define MSGTR_GuiNeedsX "MPlayer GUI requires X11.\n"
-#define MSGTR_Playing "\nPlaying %s.\n"
-#define MSGTR_NoSound "Audio: no sound\n"
-#define MSGTR_FPSforced "FPS forced to be %5.3f (ftime: %5.3f).\n"
-#define MSGTR_AvailableVideoOutputDrivers "Available video output drivers:\n"
-#define MSGTR_AvailableAudioOutputDrivers "Available audio output drivers:\n"
-#define MSGTR_AvailableAudioCodecs "Available audio codecs:\n"
-#define MSGTR_AvailableVideoCodecs "Available video codecs:\n"
-#define MSGTR_AvailableAudioFm "Available (compiled-in) audio codec families/drivers:\n"
-#define MSGTR_AvailableVideoFm "Available (compiled-in) video codec families/drivers:\n"
-#define MSGTR_AvailableFsType "Available fullscreen layer change modes:\n"
-#define MSGTR_CannotReadVideoProperties "Video: Cannot read properties.\n"
-#define MSGTR_NoStreamFound "No stream found.\n"
-#define MSGTR_ErrorInitializingVODevice "Error opening/initializing the selected video_out (-vo) device.\n"
-#define MSGTR_ForcedVideoCodec "Forced video codec: %s\n"
-#define MSGTR_ForcedAudioCodec "Forced audio codec: %s\n"
-#define MSGTR_Video_NoVideo "Video: no video\n"
-#define MSGTR_NotInitializeVOPorVO "\nFATAL: Could not initialize video filters (-vf) or video output (-vo).\n"
-#define MSGTR_Paused " ===== PAUSE =====" // no more than 23 characters (status line for audio files)
-#define MSGTR_PlaylistLoadUnable "\nUnable to load playlist %s.\n"
-#define MSGTR_Exit_SIGILL_RTCpuSel \
-"- MPlayer crashed by an 'Illegal Instruction'.\n"\
-" It may be a bug in our new runtime CPU-detection code...\n"\
-" Please read DOCS/HTML/en/bugreports.html.\n"
-#define MSGTR_Exit_SIGILL \
-"- MPlayer crashed by an 'Illegal Instruction'.\n"\
-" It usually happens when you run it on a CPU different than the one it was\n"\
-" compiled/optimized for.\n"\
-" Verify this!\n"
-#define MSGTR_Exit_SIGSEGV_SIGFPE \
-"- MPlayer crashed by bad usage of CPU/FPU/RAM.\n"\
-" Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and\n"\
-" disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.\n"
-#define MSGTR_Exit_SIGCRASH \
-"- MPlayer crashed. This shouldn't happen.\n"\
-" It can be a bug in the MPlayer code _or_ in your drivers _or_ in your\n"\
-" gcc version. If you think it's MPlayer's fault, please read\n"\
-" DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and\n"\
-" won't help unless you provide this information when reporting a possible bug.\n"
-#define MSGTR_LoadingConfig "Loading config '%s'\n"
-#define MSGTR_LoadingProtocolProfile "Loading protocol-related profile '%s'\n"
-#define MSGTR_LoadingExtensionProfile "Loading extension-related profile '%s'\n"
-#define MSGTR_AddedSubtitleFile "SUB: Added subtitle file (%d): %s\n"
-#define MSGTR_RemovedSubtitleFile "SUB: Removed subtitle file (%d): %s\n"
-#define MSGTR_ErrorOpeningOutputFile "Error opening file [%s] for writing!\n"
-#define MSGTR_RTCDeviceNotOpenable "Failed to open %s: %s (it should be readable by the user.)\n"
-#define MSGTR_LinuxRTCInitErrorIrqpSet "Linux RTC init error in ioctl (rtc_irqp_set %lu): %s\n"
-#define MSGTR_IncreaseRTCMaxUserFreq "Try adding \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" to your system startup scripts.\n"
-#define MSGTR_LinuxRTCInitErrorPieOn "Linux RTC init error in ioctl (rtc_pie_on): %s\n"
-#define MSGTR_UsingTimingType "Using %s timing.\n"
-#define MSGTR_Getch2InitializedTwice "WARNING: getch2_init called twice!\n"
-#define MSGTR_DumpstreamFdUnavailable "Cannot dump this stream - no file descriptor available.\n"
-#define MSGTR_CantOpenLibmenuFilterWithThisRootMenu "Can't open libmenu video filter with root menu %s.\n"
-#define MSGTR_AudioFilterChainPreinitError "Error at audio filter chain pre-init!\n"
-#define MSGTR_LinuxRTCReadError "Linux RTC read error: %s\n"
-#define MSGTR_SoftsleepUnderflow "Warning! Softsleep underflow!\n"
-#define MSGTR_DvdnavNullEvent "DVDNAV Event NULL?!\n"
-#define MSGTR_DvdnavHighlightEventBroken "DVDNAV Event: Highlight event broken\n"
-#define MSGTR_DvdnavEvent "DVDNAV Event: %s\n"
-#define MSGTR_DvdnavHighlightHide "DVDNAV Event: Highlight Hide\n"
-#define MSGTR_DvdnavStillFrame "######################################## DVDNAV Event: Still Frame: %d sec(s)\n"
-#define MSGTR_DvdnavNavStop "DVDNAV Event: Nav Stop\n"
-#define MSGTR_DvdnavNavNOP "DVDNAV Event: Nav NOP\n"
-#define MSGTR_DvdnavNavSpuStreamChangeVerbose "DVDNAV Event: Nav SPU Stream Change: phys: %d/%d/%d logical: %d\n"
-#define MSGTR_DvdnavNavSpuStreamChange "DVDNAV Event: Nav SPU Stream Change: phys: %d logical: %d\n"
-#define MSGTR_DvdnavNavAudioStreamChange "DVDNAV Event: Nav Audio Stream Change: phys: %d logical: %d\n"
-#define MSGTR_DvdnavNavVTSChange "DVDNAV Event: Nav VTS Change\n"
-#define MSGTR_DvdnavNavCellChange "DVDNAV Event: Nav Cell Change\n"
-#define MSGTR_DvdnavNavSpuClutChange "DVDNAV Event: Nav SPU CLUT Change\n"
-#define MSGTR_DvdnavNavSeekDone "DVDNAV Event: Nav Seek Done\n"
-#define MSGTR_MenuCall "Menu call\n"
-#define MSGTR_MasterQuit "Option -udp-slave: exiting because master exited\n"
-#define MSGTR_InvalidIP "Option -udp-ip: invalid IP address\n"
-#define MSGTR_Forking "Forking...\n"
-#define MSGTR_Forked "Forked...\n"
-#define MSGTR_CouldntStartGdb "Couldn't start gdb\n"
-#define MSGTR_CouldntFork "Couldn't fork\n"
-#define MSGTR_FilenameTooLong "Filename is too long, can not load file or directory specific config files\n"
-#define MSGTR_AudioDeviceStuck "Audio device got stuck!\n"
-#define MSGTR_AudioOutputTruncated "Audio output truncated at end.\n"
-#define MSGTR_ASSCannotAddVideoFilter "ASS: cannot add video filter\n"
-#define MSGTR_PtsAfterFiltersMissing "pts after filters MISSING\n"
-#define MSGTR_CommandLine "CommandLine:"
-#define MSGTR_MenuInitFailed "Menu init failed.\n"
-
-// --- edit decision lists
-#define MSGTR_EdlOutOfMem "Can't allocate enough memory to hold EDL data.\n"
-#define MSGTR_EdlOutOfMemFile "Can't allocate enough memory to hold EDL file name [%s].\n"
-#define MSGTR_EdlRecordsNo "Read %d EDL actions.\n"
-#define MSGTR_EdlQueueEmpty "There are no EDL actions to take care of.\n"
-#define MSGTR_EdlCantOpenForWrite "Can't open EDL file [%s] for writing.\n"
-#define MSGTR_EdlCantOpenForRead "Can't open EDL file [%s] for reading.\n"
-#define MSGTR_EdlNOsh_video "Cannot use EDL without video, disabling.\n"
-#define MSGTR_EdlNOValidLine "Invalid EDL line: %s\n"
-#define MSGTR_EdlBadlyFormattedLine "Badly formatted EDL line [%d], discarding.\n"
-#define MSGTR_EdlBadLineOverlap "Last stop position was [%f]; next start is [%f].\n"\
-"Entries must be in chronological order, cannot overlap. Discarding.\n"
-#define MSGTR_EdlBadLineBadStop "Stop time has to be after start time.\n"
-#define MSGTR_EdloutBadStop "EDL skip canceled, last start > stop\n"
-#define MSGTR_EdloutStartSkip "EDL skip start, press 'i' again to end block.\n"
-#define MSGTR_EdloutEndSkip "EDL skip end, line written.\n"
-
-// mplayer.c OSD
-#define MSGTR_OSDenabled "enabled"
-#define MSGTR_OSDdisabled "disabled"
-#define MSGTR_OSDAudio "Audio: %s"
-#define MSGTR_OSDVideo "Video: %s"
-#define MSGTR_OSDChannel "Channel: %s"
-#define MSGTR_OSDSubDelay "Sub delay: %d ms"
-#define MSGTR_OSDSpeed "Speed: x %6.2f"
-#define MSGTR_OSDosd "OSD: %s"
-#define MSGTR_OSDChapter "Chapter: (%d) %s"
-#define MSGTR_OSDAngle "Angle: %d/%d"
-#define MSGTR_OSDDeinterlace "Deinterlace: %s"
-#define MSGTR_OSDCapturing "Capturing: %s"
-#define MSGTR_OSDCapturingFailure "Capturing failed"
-
-// property values
-#define MSGTR_Enabled "enabled"
-#define MSGTR_EnabledEdl "enabled (EDL)"
-#define MSGTR_Disabled "disabled"
-#define MSGTR_HardFrameDrop "hard"
-#define MSGTR_Unknown "unknown"
-#define MSGTR_Bottom "bottom"
-#define MSGTR_Center "center"
-#define MSGTR_Top "top"
-#define MSGTR_SubSourceFile "file"
-#define MSGTR_SubSourceVobsub "vobsub"
-#define MSGTR_SubSourceDemux "embedded"
-
-// OSD bar names
-#define MSGTR_Volume "Volume"
-#define MSGTR_Panscan "Panscan"
-#define MSGTR_Gamma "Gamma"
-#define MSGTR_Brightness "Brightness"
-#define MSGTR_Contrast "Contrast"
-#define MSGTR_Saturation "Saturation"
-#define MSGTR_Hue "Hue"
-#define MSGTR_Balance "Balance"
-
-// property state
-#define MSGTR_LoopStatus "Loop: %s"
-#define MSGTR_MuteStatus "Mute: %s"
-#define MSGTR_AVDelayStatus "A-V delay: %s"
-#define MSGTR_OnTopStatus "Stay on top: %s"
-#define MSGTR_RootwinStatus "Rootwin: %s"
-#define MSGTR_BorderStatus "Border: %s"
-#define MSGTR_FramedroppingStatus "Framedropping: %s"
-#define MSGTR_VSyncStatus "VSync: %s"
-#define MSGTR_SubSelectStatus "Subtitles: %s"
-#define MSGTR_SubSourceStatus "Sub source: %s"
-#define MSGTR_SubPosStatus "Sub position: %s/100"
-#define MSGTR_SubAlignStatus "Sub alignment: %s"
-#define MSGTR_SubDelayStatus "Sub delay: %s"
-#define MSGTR_SubScale "Sub Scale: %s"
-#define MSGTR_SubVisibleStatus "Subtitles: %s"
-#define MSGTR_SubForcedOnlyStatus "Forced sub only: %s"
-
-// mencoder.c
-#define MSGTR_UsingPass3ControlFile "Using pass3 control file: %s\n"
-#define MSGTR_MissingFilename "\nFilename missing.\n\n"
-#define MSGTR_CannotOpenFile_Device "Cannot open file/device.\n"
-#define MSGTR_CannotOpenDemuxer "Cannot open demuxer.\n"
-#define MSGTR_NoAudioEncoderSelected "\nNo audio encoder (-oac) selected. Select one (see -oac help) or use -nosound.\n"
-#define MSGTR_NoVideoEncoderSelected "\nNo video encoder (-ovc) selected. Select one (see -ovc help).\n"
-#define MSGTR_CannotOpenOutputFile "Cannot open output file '%s'.\n"
-#define MSGTR_EncoderOpenFailed "Failed to open the encoder.\n"
-#define MSGTR_MencoderWrongFormatAVI "\nWARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.\n"
-#define MSGTR_MencoderWrongFormatMPG "\nWARNING: OUTPUT FILE FORMAT IS _MPEG_. See -of help.\n"
-#define MSGTR_MissingOutputFilename "No output file specified, please see the -o option."
-#define MSGTR_ForcingOutputFourcc "Forcing output FourCC to %x [%.4s].\n"
-#define MSGTR_ForcingOutputAudiofmtTag "Forcing output audio format tag to 0x%x.\n"
-#define MSGTR_DuplicateFrames "\n%d duplicate frame(s)!\n"
-#define MSGTR_SkipFrame "\nSkipping frame!\n"
-#define MSGTR_ResolutionDoesntMatch "\nNew video file has different resolution or colorspace than the previous one.\n"
-#define MSGTR_FrameCopyFileMismatch "\nAll video files must have identical fps, resolution, and codec for -ovc copy.\n"
-#define MSGTR_AudioCopyFileMismatch "\nAll files must have identical audio codec and format for -oac copy.\n"
-#define MSGTR_NoAudioFileMismatch "\nCannot mix video-only files with audio and video files. Try -nosound.\n"
-#define MSGTR_NoSpeedWithFrameCopy "WARNING: -speed is not guaranteed to work correctly with -oac copy!\n"\
-"Your encode might be broken!\n"
-#define MSGTR_ErrorWritingFile "%s: Error writing file.\n"
-#define MSGTR_FlushingVideoFrames "\nFlushing video frames.\n"
-#define MSGTR_FiltersHaveNotBeenConfiguredEmptyFile "Filters have not been configured! Empty file?\n"
-#define MSGTR_RecommendedVideoBitrate "Recommended video bitrate for %s CD: %d\n"
-#define MSGTR_VideoStreamResult "\nVideo stream: %8.3f kbit/s (%d B/s) size: %"PRIu64" bytes %5.3f secs %d frames\n"
-#define MSGTR_AudioStreamResult "\nAudio stream: %8.3f kbit/s (%d B/s) size: %"PRIu64" bytes %5.3f secs\n"
-#define MSGTR_EdlSkipStartEndCurrent "EDL SKIP: Start: %.2f End: %.2f Current: V: %.2f A: %.2f \r"
-#define MSGTR_OpenedStream "success: format: %d data: 0x%X - 0x%x\n"
-#define MSGTR_VCodecFramecopy "videocodec: framecopy (%dx%d %dbpp fourcc=%x)\n"
-#define MSGTR_ACodecFramecopy "audiocodec: framecopy (format=%x chans=%d rate=%d bits=%d B/s=%d sample-%d)\n"
-#define MSGTR_CBRPCMAudioSelected "CBR PCM audio selected.\n"
-#define MSGTR_MP3AudioSelected "MP3 audio selected.\n"
-#define MSGTR_CannotAllocateBytes "Couldn't allocate %d bytes.\n"
-#define MSGTR_SettingAudioDelay "Setting audio delay to %5.3fs.\n"
-#define MSGTR_SettingVideoDelay "Setting video delay to %5.3fs.\n"
-#define MSGTR_LimitingAudioPreload "Limiting audio preload to 0.4s.\n"
-#define MSGTR_IncreasingAudioDensity "Increasing audio density to 4.\n"
-#define MSGTR_ZeroingAudioPreloadAndMaxPtsCorrection "Forcing audio preload to 0, max pts correction to 0.\n"
-#define MSGTR_LameVersion "LAME version %s (%s)\n\n"
-#define MSGTR_InvalidBitrateForLamePreset "Error: The bitrate specified is out of the valid range for this preset.\n"\
-"\n"\
-"When using this mode you must enter a value between \"8\" and \"320\".\n"\
-"\n"\
-"For further information try: \"-lameopts preset=help\"\n"
-#define MSGTR_InvalidLamePresetOptions "Error: You did not enter a valid profile and/or options with preset.\n"\
-"\n"\
-"Available profiles are:\n"\
-"\n"\
-" <fast> standard\n"\
-" <fast> extreme\n"\
-" insane\n"\
-" <cbr> (ABR Mode) - The ABR Mode is implied. To use it,\n"\
-" simply specify a bitrate. For example:\n"\
-" \"preset=185\" activates this\n"\
-" preset and uses 185 as an average kbps.\n"\
-"\n"\
-" Some examples:\n"\
-"\n"\
-" \"-lameopts fast:preset=standard \"\n"\
-" or \"-lameopts cbr:preset=192 \"\n"\
-" or \"-lameopts preset=172 \"\n"\
-" or \"-lameopts preset=extreme \"\n"\
-"\n"\
-"For further information try: \"-lameopts preset=help\"\n"
-#define MSGTR_LamePresetsLongInfo "\n"\
-"The preset switches are designed to provide the highest possible quality.\n"\
-"\n"\
-"They have for the most part been subjected to and tuned via rigorous double\n"\
-"blind listening tests to verify and achieve this objective.\n"\
-"\n"\
-"These are continually updated to coincide with the latest developments that\n"\
-"occur and as a result should provide you with nearly the best quality\n"\
-"currently possible from LAME.\n"\
-"\n"\
-"To activate these presets:\n"\
-"\n"\
-" For VBR modes (generally highest quality):\n"\
-"\n"\
-" \"preset=standard\" This preset should generally be transparent\n"\
-" to most people on most music and is already\n"\
-" quite high in quality.\n"\
-"\n"\
-" \"preset=extreme\" If you have extremely good hearing and similar\n"\
-" equipment, this preset will generally provide\n"\
-" slightly higher quality than the \"standard\"\n"\
-" mode.\n"\
-"\n"\
-" For CBR 320kbps (highest quality possible from the preset switches):\n"\
-"\n"\
-" \"preset=insane\" This preset will usually be overkill for most\n"\
-" people and most situations, but if you must\n"\
-" have the absolute highest quality with no\n"\
-" regard to filesize, this is the way to go.\n"\
-"\n"\
-" For ABR modes (high quality per given bitrate but not as high as VBR):\n"\
-"\n"\
-" \"preset=<kbps>\" Using this preset will usually give you good\n"\
-" quality at a specified bitrate. Depending on the\n"\
-" bitrate entered, this preset will determine the\n"\
-" optimal settings for that particular situation.\n"\
-" While this approach works, it is not nearly as\n"\
-" flexible as VBR, and usually will not attain the\n"\
-" same level of quality as VBR at higher bitrates.\n"\
-"\n"\
-"The following options are also available for the corresponding profiles:\n"\
-"\n"\
-" <fast> standard\n"\
-" <fast> extreme\n"\
-" insane\n"\
-" <cbr> (ABR Mode) - The ABR Mode is implied. To use it,\n"\
-" simply specify a bitrate. For example:\n"\
-" \"preset=185\" activates this\n"\
-" preset and uses 185 as an average kbps.\n"\
-"\n"\
-" \"fast\" - Enables the new fast VBR for a particular profile. The\n"\
-" disadvantage to the speed switch is that often times the\n"\
-" bitrate will be slightly higher than with the normal mode\n"\
-" and quality may be slightly lower also.\n"\
-" Warning: with the current version fast presets might result in too\n"\
-" high bitrate compared to regular presets.\n"\
-"\n"\
-" \"cbr\" - If you use the ABR mode (read above) with a significant\n"\
-" bitrate such as 80, 96, 112, 128, 160, 192, 224, 256, 320,\n"\
-" you can use the \"cbr\" option to force CBR mode encoding\n"\
-" instead of the standard abr mode. ABR does provide higher\n"\
-" quality but CBR may be useful in situations such as when\n"\
-" streaming an MP3 over the internet may be important.\n"\
-"\n"\
-" For example:\n"\
-"\n"\
-" \"-lameopts fast:preset=standard \"\n"\
-" or \"-lameopts cbr:preset=192 \"\n"\
-" or \"-lameopts preset=172 \"\n"\
-" or \"-lameopts preset=extreme \"\n"\
-"\n"\
-"\n"\
-"A few aliases are available for ABR mode:\n"\
-"phone => 16kbps/mono phon+/lw/mw-eu/sw => 24kbps/mono\n"\
-"mw-us => 40kbps/mono voice => 56kbps/mono\n"\
-"fm/radio/tape => 112kbps hifi => 160kbps\n"\
-"cd => 192kbps studio => 256kbps"
-#define MSGTR_LameCantInit \
-"Cannot set LAME options, check bitrate/samplerate, some very low bitrates\n"\
-"(<32) need lower samplerates (i.e. -srate 8000).\n"\
-"If everything else fails, try a preset."
-#define MSGTR_ConfigFileError "Config file error"
-#define MSGTR_ErrorParsingCommandLine "error parsing command line"
-#define MSGTR_VideoStreamRequired "Video stream is mandatory!\n"
-#define MSGTR_ForcingInputFPS "Input fps will be interpreted as %5.3f instead.\n"
-#define MSGTR_RawvideoDoesNotSupportAudio "Output file format RAWVIDEO does not support audio - disabling audio.\n"
-#define MSGTR_DemuxerDoesntSupportNosound "This demuxer doesn't support -nosound yet.\n"
-#define MSGTR_MemAllocFailed "Memory allocation failed.\n"
-#define MSGTR_NoMatchingFilter "Couldn't find matching filter/ao format!\n"
-#define MSGTR_MP3WaveFormatSizeNot30 "sizeof(MPEGLAYER3WAVEFORMAT)==%d!=30, maybe broken C compiler?\n"
-#define MSGTR_NoLavcAudioCodecName "Audio LAVC, Missing codec name!\n"
-#define MSGTR_LavcAudioCodecNotFound "Audio LAVC, couldn't find encoder for codec %s.\n"
-#define MSGTR_CouldntAllocateLavcContext "Audio LAVC, couldn't allocate context!\n"
-#define MSGTR_CouldntOpenCodec "Couldn't open codec %s, br=%d.\n"
-#define MSGTR_CantCopyAudioFormat "Audio format 0x%x is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.\n"
-
-// cfg-mencoder.h
-#define MSGTR_MEncoderMP3LameHelp "\n\n"\
-" vbr=<0-4> variable bitrate method\n"\
-" 0: cbr (constant bitrate)\n"\
-" 1: mt (Mark Taylor VBR algorithm)\n"\
-" 2: rh (Robert Hegemann VBR algorithm - default)\n"\
-" 3: abr (average bitrate)\n"\
-" 4: mtrh (Mark Taylor Robert Hegemann VBR algorithm)\n"\
-"\n"\
-" abr average bitrate\n"\
-"\n"\
-" cbr constant bitrate\n"\
-" Also forces CBR mode encoding on subsequent ABR presets modes.\n"\
-"\n"\
-" br=<0-1024> specify bitrate in kBit (CBR and ABR only)\n"\
-"\n"\
-" q=<0-9> quality (0-highest, 9-lowest) (only for VBR)\n"\
-"\n"\
-" aq=<0-9> algorithmic quality (0-best/slowest, 9-worst/fastest)\n"\
-"\n"\
-" ratio=<1-100> compression ratio\n"\
-"\n"\
-" vol=<0-10> set audio input gain\n"\
-"\n"\
-" mode=<0-3> (default: auto)\n"\
-" 0: stereo\n"\
-" 1: joint-stereo\n"\
-" 2: dualchannel\n"\
-" 3: mono\n"\
-"\n"\
-" padding=<0-2>\n"\
-" 0: no\n"\
-" 1: all\n"\
-" 2: adjust\n"\
-"\n"\
-" fast Switch on faster encoding on subsequent VBR presets modes,\n"\
-" slightly lower quality and higher bitrates.\n"\
-"\n"\
-" preset=<value> Provide the highest possible quality settings.\n"\
-" medium: VBR encoding, good quality\n"\
-" (150-180 kbps bitrate range)\n"\
-" standard: VBR encoding, high quality\n"\
-" (170-210 kbps bitrate range)\n"\
-" extreme: VBR encoding, very high quality\n"\
-" (200-240 kbps bitrate range)\n"\
-" insane: CBR encoding, highest preset quality\n"\
-" (320 kbps bitrate)\n"\
-" <8-320>: ABR encoding at average given kbps bitrate.\n\n"
-
-// codec-cfg.c
-#define MSGTR_DuplicateFourcc "duplicated FourCC"
-#define MSGTR_TooManyFourccs "too many FourCCs/formats..."
-#define MSGTR_ParseError "parse error"
-#define MSGTR_ParseErrorFIDNotNumber "parse error (format ID not a number?)"
-#define MSGTR_ParseErrorFIDAliasNotNumber "parse error (format ID alias not a number?)"
-#define MSGTR_DuplicateFID "duplicated format ID"
-#define MSGTR_TooManyOut "too many out..."
-#define MSGTR_InvalidCodecName "\ncodec(%s) name is not valid!\n"
-#define MSGTR_CodecLacksFourcc "\ncodec(%s) does not have FourCC/format!\n"
-#define MSGTR_CodecLacksDriver "\ncodec(%s) does not have a driver!\n"
-#define MSGTR_CodecNeedsDLL "\ncodec(%s) needs a 'dll'!\n"
-#define MSGTR_CodecNeedsOutfmt "\ncodec(%s) needs an 'outfmt'!\n"
-#define MSGTR_CantAllocateComment "Can't allocate memory for comment. "
-#define MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN "get_token(): max >= MAX_MR_TOKEN!"
-#define MSGTR_CantGetMemoryForLine "Can't get memory for 'line': %s\n"
-#define MSGTR_CantReallocCodecsp "Can't realloc '*codecsp': %s\n"
-#define MSGTR_CodecNameNotUnique "Codec name '%s' isn't unique."
-#define MSGTR_CantStrdupName "Can't strdup -> 'name': %s\n"
-#define MSGTR_CantStrdupInfo "Can't strdup -> 'info': %s\n"
-#define MSGTR_CantStrdupDriver "Can't strdup -> 'driver': %s\n"
-#define MSGTR_CantStrdupDLL "Can't strdup -> 'dll': %s"
-#define MSGTR_AudioVideoCodecTotals "%d audio & %d video codecs\n"
-#define MSGTR_CodecDefinitionIncorrect "Codec is not defined correctly."
-#define MSGTR_OutdatedCodecsConf "This codecs.conf is too old and incompatible with this MPlayer release!"
-
-// fifo.c
-#define MSGTR_CannotMakePipe "Cannot make PIPE!\n"
-
-// parser-mecmd.c, parser-mpcmd.c
-#define MSGTR_NoFileGivenOnCommandLine "'--' indicates no more options, but no filename was given on the command line.\n"
-#define MSGTR_TheLoopOptionMustBeAnInteger "The loop option must be an integer: %s\n"
-#define MSGTR_UnknownOptionOnCommandLine "Unknown option on the command line: -%s\n"
-#define MSGTR_ErrorParsingOptionOnCommandLine "Error parsing option on the command line: -%s\n"
-#define MSGTR_InvalidPlayEntry "Invalid play entry %s\n"
-#define MSGTR_NotAnMEncoderOption "-%s is not an MEncoder option\n"
-#define MSGTR_NoFileGiven "No file given\n"
-
-// m_config.c
-#define MSGTR_SaveSlotTooOld "Save slot found from lvl %d is too old: %d !!!\n"
-#define MSGTR_InvalidCfgfileOption "The %s option can't be used in a config file.\n"
-#define MSGTR_InvalidCmdlineOption "The %s option can't be used on the command line.\n"
-#define MSGTR_InvalidSuboption "Error: option '%s' has no suboption '%s'.\n"
-#define MSGTR_MissingSuboptionParameter "Error: suboption '%s' of '%s' must have a parameter!\n"
-#define MSGTR_MissingOptionParameter "Error: option '%s' must have a parameter!\n"
-#define MSGTR_OptionListHeader "\n Name Type Min Max Global CL Cfg\n\n"
-#define MSGTR_TotalOptions "\nTotal: %d options\n"
-#define MSGTR_ProfileInclusionTooDeep "WARNING: Profile inclusion too deep.\n"
-#define MSGTR_NoProfileDefined "No profiles have been defined.\n"
-#define MSGTR_AvailableProfiles "Available profiles:\n"
-#define MSGTR_UnknownProfile "Unknown profile '%s'.\n"
-#define MSGTR_Profile "Profile %s: %s\n"
-
-// m_property.c
-#define MSGTR_PropertyListHeader "\n Name Type Min Max\n\n"
-#define MSGTR_TotalProperties "\nTotal: %d properties\n"
-
-// loader/ldt_keeper.c
-#define MSGTR_LOADER_DYLD_Warning "WARNING: Attempting to use DLL codecs but environment variable\n DYLD_BIND_AT_LAUNCH not set. This will likely crash.\n"
-
-
-// ====================== GUI messages/buttons ========================
-
-// --- labels ---
-#define MSGTR_About "About"
-#define MSGTR_FileSelect "Select file..."
-#define MSGTR_SubtitleSelect "Select subtitle..."
-#define MSGTR_OtherSelect "Select..."
-#define MSGTR_AudioFileSelect "Select external audio channel..."
-#define MSGTR_FontSelect "Select font..."
-// Note: If you change MSGTR_PlayList please see if it still fits MSGTR_MENU_PlayList
-#define MSGTR_PlayList "Playlist"
-#define MSGTR_Equalizer "Equalizer"
-#define MSGTR_ConfigureEqualizer "Configure Equalizer"
-#define MSGTR_SkinBrowser "Skin Browser"
-#define MSGTR_Network "Network streaming..."
-// Note: If you change MSGTR_Preferences please see if it still fits MSGTR_MENU_Preferences
-#define MSGTR_Preferences "Preferences"
-#define MSGTR_AudioPreferences "Audio driver configuration"
-#define MSGTR_NoMediaOpened "No media opened."
-#define MSGTR_Title "Title %d"
-#define MSGTR_NoChapter "No chapter"
-#define MSGTR_Chapter "Chapter %d"
-#define MSGTR_NoFileLoaded "No file loaded."
-#define MSGTR_Filter_UTF8Subtitles "UTF-8 encoded subtitles (*.utf, *.utf-8, *.utf8)"
-#define MSGTR_Filter_AllSubtitles "All subtitles"
-#define MSGTR_Filter_AllFiles "All files"
-#define MSGTR_Filter_TTF "True Type fonts (*.ttf)"
-#define MSGTR_Filter_Type1 "Type1 fonts (*.pfb)"
-#define MSGTR_Filter_AllFonts "All fonts"
-#define MSGTR_Filter_FontFiles "Font files (*.desc)"
-#define MSGTR_Filter_DDRawAudio "Dolby Digital / PCM (*.ac3, *.pcm)"
-#define MSGTR_Filter_MPEGAudio "MPEG audio (*.mp2, *.mp3, *.mpga, *.m4a, *.aac, *.f4a)"
-#define MSGTR_Filter_MatroskaAudio "Matroska audio (*.mka)"
-#define MSGTR_Filter_OGGAudio "Ogg audio (*.oga, *.ogg, *.spx)"
-#define MSGTR_Filter_WAVAudio "WAV audio (*.wav)"
-#define MSGTR_Filter_WMAAudio "Windows Media audio (*.wma)"
-#define MSGTR_Filter_AllAudioFiles "All audio files"
-#define MSGTR_Filter_AllVideoFiles "All video files"
-#define MSGTR_Filter_AVIFiles "AVI files"
-#define MSGTR_Filter_DivXFiles "DivX files"
-#define MSGTR_Filter_FlashVideo "Flash Video"
-#define MSGTR_Filter_MP3Files "MP3 files"
-#define MSGTR_Filter_MP4Files "MP4 files"
-#define MSGTR_Filter_MPEGFiles "MPEG files"
-#define MSGTR_Filter_MP2TS "MPEG-2 transport streams"
-#define MSGTR_Filter_MatroskaMedia "Matroska media"
-#define MSGTR_Filter_OGGMedia "Ogg media"
-#define MSGTR_Filter_QTMedia "QuickTime media"
-#define MSGTR_Filter_RNMedia "RealNetworks media"
-#define MSGTR_Filter_VideoCDImages "VCD/SVCD images"
-#define MSGTR_Filter_WAVFiles "WAV files"
-#define MSGTR_Filter_WindowsMedia "Windows media"
-#define MSGTR_Filter_Playlists "Playlists"
-
-// --- buttons ---
-#define MSGTR_Ok "OK"
-#define MSGTR_Cancel "Cancel"
-#define MSGTR_Add "Add"
-#define MSGTR_Remove "Remove"
-#define MSGTR_Clear "Clear"
-#define MSGTR_Config "Config"
-#define MSGTR_ConfigDriver "Configure driver"
-#define MSGTR_Browse "Browse"
-
-// --- error messages ---
-#define MSGTR_NEMDB "Sorry, not enough memory to draw buffer.\n"
-#define MSGTR_NEMFMR "Sorry, not enough memory for menu rendering."
-#define MSGTR_IDFGCVD "Sorry, no GUI-compatible video output driver found.\n"
-#define MSGTR_NEEDLAVC "Sorry, you cannot play non-MPEG files with your DXR3/H+ device without reencoding.\nPlease enable lavc in the DXR3/H+ configuration box."
-#define MSGTR_ICONERROR "Icon '%s' (size %d) not found or unsupported format.\n"
-
-// --- skin loader error messages
-#define MSGTR_SKIN_ERRORMESSAGE "Error in skin config file on line %d: %s"
-#define MSGTR_SKIN_ERROR_SECTION "No section specified for '%s'.\n"
-#define MSGTR_SKIN_ERROR_WINDOW "No window specified for '%s'.\n"
-#define MSGTR_SKIN_ERROR_ITEM "This item is not supported by '%s'.\n"
-#define MSGTR_SKIN_UNKNOWN_ITEM "Unknown item '%s'\n"
-#define MSGTR_SKIN_UNKNOWN_NAME "Unknown name '%s'\n"
-#define MSGTR_SKIN_SkinFileNotFound "Skin file %s not found.\n"
-#define MSGTR_SKIN_SkinFileNotReadable "Skin file %s not readable.\n"
-#define MSGTR_SKIN_BITMAP_16bit "Color depth of bitmap %s is 16 bits or less which is not supported.\n"
-#define MSGTR_SKIN_BITMAP_FileNotFound "Bitmap %s not found.\n"
-#define MSGTR_SKIN_BITMAP_PNGReadError "PNG read error in %s\n"
-#define MSGTR_SKIN_BITMAP_ConversionError "24 bit to 32 bit conversion error in %s\n"
-#define MSGTR_SKIN_UnknownMessage "Unknown message '%s'\n"
-#define MSGTR_SKIN_NotEnoughMemory "Not enough memory\n"
-#define MSGTR_SKIN_TooManyItemsDeclared "Too many items declared.\n"
-#define MSGTR_SKIN_FONT_TooManyFontsDeclared "Too many fonts declared.\n"
-#define MSGTR_SKIN_FONT_FontFileNotFound "Font description file not found.\n"
-#define MSGTR_SKIN_FONT_FontImageNotFound "Font image file not found.\n"
-#define MSGTR_SKIN_FONT_NonExistentFont "Font '%s' not found.\n"
-#define MSGTR_SKIN_UnknownParameter "Unknown parameter '%s'\n"
-#define MSGTR_SKIN_SKINCFG_SkinNotFound "Skin '%s' not found.\n"
-#define MSGTR_SKIN_SKINCFG_SelectedSkinNotFound "Selected skin '%s' not found, trying skin 'default'...\n"
-#define MSGTR_SKIN_SKINCFG_SkinCfgError "Config file processing error with skin '%s'\n"
-#define MSGTR_SKIN_LABEL "Skins:"
-
-// --- GTK menus
-#define MSGTR_MENU_AboutMPlayer "About MPlayer"
-#define MSGTR_MENU_Open "Open..."
-#define MSGTR_MENU_PlayFile "Play file..."
-#define MSGTR_MENU_PlayCD "Play CD..."
-#define MSGTR_MENU_PlayVCD "Play VCD..."
-#define MSGTR_MENU_PlayDVD "Play DVD..."
-#define MSGTR_MENU_PlayURL "Play URL..."
-#define MSGTR_MENU_LoadSubtitle "Load subtitle..."
-#define MSGTR_MENU_DropSubtitle "Drop subtitle..."
-#define MSGTR_MENU_LoadExternAudioFile "Load external audio file..."
-#define MSGTR_MENU_Playing "Playing"
-#define MSGTR_MENU_Play "Play"
-#define MSGTR_MENU_Pause "Pause"
-#define MSGTR_MENU_Stop "Stop"
-#define MSGTR_MENU_NextStream "Next stream"
-#define MSGTR_MENU_PrevStream "Prev stream"
-#define MSGTR_MENU_Size "Size"
-#define MSGTR_MENU_HalfSize "Half size"
-#define MSGTR_MENU_NormalSize "Normal size"
-#define MSGTR_MENU_DoubleSize "Double size"
-#define MSGTR_MENU_FullScreen "Fullscreen"
-#define MSGTR_MENU_CD "CD"
-#define MSGTR_MENU_DVD "DVD"
-#define MSGTR_MENU_VCD "VCD"
-#define MSGTR_MENU_PlayDisc "Open disc..."
-#define MSGTR_MENU_ShowDVDMenu "Show DVD menu"
-#define MSGTR_MENU_Titles "Titles"
-#define MSGTR_MENU_Title "Title %2d"
-#define MSGTR_MENU_None "(none)"
-#define MSGTR_MENU_Chapters "Chapters"
-#define MSGTR_MENU_Chapter "Chapter %2d"
-#define MSGTR_MENU_AudioLanguages "Audio languages"
-#define MSGTR_MENU_SubtitleLanguages "Subtitle languages"
-#define MSGTR_MENU_PlayList MSGTR_PlayList
-#define MSGTR_MENU_SkinBrowser "Skin browser"
-#define MSGTR_MENU_Preferences MSGTR_Preferences
-#define MSGTR_MENU_Exit "Exit"
-#define MSGTR_MENU_Mute "Mute"
-#define MSGTR_MENU_Original "Original"
-#define MSGTR_MENU_AspectRatio "Aspect ratio"
-#define MSGTR_MENU_AudioTrack "Audio track"
-#define MSGTR_MENU_Track "Track %d"
-#define MSGTR_MENU_VideoTrack "Video track"
-#define MSGTR_MENU_Subtitles "Subtitles"
-
-// --- equalizer
-// Note: If you change MSGTR_EQU_Audio please see if it still fits MSGTR_PREFERENCES_Audio
-#define MSGTR_EQU_Audio "Audio"
-// Note: If you change MSGTR_EQU_Video please see if it still fits MSGTR_PREFERENCES_Video
-#define MSGTR_EQU_Video "Video"
-#define MSGTR_EQU_Contrast "Contrast: "
-#define MSGTR_EQU_Brightness "Brightness: "
-#define MSGTR_EQU_Hue "Hue: "
-#define MSGTR_EQU_Saturation "Saturation: "
-#define MSGTR_EQU_Front_Left "Front Left"
-#define MSGTR_EQU_Front_Right "Front Right"
-#define MSGTR_EQU_Back_Left "Rear Left"
-#define MSGTR_EQU_Back_Right "Rear Right"
-#define MSGTR_EQU_Center "Center"
-#define MSGTR_EQU_Bass "Bass"
-#define MSGTR_EQU_All "All"
-#define MSGTR_EQU_Channel1 "Channel 1:"
-#define MSGTR_EQU_Channel2 "Channel 2:"
-#define MSGTR_EQU_Channel3 "Channel 3:"
-#define MSGTR_EQU_Channel4 "Channel 4:"
-#define MSGTR_EQU_Channel5 "Channel 5:"
-#define MSGTR_EQU_Channel6 "Channel 6:"
-
-// --- playlist
-#define MSGTR_PLAYLIST_Path "Path"
-#define MSGTR_PLAYLIST_Selected "Selected files"
-#define MSGTR_PLAYLIST_Files "Files"
-#define MSGTR_PLAYLIST_DirectoryTree "Directory tree"
-
-// --- preferences
-#define MSGTR_PREFERENCES_Audio MSGTR_EQU_Audio
-#define MSGTR_PREFERENCES_Video MSGTR_EQU_Video
-#define MSGTR_PREFERENCES_SubtitleOSD "Subtitles & OSD"
-#define MSGTR_PREFERENCES_Codecs "Codecs & demuxer"
-// Note: If you change MSGTR_PREFERENCES_Misc see if it still fits MSGTR_PREFERENCES_FRAME_Misc
-#define MSGTR_PREFERENCES_Misc "Misc"
-#define MSGTR_PREFERENCES_None "None"
-#define MSGTR_PREFERENCES_DriverDefault "driver default"
-#define MSGTR_PREFERENCES_AvailableDrivers "Available drivers:"
-#define MSGTR_PREFERENCES_DoNotPlaySound "Do not play sound"
-#define MSGTR_PREFERENCES_NormalizeSound "Normalize sound"
-#define MSGTR_PREFERENCES_EnableEqualizer "Enable equalizer"
-#define MSGTR_PREFERENCES_SoftwareMixer "Enable Software Mixer"
-#define MSGTR_PREFERENCES_ExtraStereo "Enable extra stereo"
-#define MSGTR_PREFERENCES_Coefficient "Coefficient:"
-#define MSGTR_PREFERENCES_AudioDelay "Audio delay"
-#define MSGTR_PREFERENCES_DoubleBuffer "Enable double buffering"
-#define MSGTR_PREFERENCES_DirectRender "Enable direct rendering"
-#define MSGTR_PREFERENCES_FrameDrop "Enable frame dropping"
-#define MSGTR_PREFERENCES_HFrameDrop "Enable HARD frame dropping (dangerous)"
-#define MSGTR_PREFERENCES_Flip "Flip image upside down"
-#define MSGTR_PREFERENCES_Panscan "Panscan: "
-#define MSGTR_PREFERENCES_OSD_LEVEL0 "Subtitles only"
-#define MSGTR_PREFERENCES_OSD_LEVEL1 "Volume and seek"
-#define MSGTR_PREFERENCES_OSD_LEVEL2 "Volume, seek, timer and percentage"
-#define MSGTR_PREFERENCES_OSD_LEVEL3 "Volume, seek, timer, percentage and total time"
-#define MSGTR_PREFERENCES_Subtitle "Subtitle:"
-#define MSGTR_PREFERENCES_SUB_Delay "Delay: "
-#define MSGTR_PREFERENCES_SUB_FPS "FPS:"
-#define MSGTR_PREFERENCES_SUB_POS "Position: "
-#define MSGTR_PREFERENCES_SUB_AutoLoad "Disable subtitle autoloading"
-#define MSGTR_PREFERENCES_SUB_Unicode "Unicode subtitle"
-#define MSGTR_PREFERENCES_SUB_MPSUB "Convert the given subtitle to MPlayer's subtitle format"
-#define MSGTR_PREFERENCES_SUB_SRT "Convert the given subtitle to the time based SubViewer (SRT) format"
-#define MSGTR_PREFERENCES_SUB_Overlap "Toggle subtitle overlapping"
-#define MSGTR_PREFERENCES_SUB_USE_ASS "SSA/ASS subtitle rendering"
-#define MSGTR_PREFERENCES_SUB_ASS_USE_MARGINS "Use margins"
-#define MSGTR_PREFERENCES_SUB_ASS_TOP_MARGIN "Top: "
-#define MSGTR_PREFERENCES_SUB_ASS_BOTTOM_MARGIN "Bottom: "
-#define MSGTR_PREFERENCES_Font "Font:"
-#define MSGTR_PREFERENCES_FontFactor "Font factor:"
-#define MSGTR_PREFERENCES_PostProcess "Enable postprocessing"
-#define MSGTR_PREFERENCES_AutoQuality "Auto quality: "
-#define MSGTR_PREFERENCES_NI "Use non-interleaved AVI parser"
-#define MSGTR_PREFERENCES_IDX "Rebuild index table, if needed"
-#define MSGTR_PREFERENCES_VideoCodecFamily "Video codec family:"
-#define MSGTR_PREFERENCES_AudioCodecFamily "Audio codec family:"
-#define MSGTR_PREFERENCES_FRAME_OSD_Level "OSD level"
-#define MSGTR_PREFERENCES_FRAME_Subtitle "Subtitle"
-#define MSGTR_PREFERENCES_FRAME_Font "Font"
-#define MSGTR_PREFERENCES_FRAME_PostProcess "Postprocessing"
-#define MSGTR_PREFERENCES_FRAME_CodecDemuxer "Codec & demuxer"
-#define MSGTR_PREFERENCES_FRAME_Cache "Cache"
-#define MSGTR_PREFERENCES_FRAME_Misc MSGTR_PREFERENCES_Misc
-#define MSGTR_PREFERENCES_Audio_Device "Device:"
-#define MSGTR_PREFERENCES_Audio_Mixer "Mixer:"
-#define MSGTR_PREFERENCES_Audio_MixerChannel "Mixer channel:"
-#define MSGTR_PREFERENCES_Message "Please remember that you need to restart playback for some options to take effect!"
-#define MSGTR_PREFERENCES_DXR3_VENC "Video encoder:"
-#define MSGTR_PREFERENCES_DXR3_LAVC "Use LAVC (FFmpeg)"
-#define MSGTR_PREFERENCES_FontEncoding1 "Unicode"
-#define MSGTR_PREFERENCES_FontEncoding2 "Western European Languages (ISO-8859-1)"
-#define MSGTR_PREFERENCES_FontEncoding3 "Western European Languages with Euro (ISO-8859-15)"
-#define MSGTR_PREFERENCES_FontEncoding4 "Slavic/Central European Languages (ISO-8859-2)"
-#define MSGTR_PREFERENCES_FontEncoding5 "Esperanto, Galician, Maltese, Turkish (ISO-8859-3)"
-#define MSGTR_PREFERENCES_FontEncoding6 "Old Baltic charset (ISO-8859-4)"
-#define MSGTR_PREFERENCES_FontEncoding7 "Cyrillic (ISO-8859-5)"
-#define MSGTR_PREFERENCES_FontEncoding8 "Arabic (ISO-8859-6)"
-#define MSGTR_PREFERENCES_FontEncoding9 "Modern Greek (ISO-8859-7)"
-#define MSGTR_PREFERENCES_FontEncoding10 "Turkish (ISO-8859-9)"
-#define MSGTR_PREFERENCES_FontEncoding11 "Baltic (ISO-8859-13)"
-#define MSGTR_PREFERENCES_FontEncoding12 "Celtic (ISO-8859-14)"
-#define MSGTR_PREFERENCES_FontEncoding13 "Hebrew charsets (ISO-8859-8)"
-#define MSGTR_PREFERENCES_FontEncoding14 "Russian (KOI8-R)"
-#define MSGTR_PREFERENCES_FontEncoding15 "Ukrainian, Belarusian (KOI8-U/RU)"
-#define MSGTR_PREFERENCES_FontEncoding16 "Simplified Chinese charset (CP936)"
-#define MSGTR_PREFERENCES_FontEncoding17 "Traditional Chinese charset (BIG5)"
-#define MSGTR_PREFERENCES_FontEncoding18 "Japanese charsets (SHIFT-JIS)"
-#define MSGTR_PREFERENCES_FontEncoding19 "Korean charset (CP949)"
-#define MSGTR_PREFERENCES_FontEncoding20 "Thai charset (CP874)"
-#define MSGTR_PREFERENCES_FontEncoding21 "Cyrillic Windows (CP1251)"
-#define MSGTR_PREFERENCES_FontEncoding22 "Slavic/Central European Windows (CP1250)"
-#define MSGTR_PREFERENCES_FontEncoding23 "Arabic Windows (CP1256)"
-#define MSGTR_PREFERENCES_FontNoAutoScale "No autoscale"
-#define MSGTR_PREFERENCES_FontPropWidth "Proportional to movie width"
-#define MSGTR_PREFERENCES_FontPropHeight "Proportional to movie height"
-#define MSGTR_PREFERENCES_FontPropDiagonal "Proportional to movie diagonal"
-#define MSGTR_PREFERENCES_FontEncoding "Encoding:"
-#define MSGTR_PREFERENCES_FontBlur "Blur:"
-#define MSGTR_PREFERENCES_FontOutLine "Outline:"
-#define MSGTR_PREFERENCES_FontTextScale "Text scale:"
-#define MSGTR_PREFERENCES_FontOSDScale "OSD scale:"
-#define MSGTR_PREFERENCES_Cache "Cache on/off"
-#define MSGTR_PREFERENCES_CacheSize "Cache size: "
-#define MSGTR_PREFERENCES_LoadFullscreen "Start in fullscreen"
-#define MSGTR_PREFERENCES_SaveWinPos "Save window position"
-#define MSGTR_PREFERENCES_XSCREENSAVER "Stop XScreenSaver"
-#define MSGTR_PREFERENCES_PlayBar "Enable playbar"
-#define MSGTR_PREFERENCES_NoIdle "Quit after playing"
-#define MSGTR_PREFERENCES_AutoSync "AutoSync on/off"
-#define MSGTR_PREFERENCES_AutoSyncValue "Autosync: "
-#define MSGTR_PREFERENCES_CDROMDevice "CD-ROM device:"
-#define MSGTR_PREFERENCES_DVDDevice "DVD device:"
-#define MSGTR_PREFERENCES_FPS "Movie FPS:"
-#define MSGTR_PREFERENCES_ShowVideoWindow "Show video window when inactive"
-#define MSGTR_PREFERENCES_ArtsBroken "Newer aRts versions are incompatible "\
- "with GTK 1.x and will crash GMPlayer!"
-
-// -- aboutbox
-#define MSGTR_ABOUT_UHU "GUI development sponsored by UHU Linux\n"
-#define MSGTR_ABOUT_Contributors "Code and documentation contributors\n"
-#define MSGTR_ABOUT_Codecs_libs_contributions "Codecs and third party libraries\n"
-#define MSGTR_ABOUT_Translations "Translations\n"
-#define MSGTR_ABOUT_Skins "Skins\n"
-
-// --- messagebox
-#define MSGTR_MSGBOX_LABEL_FatalError "Fatal error!"
-#define MSGTR_MSGBOX_LABEL_Error "Error!"
-#define MSGTR_MSGBOX_LABEL_Warning "Warning!"
-
-// cfg.c
-#define MSGTR_UnableToSaveOption "Unable to save option '%s'.\n"
-
-// interface.c
-#define MSGTR_DeletingSubtitles "Deleting subtitles.\n"
-#define MSGTR_LoadingSubtitles "Loading subtitles '%s'.\n"
-#define MSGTR_AddingVideoFilter "Adding video filter '%s'.\n"
-
-// mw.c
-#define MSGTR_NotAFile "This does not seem to be a file: %s !\n"
-
-// ws.c
-#define MSGTR_WS_RemoteDisplay "Remote display, disabling XMITSHM.\n"
-#define MSGTR_WS_NoXshm "Sorry, your system does not support the X shared memory extension.\n"
-#define MSGTR_WS_NoXshape "Sorry, your system does not support the XShape extension.\n"
-#define MSGTR_WS_ColorDepthTooLow "Sorry, the color depth is too low.\n"
-#define MSGTR_WS_TooManyOpenWindows "There are too many open windows.\n"
-#define MSGTR_WS_ShmError "shared memory extension error\n"
-#define MSGTR_WS_NotEnoughMemoryDrawBuffer "Sorry, not enough memory to draw buffer.\n"
-#define MSGTR_WS_DpmsUnavailable "DPMS not available?\n"
-#define MSGTR_WS_DpmsNotEnabled "Could not enable DPMS.\n"
-#define MSGTR_WS_XError "An X11 Error has occurred!\n"
-
-// wsxdnd.c
-#define MSGTR_WS_NotAFile "This does not seem to be a file...\n"
-#define MSGTR_WS_DDNothing "D&D: Nothing returned!\n"
-
-// Win32 GUI
-#define MSGTR_Close "Close"
-#define MSGTR_Default "Defaults"
-#define MSGTR_Down "Down"
-#define MSGTR_Load "Load"
-#define MSGTR_Save "Save"
-#define MSGTR_Up "Up"
-#define MSGTR_DirectorySelect "Select directory..."
-#define MSGTR_PlaylistSave "Save playlist..."
-#define MSGTR_PlaylistSelect "Select playlist..."
-#define MSGTR_SelectTitleChapter "Select title/chapter..."
-#define MSGTR_MENU_DebugConsole "Debug Console"
-#define MSGTR_MENU_OnlineHelp "Online Help"
-#define MSGTR_MENU_PlayDirectory "Play directory..."
-#define MSGTR_MENU_SeekBack "Seek Backwards"
-#define MSGTR_MENU_SeekForw "Seek Forwards"
-#define MSGTR_MENU_ShowHide "Show/Hide"
-#define MSGTR_MENU_SubtitlesOnOff "Subtitle Visibility On/Off"
-#define MSGTR_PLAYLIST_AddFile "Add File..."
-#define MSGTR_PLAYLIST_AddURL "Add URL..."
-#define MSGTR_PREFERENCES_Priority "Priority:"
-#define MSGTR_PREFERENCES_PriorityHigh "high"
-#define MSGTR_PREFERENCES_PriorityLow "low"
-#define MSGTR_PREFERENCES_PriorityNormal "normal"
-#define MSGTR_PREFERENCES_PriorityNormalAbove "above normal"
-#define MSGTR_PREFERENCES_PriorityNormalBelow "below normal"
-#define MSGTR_PREFERENCES_ShowInVideoWin "Display in the video window (DirectX only)"
-
-
-// ======================= video output drivers ========================
-
-#define MSGTR_VOincompCodec "The selected video_out device is incompatible with this codec.\n"\
- "Try appending the scale filter to your filter list,\n"\
- "e.g. -vf spp,scale instead of -vf spp.\n"
-#define MSGTR_VO_GenericError "This error has occurred"
-#define MSGTR_VO_UnableToAccess "Unable to access"
-#define MSGTR_VO_ExistsButNoDirectory "already exists, but is not a directory."
-#define MSGTR_VO_DirExistsButNotWritable "Output directory already exists, but is not writable."
-#define MSGTR_VO_DirExistsAndIsWritable "Output directory already exists and is writable."
-#define MSGTR_VO_CantCreateDirectory "Unable to create output directory."
-#define MSGTR_VO_CantCreateFile "Unable to create output file."
-#define MSGTR_VO_DirectoryCreateSuccess "Output directory successfully created."
-#define MSGTR_VO_ValueOutOfRange "value out of range"
-#define MSGTR_VO_NoValueSpecified "No value specified."
-#define MSGTR_VO_UnknownSuboptions "unknown suboption(s)"
-
-// aspect.c
-#define MSGTR_LIBVO_ASPECT_NoSuitableNewResFound "[ASPECT] Warning: No suitable new res found!\n"
-#define MSGTR_LIBVO_ASPECT_NoNewSizeFoundThatFitsIntoRes "[ASPECT] Error: No new size found that fits into res!\n"
-
-// font_load_ft.c
-#define MSGTR_LIBVO_FONT_LOAD_FT_NewFaceFailed "New_Face failed. Maybe the font path is wrong.\nPlease supply the text font file (~/.mplayer/subfont.ttf).\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_NewMemoryFaceFailed "New_Memory_Face failed..\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_SubFaceFailed "subtitle font: load_sub_face failed.\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_SubFontCharsetFailed "subtitle font: prepare_charset failed.\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_CannotPrepareSubtitleFont "Cannot prepare subtitle font.\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_CannotPrepareOSDFont "Cannot prepare OSD font.\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_CannotGenerateTables "Cannot generate tables.\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_DoneFreeTypeFailed "FT_Done_FreeType failed.\n"
-#define MSGTR_LIBVO_FONT_LOAD_FT_FontconfigNoMatch "Fontconfig failed to select a font. Trying without fontconfig...\n"
-
-// sub.c
-#define MSGTR_VO_SUB_Seekbar "Seekbar"
-#define MSGTR_VO_SUB_Play "Play"
-#define MSGTR_VO_SUB_Pause "Pause"
-#define MSGTR_VO_SUB_Stop "Stop"
-#define MSGTR_VO_SUB_Rewind "Rewind"
-#define MSGTR_VO_SUB_Forward "Forward"
-#define MSGTR_VO_SUB_Clock "Clock"
-#define MSGTR_VO_SUB_Contrast "Contrast"
-#define MSGTR_VO_SUB_Saturation "Saturation"
-#define MSGTR_VO_SUB_Volume "Volume"
-#define MSGTR_VO_SUB_Brightness "Brightness"
-#define MSGTR_VO_SUB_Hue "Hue"
-#define MSGTR_VO_SUB_Balance "Balance"
-
-// vo_3dfx.c
-#define MSGTR_LIBVO_3DFX_Only16BppSupported "[VO_3DFX] Only 16bpp supported!"
-#define MSGTR_LIBVO_3DFX_VisualIdIs "[VO_3DFX] Visual ID is %lx.\n"
-#define MSGTR_LIBVO_3DFX_UnableToOpenDevice "[VO_3DFX] Unable to open /dev/3dfx.\n"
-#define MSGTR_LIBVO_3DFX_Error "[VO_3DFX] Error: %d.\n"
-#define MSGTR_LIBVO_3DFX_CouldntMapMemoryArea "[VO_3DFX] Couldn't map 3dfx memory areas: %p,%p,%d.\n"
-#define MSGTR_LIBVO_3DFX_DisplayInitialized "[VO_3DFX] Initialized: %p.\n"
-#define MSGTR_LIBVO_3DFX_UnknownSubdevice "[VO_3DFX] Unknown subdevice: %s.\n"
-
-// vo_aa.c
-#define MSGTR_VO_AA_HelpHeader "\n\nHere are the aalib vo_aa suboptions:\n"
-#define MSGTR_VO_AA_AdditionalOptions "Additional options vo_aa provides:\n" \
-" help print this help message\n" \
-" osdcolor set OSD color\n subcolor set subtitle color\n" \
-" the color parameters are:\n 0 : normal\n" \
-" 1 : dim\n 2 : bold\n 3 : boldfont\n" \
-" 4 : reverse\n 5 : special\n\n\n"
-
-// vo_dxr3.c
-#define MSGTR_LIBVO_DXR3_UnableToLoadNewSPUPalette "[VO_DXR3] Unable to load new SPU palette!\n"
-#define MSGTR_LIBVO_DXR3_UnableToSetPlaymode "[VO_DXR3] Unable to set playmode!\n"
-#define MSGTR_LIBVO_DXR3_UnableToSetSubpictureMode "[VO_DXR3] Unable to set subpicture mode!\n"
-#define MSGTR_LIBVO_DXR3_UnableToGetTVNorm "[VO_DXR3] Unable to get TV norm!\n"
-#define MSGTR_LIBVO_DXR3_AutoSelectedTVNormByFrameRate "[VO_DXR3] Auto-selected TV norm by framerate: "
-#define MSGTR_LIBVO_DXR3_UnableToSetTVNorm "[VO_DXR3] Unable to set TV norm!\n"
-#define MSGTR_LIBVO_DXR3_SettingUpForNTSC "[VO_DXR3] Setting up for NTSC.\n"
-#define MSGTR_LIBVO_DXR3_SettingUpForPALSECAM "[VO_DXR3] Setting up for PAL/SECAM.\n"
-#define MSGTR_LIBVO_DXR3_SettingAspectRatioTo43 "[VO_DXR3] Setting aspect ratio to 4:3.\n"
-#define MSGTR_LIBVO_DXR3_SettingAspectRatioTo169 "[VO_DXR3] Setting aspect ratio to 16:9.\n"
-#define MSGTR_LIBVO_DXR3_OutOfMemory "[VO_DXR3] out of memory\n"
-#define MSGTR_LIBVO_DXR3_UnableToAllocateKeycolor "[VO_DXR3] Unable to allocate keycolor!\n"
-#define MSGTR_LIBVO_DXR3_UnableToAllocateExactKeycolor "[VO_DXR3] Unable to allocate exact keycolor, using closest match (0x%lx).\n"
-#define MSGTR_LIBVO_DXR3_Uninitializing "[VO_DXR3] Uninitializing.\n"
-#define MSGTR_LIBVO_DXR3_FailedRestoringTVNorm "[VO_DXR3] Failed restoring TV norm!\n"
-#define MSGTR_LIBVO_DXR3_EnablingPrebuffering "[VO_DXR3] Enabling prebuffering.\n"
-#define MSGTR_LIBVO_DXR3_UsingNewSyncEngine "[VO_DXR3] Using new sync engine.\n"
-#define MSGTR_LIBVO_DXR3_UsingOverlay "[VO_DXR3] Using overlay.\n"
-#define MSGTR_LIBVO_DXR3_ErrorYouNeedToCompileMplayerWithX11 "[VO_DXR3] Error: Overlay requires compiling with X11 libs/headers installed.\n"
-#define MSGTR_LIBVO_DXR3_WillSetTVNormTo "[VO_DXR3] Will set TV norm to: "
-#define MSGTR_LIBVO_DXR3_AutoAdjustToMovieFrameRatePALPAL60 "auto-adjust to movie framerate (PAL/PAL-60)"
-#define MSGTR_LIBVO_DXR3_AutoAdjustToMovieFrameRatePALNTSC "auto-adjust to movie framerate (PAL/NTSC)"
-#define MSGTR_LIBVO_DXR3_UseCurrentNorm "Use current norm."
-#define MSGTR_LIBVO_DXR3_UseUnknownNormSuppliedCurrentNorm "Unknown norm supplied. Use current norm."
-#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTrying "[VO_DXR3] Error opening %s for writing, trying /dev/em8300 instead.\n"
-#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTryingMV "[VO_DXR3] Error opening %s for writing, trying /dev/em8300_mv instead.\n"
-#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWell "[VO_DXR3] Error opening /dev/em8300 for writing as well!\nBailing out.\n"
-#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWellMV "[VO_DXR3] Error opening /dev/em8300_mv for writing as well!\nBailing out.\n"
-#define MSGTR_LIBVO_DXR3_Opened "[VO_DXR3] Opened: %s.\n"
-#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTryingSP "[VO_DXR3] Error opening %s for writing, trying /dev/em8300_sp instead.\n"
-#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWellSP "[VO_DXR3] Error opening /dev/em8300_sp for writing as well!\nBailing out.\n"
-#define MSGTR_LIBVO_DXR3_UnableToOpenDisplayDuringHackSetup "[VO_DXR3] Unable to open display during overlay hack setup!\n"
-#define MSGTR_LIBVO_DXR3_UnableToInitX11 "[VO_DXR3] Unable to init X11!\n"
-#define MSGTR_LIBVO_DXR3_FailedSettingOverlayAttribute "[VO_DXR3] Failed setting overlay attribute.\n"
-#define MSGTR_LIBVO_DXR3_FailedSettingOverlayScreen "[VO_DXR3] Failed setting overlay screen!\nExiting.\n"
-#define MSGTR_LIBVO_DXR3_FailedEnablingOverlay "[VO_DXR3] Failed enabling overlay!\nExiting.\n"
-#define MSGTR_LIBVO_DXR3_FailedResizingOverlayWindow "[VO_DXR3] Failed resizing overlay window!\n"
-#define MSGTR_LIBVO_DXR3_FailedSettingOverlayBcs "[VO_DXR3] Failed setting overlay bcs!\n"
-#define MSGTR_LIBVO_DXR3_FailedGettingOverlayYOffsetValues "[VO_DXR3] Failed getting overlay Y-offset values!\nExiting.\n"
-#define MSGTR_LIBVO_DXR3_FailedGettingOverlayXOffsetValues "[VO_DXR3] Failed getting overlay X-offset values!\nExiting.\n"
-#define MSGTR_LIBVO_DXR3_FailedGettingOverlayXScaleCorrection "[VO_DXR3] Failed getting overlay X scale correction!\nExiting.\n"
-#define MSGTR_LIBVO_DXR3_YOffset "[VO_DXR3] Yoffset: %d.\n"
-#define MSGTR_LIBVO_DXR3_XOffset "[VO_DXR3] Xoffset: %d.\n"
-#define MSGTR_LIBVO_DXR3_XCorrection "[VO_DXR3] Xcorrection: %d.\n"
-#define MSGTR_LIBVO_DXR3_FailedSetSignalMix "[VO_DXR3] Failed to set signal mix!\n"
-
-// vo_jpeg.c
-#define MSGTR_VO_JPEG_ProgressiveJPEG "Progressive JPEG enabled."
-#define MSGTR_VO_JPEG_NoProgressiveJPEG "Progressive JPEG disabled."
-#define MSGTR_VO_JPEG_BaselineJPEG "Baseline JPEG enabled."
-#define MSGTR_VO_JPEG_NoBaselineJPEG "Baseline JPEG disabled."
-
-// vo_mga.c
-#define MSGTR_LIBVO_MGA_AspectResized "[VO_MGA] aspect(): resized to %dx%d.\n"
-#define MSGTR_LIBVO_MGA_Uninit "[VO] uninit!\n"
-
-// mga_template.c
-#define MSGTR_LIBVO_MGA_ErrorInConfigIoctl "[MGA] error in mga_vid_config ioctl (wrong mga_vid.o version?)"
-#define MSGTR_LIBVO_MGA_CouldNotGetLumaValuesFromTheKernelModule "[MGA] Could not get luma values from the kernel module!\n"
-#define MSGTR_LIBVO_MGA_CouldNotSetLumaValuesFromTheKernelModule "[MGA] Could not set luma values from the kernel module!\n"
-#define MSGTR_LIBVO_MGA_ScreenWidthHeightUnknown "[MGA] Screen width/height unknown!\n"
-#define MSGTR_LIBVO_MGA_InvalidOutputFormat "[MGA] invalid output format %0X\n"
-#define MSGTR_LIBVO_MGA_IncompatibleDriverVersion "[MGA] Your mga_vid driver version is incompatible with this MPlayer version!\n"
-#define MSGTR_LIBVO_MGA_CouldntOpen "[MGA] Couldn't open: %s\n"
-#define MSGTR_LIBVO_MGA_ResolutionTooHigh "[MGA] Source resolution exceeds 1023x1023 in at least one dimension.\n[MGA] Rescale in software or use -lavdopts lowres=1.\n"
-#define MSGTR_LIBVO_MGA_mgavidVersionMismatch "[MGA] mismatch between kernel (%u) and MPlayer (%u) mga_vid driver versions\n"
-
-// vo_null.c
-#define MSGTR_LIBVO_NULL_UnknownSubdevice "[VO_NULL] Unknown subdevice: %s.\n"
-
-// vo_png.c
-#define MSGTR_LIBVO_PNG_Warning1 "[VO_PNG] Warning: compression level set to 0, compression disabled!\n"
-#define MSGTR_LIBVO_PNG_Warning2 "[VO_PNG] Info: Use -vo png:z=<n> to set compression level from 0 to 9.\n"
-#define MSGTR_LIBVO_PNG_Warning3 "[VO_PNG] Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)\n"
-#define MSGTR_LIBVO_PNG_ErrorOpeningForWriting "\n[VO_PNG] Error opening '%s' for writing!\n"
-#define MSGTR_LIBVO_PNG_ErrorInCreatePng "[VO_PNG] Error in create_png.\n"
-
-// vo_pnm.c
-#define MSGTR_VO_PNM_ASCIIMode "ASCII mode enabled."
-#define MSGTR_VO_PNM_RawMode "Raw mode enabled."
-#define MSGTR_VO_PNM_PPMType "Will write PPM files."
-#define MSGTR_VO_PNM_PGMType "Will write PGM files."
-#define MSGTR_VO_PNM_PGMYUVType "Will write PGMYUV files."
-
-// vo_sdl.c
-#define MSGTR_LIBVO_SDL_CouldntGetAnyAcceptableSDLModeForOutput "[VO_SDL] Couldn't get any acceptable SDL Mode for output.\n"
-#define MSGTR_LIBVO_SDL_SetVideoModeFailed "[VO_SDL] set_video_mode: SDL_SetVideoMode failed: %s.\n"
-#define MSGTR_LIBVO_SDL_MappingI420ToIYUV "[VO_SDL] Mapping I420 to IYUV.\n"
-#define MSGTR_LIBVO_SDL_UnsupportedImageFormat "[VO_SDL] Unsupported image format (0x%X).\n"
-#define MSGTR_LIBVO_SDL_InfoPleaseUseVmOrZoom "[VO_SDL] Info - please use -vm or -zoom to switch to the best resolution.\n"
-#define MSGTR_LIBVO_SDL_FailedToSetVideoMode "[VO_SDL] Failed to set video mode: %s.\n"
-#define MSGTR_LIBVO_SDL_CouldntCreateAYUVOverlay "[VO_SDL] Couldn't create a YUV overlay: %s.\n"
-#define MSGTR_LIBVO_SDL_CouldntCreateARGBSurface "[VO_SDL] Couldn't create an RGB surface: %s.\n"
-#define MSGTR_LIBVO_SDL_UsingDepthColorspaceConversion "[VO_SDL] Using depth/colorspace conversion, this will slow things down (%ibpp -> %ibpp).\n"
-#define MSGTR_LIBVO_SDL_UnsupportedImageFormatInDrawslice "[VO_SDL] Unsupported image format in draw_slice, contact MPlayer developers!\n"
-#define MSGTR_LIBVO_SDL_BlitFailed "[VO_SDL] Blit failed: %s.\n"
-#define MSGTR_LIBVO_SDL_InitializationFailed "[VO_SDL] SDL initialization failed: %s.\n"
-#define MSGTR_LIBVO_SDL_UsingDriver "[VO_SDL] Using driver: %s.\n"
-
-// vo_svga.c
-#define MSGTR_LIBVO_SVGA_ForcedVidmodeNotAvailable "[VO_SVGA] Forced vid_mode %d (%s) not available.\n"
-#define MSGTR_LIBVO_SVGA_ForcedVidmodeTooSmall "[VO_SVGA] Forced vid_mode %d (%s) too small.\n"
-#define MSGTR_LIBVO_SVGA_Vidmode "[VO_SVGA] Vid_mode: %d, %dx%d %dbpp.\n"
-#define MSGTR_LIBVO_SVGA_VgasetmodeFailed "[VO_SVGA] Vga_setmode(%d) failed.\n"
-#define MSGTR_LIBVO_SVGA_VideoModeIsLinearAndMemcpyCouldBeUsed "[VO_SVGA] Video mode is linear and memcpy could be used for image transfer.\n"
-#define MSGTR_LIBVO_SVGA_VideoModeHasHardwareAcceleration "[VO_SVGA] Video mode has hardware acceleration and put_image could be used.\n"
-#define MSGTR_LIBVO_SVGA_IfItWorksForYouIWouldLikeToKnow "[VO_SVGA] If it works for you I would like to know.\n[VO_SVGA] (send log with `mplayer test.avi -v -v -v -v &> svga.log`). Thx!\n"
-#define MSGTR_LIBVO_SVGA_VideoModeHas "[VO_SVGA] Video mode has %d page(s).\n"
-#define MSGTR_LIBVO_SVGA_CenteringImageStartAt "[VO_SVGA] Centering image. Starting at (%d,%d)\n"
-#define MSGTR_LIBVO_SVGA_UsingVidix "[VO_SVGA] Using VIDIX. w=%i h=%i mw=%i mh=%i\n"
-
-// vo_tdfx_vid.c
-#define MSGTR_LIBVO_TDFXVID_Move "[VO_TDXVID] Move %d(%d) x %d => %d.\n"
-#define MSGTR_LIBVO_TDFXVID_AGPMoveFailedToClearTheScreen "[VO_TDFXVID] AGP move failed to clear the screen.\n"
-#define MSGTR_LIBVO_TDFXVID_BlitFailed "[VO_TDFXVID] Blit failed.\n"
-#define MSGTR_LIBVO_TDFXVID_NonNativeOverlayFormatNeedConversion "[VO_TDFXVID] Non-native overlay format needs conversion.\n"
-#define MSGTR_LIBVO_TDFXVID_UnsupportedInputFormat "[VO_TDFXVID] Unsupported input format 0x%x.\n"
-#define MSGTR_LIBVO_TDFXVID_OverlaySetupFailed "[VO_TDFXVID] Overlay setup failed.\n"
-#define MSGTR_LIBVO_TDFXVID_OverlayOnFailed "[VO_TDFXVID] Overlay on failed.\n"
-#define MSGTR_LIBVO_TDFXVID_OverlayReady "[VO_TDFXVID] Overlay ready: %d(%d) x %d @ %d => %d(%d) x %d @ %d.\n"
-#define MSGTR_LIBVO_TDFXVID_TextureBlitReady "[VO_TDFXVID] Texture blit ready: %d(%d) x %d @ %d => %d(%d) x %d @ %d.\n"
-#define MSGTR_LIBVO_TDFXVID_OverlayOffFailed "[VO_TDFXVID] Overlay off failed\n"
-#define MSGTR_LIBVO_TDFXVID_CantOpen "[VO_TDFXVID] Can't open %s: %s.\n"
-#define MSGTR_LIBVO_TDFXVID_CantGetCurrentCfg "[VO_TDFXVID] Can't get current configuration: %s.\n"
-#define MSGTR_LIBVO_TDFXVID_MemmapFailed "[VO_TDFXVID] Memmap failed !!!!!\n"
-#define MSGTR_LIBVO_TDFXVID_GetImageTodo "Get image todo.\n"
-#define MSGTR_LIBVO_TDFXVID_AgpMoveFailed "[VO_TDFXVID] AGP move failed.\n"
-#define MSGTR_LIBVO_TDFXVID_SetYuvFailed "[VO_TDFXVID] Set YUV failed.\n"
-#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnYPlane "[VO_TDFXVID] AGP move failed on Y plane.\n"
-#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnUPlane "[VO_TDFXVID] AGP move failed on U plane.\n"
-#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnVPlane "[VO_TDFXVID] AGP move failed on V plane.\n"
-#define MSGTR_LIBVO_TDFXVID_UnknownFormat "[VO_TDFXVID] unknown format: 0x%x.\n"
-
-// vo_tdfxfb.c
-#define MSGTR_LIBVO_TDFXFB_CantOpen "[VO_TDFXFB] Can't open %s: %s.\n"
-#define MSGTR_LIBVO_TDFXFB_ProblemWithFbitgetFscreenInfo "[VO_TDFXFB] Problem with FBITGET_FSCREENINFO ioctl: %s.\n"
-#define MSGTR_LIBVO_TDFXFB_ProblemWithFbitgetVscreenInfo "[VO_TDFXFB] Problem with FBITGET_VSCREENINFO ioctl: %s.\n"
-#define MSGTR_LIBVO_TDFXFB_ThisDriverOnlySupports "[VO_TDFXFB] This driver only supports the 3Dfx Banshee, Voodoo3 and Voodoo 5.\n"
-#define MSGTR_LIBVO_TDFXFB_OutputIsNotSupported "[VO_TDFXFB] %d bpp output is not supported.\n"
-#define MSGTR_LIBVO_TDFXFB_CouldntMapMemoryAreas "[VO_TDFXFB] Couldn't map memory areas: %s.\n"
-#define MSGTR_LIBVO_TDFXFB_BppOutputIsNotSupported "[VO_TDFXFB] %d bpp output is not supported (This should never have happened).\n"
-#define MSGTR_LIBVO_TDFXFB_SomethingIsWrongWithControl "[VO_TDFXFB] Eik! Something's wrong with control().\n"
-#define MSGTR_LIBVO_TDFXFB_NotEnoughVideoMemoryToPlay "[VO_TDFXFB] Not enough video memory to play this movie. Try at a lower resolution.\n"
-#define MSGTR_LIBVO_TDFXFB_ScreenIs "[VO_TDFXFB] Screen is %dx%d at %d bpp, in is %dx%d at %d bpp, norm is %dx%d.\n"
-
-// vo_tga.c
-#define MSGTR_LIBVO_TGA_UnknownSubdevice "[VO_TGA] Unknown subdevice: %s.\n"
-
-// vo_vesa.c
-#define MSGTR_LIBVO_VESA_FatalErrorOccurred "[VO_VESA] Fatal error occurred! Can't continue.\n"
-#define MSGTR_LIBVO_VESA_UnknownSubdevice "[VO_VESA] unknown subdevice: '%s'.\n"
-#define MSGTR_LIBVO_VESA_YouHaveTooLittleVideoMemory "[VO_VESA] You have too little video memory for this mode:\n[VO_VESA] Required: %08lX present: %08lX.\n"
-#define MSGTR_LIBVO_VESA_YouHaveToSpecifyTheCapabilitiesOfTheMonitor "[VO_VESA] You have to specify the capabilities of the monitor. Not changing refresh rate.\n"
-#define MSGTR_LIBVO_VESA_UnableToFitTheMode "[VO_VESA] The mode does not fit the monitor limits. Not changing refresh rate.\n"
-#define MSGTR_LIBVO_VESA_DetectedInternalFatalError "[VO_VESA] Detected internal fatal error: init is called before preinit.\n"
-#define MSGTR_LIBVO_VESA_SwitchFlipIsNotSupported "[VO_VESA] The -flip option is not supported.\n"
-#define MSGTR_LIBVO_VESA_PossibleReasonNoVbe2BiosFound "[VO_VESA] Possible reason: No VBE2 BIOS found.\n"
-#define MSGTR_LIBVO_VESA_FoundVesaVbeBiosVersion "[VO_VESA] Found VESA VBE BIOS Version %x.%x Revision: %x.\n"
-#define MSGTR_LIBVO_VESA_VideoMemory "[VO_VESA] Video memory: %u Kb.\n"
-#define MSGTR_LIBVO_VESA_Capabilites "[VO_VESA] VESA Capabilities: %s %s %s %s %s.\n"
-#define MSGTR_LIBVO_VESA_BelowWillBePrintedOemInfo "[VO_VESA] !!! OEM info will be printed below !!!\n"
-#define MSGTR_LIBVO_VESA_YouShouldSee5OemRelatedLines "[VO_VESA] You should see 5 OEM related lines below; If not, you've broken vm86.\n"
-#define MSGTR_LIBVO_VESA_OemInfo "[VO_VESA] OEM info: %s.\n"
-#define MSGTR_LIBVO_VESA_OemRevision "[VO_VESA] OEM Revision: %x.\n"
-#define MSGTR_LIBVO_VESA_OemVendor "[VO_VESA] OEM vendor: %s.\n"
-#define MSGTR_LIBVO_VESA_OemProductName "[VO_VESA] OEM Product Name: %s.\n"
-#define MSGTR_LIBVO_VESA_OemProductRev "[VO_VESA] OEM Product Rev: %s.\n"
-#define MSGTR_LIBVO_VESA_Hint "[VO_VESA] Hint: For working TV-Out you should have plugged in the TV connector\n"\
-"[VO_VESA] before booting since VESA BIOS initializes itself only during POST.\n"
-#define MSGTR_LIBVO_VESA_UsingVesaMode "[VO_VESA] Using VESA mode (%u) = %x [%ux%u@%u]\n"
-#define MSGTR_LIBVO_VESA_CantInitializeSwscaler "[VO_VESA] Can't initialize software scaler.\n"
-#define MSGTR_LIBVO_VESA_CantUseDga "[VO_VESA] Can't use DGA. Force bank switching mode. :(\n"
-#define MSGTR_LIBVO_VESA_UsingDga "[VO_VESA] Using DGA (physical resources: %08lXh, %08lXh)"
-#define MSGTR_LIBVO_VESA_CantUseDoubleBuffering "[VO_VESA] Can't use double buffering: not enough video memory.\n"
-#define MSGTR_LIBVO_VESA_CantFindNeitherDga "[VO_VESA] Can find neither DGA nor relocatable window frame.\n"
-#define MSGTR_LIBVO_VESA_YouveForcedDga "[VO_VESA] You've forced DGA. Exiting\n"
-#define MSGTR_LIBVO_VESA_CantFindValidWindowAddress "[VO_VESA] Can't find valid window address.\n"
-#define MSGTR_LIBVO_VESA_UsingBankSwitchingMode "[VO_VESA] Using bank switching mode (physical resources: %08lXh, %08lXh).\n"
-#define MSGTR_LIBVO_VESA_CantAllocateTemporaryBuffer "[VO_VESA] Can't allocate temporary buffer.\n"
-#define MSGTR_LIBVO_VESA_SorryUnsupportedMode "[VO_VESA] Sorry, unsupported mode -- try -x 640 -zoom.\n"
-#define MSGTR_LIBVO_VESA_OhYouReallyHavePictureOnTv "[VO_VESA] Oh you really have a picture on the TV!\n"
-#define MSGTR_LIBVO_VESA_CantInitialozeLinuxVideoOverlay "[VO_VESA] Can't initialize Linux Video Overlay.\n"
-#define MSGTR_LIBVO_VESA_UsingVideoOverlay "[VO_VESA] Using video overlay: %s.\n"
-#define MSGTR_LIBVO_VESA_CantInitializeVidixDriver "[VO_VESA] Can't initialize VIDIX driver.\n"
-#define MSGTR_LIBVO_VESA_UsingVidix "[VO_VESA] Using VIDIX.\n"
-#define MSGTR_LIBVO_VESA_CantFindModeFor "[VO_VESA] Can't find mode for: %ux%u@%u.\n"
-#define MSGTR_LIBVO_VESA_InitializationComplete "[VO_VESA] VESA initialization complete.\n"
-
-// vesa_lvo.c
-#define MSGTR_LIBVO_VESA_ThisBranchIsNoLongerSupported "[VESA_LVO] This branch is no longer supported.\n[VESA_LVO] Please use -vo vesa:vidix instead.\n"
-#define MSGTR_LIBVO_VESA_CouldntOpen "[VESA_LVO] Couldn't open: '%s'\n"
-#define MSGTR_LIBVO_VESA_InvalidOutputFormat "[VESA_LVI] Invalid output format: %s(%0X)\n"
-#define MSGTR_LIBVO_VESA_IncompatibleDriverVersion "[VESA_LVO] Your fb_vid driver version is incompatible with this MPlayer version!\n"
-
-// vo_x11.c
-#define MSGTR_LIBVO_X11_DrawFrameCalled "[VO_X11] draw_frame() called!!!!!!\n"
-
-// vo_xv.c
-#define MSGTR_LIBVO_XV_DrawFrameCalled "[VO_XV] draw_frame() called!!!!!!\n"
-#define MSGTR_LIBVO_XV_SharedMemoryNotSupported "[VO_XV] Shared memory not supported\nReverting to normal Xv.\n"
-#define MSGTR_LIBVO_XV_XvNotSupportedByX11 "[VO_XV] Sorry, Xv not supported by this X11 version/driver\n[VO_XV] ******** Try with -vo x11 or -vo sdl *********\n"
-#define MSGTR_LIBVO_XV_XvQueryAdaptorsFailed "[VO_XV] XvQueryAdaptors failed.\n"
-#define MSGTR_LIBVO_XV_InvalidPortParameter "[VO_XV] Invalid port parameter, overriding with port 0.\n"
-#define MSGTR_LIBVO_XV_CouldNotGrabPort "[VO_XV] Could not grab port %i.\n"
-#define MSGTR_LIBVO_XV_CouldNotFindFreePort "[VO_XV] Could not find free Xvideo port - maybe another process is already\n"\
-"[VO_XV] using it. Close all video applications, and try again. If that does\n"\
-"[VO_XV] not help, see 'mplayer -vo help' for other (non-xv) video out drivers.\n"
-#define MSGTR_LIBVO_XV_NoXvideoSupport "[VO_XV] It seems there is no Xvideo support for your video card available.\n"\
-"[VO_XV] Run 'xvinfo' to verify its Xv support and read\n"\
-"[VO_XV] DOCS/HTML/en/video.html#xv!\n"\
-"[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.\n"\
-"[VO_XV] Try -vo x11.\n"
-#define MSGTR_VO_XV_ImagedimTooHigh "Source image dimensions are too high: %ux%u (maximum is %ux%u)\n"
-
-// vo_yuv4mpeg.c
-#define MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4 "Interlaced mode requires image height to be divisible by 4."
-#define MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail "Unable to allocate line buffer for interlaced mode."
-#define MSGTR_VO_YUV4MPEG_WidthDivisibleBy2 "Image width must be divisible by 2."
-#define MSGTR_VO_YUV4MPEG_OutFileOpenError "Can't get memory or file handle to write \"%s\"!"
-#define MSGTR_VO_YUV4MPEG_OutFileWriteError "Error writing image to output!"
-#define MSGTR_VO_YUV4MPEG_UnknownSubDev "Unknown subdevice: %s"
-#define MSGTR_VO_YUV4MPEG_InterlacedTFFMode "Using interlaced output mode, top-field first."
-#define MSGTR_VO_YUV4MPEG_InterlacedBFFMode "Using interlaced output mode, bottom-field first."
-#define MSGTR_VO_YUV4MPEG_ProgressiveMode "Using (default) progressive frame mode."
-
-// vosub_vidix.c
-#define MSGTR_LIBVO_SUB_VIDIX_CantStartPlayback "[VO_SUB_VIDIX] Can't start playback: %s\n"
-#define MSGTR_LIBVO_SUB_VIDIX_CantStopPlayback "[VO_SUB_VIDIX] Can't stop playback: %s\n"
-#define MSGTR_LIBVO_SUB_VIDIX_InterleavedUvForYuv410pNotSupported "[VO_SUB_VIDIX] Interleaved UV for YUV410P not supported.\n"
-#define MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawsliceWasCalled "[VO_SUB_VIDIX] Dummy vidix_draw_slice() was called.\n"
-#define MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawframeWasCalled "[VO_SUB_VIDIX] Dummy vidix_draw_frame() was called.\n"
-#define MSGTR_LIBVO_SUB_VIDIX_UnsupportedFourccForThisVidixDriver "[VO_SUB_VIDIX] Unsupported FourCC for this VIDIX driver: %x (%s).\n"
-#define MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedResolution "[VO_SUB_VIDIX] Video server has unsupported resolution (%dx%d), supported: %dx%d-%dx%d.\n"
-#define MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedColorDepth "[VO_SUB_VIDIX] Video server has unsupported color depth by vidix (%d).\n"
-#define MSGTR_LIBVO_SUB_VIDIX_DriverCantUpscaleImage "[VO_SUB_VIDIX] VIDIX driver can't upscale image (%d%d -> %d%d).\n"
-#define MSGTR_LIBVO_SUB_VIDIX_DriverCantDownscaleImage "[VO_SUB_VIDIX] VIDIX driver can't downscale image (%d%d -> %d%d).\n"
-#define MSGTR_LIBVO_SUB_VIDIX_CantConfigurePlayback "[VO_SUB_VIDIX] Can't configure playback: %s.\n"
-#define MSGTR_LIBVO_SUB_VIDIX_YouHaveWrongVersionOfVidixLibrary "[VO_SUB_VIDIX] You have the wrong version of the VIDIX library.\n"
-#define MSGTR_LIBVO_SUB_VIDIX_CouldntFindWorkingVidixDriver "[VO_SUB_VIDIX] Couldn't find working VIDIX driver.\n"
-#define MSGTR_LIBVO_SUB_VIDIX_CouldntGetCapability "[VO_SUB_VIDIX] Couldn't get capability: %s.\n"
-
-// x11_common.c
-#define MSGTR_EwmhFullscreenStateFailed "\nX11: Couldn't send EWMH fullscreen event!\n"
-#define MSGTR_CouldNotFindXScreenSaver "xscreensaver_disable: Could not find XScreenSaver window.\n"
-#define MSGTR_SelectedVideoMode "XF86VM: Selected video mode %dx%d for image size %dx%d.\n"
-
-#define MSGTR_InsertingAfVolume "[Mixer] No hardware mixing, inserting volume filter.\n"
-#define MSGTR_NoVolume "[Mixer] No volume control available.\n"
-#define MSGTR_NoBalance "[Mixer] No balance control available.\n"
-
-// old vo drivers that have been replaced
-#define MSGTR_VO_PGM_HasBeenReplaced "The pgm video output driver has been replaced by -vo pnm:pgmyuv.\n"
-#define MSGTR_VO_MD5_HasBeenReplaced "The md5 video output driver has been replaced by -vo md5sum.\n"
-#define MSGTR_VO_GL2_HasBeenRenamed "The gl2 video output driver has been renamed to -vo gl_tiled, but you really should be using -vo gl instead.\n"
-
-
-// ======================= audio output drivers ========================
-
-// audio_out.c
-#define MSGTR_AO_ALSA9_1x_Removed "audio_out: alsa9 and alsa1x modules were removed, use -ao alsa instead.\n"
-#define MSGTR_AO_NoSuchDriver "No such audio driver '%.*s'\n"
-#define MSGTR_AO_FailedInit "Failed to initialize audio driver '%s'\n"
-
-// ao_oss.c
-#define MSGTR_AO_OSS_CantOpenMixer "[AO OSS] audio_setup: Can't open mixer device %s: %s\n"
-#define MSGTR_AO_OSS_ChanNotFound "[AO OSS] audio_setup: Audio card mixer does not have channel '%s', using default.\n"
-#define MSGTR_AO_OSS_CantOpenDev "[AO OSS] audio_setup: Can't open audio device %s: %s\n"
-#define MSGTR_AO_OSS_CantMakeFd "[AO OSS] audio_setup: Can't make file descriptor blocking: %s\n"
-#define MSGTR_AO_OSS_CantSet "[AO OSS] Can't set audio device %s to %s output, trying %s...\n"
-#define MSGTR_AO_OSS_CantSetChans "[AO OSS] audio_setup: Failed to set audio device to %d channels.\n"
-#define MSGTR_AO_OSS_CantUseGetospace "[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(\n"
-#define MSGTR_AO_OSS_CantUseSelect "[AO OSS]\n *** Your audio driver DOES NOT support select() ***\n Recompile MPlayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n"
-#define MSGTR_AO_OSS_CantReopen "[AO OSS]\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n"
-#define MSGTR_AO_OSS_UnknownUnsupportedFormat "[AO OSS] Unknown/Unsupported OSS format: %x.\n"
-
-// ao_arts.c
-#define MSGTR_AO_ARTS_CantInit "[AO ARTS] %s\n"
-#define MSGTR_AO_ARTS_ServerConnect "[AO ARTS] Connected to sound server.\n"
-#define MSGTR_AO_ARTS_CantOpenStream "[AO ARTS] Unable to open a stream.\n"
-#define MSGTR_AO_ARTS_StreamOpen "[AO ARTS] Stream opened.\n"
-#define MSGTR_AO_ARTS_BufferSize "[AO ARTS] buffer size: %d\n"
-
-// ao_dxr2.c
-#define MSGTR_AO_DXR2_SetVolFailed "[AO DXR2] Setting volume to %d failed.\n"
-#define MSGTR_AO_DXR2_UnsupSamplerate "[AO DXR2] %d Hz not supported, try to resample.\n"
-
-// ao_esd.c
-#define MSGTR_AO_ESD_CantOpenSound "[AO ESD] esd_open_sound failed: %s\n"
-#define MSGTR_AO_ESD_LatencyInfo "[AO ESD] latency: [server: %0.2fs, net: %0.2fs] (adjust %0.2fs)\n"
-#define MSGTR_AO_ESD_CantOpenPBStream "[AO ESD] failed to open ESD playback stream: %s\n"
-
-// ao_mpegpes.c
-#define MSGTR_AO_MPEGPES_CantSetMixer "[AO MPEGPES] DVB audio set mixer failed: %s.\n"
-#define MSGTR_AO_MPEGPES_UnsupSamplerate "[AO MPEGPES] %d Hz not supported, try to resample.\n"
-
-// ao_pcm.c
-#define MSGTR_AO_PCM_FileInfo "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n"
-#define MSGTR_AO_PCM_HintInfo "[AO PCM] Info: Faster dumping is achieved with -benchmark -vc null -vo null -ao pcm:fast\n[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).\n"
-#define MSGTR_AO_PCM_CantOpenOutputFile "[AO PCM] Failed to open %s for writing!\n"
-
-// ao_sdl.c
-#define MSGTR_AO_SDL_INFO "[AO SDL] Samplerate: %iHz Channels: %s Format %s\n"
-#define MSGTR_AO_SDL_DriverInfo "[AO SDL] using %s audio driver.\n"
-#define MSGTR_AO_SDL_UnsupportedAudioFmt "[AO SDL] Unsupported audio format: 0x%x.\n"
-#define MSGTR_AO_SDL_CantInit "[AO SDL] SDL Audio initialization failed: %s\n"
-#define MSGTR_AO_SDL_CantOpenAudio "[AO SDL] Unable to open audio: %s\n"
-
-// ao_sgi.c
-#define MSGTR_AO_SGI_INFO "[AO SGI] control.\n"
-#define MSGTR_AO_SGI_InitInfo "[AO SGI] init: Samplerate: %iHz Channels: %s Format %s\n"
-#define MSGTR_AO_SGI_InvalidDevice "[AO SGI] play: invalid device.\n"
-#define MSGTR_AO_SGI_CantSetParms_Samplerate "[AO SGI] init: setparams failed: %s\nCould not set desired samplerate.\n"
-#define MSGTR_AO_SGI_CantSetAlRate "[AO SGI] init: AL_RATE was not accepted on the given resource.\n"
-#define MSGTR_AO_SGI_CantGetParms "[AO SGI] init: getparams failed: %s\n"
-#define MSGTR_AO_SGI_SampleRateInfo "[AO SGI] init: samplerate is now %f (desired rate is %f)\n"
-#define MSGTR_AO_SGI_InitConfigError "[AO SGI] init: %s\n"
-#define MSGTR_AO_SGI_InitOpenAudioFailed "[AO SGI] init: Unable to open audio channel: %s\n"
-#define MSGTR_AO_SGI_Uninit "[AO SGI] uninit: ...\n"
-#define MSGTR_AO_SGI_Reset "[AO SGI] reset: ...\n"
-#define MSGTR_AO_SGI_PauseInfo "[AO SGI] audio_pause: ...\n"
-#define MSGTR_AO_SGI_ResumeInfo "[AO SGI] audio_resume: ...\n"
-
-// ao_sun.c
-#define MSGTR_AO_SUN_RtscSetinfoFailed "[AO SUN] rtsc: SETINFO failed.\n"
-#define MSGTR_AO_SUN_RtscWriteFailed "[AO SUN] rtsc: write failed.\n"
-#define MSGTR_AO_SUN_CantOpenAudioDev "[AO SUN] Can't open audio device %s, %s -> nosound.\n"
-#define MSGTR_AO_SUN_UnsupSampleRate "[AO SUN] audio_setup: your card doesn't support %d channel, %s, %d Hz samplerate.\n"
-#define MSGTR_AO_SUN_CantUseSelect "[AO SUN]\n *** Your audio driver DOES NOT support select() ***\nRecompile MPlayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n"
-#define MSGTR_AO_SUN_CantReopenReset "[AO SUN]\nFatal error: *** CANNOT REOPEN / RESET AUDIO DEVICE (%s) ***\n"
-
-// ao_alsa.c
-#define MSGTR_AO_ALSA_InvalidMixerIndexDefaultingToZero "[AO_ALSA] Invalid mixer index. Defaulting to 0.\n"
-#define MSGTR_AO_ALSA_MixerOpenError "[AO_ALSA] Mixer open error: %s\n"
-#define MSGTR_AO_ALSA_MixerAttachError "[AO_ALSA] Mixer attach %s error: %s\n"
-#define MSGTR_AO_ALSA_MixerRegisterError "[AO_ALSA] Mixer register error: %s\n"
-#define MSGTR_AO_ALSA_MixerLoadError "[AO_ALSA] Mixer load error: %s\n"
-#define MSGTR_AO_ALSA_UnableToFindSimpleControl "[AO_ALSA] Unable to find simple control '%s',%i.\n"
-#define MSGTR_AO_ALSA_ErrorSettingLeftChannel "[AO_ALSA] Error setting left channel, %s\n"
-#define MSGTR_AO_ALSA_ErrorSettingRightChannel "[AO_ALSA] Error setting right channel, %s\n"
-#define MSGTR_AO_ALSA_CommandlineHelp "\n[AO_ALSA] -ao alsa commandline help:\n"\
-"[AO_ALSA] Example: mplayer -ao alsa:device=hw=0.3\n"\
-"[AO_ALSA] Sets first card fourth hardware device.\n\n"\
-"[AO_ALSA] Options:\n"\
-"[AO_ALSA] noblock\n"\
-"[AO_ALSA] Opens device in non-blocking mode.\n"\
-"[AO_ALSA] device=<device-name>\n"\
-"[AO_ALSA] Sets device (change , to . and : to =)\n"
-#define MSGTR_AO_ALSA_ChannelsNotSupported "[AO_ALSA] %d channels are not supported.\n"
-#define MSGTR_AO_ALSA_OpenInNonblockModeFailed "[AO_ALSA] Open in nonblock-mode failed, trying to open in block-mode.\n"
-#define MSGTR_AO_ALSA_PlaybackOpenError "[AO_ALSA] Playback open error: %s\n"
-#define MSGTR_AO_ALSA_ErrorSetBlockMode "[AL_ALSA] Error setting block-mode %s.\n"
-#define MSGTR_AO_ALSA_UnableToGetInitialParameters "[AO_ALSA] Unable to get initial parameters: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetAccessType "[AO_ALSA] Unable to set access type: %s\n"
-#define MSGTR_AO_ALSA_FormatNotSupportedByHardware "[AO_ALSA] Format %s is not supported by hardware, trying default.\n"
-#define MSGTR_AO_ALSA_UnableToSetFormat "[AO_ALSA] Unable to set format: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetChannels "[AO_ALSA] Unable to set channels: %s\n"
-#define MSGTR_AO_ALSA_UnableToDisableResampling "[AO_ALSA] Unable to disable resampling: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetSamplerate2 "[AO_ALSA] Unable to set samplerate-2: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetBufferTimeNear "[AO_ALSA] Unable to set buffer time near: %s\n"
-#define MSGTR_AO_ALSA_UnableToGetPeriodSize "[AO ALSA] Unable to get period size: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetPeriods "[AO_ALSA] Unable to set periods: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetHwParameters "[AO_ALSA] Unable to set hw-parameters: %s\n"
-#define MSGTR_AO_ALSA_UnableToGetBufferSize "[AO_ALSA] Unable to get buffersize: %s\n"
-#define MSGTR_AO_ALSA_UnableToGetSwParameters "[AO_ALSA] Unable to get sw-parameters: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetSwParameters "[AO_ALSA] Unable to set sw-parameters: %s\n"
-#define MSGTR_AO_ALSA_UnableToGetBoundary "[AO_ALSA] Unable to get boundary: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetStartThreshold "[AO_ALSA] Unable to set start threshold: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetStopThreshold "[AO_ALSA] Unable to set stop threshold: %s\n"
-#define MSGTR_AO_ALSA_UnableToSetSilenceSize "[AO_ALSA] Unable to set silence size: %s\n"
-#define MSGTR_AO_ALSA_PcmCloseError "[AO_ALSA] pcm close error: %s\n"
-#define MSGTR_AO_ALSA_NoHandlerDefined "[AO_ALSA] No handler defined!\n"
-#define MSGTR_AO_ALSA_PcmPrepareError "[AO_ALSA] pcm prepare error: %s\n"
-#define MSGTR_AO_ALSA_PcmPauseError "[AO_ALSA] pcm pause error: %s\n"
-#define MSGTR_AO_ALSA_PcmDropError "[AO_ALSA] pcm drop error: %s\n"
-#define MSGTR_AO_ALSA_PcmResumeError "[AO_ALSA] pcm resume error: %s\n"
-#define MSGTR_AO_ALSA_DeviceConfigurationError "[AO_ALSA] Device configuration error."
-#define MSGTR_AO_ALSA_PcmInSuspendModeTryingResume "[AO_ALSA] Pcm in suspend mode, trying to resume.\n"
-#define MSGTR_AO_ALSA_WriteError "[AO_ALSA] Write error: %s\n"
-#define MSGTR_AO_ALSA_TryingToResetSoundcard "[AO_ALSA] Trying to reset soundcard.\n"
-#define MSGTR_AO_ALSA_CannotGetPcmStatus "[AO_ALSA] Cannot get pcm status: %s\n"
-
-// ao_plugin.c
-#define MSGTR_AO_PLUGIN_InvalidPlugin "[AO PLUGIN] invalid plugin: %s\n"
-
-
-// ======================= audio filters ================================
-
-// af_scaletempo.c
-#define MSGTR_AF_ValueOutOfRange MSGTR_VO_ValueOutOfRange
-
-// af_ladspa.c
-#define MSGTR_AF_LADSPA_AvailableLabels "available labels in"
-#define MSGTR_AF_LADSPA_WarnNoInputs "WARNING! This LADSPA plugin has no audio inputs.\n The incoming audio signal will be lost."
-#define MSGTR_AF_LADSPA_ErrMultiChannel "Multi-channel (>2) plugins are not supported (yet).\n Use only mono and stereo plugins."
-#define MSGTR_AF_LADSPA_ErrNoOutputs "This LADSPA plugin has no audio outputs."
-#define MSGTR_AF_LADSPA_ErrInOutDiff "The number of audio inputs and audio outputs of the LADSPA plugin differ."
-#define MSGTR_AF_LADSPA_ErrFailedToLoad "failed to load"
-#define MSGTR_AF_LADSPA_ErrNoDescriptor "Couldn't find ladspa_descriptor() function in the specified library file."
-#define MSGTR_AF_LADSPA_ErrLabelNotFound "Couldn't find label in plugin library."
-#define MSGTR_AF_LADSPA_ErrNoSuboptions "No suboptions specified."
-#define MSGTR_AF_LADSPA_ErrNoLibFile "No library file specified."
-#define MSGTR_AF_LADSPA_ErrNoLabel "No filter label specified."
-#define MSGTR_AF_LADSPA_ErrNotEnoughControls "Not enough controls specified on the command line."
-#define MSGTR_AF_LADSPA_ErrControlBelow "%s: Input control #%d is below lower boundary of %0.4f.\n"
-#define MSGTR_AF_LADSPA_ErrControlAbove "%s: Input control #%d is above upper boundary of %0.4f.\n"
-
-// format.c
-#define MSGTR_AF_FORMAT_UnknownFormat "unknown format "
-
-
-// ========================== INPUT =========================================
-
-// joystick.c
-#define MSGTR_INPUT_JOYSTICK_CantOpen "Can't open joystick device %s: %s\n"
-#define MSGTR_INPUT_JOYSTICK_ErrReading "Error while reading joystick device: %s\n"
-#define MSGTR_INPUT_JOYSTICK_LoosingBytes "Joystick: We lose %d bytes of data\n"
-#define MSGTR_INPUT_JOYSTICK_WarnLostSync "Joystick: warning init event, we have lost sync with driver.\n"
-#define MSGTR_INPUT_JOYSTICK_WarnUnknownEvent "Joystick warning unknown event type %d\n"
-
-// appleir.c
-#define MSGTR_INPUT_APPLE_IR_CantOpen "Can't open Apple IR device: %s\n"
-
-// input.c
-#define MSGTR_INPUT_INPUT_ErrCantRegister2ManyCmdFds "Too many command file descriptors, cannot register file descriptor %d.\n"
-#define MSGTR_INPUT_INPUT_ErrCantRegister2ManyKeyFds "Too many key file descriptors, cannot register file descriptor %d.\n"
-#define MSGTR_INPUT_INPUT_ErrArgMustBeInt "Command %s: argument %d isn't an integer.\n"
-#define MSGTR_INPUT_INPUT_ErrArgMustBeFloat "Command %s: argument %d isn't a float.\n"
-#define MSGTR_INPUT_INPUT_ErrUnterminatedArg "Command %s: argument %d is unterminated.\n"
-#define MSGTR_INPUT_INPUT_ErrUnknownArg "Unknown argument %d\n"
-#define MSGTR_INPUT_INPUT_Err2FewArgs "Command %s requires at least %d arguments, we found only %d so far.\n"
-#define MSGTR_INPUT_INPUT_ErrReadingCmdFd "Error while reading command file descriptor %d: %s\n"
-#define MSGTR_INPUT_INPUT_ErrCmdBufferFullDroppingContent "Command buffer of file descriptor %d is full: dropping content.\n"
-#define MSGTR_INPUT_INPUT_ErrInvalidCommandForKey "Invalid command for bound key %s"
-#define MSGTR_INPUT_INPUT_ErrSelect "Select error: %s\n"
-#define MSGTR_INPUT_INPUT_ErrOnKeyInFd "Error on key input file descriptor %d\n"
-#define MSGTR_INPUT_INPUT_ErrDeadKeyOnFd "Dead key input on file descriptor %d\n"
-#define MSGTR_INPUT_INPUT_Err2ManyKeyDowns "Too many key down events at the same time\n"
-#define MSGTR_INPUT_INPUT_ErrOnCmdFd "Error on command file descriptor %d\n"
-#define MSGTR_INPUT_INPUT_ErrReadingInputConfig "Error while reading input config file %s: %s\n"
-#define MSGTR_INPUT_INPUT_ErrUnknownKey "Unknown key '%s'\n"
-#define MSGTR_INPUT_INPUT_ErrUnfinishedBinding "Unfinished binding %s\n"
-#define MSGTR_INPUT_INPUT_ErrBuffer2SmallForKeyName "Buffer is too small for this key name: %s\n"
-#define MSGTR_INPUT_INPUT_ErrNoCmdForKey "No command found for key %s"
-#define MSGTR_INPUT_INPUT_ErrBuffer2SmallForCmd "Buffer is too small for command %s\n"
-#define MSGTR_INPUT_INPUT_ErrWhyHere "What are we doing here?\n"
-#define MSGTR_INPUT_INPUT_ErrCantInitJoystick "Can't init input joystick\n"
-#define MSGTR_INPUT_INPUT_ErrCantOpenFile "Can't open %s: %s\n"
-#define MSGTR_INPUT_INPUT_ErrCantInitAppleRemote "Can't init Apple Remote.\n"
-
-// lirc.c
-#define MSGTR_LIRCopenfailed "Failed to open LIRC support. You will not be able to use your remote control.\n"
-#define MSGTR_LIRCcfgerr "Failed to read LIRC config file %s.\n"
-
-
-// ========================== LIBMPDEMUX ===================================
-
-// muxer.c, muxer_*.c
-#define MSGTR_TooManyStreams "Too many streams!"
-#define MSGTR_RawMuxerOnlyOneStream "Rawaudio muxer supports only one audio stream!\n"
-#define MSGTR_IgnoringVideoStream "Ignoring video stream!\n"
-#define MSGTR_UnknownStreamType "Warning, unknown stream type: %d\n"
-#define MSGTR_WarningLenIsntDivisible "Warning, len isn't divisible by samplesize!\n"
-#define MSGTR_MuxbufMallocErr "Muxer frame buffer cannot allocate memory!\n"
-#define MSGTR_MuxbufReallocErr "Muxer frame buffer cannot reallocate memory!\n"
-#define MSGTR_WritingHeader "Writing header...\n"
-#define MSGTR_WritingTrailer "Writing index...\n"
-
-// demuxer.c, demux_*.c
-#define MSGTR_AudioStreamRedefined "WARNING: Audio stream header %d redefined.\n"
-#define MSGTR_VideoStreamRedefined "WARNING: Video stream header %d redefined.\n"
-#define MSGTR_TooManyAudioInBuffer "\nToo many audio packets in the buffer: (%d in %d bytes).\n"
-#define MSGTR_TooManyVideoInBuffer "\nToo many video packets in the buffer: (%d in %d bytes).\n"
-#define MSGTR_MaybeNI "Maybe you are playing a non-interleaved stream/file or the codec failed?\n" \
- "For AVI files, try to force non-interleaved mode with the -ni option.\n"
-#define MSGTR_WorkAroundBlockAlignHeaderBug "AVI: Working around CBR-MP3 nBlockAlign header bug!\n"
-#define MSGTR_SwitchToNi "\nBadly interleaved AVI file detected - switching to -ni mode...\n"
-#define MSGTR_InvalidAudioStreamNosound "AVI: invalid audio stream ID: %d - ignoring (nosound)\n"
-#define MSGTR_InvalidAudioStreamUsingDefault "AVI: invalid video stream ID: %d - ignoring (using default)\n"
-#define MSGTR_ON2AviFormat "ON2 AVI format"
-#define MSGTR_Detected_XXX_FileFormat "%s file format detected.\n"
-#define MSGTR_DetectedAudiofile "Audio file detected.\n"
-#define MSGTR_InvalidMPEGES "Invalid MPEG-ES stream??? Contact the author, it may be a bug :(\n"
-#define MSGTR_FormatNotRecognized "============ Sorry, this file format is not recognized/supported =============\n"\
- "=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===\n"
-#define MSGTR_SettingProcessPriority "Setting process priority: %s\n"
-#define MSGTR_FilefmtFourccSizeFpsFtime "[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.3f ftime:=%6.4f\n"
-#define MSGTR_CannotInitializeMuxer "Cannot initialize muxer."
-#define MSGTR_MissingVideoStream "No video stream found.\n"
-#define MSGTR_MissingAudioStream "No audio stream found -> no sound.\n"
-#define MSGTR_MissingVideoStreamBug "Missing video stream!? Contact the author, it may be a bug :(\n"
-
-#define MSGTR_DoesntContainSelectedStream "demux: File doesn't contain the selected audio or video stream.\n"
-
-#define MSGTR_NI_Forced "Forced"
-#define MSGTR_NI_Detected "Detected"
-#define MSGTR_NI_Message "%s NON-INTERLEAVED AVI file format.\n"
-
-#define MSGTR_UsingNINI "Using NON-INTERLEAVED broken AVI file format.\n"
-#define MSGTR_CouldntDetFNo "Could not determine number of frames (for absolute seek).\n"
-#define MSGTR_CantSeekRawAVI "Cannot seek in raw AVI streams. (Index required, try with the -idx switch.)\n"
-#define MSGTR_CantSeekFile "Cannot seek in this file.\n"
-
-#define MSGTR_MOVcomprhdr "MOV: Compressed headers support requires ZLIB!\n"
-#define MSGTR_MOVvariableFourCC "MOV: WARNING: Variable FourCC detected!?\n"
-#define MSGTR_MOVtooManyTrk "MOV: WARNING: too many tracks"
-#define MSGTR_DetectedTV "TV detected! ;-)\n"
-#define MSGTR_ErrorOpeningOGGDemuxer "Unable to open the Ogg demuxer.\n"
-#define MSGTR_CannotOpenAudioStream "Cannot open audio stream: %s\n"
-#define MSGTR_CannotOpenSubtitlesStream "Cannot open subtitle stream: %s\n"
-#define MSGTR_OpeningAudioDemuxerFailed "Failed to open audio demuxer: %s\n"
-#define MSGTR_OpeningSubtitlesDemuxerFailed "Failed to open subtitle demuxer: %s\n"
-#define MSGTR_TVInputNotSeekable "TV input is not seekable! (Seeking will probably be for changing channels ;)\n"
-#define MSGTR_DemuxerInfoChanged "Demuxer info %s changed to %s\n"
-#define MSGTR_ClipInfo "Clip info:\n"
-
-#define MSGTR_LeaveTelecineMode "\ndemux_mpg: 30000/1001fps NTSC content detected, switching framerate.\n"
-#define MSGTR_EnterTelecineMode "\ndemux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.\n"
-
-#define MSGTR_CacheFill "\rCache fill: %5.2f%% (%"PRId64" bytes) "
-#define MSGTR_NoBindFound "No bind found for key '%s'.\n"
-#define MSGTR_FailedToOpen "Failed to open %s.\n"
-
-#define MSGTR_VideoID "[%s] Video stream found, -vid %d\n"
-#define MSGTR_AudioID "[%s] Audio stream found, -aid %d\n"
-#define MSGTR_SubtitleID "[%s] Subtitle stream found, -sid %d\n"
-
-// asfheader.c
-#define MSGTR_MPDEMUX_ASFHDR_HeaderSizeOver1MB "FATAL: header size bigger than 1 MB (%d)!\nPlease contact MPlayer authors, and upload/send this file.\n"
-#define MSGTR_MPDEMUX_ASFHDR_HeaderMallocFailed "Could not allocate %d bytes for header.\n"
-#define MSGTR_MPDEMUX_ASFHDR_EOFWhileReadingHeader "EOF while reading ASF header, broken/incomplete file?\n"
-#define MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat "DVR will probably only work with libavformat, try -demuxer 35 if you have problems\n"
-#define MSGTR_MPDEMUX_ASFHDR_NoDataChunkAfterHeader "No data chunk following header!\n"
-#define MSGTR_MPDEMUX_ASFHDR_AudioVideoHeaderNotFound "ASF: no audio or video headers found - broken file?\n"
-#define MSGTR_MPDEMUX_ASFHDR_InvalidLengthInASFHeader "Invalid length in ASF header!\n"
-#define MSGTR_MPDEMUX_ASFHDR_DRMLicenseURL "DRM License URL: %s\n"
-#define MSGTR_MPDEMUX_ASFHDR_DRMProtected "This file has been encumbered with DRM encryption, it will not play in MPlayer!\n"
-
-// aviheader.c
-#define MSGTR_MPDEMUX_AVIHDR_EmptyList "** empty list?!\n"
-#define MSGTR_MPDEMUX_AVIHDR_WarnNotExtendedAVIHdr "** Warning: this is no extended AVI header..\n"
-#define MSGTR_MPDEMUX_AVIHDR_BuildingODMLidx "AVI: ODML: Building ODML index (%d superindexchunks).\n"
-#define MSGTR_MPDEMUX_AVIHDR_BrokenODMLfile "AVI: ODML: Broken (incomplete?) file detected. Will use traditional index.\n"
-#define MSGTR_MPDEMUX_AVIHDR_CantReadIdxFile "Can't read index file %s: %s\n"
-#define MSGTR_MPDEMUX_AVIHDR_NotValidMPidxFile "%s is not a valid MPlayer index file.\n"
-#define MSGTR_MPDEMUX_AVIHDR_FailedMallocForIdxFile "Could not allocate memory for index data from %s.\n"
-#define MSGTR_MPDEMUX_AVIHDR_PrematureEOF "premature end of index file %s\n"
-#define MSGTR_MPDEMUX_AVIHDR_IdxFileLoaded "Loaded index file: %s\n"
-#define MSGTR_MPDEMUX_AVIHDR_GeneratingIdx "Generating Index: %3lu %s \r"
-#define MSGTR_MPDEMUX_AVIHDR_IdxGeneratedForHowManyChunks "AVI: Generated index table for %d chunks!\n"
-#define MSGTR_MPDEMUX_AVIHDR_Failed2WriteIdxFile "Couldn't write index file %s: %s\n"
-#define MSGTR_MPDEMUX_AVIHDR_IdxFileSaved "Saved index file: %s\n"
-
-// demux_audio.c
-#define MSGTR_MPDEMUX_AUDIO_BadID3v2TagSize "Audio demuxer: bad ID3v2 tag size: larger than stream (%u).\n"
-#define MSGTR_MPDEMUX_AUDIO_DamagedAppendedID3v2Tag "Audio demuxer: damaged appended ID3v2 tag detected.\n"
-#define MSGTR_MPDEMUX_AUDIO_UnknownFormat "Audio demuxer: unknown format %d.\n"
-
-// demux_demuxers.c
-#define MSGTR_MPDEMUX_DEMUXERS_FillBufferError "fill_buffer error: bad demuxer: not vd, ad or sd.\n"
-
-// demux_mkv.c
-#define MSGTR_MPDEMUX_MKV_ZlibInitializationFailed "[mkv] zlib initialization failed.\n"
-#define MSGTR_MPDEMUX_MKV_ZlibDecompressionFailed "[mkv] zlib decompression failed.\n"
-#define MSGTR_MPDEMUX_MKV_LzoInitializationFailed "[mkv] lzo initialization failed.\n"
-#define MSGTR_MPDEMUX_MKV_LzoDecompressionFailed "[mkv] lzo decompression failed.\n"
-#define MSGTR_MPDEMUX_MKV_TrackEncrypted "[mkv] Track number %u has been encrypted and decryption has not yet been\n[mkv] implemented. Skipping track.\n"
-#define MSGTR_MPDEMUX_MKV_UnknownContentEncoding "[mkv] Unknown content encoding type for track %u. Skipping track.\n"
-#define MSGTR_MPDEMUX_MKV_UnknownCompression "[mkv] Track %u has been compressed with an unknown/unsupported compression\n[mkv] algorithm (%u). Skipping track.\n"
-#define MSGTR_MPDEMUX_MKV_ZlibCompressionUnsupported "[mkv] Track %u was compressed with zlib but mplayer has not been compiled\n[mkv] with support for zlib compression. Skipping track.\n"
-#define MSGTR_MPDEMUX_MKV_TrackIDName "[mkv] Track ID %u: %s (%s) \"%s\", %s\n"
-#define MSGTR_MPDEMUX_MKV_TrackID "[mkv] Track ID %u: %s (%s), %s\n"
-#define MSGTR_MPDEMUX_MKV_UnknownCodecID "[mkv] Unknown/unsupported CodecID (%s) or missing/bad CodecPrivate\n[mkv] data (track %u).\n"
-#define MSGTR_MPDEMUX_MKV_FlacTrackDoesNotContainValidHeaders "[mkv] FLAC track does not contain valid headers.\n"
-#define MSGTR_MPDEMUX_MKV_UnknownAudioCodec "[mkv] Unknown/unsupported audio codec ID '%s' for track %u or missing/faulty\n[mkv] private codec data.\n"
-#define MSGTR_MPDEMUX_MKV_SubtitleTypeNotSupported "[mkv] Subtitle type '%s' is not supported.\n"
-#define MSGTR_MPDEMUX_MKV_WillPlayVideoTrack "[mkv] Will play video track %u.\n"
-#define MSGTR_MPDEMUX_MKV_NoVideoTrackFound "[mkv] No video track found/wanted.\n"
-#define MSGTR_MPDEMUX_MKV_NoAudioTrackFound "[mkv] No audio track found/wanted.\n"
-#define MSGTR_MPDEMUX_MKV_WillDisplaySubtitleTrack "[mkv] Will display subtitle track %u.\n"
-#define MSGTR_MPDEMUX_MKV_NoBlockDurationForSubtitleTrackFound "[mkv] Warning: No BlockDuration for subtitle track found.\n"
-#define MSGTR_MPDEMUX_MKV_TooManySublines "[mkv] Warning: too many sublines to render, skipping.\n"
-#define MSGTR_MPDEMUX_MKV_TooManySublinesSkippingAfterFirst "\n[mkv] Warning: too many sublines to render, skipping after first %i.\n"
-
-// demux_nuv.c
-#define MSGTR_MPDEMUX_NUV_NoVideoBlocksInFile "No video blocks in file.\n"
-
-// demux_xmms.c
-#define MSGTR_MPDEMUX_XMMS_FoundPlugin "Found plugin: %s (%s).\n"
-#define MSGTR_MPDEMUX_XMMS_ClosingPlugin "Closing plugin: %s.\n"
-#define MSGTR_MPDEMUX_XMMS_WaitForStart "Waiting for the XMMS plugin to start playback of '%s'...\n"
-
-
-// ========================== LIBMENU ===================================
-
-// common
-#define MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition "[MENU] No entry found in the menu definition.\n"
-
-// libmenu/menu.c
-#define MSGTR_LIBMENU_SyntaxErrorAtLine "[MENU] syntax error at line: %d\n"
-#define MSGTR_LIBMENU_MenuDefinitionsNeedANameAttrib "[MENU] Menu definitions need a name attribute (line %d).\n"
-#define MSGTR_LIBMENU_BadAttrib "[MENU] bad attribute %s=%s in menu '%s' at line %d\n"
-#define MSGTR_LIBMENU_UnknownMenuType "[MENU] unknown menu type '%s' at line %d\n"
-#define MSGTR_LIBMENU_CantOpenConfigFile "[MENU] Can't open menu config file: %s\n"
-#define MSGTR_LIBMENU_ConfigFileIsTooBig "[MENU] Config file is too big (> %d KB)\n"
-#define MSGTR_LIBMENU_ConfigFileIsEmpty "[MENU] Config file is empty.\n"
-#define MSGTR_LIBMENU_MenuNotFound "[MENU] Menu %s not found.\n"
-#define MSGTR_LIBMENU_MenuInitFailed "[MENU] Menu '%s': Init failed.\n"
-#define MSGTR_LIBMENU_UnsupportedOutformat "[MENU] Unsupported output format!!!!\n"
-
-// libmenu/menu_cmdlist.c
-#define MSGTR_LIBMENU_ListMenuEntryDefinitionsNeedAName "[MENU] List menu entry definitions need a name (line %d).\n"
-#define MSGTR_LIBMENU_ListMenuNeedsAnArgument "[MENU] List menu needs an argument.\n"
-
-// libmenu/menu_console.c
-#define MSGTR_LIBMENU_WaitPidError "[MENU] Waitpid error: %s.\n"
-#define MSGTR_LIBMENU_SelectError "[MENU] Select error.\n"
-#define MSGTR_LIBMENU_ReadErrorOnChildFD "[MENU] Read error on child's file descriptor: %s.\n"
-#define MSGTR_LIBMENU_ConsoleRun "[MENU] Console run: %s ...\n"
-#define MSGTR_LIBMENU_AChildIsAlreadyRunning "[MENU] A child is already running.\n"
-#define MSGTR_LIBMENU_ForkFailed "[MENU] Fork failed !!!\n"
-#define MSGTR_LIBMENU_WriteError "[MENU] write error\n"
-
-// libmenu/menu_filesel.c
-#define MSGTR_LIBMENU_OpendirError "[MENU] opendir error: %s\n"
-#define MSGTR_LIBMENU_ReallocError "[MENU] realloc error: %s\n"
-#define MSGTR_LIBMENU_MallocError "[MENU] memory allocation error: %s\n"
-#define MSGTR_LIBMENU_ReaddirError "[MENU] readdir error: %s\n"
-#define MSGTR_LIBMENU_CantOpenDirectory "[MENU] Can't open directory %s.\n"
-
-// libmenu/menu_param.c
-#define MSGTR_LIBMENU_SubmenuDefinitionNeedAMenuAttribut "[MENU] Submenu definition needs a 'menu' attribute.\n"
-#define MSGTR_LIBMENU_InvalidProperty "[MENU] Invalid property '%s' in pref menu entry. (line %d).\n"
-#define MSGTR_LIBMENU_PrefMenuEntryDefinitionsNeed "[MENU] Pref menu entry definitions need a valid 'property' or 'txt' attribute (line %d).\n"
-#define MSGTR_LIBMENU_PrefMenuNeedsAnArgument "[MENU] Pref menu needs an argument.\n"
-
-// libmenu/menu_pt.c
-#define MSGTR_LIBMENU_CantfindTheTargetItem "[MENU] Can't find the target item ????\n"
-#define MSGTR_LIBMENU_FailedToBuildCommand "[MENU] Failed to build command: %s.\n"
-
-// libmenu/menu_txt.c
-#define MSGTR_LIBMENU_MenuTxtNeedATxtFileName "[MENU] Text menu needs a textfile name (parameter file).\n"
-#define MSGTR_LIBMENU_MenuTxtCantOpen "[MENU] Can't open %s.\n"
-#define MSGTR_LIBMENU_WarningTooLongLineSplitting "[MENU] Warning, line too long. Splitting it.\n"
-#define MSGTR_LIBMENU_ParsedLines "[MENU] Parsed %d lines.\n"
-
-// libmenu/vf_menu.c
-#define MSGTR_LIBMENU_UnknownMenuCommand "[MENU] Unknown command: '%s'.\n"
-#define MSGTR_LIBMENU_FailedToOpenMenu "[MENU] Failed to open menu: '%s'.\n"
-
-
-// ========================== LIBMPCODECS ===================================
-
-// dec_video.c & dec_audio.c:
-#define MSGTR_CantOpenCodec "Could not open codec.\n"
-#define MSGTR_CantCloseCodec "Could not close codec.\n"
-
-#define MSGTR_MissingDLLcodec "ERROR: Could not open required DirectShow codec %s.\n"
-#define MSGTR_ACMiniterror "Could not load/initialize Win32/ACM audio codec (missing DLL file?).\n"
-#define MSGTR_MissingLAVCcodec "Cannot find codec '%s' in libavcodec...\n"
-
-#define MSGTR_MpegNoSequHdr "MPEG: FATAL: EOF while searching for sequence header.\n"
-#define MSGTR_CannotReadMpegSequHdr "FATAL: Cannot read sequence header.\n"
-#define MSGTR_CannotReadMpegSequHdrEx "FATAL: Cannot read sequence header extension.\n"
-#define MSGTR_BadMpegSequHdr "MPEG: bad sequence header\n"
-#define MSGTR_BadMpegSequHdrEx "MPEG: bad sequence header extension\n"
-
-#define MSGTR_ShMemAllocFail "Cannot allocate shared memory.\n"
-#define MSGTR_CantAllocAudioBuf "Cannot allocate audio out buffer.\n"
-
-#define MSGTR_UnknownAudio "Unknown/missing audio format -> no sound\n"
-
-#define MSGTR_UsingExternalPP "[PP] Using external postprocessing filter, max q = %d.\n"
-#define MSGTR_UsingCodecPP "[PP] Using codec's postprocessing, max q = %d.\n"
-#define MSGTR_VideoCodecFamilyNotAvailableStr "Requested video codec family [%s] (vfm=%s) not available.\nEnable it at compilation.\n"
-#define MSGTR_AudioCodecFamilyNotAvailableStr "Requested audio codec family [%s] (afm=%s) not available.\nEnable it at compilation.\n"
-#define MSGTR_OpeningVideoDecoder "Opening video decoder: [%s] %s\n"
-#define MSGTR_SelectedVideoCodec "Selected video codec: [%s] vfm: %s (%s)\n"
-#define MSGTR_OpeningAudioDecoder "Opening audio decoder: [%s] %s\n"
-#define MSGTR_SelectedAudioCodec "Selected audio codec: [%s] afm: %s (%s)\n"
-#define MSGTR_VDecoderInitFailed "VDecoder init failed :(\n"
-#define MSGTR_ADecoderInitFailed "ADecoder init failed :(\n"
-#define MSGTR_ADecoderPreinitFailed "ADecoder preinit failed :(\n"
-
-// ad_dvdpcm.c:
-#define MSGTR_SamplesWanted "Samples of this format are needed to improve support. Please contact the developers.\n"
-
-// libmpcodecs/ad_libdv.c
-#define MSGTR_MPCODECS_AudioFramesizeDiffers "[AD_LIBDV] Warning! Audio framesize differs! read=%d hdr=%d.\n"
-
-// vd.c
-#define MSGTR_CodecDidNotSet "VDec: Codec did not set sh->disp_w and sh->disp_h, trying workaround.\n"
-#define MSGTR_CouldNotFindColorspace "Could not find matching colorspace - retrying with -vf scale...\n"
-#define MSGTR_MovieAspectIsSet "Movie-Aspect is %.2f:1 - prescaling to correct movie aspect.\n"
-#define MSGTR_MovieAspectUndefined "Movie-Aspect is undefined - no prescaling applied.\n"
-
-// vd_dshow.c, vd_dmo.c
-#define MSGTR_DownloadCodecPackage "You need to upgrade/install the binary codecs package.\nGo to http://www.mplayerhq.hu/dload.html\n"
-
-// libmpcodecs/vd_dmo.c vd_dshow.c vd_vfw.c
-#define MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec "[VD_DMO] Couldn't allocate image for cinepak codec.\n"
-
-// libmpcodecs/vd_ffmpeg.c
-#define MSGTR_MPCODECS_XVMCAcceleratedCodec "[VD_FFMPEG] XVMC accelerated codec.\n"
-#define MSGTR_MPCODECS_ArithmeticMeanOfQP "[VD_FFMPEG] Arithmetic mean of QP: %2.4f, Harmonic mean of QP: %2.4f\n"
-#define MSGTR_MPCODECS_DRIFailure "[VD_FFMPEG] DRI failure.\n"
-#define MSGTR_MPCODECS_CouldntAllocateImageForCodec "[VD_FFMPEG] Couldn't allocate image for codec.\n"
-#define MSGTR_MPCODECS_XVMCAcceleratedMPEG2 "[VD_FFMPEG] XVMC-accelerated MPEG-2.\n"
-#define MSGTR_MPCODECS_TryingPixfmt "[VD_FFMPEG] Trying pixfmt=%d.\n"
-#define MSGTR_MPCODECS_McGetBufferShouldWorkOnlyWithXVMC "[VD_FFMPEG] The mc_get_buffer should work only with XVMC acceleration!!"
-#define MSGTR_MPCODECS_UnexpectedInitVoError "[VD_FFMPEG] Unexpected init_vo error.\n"
-#define MSGTR_MPCODECS_UnrecoverableErrorRenderBuffersNotTaken "[VD_FFMPEG] Unrecoverable error, render buffers not taken.\n"
-#define MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed "[VD_FFMPEG] Only buffers allocated by vo_xvmc allowed.\n"
-
-// libmpcodecs/ve_lavc.c
-#define MSGTR_MPCODECS_HighQualityEncodingSelected "[VE_LAVC] High quality encoding selected (non-realtime)!\n"
-#define MSGTR_MPCODECS_UsingConstantQscale "[VE_LAVC] Using constant qscale = %f (VBR).\n"
-
-// libmpcodecs/ve_raw.c
-#define MSGTR_MPCODECS_OutputWithFourccNotSupported "[VE_RAW] Raw output with FourCC [%x] not supported!\n"
-#define MSGTR_MPCODECS_NoVfwCodecSpecified "[VE_RAW] Required VfW codec not specified!!\n"
-
-// vf.c
-#define MSGTR_CouldNotFindVideoFilter "Couldn't find video filter '%s'.\n"
-#define MSGTR_CouldNotOpenVideoFilter "Couldn't open video filter '%s'.\n"
-#define MSGTR_OpeningVideoFilter "Opening video filter: "
-#define MSGTR_CannotFindColorspace "Cannot find matching colorspace, even by inserting 'scale' :(\n"
-
-// libmpcodecs/vf_crop.c
-#define MSGTR_MPCODECS_CropBadPositionWidthHeight "[CROP] Bad position/width/height - cropped area outside of the original!\n"
-
-// libmpcodecs/vf_cropdetect.c
-#define MSGTR_MPCODECS_CropArea "[CROP] Crop area: X: %d..%d Y: %d..%d (-vf crop=%d:%d:%d:%d).\n"
-
-// libmpcodecs/vf_format.c, vf_palette.c, vf_noformat.c
-#define MSGTR_MPCODECS_UnknownFormatName "[VF_FORMAT] Unknown format name: '%s'.\n"
-
-// libmpcodecs/vf_framestep.c vf_noformat.c vf_palette.c vf_tile.c
-#define MSGTR_MPCODECS_ErrorParsingArgument "[VF_FRAMESTEP] Error parsing argument.\n"
-
-// libmpcodecs/ve_vfw.c
-#define MSGTR_MPCODECS_CompressorType "Compressor type: %.4lx\n"
-#define MSGTR_MPCODECS_CompressorSubtype "Compressor subtype: %.4lx\n"
-#define MSGTR_MPCODECS_CompressorFlags "Compressor flags: %lu, version %lu, ICM version: %lu\n"
-#define MSGTR_MPCODECS_Flags "Flags:"
-#define MSGTR_MPCODECS_Quality " quality"
-
-// libmpcodecs/vf_expand.c
-#define MSGTR_MPCODECS_FullDRNotPossible "Full DR not possible, trying SLICES instead!\n"
-#define MSGTR_MPCODECS_WarnNextFilterDoesntSupportSlices "WARNING! Next filter doesn't support SLICES, get ready for sig11...\n"
-#define MSGTR_MPCODECS_FunWhydowegetNULL "Why do we get NULL??\n"
-
-// libmpcodecs/vf_test.c, vf_yuy2.c, vf_yvu9.c
-#define MSGTR_MPCODECS_WarnNextFilterDoesntSupport "%s not supported by next filter/vo :(\n"
-
-
-// ================================== LIBASS ====================================
-
-// ass_bitmap.c
-#define MSGTR_LIBASS_FT_Glyph_To_BitmapError "[ass] FT_Glyph_To_Bitmap error %d \n"
-#define MSGTR_LIBASS_UnsupportedPixelMode "[ass] Unsupported pixel mode: %d\n"
-#define MSGTR_LIBASS_GlyphBBoxTooLarge "[ass] Glyph bounding box too large: %dx%dpx\n"
-
-// ass.c
-#define MSGTR_LIBASS_NoStyleNamedXFoundUsingY "[ass] [%p] Warning: no style named '%s' found, using '%s'\n"
-#define MSGTR_LIBASS_BadTimestamp "[ass] bad timestamp\n"
-#define MSGTR_LIBASS_BadEncodedDataSize "[ass] bad encoded data size\n"
-#define MSGTR_LIBASS_FontLineTooLong "[ass] Font line too long: %d, %s\n"
-#define MSGTR_LIBASS_EventFormatHeaderMissing "[ass] Event format header missing\n"
-#define MSGTR_LIBASS_ErrorOpeningIconvDescriptor "[ass] error opening iconv descriptor.\n"
-#define MSGTR_LIBASS_ErrorRecodingFile "[ass] error recoding file.\n"
-#define MSGTR_LIBASS_FopenFailed "[ass] ass_read_file(%s): fopen failed\n"
-#define MSGTR_LIBASS_FseekFailed "[ass] ass_read_file(%s): fseek failed\n"
-#define MSGTR_LIBASS_RefusingToLoadSubtitlesLargerThan100M "[ass] ass_read_file(%s): Refusing to load subtitles larger than 100M\n"
-#define MSGTR_LIBASS_ReadFailed "Read failed, %d: %s\n"
-#define MSGTR_LIBASS_AddedSubtitleFileMemory "[ass] Added subtitle file: <memory> (%d styles, %d events)\n"
-#define MSGTR_LIBASS_AddedSubtitleFileFname "[ass] Added subtitle file: %s (%d styles, %d events)\n"
-#define MSGTR_LIBASS_FailedToCreateDirectory "[ass] Failed to create directory %s\n"
-#define MSGTR_LIBASS_NotADirectory "[ass] Not a directory: %s\n"
-
-// ass_cache.c
-#define MSGTR_LIBASS_TooManyFonts "[ass] Too many fonts\n"
-#define MSGTR_LIBASS_ErrorOpeningFont "[ass] Error opening font: %s, %d\n"
-
-// ass_fontconfig.c
-#define MSGTR_LIBASS_SelectedFontFamilyIsNotTheRequestedOne "[ass] fontconfig: Selected font is not the requested one: '%s' != '%s'\n"
-#define MSGTR_LIBASS_UsingDefaultFontFamily "[ass] fontconfig_select: Using default font family: (%s, %d, %d) -> %s, %d\n"
-#define MSGTR_LIBASS_UsingDefaultFont "[ass] fontconfig_select: Using default font: (%s, %d, %d) -> %s, %d\n"
-#define MSGTR_LIBASS_UsingArialFontFamily "[ass] fontconfig_select: Using 'Arial' font family: (%s, %d, %d) -> %s, %d\n"
-#define MSGTR_LIBASS_FcInitLoadConfigAndFontsFailed "[ass] FcInitLoadConfigAndFonts failed.\n"
-#define MSGTR_LIBASS_UpdatingFontCache "[ass] Updating font cache.\n"
-#define MSGTR_LIBASS_BetaVersionsOfFontconfigAreNotSupported "[ass] Beta versions of fontconfig are not supported.\n[ass] Update before reporting any bugs.\n"
-#define MSGTR_LIBASS_FcStrSetAddFailed "[ass] FcStrSetAdd failed.\n"
-#define MSGTR_LIBASS_FcDirScanFailed "[ass] FcDirScan failed.\n"
-#define MSGTR_LIBASS_FcDirSave "[ass] FcDirSave failed.\n"
-#define MSGTR_LIBASS_FcConfigAppFontAddDirFailed "[ass] FcConfigAppFontAddDir failed\n"
-#define MSGTR_LIBASS_FontconfigDisabledDefaultFontWillBeUsed "[ass] Fontconfig disabled, only default font will be used.\n"
-#define MSGTR_LIBASS_FunctionCallFailed "[ass] %s failed\n"
-
-// ass_render.c
-#define MSGTR_LIBASS_NeitherPlayResXNorPlayResYDefined "[ass] Neither PlayResX nor PlayResY defined. Assuming 384x288.\n"
-#define MSGTR_LIBASS_PlayResYUndefinedSettingY "[ass] PlayResY undefined, setting %d.\n"
-#define MSGTR_LIBASS_PlayResXUndefinedSettingX "[ass] PlayResX undefined, setting %d.\n"
-#define MSGTR_LIBASS_FT_Init_FreeTypeFailed "[ass] FT_Init_FreeType failed.\n"
-#define MSGTR_LIBASS_Init "[ass] Init\n"
-#define MSGTR_LIBASS_InitFailed "[ass] Init failed.\n"
-#define MSGTR_LIBASS_BadCommand "[ass] Bad command: %c%c\n"
-#define MSGTR_LIBASS_ErrorLoadingGlyph "[ass] Error loading glyph.\n"
-#define MSGTR_LIBASS_FT_Glyph_Stroke_Error "[ass] FT_Glyph_Stroke error %d \n"
-#define MSGTR_LIBASS_UnknownEffectType_InternalError "[ass] Unknown effect type (internal error)\n"
-#define MSGTR_LIBASS_NoStyleFound "[ass] No style found!\n"
-#define MSGTR_LIBASS_EmptyEvent "[ass] Empty event!\n"
-#define MSGTR_LIBASS_MAX_GLYPHS_Reached "[ass] MAX_GLYPHS reached: event %d, start = %llu, duration = %llu\n Text = %s\n"
-#define MSGTR_LIBASS_EventHeightHasChanged "[ass] Warning! Event height has changed! \n"
-
-// ass_font.c
-#define MSGTR_LIBASS_GlyphNotFoundReselectingFont "[ass] Glyph 0x%X not found, selecting one more font for (%s, %d, %d)\n"
-#define MSGTR_LIBASS_GlyphNotFound "[ass] Glyph 0x%X not found in font for (%s, %d, %d)\n"
-#define MSGTR_LIBASS_ErrorOpeningMemoryFont "[ass] Error opening memory font: %s\n"
-#define MSGTR_LIBASS_NoCharmaps "[ass] font face with no charmaps\n"
-#define MSGTR_LIBASS_NoCharmapAutodetected "[ass] no charmap autodetected, trying the first one\n"
-
-
-// ================================== stream ====================================
-
-// ai_alsa.c
-#define MSGTR_MPDEMUX_AIALSA_CannotSetSamplerate "Cannot set samplerate.\n"
-#define MSGTR_MPDEMUX_AIALSA_CannotSetBufferTime "Cannot set buffer time.\n"
-#define MSGTR_MPDEMUX_AIALSA_CannotSetPeriodTime "Cannot set period time.\n"
-
-// ai_alsa.c
-#define MSGTR_MPDEMUX_AIALSA_PcmBrokenConfig "Broken configuration for this PCM: no configurations available.\n"
-#define MSGTR_MPDEMUX_AIALSA_UnavailableAccessType "Access type not available.\n"
-#define MSGTR_MPDEMUX_AIALSA_UnavailableSampleFmt "Sample format not available.\n"
-#define MSGTR_MPDEMUX_AIALSA_UnavailableChanCount "Channel count not available - reverting to default: %d\n"
-#define MSGTR_MPDEMUX_AIALSA_CannotInstallHWParams "Unable to install hardware parameters: %s"
-#define MSGTR_MPDEMUX_AIALSA_PeriodEqualsBufferSize "Can't use period equal to buffer size (%u == %lu)\n"
-#define MSGTR_MPDEMUX_AIALSA_CannotInstallSWParams "Unable to install software parameters:\n"
-#define MSGTR_MPDEMUX_AIALSA_ErrorOpeningAudio "Error opening audio: %s\n"
-#define MSGTR_MPDEMUX_AIALSA_AlsaStatusError "ALSA status error: %s"
-#define MSGTR_MPDEMUX_AIALSA_AlsaXRUN "ALSA xrun!!! (at least %.3f ms long)\n"
-#define MSGTR_MPDEMUX_AIALSA_AlsaXRUNPrepareError "ALSA xrun: prepare error: %s"
-#define MSGTR_MPDEMUX_AIALSA_AlsaReadWriteError "ALSA read/write error"
-
-// ai_oss.c
-#define MSGTR_MPDEMUX_AIOSS_Unable2SetChanCount "Unable to set channel count: %d\n"
-#define MSGTR_MPDEMUX_AIOSS_Unable2SetStereo "Unable to set stereo: %d\n"
-#define MSGTR_MPDEMUX_AIOSS_Unable2Open "Unable to open '%s': %s\n"
-#define MSGTR_MPDEMUX_AIOSS_UnsupportedFmt "unsupported format\n"
-#define MSGTR_MPDEMUX_AIOSS_Unable2SetAudioFmt "Unable to set audio format."
-#define MSGTR_MPDEMUX_AIOSS_Unable2SetSamplerate "Unable to set samplerate: %d\n"
-#define MSGTR_MPDEMUX_AIOSS_Unable2SetTrigger "Unable to set trigger: %d\n"
-#define MSGTR_MPDEMUX_AIOSS_Unable2GetBlockSize "Unable to get block size!\n"
-#define MSGTR_MPDEMUX_AIOSS_AudioBlockSizeZero "Audio block size is zero, setting to %d!\n"
-#define MSGTR_MPDEMUX_AIOSS_AudioBlockSize2Low "Audio block size too low, setting to %d!\n"
-
-// asf_mmst_streaming.c
-#define MSGTR_MPDEMUX_MMST_WriteError "write error\n"
-#define MSGTR_MPDEMUX_MMST_EOFAlert "\nAlert! EOF\n"
-#define MSGTR_MPDEMUX_MMST_PreHeaderReadFailed "pre-header read failed\n"
-#define MSGTR_MPDEMUX_MMST_InvalidHeaderSize "Invalid header size, giving up.\n"
-#define MSGTR_MPDEMUX_MMST_HeaderDataReadFailed "Header data read failed.\n"
-#define MSGTR_MPDEMUX_MMST_packet_lenReadFailed "packet_len read failed.\n"
-#define MSGTR_MPDEMUX_MMST_InvalidRTSPPacketSize "Invalid RTSP packet size, giving up.\n"
-#define MSGTR_MPDEMUX_MMST_CmdDataReadFailed "Command data read failed.\n"
-#define MSGTR_MPDEMUX_MMST_HeaderObject "header object\n"
-#define MSGTR_MPDEMUX_MMST_DataObject "data object\n"
-#define MSGTR_MPDEMUX_MMST_FileObjectPacketLen "file object, packet length = %d (%d)\n"
-#define MSGTR_MPDEMUX_MMST_StreamObjectStreamID "stream object, stream ID: %d\n"
-#define MSGTR_MPDEMUX_MMST_2ManyStreamID "Too many IDs, stream skipped."
-#define MSGTR_MPDEMUX_MMST_UnknownObject "unknown object\n"
-#define MSGTR_MPDEMUX_MMST_MediaDataReadFailed "Media data read failed.\n"
-#define MSGTR_MPDEMUX_MMST_MissingSignature "missing signature\n"
-#define MSGTR_MPDEMUX_MMST_PatentedTechnologyJoke "Everything done. Thank you for downloading a media file containing proprietary and patented technology.\n"
-#define MSGTR_MPDEMUX_MMST_UnknownCmd "unknown command %02x\n"
-#define MSGTR_MPDEMUX_MMST_GetMediaPacketErr "get_media_packet error : %s\n"
-#define MSGTR_MPDEMUX_MMST_Connected "Connected\n"
-
-// asf_streaming.c
-#define MSGTR_MPDEMUX_ASF_StreamChunkSize2Small "Ahhhh, stream_chunck size is too small: %d\n"
-#define MSGTR_MPDEMUX_ASF_SizeConfirmMismatch "size_confirm mismatch!: %d %d\n"
-#define MSGTR_MPDEMUX_ASF_WarnDropHeader "Warning: drop header ????\n"
-#define MSGTR_MPDEMUX_ASF_ErrorParsingChunkHeader "Error while parsing chunk header\n"
-#define MSGTR_MPDEMUX_ASF_NoHeaderAtFirstChunk "Didn't get a header as first chunk !!!!\n"
-#define MSGTR_MPDEMUX_ASF_BufferMallocFailed "Error: Can't allocate %d bytes buffer.\n"
-#define MSGTR_MPDEMUX_ASF_ErrReadingNetworkStream "Error while reading network stream.\n"
-#define MSGTR_MPDEMUX_ASF_ErrChunk2Small "Error: Chunk is too small.\n"
-#define MSGTR_MPDEMUX_ASF_ErrSubChunkNumberInvalid "Error: Subchunk number is invalid.\n"
-#define MSGTR_MPDEMUX_ASF_Bandwidth2SmallCannotPlay "Bandwidth too small, file cannot be played!\n"
-#define MSGTR_MPDEMUX_ASF_Bandwidth2SmallDeselectedAudio "Bandwidth too small, deselected audio stream.\n"
-#define MSGTR_MPDEMUX_ASF_Bandwidth2SmallDeselectedVideo "Bandwidth too small, deselected video stream.\n"
-#define MSGTR_MPDEMUX_ASF_InvalidLenInHeader "Invalid length in ASF header!\n"
-#define MSGTR_MPDEMUX_ASF_ErrReadingChunkHeader "Error while reading chunk header.\n"
-#define MSGTR_MPDEMUX_ASF_ErrChunkBiggerThanPacket "Error: chunk_size > packet_size\n"
-#define MSGTR_MPDEMUX_ASF_ErrReadingChunk "Error while reading chunk.\n"
-#define MSGTR_MPDEMUX_ASF_ASFRedirector "=====> ASF Redirector\n"
-#define MSGTR_MPDEMUX_ASF_InvalidProxyURL "invalid proxy URL\n"
-#define MSGTR_MPDEMUX_ASF_UnknownASFStreamType "unknown ASF stream type\n"
-#define MSGTR_MPDEMUX_ASF_Failed2ParseHTTPResponse "Failed to parse HTTP response.\n"
-#define MSGTR_MPDEMUX_ASF_ServerReturn "Server returned %d:%s\n"
-#define MSGTR_MPDEMUX_ASF_ASFHTTPParseWarnCuttedPragma "ASF HTTP PARSE WARNING : Pragma %s cut from %zu bytes to %zu\n"
-#define MSGTR_MPDEMUX_ASF_SocketWriteError "socket write error: %s\n"
-#define MSGTR_MPDEMUX_ASF_HeaderParseFailed "Failed to parse header.\n"
-#define MSGTR_MPDEMUX_ASF_NoStreamFound "No stream found.\n"
-#define MSGTR_MPDEMUX_ASF_UnknownASFStreamingType "unknown ASF streaming type\n"
-#define MSGTR_MPDEMUX_ASF_InfoStreamASFURL "STREAM_ASF, URL: %s\n"
-#define MSGTR_MPDEMUX_ASF_StreamingFailed "Failed, exiting.\n"
-
-// audio_in.c
-#define MSGTR_MPDEMUX_AUDIOIN_ErrReadingAudio "\nError reading audio: %s\n"
-#define MSGTR_MPDEMUX_AUDIOIN_XRUNSomeFramesMayBeLeftOut "Recovered from cross-run, some frames may be left out!\n"
-#define MSGTR_MPDEMUX_AUDIOIN_ErrFatalCannotRecover "Fatal error, cannot recover!\n"
-#define MSGTR_MPDEMUX_AUDIOIN_NotEnoughSamples "\nNot enough audio samples!\n"
-
-// cache2.c
-#define MSGTR_MPDEMUX_CACHE2_NonCacheableStream "\rThis stream is non-cacheable.\n"
-#define MSGTR_MPDEMUX_CACHE2_ReadFileposDiffers "!!! read_filepos differs!!! Report this bug...\n"
-
-// network.c
-#define MSGTR_MPDEMUX_NW_UnknownAF "Unknown address family %d\n"
-#define MSGTR_MPDEMUX_NW_ResolvingHostForAF "Resolving %s for %s...\n"
-#define MSGTR_MPDEMUX_NW_CantResolv "Couldn't resolve name for %s: %s\n"
-#define MSGTR_MPDEMUX_NW_ConnectingToServer "Connecting to server %s[%s]: %d...\n"
-#define MSGTR_MPDEMUX_NW_CantConnect2Server "Failed to connect to server with %s\n"
-#define MSGTR_MPDEMUX_NW_SelectFailed "Select failed.\n"
-#define MSGTR_MPDEMUX_NW_ConnTimeout "connection timeout\n"
-#define MSGTR_MPDEMUX_NW_GetSockOptFailed "getsockopt failed: %s\n"
-#define MSGTR_MPDEMUX_NW_ConnectError "connect error: %s\n"
-#define MSGTR_MPDEMUX_NW_InvalidProxySettingTryingWithout "Invalid proxy setting... Trying without proxy.\n"
-#define MSGTR_MPDEMUX_NW_CantResolvTryingWithoutProxy "Could not resolve remote hostname for AF_INET. Trying without proxy.\n"
-#define MSGTR_MPDEMUX_NW_ErrSendingHTTPRequest "Error while sending HTTP request: Didn't send all the request.\n"
-#define MSGTR_MPDEMUX_NW_ReadFailed "Read failed.\n"
-#define MSGTR_MPDEMUX_NW_Read0CouldBeEOF "http_read_response read 0 (i.e. EOF).\n"
-#define MSGTR_MPDEMUX_NW_AuthFailed "Authentication failed. Please use the -user and -passwd options to provide your\n"\
-"username/password for a list of URLs, or form an URL like:\n"\
-"http://username:password@hostname/file\n"
-#define MSGTR_MPDEMUX_NW_AuthRequiredFor "Authentication required for %s\n"
-#define MSGTR_MPDEMUX_NW_AuthRequired "Authentication required.\n"
-#define MSGTR_MPDEMUX_NW_NoPasswdProvidedTryingBlank "No password provided, trying blank password.\n"
-#define MSGTR_MPDEMUX_NW_ErrServerReturned "Server returns %d: %s\n"
-#define MSGTR_MPDEMUX_NW_CacheSizeSetTo "Cache size set to %d KBytes\n"
-
-// open.c, stream.c:
-#define MSGTR_CdDevNotfound "CD-ROM Device '%s' not found.\n"
-#define MSGTR_ErrTrackSelect "Error selecting VCD track."
-#define MSGTR_ReadSTDIN "Reading from stdin...\n"
-#define MSGTR_UnableOpenURL "Unable to open URL: %s\n"
-#define MSGTR_ConnToServer "Connected to server: %s\n"
-#define MSGTR_FileNotFound "File not found: '%s'\n"
-
-#define MSGTR_SMBInitError "Cannot init the libsmbclient library: %d\n"
-#define MSGTR_SMBFileNotFound "Could not open from LAN: '%s'\n"
-#define MSGTR_SMBNotCompiled "MPlayer was not compiled with SMB reading support.\n"
-
-#define MSGTR_CantOpenBluray "Couldn't open Blu-ray device: %s\n"
-#define MSGTR_CantOpenDVD "Couldn't open DVD device: %s (%s)\n"
-
-#define MSGTR_URLParsingFailed "URL parsing failed on url %s\n"
-#define MSGTR_FailedSetStreamOption "Failed to set stream option %s=%s\n"
-#define MSGTR_StreamNeedType "Streams need a type!\n"
-#define MSGTR_StreamProtocolNULL "Stream type %s has protocols == NULL, it's a bug\n"
-#define MSGTR_StreamCantHandleURL "No stream found to handle url %s\n"
-#define MSGTR_StreamNULLFilename "open_output_stream(), NULL filename, report this bug\n"
-#define MSGTR_StreamErrorWritingCapture "Error writing capture file: %s\n"
-#define MSGTR_StreamSeekFailed "Seek failed\n"
-#define MSGTR_StreamNotSeekable "Stream not seekable!\n"
-#define MSGTR_StreamCannotSeekBackward "Cannot seek backward in linear streams!\n"
-
-// stream_cdda.c
-#define MSGTR_MPDEMUX_CDDA_CantOpenCDDADevice "Can't open CDDA device.\n"
-#define MSGTR_MPDEMUX_CDDA_CantOpenDisc "Can't open disc.\n"
-#define MSGTR_MPDEMUX_CDDA_AudioCDFoundWithNTracks "Found audio CD with %d tracks.\n"
-
-// stream_cddb.c
-#define MSGTR_MPDEMUX_CDDB_FailedToReadTOC "Failed to read TOC.\n"
-#define MSGTR_MPDEMUX_CDDB_FailedToOpenDevice "Failed to open %s device.\n"
-#define MSGTR_MPDEMUX_CDDB_NotAValidURL "not a valid URL\n"
-#define MSGTR_MPDEMUX_CDDB_FailedToSendHTTPRequest "Failed to send the HTTP request.\n"
-#define MSGTR_MPDEMUX_CDDB_FailedToReadHTTPResponse "Failed to read the HTTP response.\n"
-#define MSGTR_MPDEMUX_CDDB_HTTPErrorNOTFOUND "Not Found.\n"
-#define MSGTR_MPDEMUX_CDDB_HTTPErrorUnknown "unknown error code\n"
-#define MSGTR_MPDEMUX_CDDB_NoCacheFound "No cache found.\n"
-#define MSGTR_MPDEMUX_CDDB_NotAllXMCDFileHasBeenRead "Not all the xmcd file has been read.\n"
-#define MSGTR_MPDEMUX_CDDB_FailedToCreateDirectory "Failed to create directory %s.\n"
-#define MSGTR_MPDEMUX_CDDB_NotAllXMCDFileHasBeenWritten "Not all of the xmcd file has been written.\n"
-#define MSGTR_MPDEMUX_CDDB_InvalidXMCDDatabaseReturned "Invalid xmcd database file returned.\n"
-#define MSGTR_MPDEMUX_CDDB_UnexpectedFIXME "unexpected FIXME\n"
-#define MSGTR_MPDEMUX_CDDB_UnhandledCode "unhandled code\n"
-#define MSGTR_MPDEMUX_CDDB_UnableToFindEOL "Unable to find end of line.\n"
-#define MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle "Parse OK, found: %s\n"
-#define MSGTR_MPDEMUX_CDDB_AlbumNotFound "Album not found.\n"
-#define MSGTR_MPDEMUX_CDDB_ServerReturnsCommandSyntaxErr "Server returns: Command syntax error\n"
-#define MSGTR_MPDEMUX_CDDB_NoSitesInfoAvailable "No sites information available.\n"
-#define MSGTR_MPDEMUX_CDDB_FailedToGetProtocolLevel "Failed to get the protocol level.\n"
-#define MSGTR_MPDEMUX_CDDB_NoCDInDrive "No CD in the drive.\n"
-
-// stream_cue.c
-#define MSGTR_MPDEMUX_CUEREAD_UnexpectedCuefileLine "[bincue] Unexpected cuefile line: %s\n"
-#define MSGTR_MPDEMUX_CUEREAD_BinFilenameTested "[bincue] bin filename tested: %s\n"
-#define MSGTR_MPDEMUX_CUEREAD_CannotFindBinFile "[bincue] Couldn't find the bin file - giving up.\n"
-#define MSGTR_MPDEMUX_CUEREAD_UsingBinFile "[bincue] Using bin file %s.\n"
-#define MSGTR_MPDEMUX_CUEREAD_UnknownModeForBinfile "[bincue] unknown mode for binfile. Should not happen. Aborting.\n"
-#define MSGTR_MPDEMUX_CUEREAD_CannotOpenCueFile "[bincue] Cannot open %s.\n"
-#define MSGTR_MPDEMUX_CUEREAD_ErrReadingFromCueFile "[bincue] Error reading from %s\n"
-#define MSGTR_MPDEMUX_CUEREAD_ErrGettingBinFileSize "[bincue] Error getting size of bin file.\n"
-#define MSGTR_MPDEMUX_CUEREAD_InfoTrackFormat "track %02d: format=%d %02d:%02d:%02d\n"
-#define MSGTR_MPDEMUX_CUEREAD_UnexpectedBinFileEOF "[bincue] unexpected end of bin file\n"
-#define MSGTR_MPDEMUX_CUEREAD_CannotReadNBytesOfPayload "[bincue] Couldn't read %d bytes of payload.\n"
-#define MSGTR_MPDEMUX_CUEREAD_CueStreamInfo_FilenameTrackTracksavail "CUE stream_open, filename=%s, track=%d, available tracks: %d -> %d\n"
-
-// stream_dvd.c
-#define MSGTR_DVDspeedCantOpen "Couldn't open DVD device for writing, changing DVD speed needs write access.\n"
-#define MSGTR_DVDrestoreSpeed "Restoring DVD speed... "
-#define MSGTR_DVDlimitSpeed "Limiting DVD speed to %dKB/s... "
-#define MSGTR_DVDlimitFail "failed\n"
-#define MSGTR_DVDlimitOk "successful\n"
-#define MSGTR_NoDVDSupport "MPlayer was compiled without DVD support, exiting.\n"
-#define MSGTR_DVDnumTitles "There are %d titles on this DVD.\n"
-#define MSGTR_DVDinvalidTitle "Invalid DVD title number: %d\n"
-#define MSGTR_DVDnumChapters "There are %d chapters in this DVD title.\n"
-#define MSGTR_DVDinvalidChapter "Invalid DVD chapter number: %d\n"
-#define MSGTR_DVDinvalidChapterRange "Invalid chapter range specification %s\n"
-#define MSGTR_DVDinvalidLastChapter "Invalid DVD last chapter number: %d\n"
-#define MSGTR_DVDnumAngles "There are %d angles in this DVD title.\n"
-#define MSGTR_DVDinvalidAngle "Invalid DVD angle number: %d\n"
-#define MSGTR_DVDnoIFO "Cannot open the IFO file for DVD title %d.\n"
-#define MSGTR_DVDnoVMG "Can't open VMG info!\n"
-#define MSGTR_DVDnoVOBs "Cannot open title VOBS (VTS_%02d_1.VOB).\n"
-#define MSGTR_DVDnoMatchingAudio "No matching DVD audio language found!\n"
-#define MSGTR_DVDaudioChannel "Selected DVD audio channel: %d language: %c%c\n"
-#define MSGTR_DVDaudioStreamInfo "audio stream: %d format: %s (%s) language: %s aid: %d.\n"
-#define MSGTR_DVDnumAudioChannels "number of audio channels on disk: %d.\n"
-#define MSGTR_DVDnoMatchingSubtitle "No matching DVD subtitle language found!\n"
-#define MSGTR_DVDsubtitleChannel "Selected DVD subtitle channel: %d language: %c%c\n"
-#define MSGTR_DVDsubtitleLanguage "subtitle ( sid ): %d language: %s\n"
-#define MSGTR_DVDnumSubtitles "number of subtitles on disk: %d\n"
-
-// stream_bluray.c
-#define MSGTR_BlurayNoDevice "No Blu-ray device/location was specified ...\n"
-#define MSGTR_BlurayNoTitles "Can't find any Blu-ray-compatible title here.\n"
-
-// stream_radio.c
-#define MSGTR_RADIO_ChannelNamesDetected "[radio] Radio channel names detected.\n"
-#define MSGTR_RADIO_WrongFreqForChannel "[radio] Wrong frequency for channel %s\n"
-#define MSGTR_RADIO_WrongChannelNumberFloat "[radio] Wrong channel number: %.2f\n"
-#define MSGTR_RADIO_WrongChannelNumberInt "[radio] Wrong channel number: %d\n"
-#define MSGTR_RADIO_WrongChannelName "[radio] Wrong channel name: %s\n"
-#define MSGTR_RADIO_FreqParameterDetected "[radio] Radio frequency parameter detected.\n"
-#define MSGTR_RADIO_GetTunerFailed "[radio] Warning: ioctl get tuner failed: %s. Setting frac to %d.\n"
-#define MSGTR_RADIO_NotRadioDevice "[radio] %s is no radio device!\n"
-#define MSGTR_RADIO_SetFreqFailed "[radio] ioctl set frequency 0x%x (%.2f) failed: %s\n"
-#define MSGTR_RADIO_GetFreqFailed "[radio] ioctl get frequency failed: %s\n"
-#define MSGTR_RADIO_SetMuteFailed "[radio] ioctl set mute failed: %s\n"
-#define MSGTR_RADIO_QueryControlFailed "[radio] ioctl query control failed: %s\n"
-#define MSGTR_RADIO_GetVolumeFailed "[radio] ioctl get volume failed: %s\n"
-#define MSGTR_RADIO_SetVolumeFailed "[radio] ioctl set volume failed: %s\n"
-#define MSGTR_RADIO_DroppingFrame "\n[radio] too bad - dropping audio frame (%d bytes)!\n"
-#define MSGTR_RADIO_BufferEmpty "[radio] grab_audio_frame: buffer empty, waiting for %d data bytes.\n"
-#define MSGTR_RADIO_AudioInitFailed "[radio] audio_in_init failed: %s\n"
-#define MSGTR_RADIO_AllocateBufferFailed "[radio] cannot allocate audio buffer (block=%d,buf=%d): %s\n"
-#define MSGTR_RADIO_CurrentFreq "[radio] Current frequency: %.2f\n"
-#define MSGTR_RADIO_SelectedChannel "[radio] Selected channel: %d - %s (freq: %.2f)\n"
-#define MSGTR_RADIO_ChangeChannelNoChannelList "[radio] Can not change channel: no channel list given.\n"
-#define MSGTR_RADIO_UnableOpenDevice "[radio] Unable to open '%s': %s\n"
-#define MSGTR_RADIO_InitFracFailed "[radio] init_frac failed.\n"
-#define MSGTR_RADIO_WrongFreq "[radio] Wrong frequency: %.2f\n"
-#define MSGTR_RADIO_UsingFreq "[radio] Using frequency: %.2f.\n"
-#define MSGTR_RADIO_AudioInInitFailed "[radio] audio_in_init failed.\n"
-#define MSGTR_RADIO_AudioInSetupFailed "[radio] audio_in_setup call failed: %s\n"
-#define MSGTR_RADIO_ClearBufferFailed "[radio] Clearing buffer failed: %s\n"
-#define MSGTR_RADIO_StreamEnableCacheFailed "[radio] Call to stream_enable_cache failed: %s\n"
-#define MSGTR_RADIO_DriverUnknownStr "[radio] Unknown driver name: %s\n"
-#define MSGTR_RADIO_DriverV4L2 "[radio] Using V4Lv2 radio interface.\n"
-#define MSGTR_RADIO_DriverV4L "[radio] Using V4Lv1 radio interface.\n"
-#define MSGTR_RADIO_DriverBSDBT848 "[radio] Using *BSD BT848 radio interface.\n"
-
-//tv.c
-#define MSGTR_TV_BogusNormParameter "tv.c: norm_from_string(%s): Bogus norm parameter, setting %s.\n"
-#define MSGTR_TV_NoVideoInputPresent "Error: No video input present!\n"
-#define MSGTR_TV_UnknownImageFormat ""\
-"==================================================================\n"\
-" WARNING: UNTESTED OR UNKNOWN OUTPUT IMAGE FORMAT REQUESTED (0x%x)\n"\
-" This may cause buggy playback or program crash! Bug reports will\n"\
-" be ignored! You should try again with YV12 (which is the default\n"\
-" colorspace) and read the documentation!\n"\
-"==================================================================\n"
-#define MSGTR_TV_CannotSetNorm "Error: Cannot set norm!\n"
-#define MSGTR_TV_MJP_WidthHeight " MJP: width %d height %d\n"
-#define MSGTR_TV_UnableToSetWidth "Unable to set requested width: %d\n"
-#define MSGTR_TV_UnableToSetHeight "Unable to set requested height: %d\n"
-#define MSGTR_TV_NoTuner "Selected input hasn't got a tuner!\n"
-#define MSGTR_TV_UnableFindChanlist "Unable to find selected channel list! (%s)\n"
-#define MSGTR_TV_ChannelFreqParamConflict "You can't set frequency and channel simultaneously!\n"
-#define MSGTR_TV_ChannelNamesDetected "TV channel names detected.\n"
-#define MSGTR_TV_NoFreqForChannel "Couldn't find frequency for channel %s (%s)\n"
-#define MSGTR_TV_SelectedChannel3 "Selected channel: %s - %s (freq: %.3f)\n"
-#define MSGTR_TV_SelectedChannel2 "Selected channel: %s (freq: %.3f)\n"
-#define MSGTR_TV_UnsupportedAudioType "Audio type '%s (%x)' unsupported!\n"
-#define MSGTR_TV_AvailableDrivers "Available drivers:\n"
-#define MSGTR_TV_DriverInfo "Selected driver: %s\n name: %s\n author: %s\n comment: %s\n"
-#define MSGTR_TV_NoSuchDriver "No such driver: %s\n"
-#define MSGTR_TV_DriverAutoDetectionFailed "TV driver autodetection failed.\n"
-#define MSGTR_TV_UnknownColorOption "Unknown color option (%d) specified!\n"
-#define MSGTR_TV_NoTeletext "No teletext"
-#define MSGTR_TV_Bt848IoctlFailed "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n"
-#define MSGTR_TV_Bt848InvalidAudioRate "tvi_bsdbt848: Invalid audio rate. Error: %s\n"
-#define MSGTR_TV_Bt848ErrorOpeningBktrDev "tvi_bsdbt848: Unable to open bktr device. Error: %s\n"
-#define MSGTR_TV_Bt848ErrorOpeningTunerDev "tvi_bsdbt848: Unable to open tuner device. Error: %s\n"
-#define MSGTR_TV_Bt848ErrorOpeningDspDev "tvi_bsdbt848: Unable to open dsp device. Error: %s\n"
-#define MSGTR_TV_Bt848ErrorConfiguringDsp "tvi_bsdbt848: Configuration of dsp failed. Error: %s\n"
-#define MSGTR_TV_Bt848ErrorReadingAudio "tvi_bsdbt848: Error reading audio data. Error: %s\n"
-#define MSGTR_TV_Bt848MmapFailed "tvi_bsdbt848: mmap failed. Error: %s\n"
-#define MSGTR_TV_Bt848FrameBufAllocFailed "tvi_bsdbt848: Frame buffer allocation failed. Error: %s\n"
-#define MSGTR_TV_Bt848ErrorSettingWidth "tvi_bsdbt848: Error setting picture width. Error: %s\n"
-#define MSGTR_TV_Bt848ErrorSettingHeight "tvi_bsdbt848: Error setting picture height. Error: %s\n"
-#define MSGTR_TV_Bt848UnableToStopCapture "tvi_bsdbt848: Unable to stop capture. Error: %s\n"
-#define MSGTR_TV_TTSupportedLanguages "Supported Teletext languages:\n"
-#define MSGTR_TV_TTSelectedLanguage "Selected default teletext language: %s\n"
-#define MSGTR_TV_ScannerNotAvailableWithoutTuner "Channel scanner is not available without tuner\n"
-
-//tvi_dshow.c
-#define MSGTR_TVI_DS_UnableConnectInputVideoDecoder "Unable to connect given input to video decoder. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableConnectInputAudioDecoder "Unable to connect given input to audio decoder. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableSelectVideoFormat "tvi_dshow: Unable to select video format. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableSelectAudioFormat "tvi_dshow: Unable to select audio format. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableGetMediaControlInterface "tvi_dshow: Unable to get IMediaControl interface. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableStartGraph "tvi_dshow: Unable to start graph! Error:0x%x\n"
-#define MSGTR_TVI_DS_DeviceNotFound "tvi_dshow: Device #%d not found\n"
-#define MSGTR_TVI_DS_UnableGetDeviceName "tvi_dshow: Unable to get name for device #%d\n"
-#define MSGTR_TVI_DS_UsingDevice "tvi_dshow: Using device #%d: %s\n"
-#define MSGTR_TVI_DS_DirectGetFreqFailed "tvi_dshow: Unable to get frequency directly. OS built-in channels table will be used.\n"
-#define MSGTR_TVI_DS_UnableExtractFreqTable "tvi_dshow: Unable to load frequency table from kstvtune.ax\n"
-#define MSGTR_TVI_DS_WrongDeviceParam "tvi_dshow: Wrong device parameter: %s\n"
-#define MSGTR_TVI_DS_WrongDeviceIndex "tvi_dshow: Wrong device index: %d\n"
-#define MSGTR_TVI_DS_WrongADeviceParam "tvi_dshow: Wrong adevice parameter: %s\n"
-#define MSGTR_TVI_DS_WrongADeviceIndex "tvi_dshow: Wrong adevice index: %d\n"
-
-#define MSGTR_TVI_DS_SamplerateNotsupported "tvi_dshow: Samplerate %d is not supported by device. Failing back to first available.\n"
-#define MSGTR_TVI_DS_VideoAdjustigNotSupported "tvi_dshow: Adjusting of brightness/hue/saturation/contrast is not supported by device\n"
-
-#define MSGTR_TVI_DS_ChangingWidthHeightNotSupported "tvi_dshow: Changing video width/height is not supported by device.\n"
-#define MSGTR_TVI_DS_SelectingInputNotSupported "tvi_dshow: Selection of capture source is not supported by device\n"
-#define MSGTR_TVI_DS_ErrorParsingAudioFormatStruct "tvi_dshow: Unable to parse audio format structure.\n"
-#define MSGTR_TVI_DS_ErrorParsingVideoFormatStruct "tvi_dshow: Unable to parse video format structure.\n"
-#define MSGTR_TVI_DS_UnableSetAudioMode "tvi_dshow: Unable to set audio mode %d. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnsupportedMediaType "tvi_dshow: Unsupported media type passed to %s\n"
-#define MSGTR_TVI_DS_UnableGetsupportedVideoFormats "tvi_dshow: Unable to get supported media formats from video pin. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableGetsupportedAudioFormats "tvi_dshow: Unable to get supported media formats from audio pin. Error:0x%x Disabling audio.\n"
-#define MSGTR_TVI_DS_UnableFindNearestChannel "tvi_dshow: Unable to find nearest channel in system frequency table\n"
-#define MSGTR_TVI_DS_UnableToSetChannel "tvi_dshow: Unable to switch to nearest channel from system frequency table. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableTerminateVPPin "tvi_dshow: Unable to terminate VideoPort pin with any filter in graph. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableBuildVideoSubGraph "tvi_dshow: Unable to build video chain of capture graph. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableBuildAudioSubGraph "tvi_dshow: Unable to build audio chain of capture graph. Error:0x%x\n"
-#define MSGTR_TVI_DS_UnableBuildVBISubGraph "tvi_dshow: Unable to build VBI chain of capture graph. Error:0x%x\n"
-#define MSGTR_TVI_DS_GraphInitFailure "tvi_dshow: Directshow graph initialization failure.\n"
-#define MSGTR_TVI_DS_NoVideoCaptureDevice "tvi_dshow: Unable to find video capture device\n"
-#define MSGTR_TVI_DS_NoAudioCaptureDevice "tvi_dshow: Unable to find audio capture device\n"
-#define MSGTR_TVI_DS_GetActualMediatypeFailed "tvi_dshow: Unable to get actual mediatype (Error:0x%x). Assuming equal to requested.\n"
-
-// url.c
-#define MSGTR_MPDEMUX_URL_StringAlreadyEscaped "String appears to be already escaped in url_escape %c%c1%c2\n"
-
-// subtitles
-#define MSGTR_SUBTITLES_SubRip_UnknownFontColor "SubRip: unknown font color in subtitle: %s\n"
-
-
-/* untranslated messages from the English master file */
-
-
-#endif /* MPLAYER_HELP_MP_H */
diff --git a/ffmpeg/libavfilter/libmpcodecs/mpbswap.h b/ffmpeg/libavfilter/libmpcodecs/mpbswap.h
deleted file mode 100644
index 28f7337..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/mpbswap.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef MPLAYER_MPBSWAP_H
-#define MPLAYER_MPBSWAP_H
-
-#include <sys/types.h>
-#include "config.h"
-#include "libavutil/bswap.h"
-
-#define bswap_16(v) av_bswap16(v)
-#define bswap_32(v) av_bswap32(v)
-#define le2me_16(v) av_le2ne16(v)
-#define le2me_32(v) av_le2ne32(v)
-#define le2me_64(v) av_le2ne64(v)
-#define be2me_16(v) av_be2ne16(v)
-#define be2me_32(v) av_be2ne32(v)
-
-#endif /* MPLAYER_MPBSWAP_H */
diff --git a/ffmpeg/libavfilter/libmpcodecs/pullup.c b/ffmpeg/libavfilter/libmpcodecs/pullup.c
deleted file mode 100644
index b5fae9b..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/pullup.c
+++ /dev/null
@@ -1,823 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/x86/asm.h"
-#include "config.h"
-#include "pullup.h"
-
-
-
-#if ARCH_X86
-#if HAVE_MMX
-static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
-{
- int ret;
- __asm__ volatile (
- "movl $4, %%ecx \n\t"
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
-
- "1: \n\t"
-
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_S"), %%mm2 \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "movq (%%"REG_D"), %%mm1 \n\t"
- "add %%"REG_a", %%"REG_D" \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "psubusb %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm0 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm0, %%mm4 \n\t"
- "paddw %%mm1, %%mm4 \n\t"
- "paddw %%mm2, %%mm4 \n\t"
- "paddw %%mm3, %%mm4 \n\t"
-
- "decl %%ecx \n\t"
- "jnz 1b \n\t"
-
- "movq %%mm4, %%mm3 \n\t"
- "punpcklwd %%mm7, %%mm4 \n\t"
- "punpckhwd %%mm7, %%mm3 \n\t"
- "paddd %%mm4, %%mm3 \n\t"
- "movd %%mm3, %%eax \n\t"
- "psrlq $32, %%mm3 \n\t"
- "movd %%mm3, %%edx \n\t"
- "addl %%edx, %%eax \n\t"
- "emms \n\t"
- : "=a" (ret)
- : "S" (a), "D" (b), "a" (s)
- : "%ecx", "%edx"
- );
- return ret;
-}
-
-static int licomb_y_mmx(unsigned char *a, unsigned char *b, int s)
-{
- int ret;
- __asm__ volatile (
- "movl $4, %%ecx \n\t"
- "pxor %%mm6, %%mm6 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
- "sub %%"REG_a", %%"REG_D" \n\t"
-
- "2: \n\t"
-
- "movq (%%"REG_D"), %%mm0 \n\t"
- "movq (%%"REG_D"), %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "movq (%%"REG_D",%%"REG_a"), %%mm2 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "paddw %%mm0, %%mm0 \n\t"
- "paddw %%mm2, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "psubusw %%mm1, %%mm0 \n\t"
- "psubusw %%mm2, %%mm1 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "paddw %%mm1, %%mm6 \n\t"
-
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_D"), %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm0 \n\t"
- "movq (%%"REG_D",%%"REG_a"), %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "paddw %%mm0, %%mm0 \n\t"
- "paddw %%mm2, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "psubusw %%mm1, %%mm0 \n\t"
- "psubusw %%mm2, %%mm1 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "paddw %%mm1, %%mm6 \n\t"
-
- "movq (%%"REG_D",%%"REG_a"), %%mm0 \n\t"
- "movq (%%"REG_S"), %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "paddw %%mm0, %%mm0 \n\t"
- "paddw %%mm2, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "psubusw %%mm1, %%mm0 \n\t"
- "psubusw %%mm2, %%mm1 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "paddw %%mm1, %%mm6 \n\t"
-
- "movq (%%"REG_D",%%"REG_a"), %%mm0 \n\t"
- "movq (%%"REG_S"), %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm0 \n\t"
- "movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "paddw %%mm0, %%mm0 \n\t"
- "paddw %%mm2, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "psubusw %%mm1, %%mm0 \n\t"
- "psubusw %%mm2, %%mm1 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "paddw %%mm1, %%mm6 \n\t"
-
- "add %%"REG_a", %%"REG_S" \n\t"
- "add %%"REG_a", %%"REG_D" \n\t"
- "decl %%ecx \n\t"
- "jnz 2b \n\t"
-
- "movq %%mm6, %%mm5 \n\t"
- "punpcklwd %%mm7, %%mm6 \n\t"
- "punpckhwd %%mm7, %%mm5 \n\t"
- "paddd %%mm6, %%mm5 \n\t"
- "movd %%mm5, %%eax \n\t"
- "psrlq $32, %%mm5 \n\t"
- "movd %%mm5, %%edx \n\t"
- "addl %%edx, %%eax \n\t"
-
- "emms \n\t"
- : "=a" (ret)
- : "S" (a), "D" (b), "a" (s)
- : "%ecx", "%edx"
- );
- return ret;
-}
-
-static int var_y_mmx(unsigned char *a, unsigned char *b, int s)
-{
- int ret;
- __asm__ volatile (
- "movl $3, %%ecx \n\t"
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
-
- "1: \n\t"
-
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_S"), %%mm2 \n\t"
- "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "psubusb %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm0 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm0, %%mm4 \n\t"
- "paddw %%mm1, %%mm4 \n\t"
- "paddw %%mm2, %%mm4 \n\t"
- "paddw %%mm3, %%mm4 \n\t"
-
- "decl %%ecx \n\t"
- "jnz 1b \n\t"
-
- "movq %%mm4, %%mm3 \n\t"
- "punpcklwd %%mm7, %%mm4 \n\t"
- "punpckhwd %%mm7, %%mm3 \n\t"
- "paddd %%mm4, %%mm3 \n\t"
- "movd %%mm3, %%eax \n\t"
- "psrlq $32, %%mm3 \n\t"
- "movd %%mm3, %%edx \n\t"
- "addl %%edx, %%eax \n\t"
- "emms \n\t"
- : "=a" (ret)
- : "S" (a), "a" (s)
- : "%ecx", "%edx"
- );
- return 4*ret;
-}
-#endif
-#endif
-
-#define ABS(a) (((a)^((a)>>31))-((a)>>31))
-
-static int diff_y(unsigned char *a, unsigned char *b, int s)
-{
- int i, j, diff=0;
- for (i=4; i; i--) {
- for (j=0; j<8; j++) diff += ABS(a[j]-b[j]);
- a+=s; b+=s;
- }
- return diff;
-}
-
-static int licomb_y(unsigned char *a, unsigned char *b, int s)
-{
- int i, j, diff=0;
- for (i=4; i; i--) {
- for (j=0; j<8; j++)
- diff += ABS((a[j]<<1) - b[j-s] - b[j])
- + ABS((b[j]<<1) - a[j] - a[j+s]);
- a+=s; b+=s;
- }
- return diff;
-}
-
-#if 0
-static int qpcomb_y(unsigned char *a, unsigned char *b, int s)
-{
- int i, j, diff=0;
- for (i=4; i; i--) {
- for (j=0; j<8; j++)
- diff += ABS(a[j] - 3*b[j-s] + 3*a[j+s] - b[j]);
- a+=s; b+=s;
- }
- return diff;
-}
-
-static int licomb_y_test(unsigned char *a, unsigned char *b, int s)
-{
- int c = licomb_y(a,b,s);
- int m = licomb_y_mmx(a,b,s);
- if (c != m) printf("%d != %d\n", c, m);
- return m;
-}
-#endif
-
-static int var_y(unsigned char *a, unsigned char *b, int s)
-{
- int i, j, var=0;
- for (i=3; i; i--) {
- for (j=0; j<8; j++) {
- var += ABS(a[j]-a[j+s]);
- }
- a+=s; b+=s;
- }
- return 4*var; /* match comb scaling */
-}
-
-
-
-
-
-
-
-
-
-static void alloc_buffer(struct pullup_context *c, struct pullup_buffer *b)
-{
- int i;
- if (b->planes) return;
- b->planes = calloc(c->nplanes, sizeof(unsigned char *));
- for (i = 0; i < c->nplanes; i++) {
- b->planes[i] = malloc(c->h[i]*c->stride[i]);
- /* Deal with idiotic 128=0 for chroma: */
- memset(b->planes[i], c->background[i], c->h[i]*c->stride[i]);
- }
-}
-
-struct pullup_buffer *ff_pullup_lock_buffer(struct pullup_buffer *b, int parity)
-{
- if (!b) return 0;
- if ((parity+1) & 1) b->lock[0]++;
- if ((parity+1) & 2) b->lock[1]++;
- return b;
-}
-
-void ff_pullup_release_buffer(struct pullup_buffer *b, int parity)
-{
- if (!b) return;
- if ((parity+1) & 1) b->lock[0]--;
- if ((parity+1) & 2) b->lock[1]--;
-}
-
-struct pullup_buffer *ff_pullup_get_buffer(struct pullup_context *c, int parity)
-{
- int i;
-
- /* Try first to get the sister buffer for the previous field */
- if (parity < 2 && c->last && parity != c->last->parity
- && !c->last->buffer->lock[parity]) {
- alloc_buffer(c, c->last->buffer);
- return ff_pullup_lock_buffer(c->last->buffer, parity);
- }
-
- /* Prefer a buffer with both fields open */
- for (i = 0; i < c->nbuffers; i++) {
- if (c->buffers[i].lock[0]) continue;
- if (c->buffers[i].lock[1]) continue;
- alloc_buffer(c, &c->buffers[i]);
- return ff_pullup_lock_buffer(&c->buffers[i], parity);
- }
-
- if (parity == 2) return 0;
-
- /* Search for any half-free buffer */
- for (i = 0; i < c->nbuffers; i++) {
- if (((parity+1) & 1) && c->buffers[i].lock[0]) continue;
- if (((parity+1) & 2) && c->buffers[i].lock[1]) continue;
- alloc_buffer(c, &c->buffers[i]);
- return ff_pullup_lock_buffer(&c->buffers[i], parity);
- }
-
- return 0;
-}
-
-
-
-
-
-
-static void compute_metric(struct pullup_context *c,
- struct pullup_field *fa, int pa,
- struct pullup_field *fb, int pb,
- int (*func)(unsigned char *, unsigned char *, int), int *dest)
-{
- unsigned char *a, *b;
- int x, y;
- int mp = c->metric_plane;
- int xstep = c->bpp[mp];
- int ystep = c->stride[mp]<<3;
- int s = c->stride[mp]<<1; /* field stride */
- int w = c->metric_w*xstep;
-
- if (!fa->buffer || !fb->buffer) return;
-
- /* Shortcut for duplicate fields (e.g. from RFF flag) */
- if (fa->buffer == fb->buffer && pa == pb) {
- memset(dest, 0, c->metric_len * sizeof(int));
- return;
- }
-
- a = fa->buffer->planes[mp] + pa * c->stride[mp] + c->metric_offset;
- b = fb->buffer->planes[mp] + pb * c->stride[mp] + c->metric_offset;
-
- for (y = c->metric_h; y; y--) {
- for (x = 0; x < w; x += xstep) {
- *dest++ = func(a + x, b + x, s);
- }
- a += ystep; b += ystep;
- }
-}
-
-
-
-
-
-static void alloc_metrics(struct pullup_context *c, struct pullup_field *f)
-{
- f->diffs = calloc(c->metric_len, sizeof(int));
- f->comb = calloc(c->metric_len, sizeof(int));
- f->var = calloc(c->metric_len, sizeof(int));
- /* add more metrics here as needed */
-}
-
-static struct pullup_field *make_field_queue(struct pullup_context *c, int len)
-{
- struct pullup_field *head, *f;
- f = head = calloc(1, sizeof(struct pullup_field));
- alloc_metrics(c, f);
- for (; len > 0; len--) {
- f->next = calloc(1, sizeof(struct pullup_field));
- f->next->prev = f;
- f = f->next;
- alloc_metrics(c, f);
- }
- f->next = head;
- head->prev = f;
- return head;
-}
-
-static void check_field_queue(struct pullup_context *c)
-{
- if (c->head->next == c->first) {
- struct pullup_field *f = calloc(1, sizeof(struct pullup_field));
- alloc_metrics(c, f);
- f->prev = c->head;
- f->next = c->first;
- c->head->next = f;
- c->first->prev = f;
- }
-}
-
-void ff_pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int parity)
-{
- struct pullup_field *f;
-
- /* Grow the circular list if needed */
- check_field_queue(c);
-
- /* Cannot have two fields of same parity in a row; drop the new one */
- if (c->last && c->last->parity == parity) return;
-
- f = c->head;
- f->parity = parity;
- f->buffer = ff_pullup_lock_buffer(b, parity);
- f->flags = 0;
- f->breaks = 0;
- f->affinity = 0;
-
- compute_metric(c, f, parity, f->prev->prev, parity, c->diff, f->diffs);
- compute_metric(c, parity?f->prev:f, 0, parity?f:f->prev, 1, c->comb, f->comb);
- compute_metric(c, f, parity, f, -1, c->var, f->var);
-
- /* Advance the circular list */
- if (!c->first) c->first = c->head;
- c->last = c->head;
- c->head = c->head->next;
-}
-
-void ff_pullup_flush_fields(struct pullup_context *c)
-{
- struct pullup_field *f;
-
- for (f = c->first; f && f != c->head; f = f->next) {
- ff_pullup_release_buffer(f->buffer, f->parity);
- f->buffer = 0;
- }
- c->first = c->last = 0;
-}
-
-
-
-
-
-
-
-
-#define F_HAVE_BREAKS 1
-#define F_HAVE_AFFINITY 2
-
-
-#define BREAK_LEFT 1
-#define BREAK_RIGHT 2
-
-
-
-
-static int queue_length(struct pullup_field *begin, struct pullup_field *end)
-{
- int count = 1;
- struct pullup_field *f;
-
- if (!begin || !end) return 0;
- for (f = begin; f != end; f = f->next) count++;
- return count;
-}
-
-static int find_first_break(struct pullup_field *f, int max)
-{
- int i;
- for (i = 0; i < max; i++) {
- if (f->breaks & BREAK_RIGHT || f->next->breaks & BREAK_LEFT)
- return i+1;
- f = f->next;
- }
- return 0;
-}
-
-static void compute_breaks(struct pullup_context *c, struct pullup_field *f0)
-{
- int i;
- struct pullup_field *f1 = f0->next;
- struct pullup_field *f2 = f1->next;
- struct pullup_field *f3 = f2->next;
- int l, max_l=0, max_r=0;
- //struct pullup_field *ff;
- //for (i=0, ff=c->first; ff != f0; i++, ff=ff->next);
-
- if (f0->flags & F_HAVE_BREAKS) return;
- //printf("\n%d: ", i);
- f0->flags |= F_HAVE_BREAKS;
-
- /* Special case when fields are 100% identical */
- if (f0->buffer == f2->buffer && f1->buffer != f3->buffer) {
- f2->breaks |= BREAK_RIGHT;
- return;
- }
- if (f0->buffer != f2->buffer && f1->buffer == f3->buffer) {
- f1->breaks |= BREAK_LEFT;
- return;
- }
-
- for (i = 0; i < c->metric_len; i++) {
- l = f2->diffs[i] - f3->diffs[i];
- if (l > max_l) max_l = l;
- if (-l > max_r) max_r = -l;
- }
- /* Don't get tripped up when differences are mostly quant error */
- //printf("%d %d\n", max_l, max_r);
- if (max_l + max_r < 128) return;
- if (max_l > 4*max_r) f1->breaks |= BREAK_LEFT;
- if (max_r > 4*max_l) f2->breaks |= BREAK_RIGHT;
-}
-
-static void compute_affinity(struct pullup_context *c, struct pullup_field *f)
-{
- int i;
- int max_l=0, max_r=0, l;
- if (f->flags & F_HAVE_AFFINITY) return;
- f->flags |= F_HAVE_AFFINITY;
- if (f->buffer == f->next->next->buffer) {
- f->affinity = 1;
- f->next->affinity = 0;
- f->next->next->affinity = -1;
- f->next->flags |= F_HAVE_AFFINITY;
- f->next->next->flags |= F_HAVE_AFFINITY;
- return;
- }
- if (1) {
- for (i = 0; i < c->metric_len; i++) {
- int lv = f->prev->var[i];
- int rv = f->next->var[i];
- int v = f->var[i];
- int lc = f->comb[i] - (v+lv) + ABS(v-lv);
- int rc = f->next->comb[i] - (v+rv) + ABS(v-rv);
- lc = lc>0 ? lc : 0;
- rc = rc>0 ? rc : 0;
- l = lc - rc;
- if (l > max_l) max_l = l;
- if (-l > max_r) max_r = -l;
- }
- if (max_l + max_r < 64) return;
- if (max_r > 6*max_l) f->affinity = -1;
- else if (max_l > 6*max_r) f->affinity = 1;
- } else {
- for (i = 0; i < c->metric_len; i++) {
- l = f->comb[i] - f->next->comb[i];
- if (l > max_l) max_l = l;
- if (-l > max_r) max_r = -l;
- }
- if (max_l + max_r < 64) return;
- if (max_r > 2*max_l) f->affinity = -1;
- else if (max_l > 2*max_r) f->affinity = 1;
- }
-}
-
-static void foo(struct pullup_context *c)
-{
- struct pullup_field *f = c->first;
- int i, n = queue_length(f, c->last);
- for (i = 0; i < n-1; i++) {
- if (i < n-3) compute_breaks(c, f);
- compute_affinity(c, f);
- f = f->next;
- }
-}
-
-static int decide_frame_length(struct pullup_context *c)
-{
- struct pullup_field *f0 = c->first;
- struct pullup_field *f1 = f0->next;
- struct pullup_field *f2 = f1->next;
- int l;
-
- if (queue_length(c->first, c->last) < 4) return 0;
- foo(c);
-
- if (f0->affinity == -1) return 1;
-
- l = find_first_break(f0, 3);
- if (l == 1 && c->strict_breaks < 0) l = 0;
-
- switch (l) {
- case 1:
- if (c->strict_breaks < 1 && f0->affinity == 1 && f1->affinity == -1)
- return 2;
- else return 1;
- case 2:
- /* FIXME: strictly speaking, f0->prev is no longer valid... :) */
- if (c->strict_pairs
- && (f0->prev->breaks & BREAK_RIGHT) && (f2->breaks & BREAK_LEFT)
- && (f0->affinity != 1 || f1->affinity != -1) )
- return 1;
- if (f1->affinity == 1) return 1;
- else return 2;
- case 3:
- if (f2->affinity == 1) return 2;
- else return 3;
- default:
- /* 9 possibilities covered before switch */
- if (f1->affinity == 1) return 1; /* covers 6 */
- else if (f1->affinity == -1) return 2; /* covers 6 */
- else if (f2->affinity == -1) { /* covers 2 */
- if (f0->affinity == 1) return 3;
- else return 1;
- }
- else return 2; /* the remaining 6 */
- }
-}
-
-
-static void print_aff_and_breaks(struct pullup_context *c, struct pullup_field *f)
-{
- int i;
- struct pullup_field *f0 = f;
- const char aff_l[] = "+..", aff_r[] = "..+";
- printf("\naffinity: ");
- for (i = 0; i < 4; i++) {
- printf("%c%d%c", aff_l[1+f->affinity], i, aff_r[1+f->affinity]);
- f = f->next;
- }
- f = f0;
- printf("\nbreaks: ");
- for (i=0; i<4; i++) {
- printf("%c%d%c", f->breaks & BREAK_LEFT ? '|' : '.', i, f->breaks & BREAK_RIGHT ? '|' : '.');
- f = f->next;
- }
- printf("\n");
-}
-
-
-
-
-
-struct pullup_frame *ff_pullup_get_frame(struct pullup_context *c)
-{
- int i;
- struct pullup_frame *fr = c->frame;
- int n = decide_frame_length(c);
- int aff = c->first->next->affinity;
-
- if (!n) return 0;
- if (fr->lock) return 0;
-
- if (c->verbose) {
- print_aff_and_breaks(c, c->first);
- printf("duration: %d \n", n);
- }
-
- fr->lock++;
- fr->length = n;
- fr->parity = c->first->parity;
- fr->buffer = 0;
- for (i = 0; i < n; i++) {
- /* We cheat and steal the buffer without release+relock */
- fr->ifields[i] = c->first->buffer;
- c->first->buffer = 0;
- c->first = c->first->next;
- }
-
- if (n == 1) {
- fr->ofields[fr->parity] = fr->ifields[0];
- fr->ofields[fr->parity^1] = 0;
- } else if (n == 2) {
- fr->ofields[fr->parity] = fr->ifields[0];
- fr->ofields[fr->parity^1] = fr->ifields[1];
- } else if (n == 3) {
- if (aff == 0)
- aff = (fr->ifields[0] == fr->ifields[1]) ? -1 : 1;
- /* else if (c->verbose) printf("forced aff: %d \n", aff); */
- fr->ofields[fr->parity] = fr->ifields[1+aff];
- fr->ofields[fr->parity^1] = fr->ifields[1];
- }
- ff_pullup_lock_buffer(fr->ofields[0], 0);
- ff_pullup_lock_buffer(fr->ofields[1], 1);
-
- if (fr->ofields[0] == fr->ofields[1]) {
- fr->buffer = fr->ofields[0];
- ff_pullup_lock_buffer(fr->buffer, 2);
- return fr;
- }
- return fr;
-}
-
-static void copy_field(struct pullup_context *c, struct pullup_buffer *dest,
- struct pullup_buffer *src, int parity)
-{
- int i, j;
- unsigned char *d, *s;
- for (i = 0; i < c->nplanes; i++) {
- s = src->planes[i] + parity*c->stride[i];
- d = dest->planes[i] + parity*c->stride[i];
- for (j = c->h[i]>>1; j; j--) {
- memcpy(d, s, c->stride[i]);
- s += c->stride[i]<<1;
- d += c->stride[i]<<1;
- }
- }
-}
-
-void ff_pullup_pack_frame(struct pullup_context *c, struct pullup_frame *fr)
-{
- int i;
- if (fr->buffer) return;
- if (fr->length < 2) return; /* FIXME: deal with this */
- for (i = 0; i < 2; i++)
- {
- if (fr->ofields[i]->lock[i^1]) continue;
- fr->buffer = fr->ofields[i];
- ff_pullup_lock_buffer(fr->buffer, 2);
- copy_field(c, fr->buffer, fr->ofields[i^1], i^1);
- return;
- }
- fr->buffer = ff_pullup_get_buffer(c, 2);
- copy_field(c, fr->buffer, fr->ofields[0], 0);
- copy_field(c, fr->buffer, fr->ofields[1], 1);
-}
-
-void ff_pullup_release_frame(struct pullup_frame *fr)
-{
- int i;
- for (i = 0; i < fr->length; i++)
- ff_pullup_release_buffer(fr->ifields[i], fr->parity ^ (i&1));
- ff_pullup_release_buffer(fr->ofields[0], 0);
- ff_pullup_release_buffer(fr->ofields[1], 1);
- if (fr->buffer) ff_pullup_release_buffer(fr->buffer, 2);
- fr->lock--;
-}
-
-
-
-
-
-
-struct pullup_context *ff_pullup_alloc_context(void)
-{
- struct pullup_context *c;
-
- c = calloc(1, sizeof(struct pullup_context));
-
- return c;
-}
-
-void ff_pullup_preinit_context(struct pullup_context *c)
-{
- c->bpp = calloc(c->nplanes, sizeof(int));
- c->w = calloc(c->nplanes, sizeof(int));
- c->h = calloc(c->nplanes, sizeof(int));
- c->stride = calloc(c->nplanes, sizeof(int));
- c->background = calloc(c->nplanes, sizeof(int));
-}
-
-void ff_pullup_init_context(struct pullup_context *c)
-{
- int mp = c->metric_plane;
- if (c->nbuffers < 10) c->nbuffers = 10;
- c->buffers = calloc(c->nbuffers, sizeof (struct pullup_buffer));
-
- c->metric_w = (c->w[mp] - ((c->junk_left + c->junk_right) << 3)) >> 3;
- c->metric_h = (c->h[mp] - ((c->junk_top + c->junk_bottom) << 1)) >> 3;
- c->metric_offset = c->junk_left*c->bpp[mp] + (c->junk_top<<1)*c->stride[mp];
- c->metric_len = c->metric_w * c->metric_h;
-
- c->head = make_field_queue(c, 8);
-
- c->frame = calloc(1, sizeof (struct pullup_frame));
- c->frame->ifields = calloc(3, sizeof (struct pullup_buffer *));
-
- switch(c->format) {
- case PULLUP_FMT_Y:
- c->diff = diff_y;
- c->comb = licomb_y;
- c->var = var_y;
-#if ARCH_X86
-#if HAVE_MMX
- if (c->cpu & PULLUP_CPU_MMX) {
- c->diff = diff_y_mmx;
- c->comb = licomb_y_mmx;
- c->var = var_y_mmx;
- }
-#endif
-#endif
- /* c->comb = qpcomb_y; */
- break;
-#if 0
- case PULLUP_FMT_YUY2:
- c->diff = diff_yuy2;
- break;
- case PULLUP_FMT_RGB32:
- c->diff = diff_rgb32;
- break;
-#endif
- }
-}
-
-void ff_pullup_free_context(struct pullup_context *c)
-{
- struct pullup_field *f;
- free(c->buffers);
- f = c->head;
- do {
- if (!f) break;
- free(f->diffs);
- free(f->comb);
- f = f->next;
- free(f->prev);
- } while (f != c->head);
- free(c->frame);
- free(c);
-}
diff --git a/ffmpeg/libavfilter/libmpcodecs/pullup.h b/ffmpeg/libavfilter/libmpcodecs/pullup.h
deleted file mode 100644
index cd6ec00..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/pullup.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef MPLAYER_PULLUP_H
-#define MPLAYER_PULLUP_H
-
-#define PULLUP_CPU_MMX 1
-#define PULLUP_CPU_MMX2 2
-#define PULLUP_CPU_3DNOW 4
-#define PULLUP_CPU_3DNOWEXT 8
-#define PULLUP_CPU_SSE 16
-#define PULLUP_CPU_SSE2 32
-
-#define PULLUP_FMT_Y 1
-#define PULLUP_FMT_YUY2 2
-#define PULLUP_FMT_UYVY 3
-#define PULLUP_FMT_RGB32 4
-
-struct pullup_buffer
-{
- int lock[2];
- unsigned char **planes;
-};
-
-struct pullup_field
-{
- int parity;
- struct pullup_buffer *buffer;
- unsigned int flags;
- int breaks;
- int affinity;
- int *diffs;
- int *comb;
- int *var;
- struct pullup_field *prev, *next;
-};
-
-struct pullup_frame
-{
- int lock;
- int length;
- int parity;
- struct pullup_buffer **ifields, *ofields[2];
- struct pullup_buffer *buffer;
-};
-
-struct pullup_context
-{
- /* Public interface */
- int format;
- int nplanes;
- int *bpp, *w, *h, *stride, *background;
- unsigned int cpu;
- int junk_left, junk_right, junk_top, junk_bottom;
- int verbose;
- int metric_plane;
- int strict_breaks;
- int strict_pairs;
- /* Internal data */
- struct pullup_field *first, *last, *head;
- struct pullup_buffer *buffers;
- int nbuffers;
- int (*diff)(unsigned char *, unsigned char *, int);
- int (*comb)(unsigned char *, unsigned char *, int);
- int (*var)(unsigned char *, unsigned char *, int);
- int metric_w, metric_h, metric_len, metric_offset;
- struct pullup_frame *frame;
-};
-
-
-struct pullup_buffer *ff_pullup_lock_buffer(struct pullup_buffer *b, int parity);
-void ff_pullup_release_buffer(struct pullup_buffer *b, int parity);
-struct pullup_buffer *ff_pullup_get_buffer(struct pullup_context *c, int parity);
-
-void ff_pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int parity);
-void ff_pullup_flush_fields(struct pullup_context *c);
-
-struct pullup_frame *ff_pullup_get_frame(struct pullup_context *c);
-void ff_pullup_pack_frame(struct pullup_context *c, struct pullup_frame *fr);
-void ff_pullup_release_frame(struct pullup_frame *fr);
-
-struct pullup_context *ff_pullup_alloc_context(void);
-void ff_pullup_preinit_context(struct pullup_context *c);
-void ff_pullup_init_context(struct pullup_context *c);
-void ff_pullup_free_context(struct pullup_context *c);
-
-#endif /* MPLAYER_PULLUP_H */
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_detc.c b/ffmpeg/libavfilter/libmpcodecs/vf_detc.c
deleted file mode 100644
index 751e2b8..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_detc.c
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#include "libvo/fastmemcpy.h"
-
-struct metrics {
- int even;
- int odd;
- int noise;
- int temp;
-};
-
-struct vf_priv_s {
- int frame;
- int drop, lastdrop;
- struct metrics pm;
- int thres[5];
- int inframes, outframes;
- int mode;
- int (*analyze)(struct vf_priv_s *, mp_image_t *, mp_image_t *);
- int needread;
-};
-
-#define COMPE(a,b,e) (abs((a)-(b)) < (((a)+(b))>>(e)))
-#define COMPARABLE(a,b) COMPE((a),(b),2)
-#define VERYCLOSE(a,b) COMPE((a),(b),3)
-
-#define OUTER_TC_NBHD(s) ( \
- COMPARABLE((s)[-1].m.even,(s)[-1].m.odd) && \
- COMPARABLE((s)[1].m.even,(s)[0].m.odd) && \
- COMPARABLE((s)[2].m.even,(s)[1].m.odd) && \
- COMPARABLE((s)[-1].m.noise,(s)[0].m.temp) && \
- COMPARABLE((s)[2].m.noise,(s)[2].m.temp) )
-
-#define INNER_TC_NBHD(s,l,h) ( \
- COMPARABLE((s)[0].m.even,(l)) && \
- COMPARABLE((s)[2].m.odd,(l)) && ( \
- COMPARABLE((s)[0].m.noise,(h)) || \
- COMPARABLE((s)[1].m.noise,(h)) ) )
-
-enum {
- TC_DROP,
- TC_PROG,
- TC_IL1,
- TC_IL2
-};
-
-static void block_diffs(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
-{
- int x, y, even=0, odd=0, noise, temp;
- unsigned char *oldp, *newp;
- m->noise = m->temp = 0;
- for (x = 8; x; x--) {
- oldp = old++;
- newp = new++;
- noise = temp = 0;
- for (y = 4; y; y--) {
- even += abs(newp[0]-oldp[0]);
- odd += abs(newp[ns]-oldp[os]);
- noise += newp[ns]-newp[0];
- temp += oldp[os]-newp[0];
- oldp += os<<1;
- newp += ns<<1;
- }
- m->noise += abs(noise);
- m->temp += abs(temp);
- }
- m->even = even;
- m->odd = odd;
-}
-
-static void diff_planes(struct metrics *m, unsigned char *old, unsigned char *new, int w, int h, int os, int ns)
-{
- int x, y, me=0, mo=0, mn=0, mt=0;
- struct metrics l;
- for (y = 0; y < h-7; y += 8) {
- for (x = 0; x < w-7; x += 8) {
- block_diffs(&l, old+x+y*os, new+x+y*ns, os, ns);
- if (l.even > me) me = l.even;
- if (l.odd > mo) mo = l.odd;
- if (l.noise > mn) mn = l.noise;
- if (l.temp > mt) mt = l.temp;
- }
- }
- m->even = me;
- m->odd = mo;
- m->noise = mn;
- m->temp = mt;
-}
-
-static void diff_fields(struct metrics *metr, mp_image_t *old, mp_image_t *new)
-{
- struct metrics m, mu, mv;
- diff_planes(&m, old->planes[0], new->planes[0],
- new->w, new->h, old->stride[0], new->stride[0]);
- if (new->flags & MP_IMGFLAG_PLANAR) {
- diff_planes(&mu, old->planes[1], new->planes[1],
- new->chroma_width, new->chroma_height,
- old->stride[1], new->stride[1]);
- diff_planes(&mv, old->planes[2], new->planes[2],
- new->chroma_width, new->chroma_height,
- old->stride[2], new->stride[2]);
- if (mu.even > m.even) m.even = mu.even;
- if (mu.odd > m.odd) m.odd = mu.odd;
- if (mu.noise > m.noise) m.noise = mu.noise;
- if (mu.temp > m.temp) m.temp = mu.temp;
- if (mv.even > m.even) m.even = mv.even;
- if (mv.odd > m.odd) m.odd = mv.odd;
- if (mv.noise > m.noise) m.noise = mv.noise;
- if (mv.temp > m.temp) m.temp = mv.temp;
- }
- *metr = m;
-}
-
-static void status(int f, struct metrics *m)
-{
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "frame %d: e=%d o=%d n=%d t=%d\n",
- f, m->even, m->odd, m->noise, m->temp);
-}
-
-static int analyze_fixed_pattern(struct vf_priv_s *p, mp_image_t *new, mp_image_t *old)
-{
- if (p->frame >= 0) p->frame = (p->frame+1)%5;
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "frame %d\n", p->frame);
- switch (p->frame) {
- case -1: case 0: case 1: case 2:
- return TC_PROG;
- case 3:
- return TC_IL1;
- case 4:
- return TC_IL2;
- }
- return 0;
-}
-
-static int analyze_aggressive(struct vf_priv_s *p, mp_image_t *new, mp_image_t *old)
-{
- struct metrics m, pm;
-
- if (p->frame >= 0) p->frame = (p->frame+1)%5;
-
- diff_fields(&m, old, new);
-
- status(p->frame, &m);
-
- pm = p->pm;
- p->pm = m;
-
- if (p->frame == 4) {
- /* We need to break at scene changes, but is this a valid test? */
- if ((m.even > p->thres[2]) && (m.odd > p->thres[2]) && (m.temp > p->thres[3])
- && (m.temp > 5*pm.temp) && (m.temp*2 > m.noise)) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "scene change breaking telecine!\n");
- p->frame = -1;
- return TC_DROP;
- }
- /* Thres. is to compensate for quantization errors when noise is low */
- if (m.noise - m.temp > -p->thres[4]) {
- if (COMPARABLE(m.even, pm.odd)) {
- //ff_mp_msg(MSGT_VFILTER, MSGL_V, "confirmed field match!\n");
- return TC_IL2;
- } else if ((m.even < p->thres[0]) && (m.odd < p->thres[0]) && VERYCLOSE(m.even, m.odd)
- && VERYCLOSE(m.noise,m.temp) && VERYCLOSE(m.noise,pm.noise)) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "interlaced frame appears in duplicate!!!\n");
- p->pm = pm; /* hack :) */
- p->frame = 3;
- return TC_IL1;
- }
- } else {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "mismatched telecine fields!\n");
- p->frame = -1;
- }
- }
-
- if (2*m.even*m.temp < m.odd*m.noise) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "caught telecine sync!\n");
- p->frame = 3;
- return TC_IL1;
- }
-
- if (p->frame < 3) {
- if (m.noise > p->thres[3]) {
- if (m.noise > 2*m.temp) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "merging fields out of sequence!\n");
- return TC_IL2;
- }
- if ((m.noise > 2*pm.noise) && (m.even > p->thres[2]) && (m.odd > p->thres[2])) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "dropping horrible interlaced frame!\n");
- return TC_DROP;
- }
- }
- }
-
- switch (p->frame) {
- case -1:
- if (4*m.noise > 5*m.temp) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "merging fields out of sequence!\n");
- return TC_IL2;
- }
- case 0:
- case 1:
- case 2:
- return TC_PROG;
- case 3:
- if ((m.even > p->thres[1]) && (m.even > m.odd) && (m.temp > m.noise)) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "lost telecine tracking!\n");
- p->frame = -1;
- return TC_PROG;
- }
- return TC_IL1;
- case 4:
- return TC_IL2;
- }
- return 0;
-}
-
-static void copy_image(mp_image_t *dmpi, mp_image_t *mpi, int field)
-{
- switch (field) {
- case 0:
- my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- break;
- case 1:
- my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
- mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
- mpi->planes[1]+mpi->stride[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
- mpi->planes[2]+mpi->stride[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- break;
- case 2:
- memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
- dmpi->stride[0], mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(dmpi->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[1], mpi->stride[1]);
- memcpy_pic(dmpi->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[2], mpi->stride[2]);
- }
- break;
- }
-}
-
-static int do_put_image(struct vf_instance *vf, mp_image_t *dmpi)
-{
- struct vf_priv_s *p = vf->priv;
- int dropflag;
-
- switch (p->drop) {
- default:
- dropflag = 0;
- break;
- case 1:
- dropflag = (++p->lastdrop >= 5);
- break;
- case 2:
- dropflag = (++p->lastdrop >= 5) && (4*p->inframes <= 5*p->outframes);
- break;
- }
-
- if (dropflag) {
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "drop! [%d/%d=%g]\n",
- p->outframes, p->inframes, (float)p->outframes/p->inframes);
- p->lastdrop = 0;
- return 0;
- }
-
- p->outframes++;
- return ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- int ret=0;
- mp_image_t *dmpi;
- struct vf_priv_s *p = vf->priv;
-
- p->inframes++;
-
- if (p->needread) dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
- mpi->width, mpi->height);
- /* FIXME: is there a good way to get rid of static type? */
- else dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
-
- switch (p->analyze(p, mpi, dmpi)) {
- case TC_DROP:
- /* Don't copy anything unless we'll need to read it. */
- if (p->needread) copy_image(dmpi, mpi, 2);
- p->lastdrop = 0;
- break;
- case TC_PROG:
- /* Copy and display the whole frame. */
- copy_image(dmpi, mpi, 2);
- ret = do_put_image(vf, dmpi);
- break;
- case TC_IL1:
- /* Only copy bottom field unless we need to read. */
- if (p->needread) copy_image(dmpi, mpi, 2);
- else copy_image(dmpi, mpi, 1);
- p->lastdrop = 0;
- break;
- case TC_IL2:
- /* Copy top field and show frame, then copy bottom if needed. */
- copy_image(dmpi, mpi, 0);
- ret = do_put_image(vf, dmpi);
- if (p->needread) copy_image(dmpi, mpi, 1);
- break;
- }
- return ret;
-}
-
-static int query_format(struct vf_instance *vf, unsigned int fmt)
-{
- /* FIXME - figure out which other formats work */
- switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void uninit(struct vf_instance *vf)
-{
- free(vf->priv);
-}
-
-static struct {
- const char *name;
- int (*func)(struct vf_priv_s *p, mp_image_t *new, mp_image_t *old);
- int needread;
-} anal_funcs[] = {
- { "fixed", analyze_fixed_pattern, 0 },
- { "aggressive", analyze_aggressive, 1 },
- { NULL, NULL, 0 }
-};
-
-#define STARTVARS if (0)
-#define GETVAR(str, name, out, func) \
- else if (!strncmp((str), name "=", sizeof(name))) \
- (out) = (func)((str) + sizeof(name))
-
-static void parse_var(struct vf_priv_s *p, char *var)
-{
- STARTVARS;
- GETVAR(var, "dr", p->drop, atoi);
- GETVAR(var, "t0", p->thres[0], atoi);
- GETVAR(var, "t1", p->thres[1], atoi);
- GETVAR(var, "t2", p->thres[2], atoi);
- GETVAR(var, "t3", p->thres[3], atoi);
- GETVAR(var, "t4", p->thres[4], atoi);
- GETVAR(var, "fr", p->frame, atoi);
- GETVAR(var, "am", p->mode, atoi);
-}
-
-static void parse_args(struct vf_priv_s *p, char *args)
-{
- char *next, *orig;
- for (args=orig=strdup(args); args; args=next) {
- next = strchr(args, ':');
- if (next) *next++ = 0;
- parse_var(p, args);
- }
- free(orig);
-}
-
-static int vf_open(vf_instance_t *vf, char *args)
-{
- struct vf_priv_s *p;
- vf->config = config;
- vf->put_image = put_image;
- vf->query_format = query_format;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
- vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
- p->frame = -1;
- p->thres[0] = 440;
- p->thres[1] = 720;
- p->thres[2] = 2500;
- p->thres[3] = 2500;
- p->thres[4] = 800;
- p->drop = 0;
- p->mode = 1;
- if (args) parse_args(p, args);
- p->analyze = anal_funcs[p->mode].func;
- p->needread = anal_funcs[p->mode].needread;
- return 1;
-}
-
-const vf_info_t ff_vf_info_detc = {
- "de-telecine filter",
- "detc",
- "Rich Felker",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_dint.c b/ffmpeg/libavfilter/libmpcodecs/vf_dint.c
deleted file mode 100644
index 950e835..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_dint.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "mp_image.h"
-#include "img_format.h"
-#include "vf.h"
-
-struct vf_priv_s {
- float sense; // first parameter
- float level; // second parameter
- unsigned int imgfmt;
- int diff;
- uint32_t max;
-// int dfr;
-// int rdfr;
- int was_dint;
- mp_image_t *pmpi; // previous mpi
-};
-
-#define MAXROWSIZE 1200
-
-static int config (struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- int rowsize;
-
- vf->priv->pmpi = ff_vf_get_image (vf->next, outfmt, MP_IMGTYPE_TEMP,
- 0, width, height);
- if (!(vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) &&
- outfmt != IMGFMT_RGB32 && outfmt != IMGFMT_BGR32 &&
- outfmt != IMGFMT_RGB24 && outfmt != IMGFMT_BGR24 &&
- outfmt != IMGFMT_RGB16 && outfmt != IMGFMT_BGR16)
- {
- ff_mp_msg (MSGT_VFILTER, MSGL_WARN, "Drop-interlaced filter doesn't support this outfmt :(\n");
- return 0;
- }
- vf->priv->imgfmt = outfmt;
- // recalculate internal values
- rowsize = vf->priv->pmpi->width;
- if (rowsize > MAXROWSIZE) rowsize = MAXROWSIZE;
- vf->priv->max = vf->priv->level * vf->priv->pmpi->height * rowsize / 2;
- if (vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) // planar YUV
- vf->priv->diff = vf->priv->sense * 256;
- else
- vf->priv->diff = vf->priv->sense * (1 << (vf->priv->pmpi->bpp/3));
- if (vf->priv->diff < 0) vf->priv->diff = 0;
- if (!(vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) &&
- vf->priv->pmpi->bpp < 24 && vf->priv->diff > 31)
- vf->priv->diff = 31;
- ff_mp_msg (MSGT_VFILTER, MSGL_INFO, "Drop-interlaced: %dx%d diff %d / level %u\n",
- vf->priv->pmpi->width, vf->priv->pmpi->height,
- vf->priv->diff, (unsigned int)vf->priv->max);
-// vf->priv->rdfr = vf->priv->dfr = 0;
- vf->priv->was_dint = 0;
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static int put_image (struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- int8_t rrow0[MAXROWSIZE];
- int8_t rrow1[MAXROWSIZE];
- int8_t rrow2[MAXROWSIZE];
- int8_t *row0 = rrow0, *row1 = rrow1, *row2 = rrow2/*, *row3 = rrow3*/;
- int rowsize = mpi->width;
- uint32_t nok = 0, max = vf->priv->max;
- int diff = vf->priv->diff;
- int i, j;
- register int n1, n2;
- unsigned char *cur0, *prv0;
- register unsigned char *cur, *prv;
-
- if (rowsize > MAXROWSIZE) rowsize = MAXROWSIZE;
- // check if nothing to do
- if (mpi->imgfmt == vf->priv->imgfmt)
- {
- cur0 = mpi->planes[0] + mpi->stride[0];
- prv0 = mpi->planes[0];
- for (j = 1; j < mpi->height && nok <= max; j++)
- {
- cur = cur0;
- prv = prv0;
- // analyse row (row0)
- if (mpi->flags & MP_IMGFLAG_PLANAR) // planar YUV - check luminance
- for (i = 0; i < rowsize; i++)
- {
- if (cur[0] - prv[0] > diff)
- row0[i] = 1;
- else if (cur[0] - prv[0] < -diff)
- row0[i] = -1;
- else
- row0[i] = 0;
- cur++;
- prv++;
- // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
- // but row3 is 1 so it's interlaced ptr (nok++)
- if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
- (++nok) > max)
- break;
- }
- else if (mpi->bpp < 24) // RGB/BGR 16 - check all colors
- for (i = 0; i < rowsize; i++)
- {
- n1 = cur[0] + (cur[1]<<8);
- n2 = prv[0] + (prv[1]<<8);
- if ((n1&0x1f) - (n2&0x1f) > diff ||
- ((n1>>5)&0x3f) - ((n2>>5)&0x3f) > diff ||
- ((n1>>11)&0x1f) - ((n2>>11)&0x1f) > diff)
- row0[i] = 1;
- else if ((n1&0x1f) - (n2&0x1f) < -diff ||
- ((n1>>5)&0x3f) - ((n2>>5)&0x3f) < -diff ||
- ((n1>>11)&0x1f) - ((n2>>11)&0x1f) < -diff)
- row0[i] = -1;
- else
- row0[i] = 0;
- cur += 2;
- prv += 2;
- // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
- // but row3 is 1 so it's interlaced ptr (nok++)
- if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
- (++nok) > max)
- break;
- }
- else // RGB/BGR 24/32
- for (i = 0; i < rowsize; i++)
- {
- if (cur[0] - prv[0] > diff ||
- cur[1] - prv[1] > diff ||
- cur[2] - prv[2] > diff)
- row0[i] = 1;
- else if (prv[0] - cur[0] > diff ||
- prv[1] - cur[1] > diff ||
- prv[2] - cur[2] > diff)
- row0[i] = -1;
- else
- row0[i] = 0;
- cur += mpi->bpp/8;
- prv += mpi->bpp/8;
- // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
- // but row3 is 1 so it's interlaced ptr (nok++)
- if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
- (++nok) > max)
- break;
- }
- cur0 += mpi->stride[0];
- prv0 += mpi->stride[0];
- // rotate rows
- cur = row2;
- row2 = row1;
- row1 = row0;
- row0 = cur;
- }
- }
- // check if number of interlaced is above of max
- if (nok > max)
- {
-// vf->priv->dfr++;
- if (vf->priv->was_dint < 1) // can skip at most one frame!
- {
- vf->priv->was_dint++;
-// vf->priv->rdfr++;
-// ff_mp_msg (MSGT_VFILTER, MSGL_INFO, "DI:%d/%d ", vf->priv->rdfr, vf->priv->dfr);
- return 0;
- }
- }
- vf->priv->was_dint = 0;
-// ff_mp_msg (MSGT_VFILTER, MSGL_INFO, "DI:%d/%d ", vf->priv->rdfr, vf->priv->dfr);
- return ff_vf_next_put_image (vf, mpi, pts);
-}
-
-static int vf_open(vf_instance_t *vf, char *args){
- vf->config = config;
- vf->put_image = put_image;
-// vf->default_reqs=VFCAP_ACCEPT_STRIDE;
- vf->priv = malloc (sizeof(struct vf_priv_s));
- vf->priv->sense = 0.1;
- vf->priv->level = 0.15;
- vf->priv->pmpi = NULL;
- if (args)
- sscanf (args, "%f:%f", &vf->priv->sense, &vf->priv->level);
- return 1;
-}
-
-const vf_info_t ff_vf_info_dint = {
- "drop interlaced frames",
- "dint",
- "A.G.",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_divtc.c b/ffmpeg/libavfilter/libmpcodecs/vf_divtc.c
deleted file mode 100644
index 61f6e35..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_divtc.c
+++ /dev/null
@@ -1,722 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <math.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "cpudetect.h"
-#include "libavutil/common.h"
-#include "libavutil/x86/asm.h"
-#include "mpbswap.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#include "libvo/fastmemcpy.h"
-
-const vf_info_t ff_vf_info_divtc;
-
-struct vf_priv_s
- {
- int deghost, pass, phase, window, fcount, bcount, frameno, misscount,
- ocount, sum[5];
- double threshold;
- FILE *file;
- int8_t *bdata;
- unsigned int *csdata;
- int *history;
- };
-
-/*
- * diff_MMX and diff_C stolen from vf_decimate.c
- */
-
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
-static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
- {
- volatile short out[4];
- __asm__ (
- "movl $8, %%ecx \n\t"
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
-
- ASMALIGN(4)
- "1: \n\t"
-
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_S"), %%mm2 \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "movq (%%"REG_D"), %%mm1 \n\t"
- "add %%"REG_b", %%"REG_D" \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "psubusb %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm0 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm0, %%mm4 \n\t"
- "paddw %%mm1, %%mm4 \n\t"
- "paddw %%mm2, %%mm4 \n\t"
- "paddw %%mm3, %%mm4 \n\t"
-
- "decl %%ecx \n\t"
- "jnz 1b \n\t"
- "movq %%mm4, (%%"REG_d") \n\t"
- "emms \n\t"
- :
- : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
- : "%ecx", "memory"
- );
- return out[0]+out[1]+out[2]+out[3];
- }
-#endif
-
-static int diff_C(unsigned char *old, unsigned char *new, int os, int ns)
- {
- int x, y, d=0;
-
- for(y=8; y; y--, new+=ns, old+=os)
- for(x=8; x; x--)
- d+=abs(new[x]-old[x]);
-
- return d;
- }
-
-static int (*diff)(unsigned char *, unsigned char *, int, int);
-
-static int diff_plane(unsigned char *old, unsigned char *new,
- int w, int h, int os, int ns, int arg)
- {
- int x, y, d, max=0, sum=0, n=0;
-
- for(y=0; y<h-7; y+=8)
- {
- for(x=0; x<w-7; x+=8)
- {
- d=diff(old+x+y*os, new+x+y*ns, os, ns);
- if(d>max) max=d;
- sum+=d;
- n++;
- }
- }
-
- return (sum+n*max)/2;
- }
-
-/*
-static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
- int w, int h, int s, int zs, int arg)
- {
- unsigned int shift, sum;
- unsigned char *e;
-
- for(sum=0; h; h--, p+=s-w)
- for(e=p+w, shift=32; p<e;)
- sum^=(*p++)<<(shift=(shift-8)&31);
-
- return sum;
- }
-*/
-
-static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
- int w, int h, int s, int zs, int arg)
- {
- unsigned int shift;
- uint32_t sum, t;
- unsigned char *e, *e2;
-#if HAVE_FAST_64BIT
- typedef uint64_t wsum_t;
-#else
- typedef uint32_t wsum_t;
-#endif
- wsum_t wsum;
-
- for(sum=0; h; h--, p+=s-w)
- {
- for(shift=0, e=p+w; (int)p&(sizeof(wsum_t)-1) && p<e;)
- sum^=*p++<<(shift=(shift-8)&31);
-
- for(wsum=0, e2=e-sizeof(wsum_t)+1; p<e2; p+=sizeof(wsum_t))
- wsum^=*(wsum_t *)p;
-
-#if HAVE_FAST_64BIT
- t=be2me_32((uint32_t)(wsum>>32^wsum));
-#else
- t=be2me_32(wsum);
-#endif
-
- for(sum^=(t<<shift|t>>(32-shift)); p<e;)
- sum^=*p++<<(shift=(shift-8)&31);
- }
-
- return sum;
- }
-
-static int deghost_plane(unsigned char *d, unsigned char *s,
- int w, int h, int ds, int ss, int threshold)
- {
- int t;
- unsigned char *e;
-
- for(; h; h--, s+=ss-w, d+=ds-w)
- for(e=d+w; d<e; d++, s++)
- if(abs(*d-*s)>=threshold)
- *d=(t=(*d<<1)-*s)<0?0:t>255?255:t;
-
- return 0;
- }
-
-static int copyop(unsigned char *d, unsigned char *s, int bpl, int h, int dstride, int sstride, int dummy) {
- memcpy_pic(d, s, bpl, h, dstride, sstride);
- return 0;
-}
-
-static int imgop(int(*planeop)(unsigned char *, unsigned char *,
- int, int, int, int, int),
- mp_image_t *dst, mp_image_t *src, int arg)
- {
- if(dst->flags&MP_IMGFLAG_PLANAR)
- return planeop(dst->planes[0], src?src->planes[0]:0,
- dst->w, dst->h,
- dst->stride[0], src?src->stride[0]:0, arg)+
- planeop(dst->planes[1], src?src->planes[1]:0,
- dst->chroma_width, dst->chroma_height,
- dst->stride[1], src?src->stride[1]:0, arg)+
- planeop(dst->planes[2], src?src->planes[2]:0,
- dst->chroma_width, dst->chroma_height,
- dst->stride[2], src?src->stride[2]:0, arg);
-
- return planeop(dst->planes[0], src?src->planes[0]:0,
- dst->w*(dst->bpp/8), dst->h,
- dst->stride[0], src?src->stride[0]:0, arg);
- }
-
-/*
- * Find the phase in which the telecine pattern fits best to the
- * given 5 frame slice of frame difference measurements.
- *
- * If phase1 and phase2 are not negative, only the two specified
- * phases are tested.
- */
-
-static int match(struct vf_priv_s *p, int *diffs,
- int phase1, int phase2, double *strength)
- {
- static const int pattern1[]={ -4, 1, 1, 1, 1 },
- pattern2[]={ -2, -3, 4, 4, -3 }, *pattern;
- int f, m, n, t[5];
-
- pattern=p->deghost>0?pattern2:pattern1;
-
- for(f=0; f<5; f++)
- {
- if(phase1<0 || phase2<0 || f==phase1 || f==phase2)
- {
- for(n=t[f]=0; n<5; n++)
- t[f]+=diffs[n]*pattern[(n-f+5)%5];
- }
- else
- t[f]=INT_MIN;
- }
-
- /* find the best match */
- for(m=0, n=1; n<5; n++)
- if(t[n]>t[m]) m=n;
-
- if(strength)
- {
- /* the second best match */
- for(f=m?0:1, n=f+1; n<5; n++)
- if(n!=m && t[n]>t[f]) f=n;
-
- *strength=(t[m]>0?(double)(t[m]-t[f])/t[m]:0.0);
- }
-
- return m;
- }
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
- {
- mp_image_t *dmpi, *tmpi=0;
- int n, m, f, newphase;
- struct vf_priv_s *p=vf->priv;
- unsigned int checksum;
- double d;
-
- dmpi=ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
- mpi->width, mpi->height);
- ff_vf_clone_mpi_attributes(dmpi, mpi);
-
- newphase=p->phase;
-
- switch(p->pass)
- {
- case 1:
- fprintf(p->file, "%08x %d\n",
- (unsigned int)imgop((void *)checksum_plane, mpi, 0, 0),
- p->frameno?imgop(diff_plane, dmpi, mpi, 0):0);
- break;
-
- case 2:
- if(p->frameno/5>p->bcount)
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_ERR,
- "\n%s: Log file ends prematurely! "
- "Switching to one pass mode.\n", vf->info->name);
- p->pass=0;
- break;
- }
-
- checksum=(unsigned int)imgop((void *)checksum_plane, mpi, 0, 0);
-
- if(checksum!=p->csdata[p->frameno])
- {
- for(f=0; f<100; f++)
- if(p->frameno+f<p->fcount && p->csdata[p->frameno+f]==checksum)
- break;
- else if(p->frameno-f>=0 && p->csdata[p->frameno-f]==checksum)
- {
- f=-f;
- break;
- }
-
- if(f<100)
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO,
- "\n%s: Mismatch with pass-1: %+d frame(s).\n",
- vf->info->name, f);
-
- p->frameno+=f;
- p->misscount=0;
- }
- else if(p->misscount++>=30)
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_ERR,
- "\n%s: Sync with pass-1 lost! "
- "Switching to one pass mode.\n", vf->info->name);
- p->pass=0;
- break;
- }
- }
-
- n=(p->frameno)/5;
- if(n>=p->bcount) n=p->bcount-1;
-
- newphase=p->bdata[n];
- break;
-
- default:
- if(p->frameno)
- {
- int *sump=p->sum+p->frameno%5,
- *histp=p->history+p->frameno%p->window;
-
- *sump-=*histp;
- *sump+=(*histp=imgop(diff_plane, dmpi, mpi, 0));
- }
-
- m=match(p, p->sum, -1, -1, &d);
-
- if(d>=p->threshold)
- newphase=m;
- }
-
- n=p->ocount++%5;
-
- if(newphase!=p->phase && ((p->phase+4)%5<n)==((newphase+4)%5<n))
- {
- p->phase=newphase;
- ff_mp_msg(MSGT_VFILTER, MSGL_STATUS,
- "\n%s: Telecine phase %d.\n", vf->info->name, p->phase);
- }
-
- switch((p->frameno++-p->phase+10)%5)
- {
- case 0:
- imgop(copyop, dmpi, mpi, 0);
- return 0;
-
- case 4:
- if(p->deghost>0)
- {
- tmpi=ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_READABLE,
- mpi->width, mpi->height);
- ff_vf_clone_mpi_attributes(tmpi, mpi);
-
- imgop(copyop, tmpi, mpi, 0);
- imgop(deghost_plane, tmpi, dmpi, p->deghost);
- imgop(copyop, dmpi, mpi, 0);
- return ff_vf_next_put_image(vf, tmpi, MP_NOPTS_VALUE);
- }
- }
-
- imgop(copyop, dmpi, mpi, 0);
- return ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- }
-
-static int analyze(struct vf_priv_s *p)
- {
- int *buf=0, *bp, bufsize=0, n, b, f, i, j, m, s;
- unsigned int *cbuf=0, *cp;
- int8_t *pbuf;
- int8_t lbuf[256];
- int sum[5];
- double d;
-
- /* read the file */
-
- n=15;
- while(fgets(lbuf, 256, p->file))
- {
- if(n>=bufsize-19)
- {
- bufsize=bufsize?bufsize*2:30000;
- if((bp=realloc(buf, bufsize*sizeof *buf))) buf=bp;
- if((cp=realloc(cbuf, bufsize*sizeof *cbuf))) cbuf=cp;
-
- if(!bp || !cp)
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: Not enough memory.\n",
- ff_vf_info_divtc.name);
- free(buf);
- free(cbuf);
- return 0;
- }
- }
- sscanf(lbuf, "%x %d", cbuf+n, buf+n);
- n++;
- }
-
- if(n <= 15)
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: Empty 2-pass log file.\n",
- ff_vf_info_divtc.name);
- free(buf);
- free(cbuf);
- return 0;
- }
-
- /* generate some dummy data past the beginning and end of the array */
-
- buf+=15, cbuf+=15;
- n-=15;
-
- memcpy(buf-15, buf, 15*sizeof *buf);
- memset(cbuf-15, 0, 15*sizeof *cbuf);
-
- while(n%5)
- buf[n]=buf[n-5], cbuf[n]=0, n++;
-
- memcpy(buf+n, buf+n-15, 15*sizeof *buf);
- memset(cbuf+n, 0, 15*sizeof *cbuf);
-
- p->csdata=cbuf;
- p->fcount=n;
-
- /* array with one slot for each slice of 5 frames */
-
- p->bdata=pbuf=malloc(p->bcount=b=(n/5));
- memset(pbuf, 255, b);
-
- /* resolve the automatic mode */
-
- if(p->deghost<0)
- {
- int deghost=-p->deghost;
- double s0=0.0, s1=0.0;
-
- for(f=0; f<n; f+=5)
- {
- p->deghost=0; match(p, buf+f, -1, -1, &d); s0+=d;
- p->deghost=1; match(p, buf+f, -1, -1, &d); s1+=d;
- }
-
- p->deghost=s1>s0?deghost:0;
-
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO,
- "%s: Deghosting %-3s (relative pattern strength %+.2fdB).\n",
- ff_vf_info_divtc.name,
- p->deghost?"ON":"OFF",
- 10.0*log10(s1/s0));
- }
-
- /* analyze the data */
-
- for(f=0; f<5; f++)
- for(sum[f]=0, n=-15; n<20; n+=5)
- sum[f]+=buf[n+f];
-
- for(f=0; f<b; f++)
- {
- m=match(p, sum, -1, -1, &d);
-
- if(d>=p->threshold)
- pbuf[f]=m;
-
- if(f<b-1)
- for(n=0; n<5; n++)
- sum[n]=sum[n]-buf[5*(f-3)+n]+buf[5*(f+4)+n];
- }
-
- /* fill in the gaps */
-
- /* the beginning */
- for(f=0; f<b && pbuf[f]==-1; f++);
-
- if(f==b)
- {
- free(buf-15);
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: No telecine pattern found!\n",
- ff_vf_info_divtc.name);
- return 0;
- }
-
- for(n=0; n<f; pbuf[n++]=pbuf[f]);
-
- /* the end */
- for(f=b-1; pbuf[f]==-1; f--);
- for(n=f+1; n<b; pbuf[n++]=pbuf[f]);
-
- /* the rest */
- for(f=0;;)
- {
- while(f<b && pbuf[f]!=-1) f++;
- if(f==b) break;
- for(n=f; pbuf[n]==-1; n++);
-
- if(pbuf[f-1]==pbuf[n])
- {
- /* just a gap */
- while(f<n) pbuf[f++]=pbuf[n];
- }
- else
- {
- /* phase change, reanalyze the original data in the gap with zero
- threshold for only the two phases that appear at the ends */
-
- for(i=0; i<5; i++)
- for(sum[i]=0, j=5*f-15; j<5*f; j+=5)
- sum[i]+=buf[i+j];
-
- for(i=f; i<n; i++)
- {
- pbuf[i]=match(p, sum, pbuf[f-1], pbuf[n], 0);
-
- for(j=0; j<5; j++)
- sum[j]=sum[j]-buf[5*(i-3)+j]+buf[5*(i+4)+j];
- }
-
- /* estimate the transition point by dividing the gap
- in the same proportion as the number of matches of each kind */
-
- for(i=f, m=f; i<n; i++)
- if(pbuf[i]==pbuf[f-1]) m++;
-
- /* find the transition of the right direction nearest to the
- estimated point */
-
- if(m>f && m<n)
- {
- for(j=m; j>f; j--)
- if(pbuf[j-1]==pbuf[f-1] && pbuf[j]==pbuf[n]) break;
- for(s=m; s<n; s++)
- if(pbuf[s-1]==pbuf[f-1] && pbuf[s]==pbuf[n]) break;
-
- m=(s-m<m-j)?s:j;
- }
-
- /* and rewrite the data to allow only this one transition */
-
- for(i=f; i<m; i++)
- pbuf[i]=pbuf[f-1];
-
- for(; i<n; i++)
- pbuf[i]=pbuf[n];
-
- f=n;
- }
- }
-
- free(buf-15);
-
- return 1;
- }
-
-static int query_format(struct vf_instance *vf, unsigned int fmt)
- {
- switch(fmt)
- {
- case IMGFMT_444P: case IMGFMT_IYUV: case IMGFMT_RGB24:
- case IMGFMT_422P: case IMGFMT_UYVY: case IMGFMT_BGR24:
- case IMGFMT_411P: case IMGFMT_YUY2: case IMGFMT_IF09:
- case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_YVU9:
- case IMGFMT_IUYV: case IMGFMT_Y800: case IMGFMT_Y8:
- return ff_vf_next_query_format(vf,fmt);
- }
-
- return 0;
- }
-
-static void uninit(struct vf_instance *vf)
- {
- if(vf->priv)
- {
- if(vf->priv->file) fclose(vf->priv->file);
- if(vf->priv->csdata) free(vf->priv->csdata-15);
- free(vf->priv->bdata);
- free(vf->priv->history);
- free(vf->priv);
- }
- }
-
-static int vf_open(vf_instance_t *vf, char *args)
- {
- struct vf_priv_s *p;
- const char *filename="framediff.log";
- char *ap, *q, *a;
-
- if(args && !(args=strdup(args)))
- {
- nomem:
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL,
- "%s: Not enough memory.\n", vf->info->name);
- fail:
- uninit(vf);
- free(args);
- return 0;
- }
-
- vf->put_image=put_image;
- vf->uninit=uninit;
- vf->query_format=query_format;
- vf->default_reqs=VFCAP_ACCEPT_STRIDE;
- if(!(vf->priv=p=calloc(1, sizeof(struct vf_priv_s))))
- goto nomem;
-
- p->phase=5;
- p->threshold=0.5;
- p->window=30;
-
- if((ap=args))
- while(*ap)
- {
- q=ap;
- if((ap=strchr(q, ':'))) *ap++=0; else ap=q+strlen(q);
- if((a=strchr(q, '='))) *a++=0; else a=q+strlen(q);
-
- switch(*q)
- {
- case 0: break;
- case 'f': filename=a; break;
- case 't': p->threshold=atof(a); break;
- case 'w': p->window=5*(atoi(a)+4)/5; break;
- case 'd': p->deghost=atoi(a); break;
- case 'p':
- if(q[1]=='h') p->phase=atoi(a);
- else p->pass=atoi(a);
- break;
-
- case 'h':
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO,
- "\n%s options:\n\n"
- "pass=1|2 - Use 2-pass mode.\n"
- "file=filename - Set the 2-pass log file name "
- "(default %s).\n"
- "threshold=value - Set the pattern recognition "
- "sensitivity (default %g).\n"
- "deghost=value - Select deghosting threshold "
- "(default %d).\n"
- "window=numframes - Set the statistics window "
- "for 1-pass mode (default %d).\n"
- "phase=0|1|2|3|4 - Set the initial phase "
- "for 1-pass mode (default %d).\n\n"
- "The option names can be abbreviated to the shortest "
- "unique prefix.\n\n",
- vf->info->name, filename, p->threshold, p->deghost,
- p->window, p->phase%5);
- break;
-
- default:
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL,
- "%s: Unknown argument %s.\n", vf->info->name, q);
- goto fail;
- }
- }
-
- switch(p->pass)
- {
- case 1:
- if(!(p->file=fopen(filename, "w")))
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL,
- "%s: Can't create file %s.\n", vf->info->name, filename);
- goto fail;
- }
-
- break;
-
- case 2:
- if(!(p->file=fopen(filename, "r")))
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL,
- "%s: Can't open file %s.\n", vf->info->name, filename);
- goto fail;
- }
-
- if(!analyze(p))
- goto fail;
-
- fclose(p->file);
- p->file=0;
- break;
- }
-
- if(p->window<5) p->window=5;
- if(!(p->history=calloc(sizeof *p->history, p->window)))
- goto nomem;
-
- diff = diff_C;
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
- if(ff_gCpuCaps.hasMMX) diff = diff_MMX;
-#endif
-
- free(args);
- return 1;
- }
-
-const vf_info_t ff_vf_info_divtc =
- {
- "inverse telecine for deinterlaced video",
- "divtc",
- "Ville Saari",
- "",
- vf_open,
- NULL
- };
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_down3dright.c b/ffmpeg/libavfilter/libmpcodecs/vf_down3dright.c
deleted file mode 100644
index 5c95ce6..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_down3dright.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "cpudetect.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#include "libvo/fastmemcpy.h"
-
-struct vf_priv_s {
- int skipline;
- int scalew;
- int scaleh;
-};
-
-static void toright(unsigned char *dst[3], unsigned char *src[3],
- int dststride[3], int srcstride[3],
- int w, int h, struct vf_priv_s* p)
-{
- int k;
-
- for (k = 0; k < 3; k++) {
- unsigned char* fromL = src[k];
- unsigned char* fromR = src[k];
- unsigned char* to = dst[k];
- int src = srcstride[k];
- int dst = dststride[k];
- int ss;
- unsigned int dd;
- int i;
-
- if (k > 0) {
- i = h / 4 - p->skipline / 2;
- ss = src * (h / 4 + p->skipline / 2);
- dd = w / 4;
- } else {
- i = h / 2 - p->skipline;
- ss = src * (h / 2 + p->skipline);
- dd = w / 2;
- }
- fromR += ss;
- for ( ; i > 0; i--) {
- int j;
- unsigned char* t = to;
- unsigned char* sL = fromL;
- unsigned char* sR = fromR;
-
- if (p->scalew == 1) {
- for (j = dd; j > 0; j--) {
- *t++ = (sL[0] + sL[1]) / 2;
- sL+=2;
- }
- for (j = dd ; j > 0; j--) {
- *t++ = (sR[0] + sR[1]) / 2;
- sR+=2;
- }
- } else {
- for (j = dd * 2 ; j > 0; j--)
- *t++ = *sL++;
- for (j = dd * 2 ; j > 0; j--)
- *t++ = *sR++;
- }
- if (p->scaleh == 1) {
- fast_memcpy(to + dst, to, dst);
- to += dst;
- }
- to += dst;
- fromL += src;
- fromR += src;
- }
- //printf("K %d %d %d %d %d \n", k, w, h, src, dst);
- }
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- mp_image_t *dmpi;
-
- // hope we'll get DR buffer:
- dmpi=ff_vf_get_image(vf->next, IMGFMT_YV12,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
- ((vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0),
- mpi->w * vf->priv->scalew,
- mpi->h / vf->priv->scaleh - vf->priv->skipline);
-
- toright(dmpi->planes, mpi->planes, dmpi->stride,
- mpi->stride, mpi->w, mpi->h, vf->priv);
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- /* FIXME - also support UYVY output? */
- return ff_vf_next_config(vf, width * vf->priv->scalew,
- height / vf->priv->scaleh - vf->priv->skipline, d_width, d_height, flags, IMGFMT_YV12);
-}
-
-
-static int query_format(struct vf_instance *vf, unsigned int fmt)
-{
- /* FIXME - really any YUV 4:2:0 input format should work */
- switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return ff_vf_next_query_format(vf, IMGFMT_YV12);
- }
- return 0;
-}
-
-static void uninit(struct vf_instance *vf)
-{
- free(vf->priv);
-}
-
-static int vf_open(vf_instance_t *vf, char *args)
-{
- vf->config=config;
- vf->query_format=query_format;
- vf->put_image=put_image;
- vf->uninit=uninit;
-
- vf->priv = calloc(1, sizeof (struct vf_priv_s));
- vf->priv->skipline = 0;
- vf->priv->scalew = 1;
- vf->priv->scaleh = 2;
- if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_down3dright = {
- "convert stereo movie from top-bottom to left-right field",
- "down3dright",
- "Zdenek Kabelac",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_eq.c b/ffmpeg/libavfilter/libmpcodecs/vf_eq.c
index 4e256d9..c926c51 100644
--- a/ffmpeg/libavfilter/libmpcodecs/vf_eq.c
+++ b/ffmpeg/libavfilter/libmpcodecs/vf_eq.c
@@ -31,7 +31,7 @@
#include "libvo/video_out.h"
-static struct vf_priv_s {
+struct vf_priv_s {
unsigned char *buf;
int brightness;
int contrast;
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_fil.c b/ffmpeg/libavfilter/libmpcodecs/vf_fil.c
deleted file mode 100644
index 80c6648..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_fil.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "mp_image.h"
-#include "vf.h"
-
-struct vf_priv_s {
- int interleave;
- int height;
- int width;
- int stridefactor;
-};
-
-//===========================================================================//
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
- int pixel_stride= (width+15)&~15; //FIXME this is ust a guess ... especially for non planar its somewhat bad one
-
-#if 0
- if(mpi->flags&MP_IMGFLAG_PLANAR)
- pixel_stride= mpi->stride[0];
- else
- pixel_stride= 8*mpi->stride[0] / mpi->bpp;
-
-#endif
-
- if(vf->priv->interleave){
- vf->priv->height= 2*height;
- vf->priv->width= width - (pixel_stride/2);
- vf->priv->stridefactor=1;
- }else{
- vf->priv->height= height/2;
- vf->priv->width= width + pixel_stride;
- vf->priv->stridefactor=4;
- }
-//printf("hX %d %d %d\n", vf->priv->width,vf->priv->height,vf->priv->stridefactor);
-
- return ff_vf_next_config(vf, vf->priv->width, vf->priv->height,
- (d_width*vf->priv->stridefactor)>>1, 2*d_height/vf->priv->stridefactor, flags, outfmt);
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- if(mpi->flags&MP_IMGFLAG_DIRECT){
- // we've used DR, so we're ready...
- return ff_vf_next_put_image(vf,(mp_image_t*)mpi->priv, pts);
- }
-
- vf->dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
- vf->priv->width, vf->priv->height);
-
- // set up mpi as a double-stride image of dmpi:
- vf->dmpi->planes[0]=mpi->planes[0];
- vf->dmpi->stride[0]=(mpi->stride[0]*vf->priv->stridefactor)>>1;
- if(vf->dmpi->flags&MP_IMGFLAG_PLANAR){
- vf->dmpi->planes[1]=mpi->planes[1];
- vf->dmpi->stride[1]=(mpi->stride[1]*vf->priv->stridefactor)>>1;
- vf->dmpi->planes[2]=mpi->planes[2];
- vf->dmpi->stride[2]=(mpi->stride[2]*vf->priv->stridefactor)>>1;
- } else
- vf->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!!
-
- return ff_vf_next_put_image(vf,vf->dmpi, pts);
-}
-
-//===========================================================================//
-
-static void uninit(struct vf_instance *vf)
-{
- free(vf->priv);
-}
-
-static int vf_open(vf_instance_t *vf, char *args){
- vf->config=config;
- vf->put_image=put_image;
- vf->uninit=uninit;
- vf->default_reqs=VFCAP_ACCEPT_STRIDE;
- vf->priv=calloc(1, sizeof(struct vf_priv_s));
- vf->priv->interleave= args && (*args == 'i');
- return 1;
-}
-
-const vf_info_t ff_vf_info_fil = {
- "fast (de)interleaver",
- "fil",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
-
-//===========================================================================//
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_filmdint.c b/ffmpeg/libavfilter/libmpcodecs/vf_filmdint.c
deleted file mode 100644
index 93354e2..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_filmdint.c
+++ /dev/null
@@ -1,1461 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "cpudetect.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vd.h"
-#include "vf.h"
-#include "cmmx.h"
-#include "libavutil/x86/asm.h"
-#include "libvo/fastmemcpy.h"
-
-#define NUM_STORED 4
-
-enum pu_field_type_t {
- PU_1ST_OF_3,
- PU_2ND_OF_3,
- PU_3RD_OF_3,
- PU_1ST_OF_2,
- PU_2ND_OF_2,
- PU_INTERLACED
-};
-
-struct metrics {
- /* This struct maps to a packed word 64-bit MMX register */
- unsigned short int even;
- unsigned short int odd;
- unsigned short int noise;
- unsigned short int temp;
-} __attribute__ ((aligned (8)));
-
-struct frame_stats {
- struct metrics tiny, low, high, bigger, twox, max;
- struct { unsigned int even, odd, noise, temp; } sad;
- unsigned short interlaced_high;
- unsigned short interlaced_low;
- unsigned short num_blocks;
-};
-
-struct vf_priv_s {
- unsigned long inframes;
- unsigned long outframes;
- enum pu_field_type_t prev_type;
- unsigned swapped, chroma_swapped;
- unsigned luma_only;
- unsigned verbose;
- unsigned fast;
- unsigned long w, h, cw, ch, stride, chroma_stride, nplanes;
- unsigned long sad_thres;
- unsigned long dint_thres;
- unsigned char *memory_allocated;
- unsigned char *planes[2*NUM_STORED][4];
- unsigned char **old_planes;
- unsigned long static_idx;
- unsigned long temp_idx;
- unsigned long crop_x, crop_y, crop_cx, crop_cy;
- unsigned long export_count, merge_count;
- unsigned long num_breaks;
- unsigned long num_copies;
- long in_inc, out_dec, iosync;
- long num_fields;
- long prev_fields;
- long notout;
- long mmx2;
- unsigned small_bytes[2];
- unsigned mmx_temp[2];
- struct frame_stats stats[2];
- struct metrics thres;
- char chflag;
- double diff_time, merge_time, decode_time, vo_time, filter_time;
-};
-
-#define PPZ { 2000, 2000, 0, 2000 }
-#define PPR { 2000, 2000, 0, 2000 }
-static const struct frame_stats ppzs = {PPZ,PPZ,PPZ,PPZ,PPZ,PPZ,PPZ,0,0,9999};
-static const struct frame_stats pprs = {PPR,PPR,PPR,PPR,PPR,PPR,PPR,0,0,9999};
-
-#ifndef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-#define PDIFFUB(X,Y,T) "movq " #X "," #T "\n\t" \
- "psubusb " #Y "," #T "\n\t" \
- "psubusb " #X "," #Y "\n\t" \
- "paddusb " #Y "," #T "\n\t"
-
-#define PDIFFUBT(X,Y,T) "movq " #X "," #T "\n\t" \
- "psubusb " #Y "," #T "\n\t" \
- "psubusb " #X "," #Y "\n\t" \
- "paddusb " #T "," #Y "\n\t"
-
-#define PSUMBW(X,T,Z) "movq " #X "," #T "\n\t" \
- "punpcklbw " #Z "," #X "\n\t" \
- "punpckhbw " #Z "," #T "\n\t" \
- "paddw " #T "," #X "\n\t" \
- "movq " #X "," #T "\n\t" \
- "psllq $32, " #T "\n\t" \
- "paddw " #T "," #X "\n\t" \
- "movq " #X "," #T "\n\t" \
- "psllq $16, " #T "\n\t" \
- "paddw " #T "," #X "\n\t" \
- "psrlq $48, " #X "\n\t"
-
-#define PSADBW(X,Y,T,Z) PDIFFUBT(X,Y,T) PSUMBW(Y,T,Z)
-
-#define PMAXUB(X,Y) "psubusb " #X "," #Y "\n\tpaddusb " #X "," #Y "\n\t"
-#define PMAXUW(X,Y) "psubusw " #X "," #Y "\n\tpaddusw " #X "," #Y "\n\t"
-#define PMINUBT(X,Y,T) "movq " #Y "," #T "\n\t" \
- "psubusb " #X "," #T "\n\t" \
- "psubusb " #T "," #Y "\n\t"
-#define PAVGB(X,Y) "pavgusb " #X "," #Y "\n\t"
-
-static inline void
-get_metrics_c(unsigned char *a, unsigned char *b, int as, int bs, int lines,
- struct metrics *m)
-{
- a -= as;
- b -= bs;
- do {
- cmmx_t old_po = *(cmmx_t*)(a );
- cmmx_t po = *(cmmx_t*)(b );
- cmmx_t e = *(cmmx_t*)(b + bs);
- cmmx_t old_o = *(cmmx_t*)(a + 2*as);
- cmmx_t o = *(cmmx_t*)(b + 2*bs);
- cmmx_t ne = *(cmmx_t*)(b + 3*bs);
- cmmx_t old_no = *(cmmx_t*)(a + 4*as);
- cmmx_t no = *(cmmx_t*)(b + 4*bs);
-
- cmmx_t qup_old_odd = p31avgb(old_o, old_po);
- cmmx_t qup_odd = p31avgb( o, po);
- cmmx_t qdown_old_odd = p31avgb(old_o, old_no);
- cmmx_t qdown_odd = p31avgb( o, no);
-
- cmmx_t qup_even = p31avgb(ne, e);
- cmmx_t qdown_even = p31avgb(e, ne);
-
- cmmx_t temp_up_diff = pdiffub(qdown_even, qup_old_odd);
- cmmx_t noise_up_diff = pdiffub(qdown_even, qup_odd);
- cmmx_t temp_down_diff = pdiffub(qup_even, qdown_old_odd);
- cmmx_t noise_down_diff = pdiffub(qup_even, qdown_odd);
-
- cmmx_t odd_diff = pdiffub(o, old_o);
- m->odd += psumbw(odd_diff);
- m->even += psadbw(e, *(cmmx_t*)(a+as));
-
- temp_up_diff = pminub(temp_up_diff, temp_down_diff);
- temp_up_diff = pminub(temp_up_diff, odd_diff);
- m->temp += psumbw(temp_up_diff);
- noise_up_diff = pminub(noise_up_diff, odd_diff);
- noise_up_diff = pminub(noise_up_diff, noise_down_diff);
-
- m->noise += psumbw(noise_up_diff);
- a += 2*as;
- b += 2*bs;
- } while (--lines);
-}
-
-static inline void
-get_metrics_fast_c(unsigned char *a, unsigned char *b, int as, int bs,
- int lines, struct metrics *m)
-{
- a -= as;
- b -= bs;
- do {
- cmmx_t old_po = (*(cmmx_t*)(a ) >> 1) & ~SIGN_BITS;
- cmmx_t po = (*(cmmx_t*)(b ) >> 1) & ~SIGN_BITS;
- cmmx_t old_e = (*(cmmx_t*)(a + as) >> 1) & ~SIGN_BITS;
- cmmx_t e = (*(cmmx_t*)(b + bs) >> 1) & ~SIGN_BITS;
- cmmx_t old_o = (*(cmmx_t*)(a + 2*as) >> 1) & ~SIGN_BITS;
- cmmx_t o = (*(cmmx_t*)(b + 2*bs) >> 1) & ~SIGN_BITS;
- cmmx_t ne = (*(cmmx_t*)(b + 3*bs) >> 1) & ~SIGN_BITS;
- cmmx_t old_no = (*(cmmx_t*)(a + 4*as) >> 1) & ~SIGN_BITS;
- cmmx_t no = (*(cmmx_t*)(b + 4*bs) >> 1) & ~SIGN_BITS;
-
- cmmx_t qup_old_odd = p31avgb_s(old_o, old_po);
- cmmx_t qup_odd = p31avgb_s( o, po);
- cmmx_t qdown_old_odd = p31avgb_s(old_o, old_no);
- cmmx_t qdown_odd = p31avgb_s( o, no);
-
- cmmx_t qup_even = p31avgb_s(ne, e);
- cmmx_t qdown_even = p31avgb_s(e, ne);
-
- cmmx_t temp_up_diff = pdiffub_s(qdown_even, qup_old_odd);
- cmmx_t noise_up_diff = pdiffub_s(qdown_even, qup_odd);
- cmmx_t temp_down_diff = pdiffub_s(qup_even, qdown_old_odd);
- cmmx_t noise_down_diff = pdiffub_s(qup_even, qdown_odd);
-
- cmmx_t odd_diff = pdiffub_s(o, old_o);
- m->odd += psumbw_s(odd_diff) << 1;
- m->even += psadbw_s(e, old_e) << 1;
-
- temp_up_diff = pminub_s(temp_up_diff, temp_down_diff);
- temp_up_diff = pminub_s(temp_up_diff, odd_diff);
- m->temp += psumbw_s(temp_up_diff) << 1;
- noise_up_diff = pminub_s(noise_up_diff, odd_diff);
- noise_up_diff = pminub_s(noise_up_diff, noise_down_diff);
-
- m->noise += psumbw_s(noise_up_diff) << 1;
- a += 2*as;
- b += 2*bs;
- } while (--lines);
-}
-
-static inline void
-get_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs,
- int lines, struct metrics *m)
-{
- a -= as;
- b -= bs;
- do {
- cmmx_t old_po = (*(cmmx_t*)(a )>>1) & ~SIGN_BITS;
- cmmx_t po = (*(cmmx_t*)(b )>>1) & ~SIGN_BITS;
- cmmx_t old_e = (*(cmmx_t*)(a + as)>>1) & ~SIGN_BITS;
- cmmx_t e = (*(cmmx_t*)(b + bs)>>1) & ~SIGN_BITS;
- cmmx_t old_o = (*(cmmx_t*)(a + 2*as)>>1) & ~SIGN_BITS;
- cmmx_t o = (*(cmmx_t*)(b + 2*bs)>>1) & ~SIGN_BITS;
- cmmx_t ne = (*(cmmx_t*)(b + 3*bs)>>1) & ~SIGN_BITS;
-
- cmmx_t down_even = p31avgb_s(e, ne);
- cmmx_t up_odd = p31avgb_s(o, po);
- cmmx_t up_old_odd = p31avgb_s(old_o, old_po);
-
- cmmx_t odd_diff = pdiffub_s(o, old_o);
- cmmx_t temp_diff = pdiffub_s(down_even, up_old_odd);
- cmmx_t noise_diff = pdiffub_s(down_even, up_odd);
-
- m->even += psadbw_s(e, old_e) << 1;
- m->odd += psumbw_s(odd_diff) << 1;
-
- temp_diff = pminub_s(temp_diff, odd_diff);
- noise_diff = pminub_s(noise_diff, odd_diff);
-
- m->noise += psumbw_s(noise_diff) << 1;
- m->temp += psumbw_s(temp_diff) << 1;
- a += 2*as;
- b += 2*bs;
- } while (--lines);
-
-}
-
-static inline void
-get_block_stats(struct metrics *m, struct vf_priv_s *p, struct frame_stats *s)
-{
- unsigned two_e = m->even + MAX(m->even , p->thres.even );
- unsigned two_o = m->odd + MAX(m->odd , p->thres.odd );
- unsigned two_n = m->noise + MAX(m->noise, p->thres.noise);
- unsigned two_t = m->temp + MAX(m->temp , p->thres.temp );
-
- unsigned e_big = m->even >= (m->odd + two_o + 1)/2;
- unsigned o_big = m->odd >= (m->even + two_e + 1)/2;
- unsigned n_big = m->noise >= (m->temp + two_t + 1)/2;
- unsigned t_big = m->temp >= (m->noise + two_n + 1)/2;
-
- unsigned e2x = m->even >= two_o;
- unsigned o2x = m->odd >= two_e;
- unsigned n2x = m->noise >= two_t;
- unsigned t2x = m->temp >= two_n;
-
- unsigned ntiny_e = m->even > p->thres.even ;
- unsigned ntiny_o = m->odd > p->thres.odd ;
- unsigned ntiny_n = m->noise > p->thres.noise;
- unsigned ntiny_t = m->temp > p->thres.temp ;
-
- unsigned nlow_e = m->even > 2*p->thres.even ;
- unsigned nlow_o = m->odd > 2*p->thres.odd ;
- unsigned nlow_n = m->noise > 2*p->thres.noise;
- unsigned nlow_t = m->temp > 2*p->thres.temp ;
-
- unsigned high_e = m->even > 4*p->thres.even ;
- unsigned high_o = m->odd > 4*p->thres.odd ;
- unsigned high_n = m->noise > 4*p->thres.noise;
- unsigned high_t = m->temp > 4*p->thres.temp ;
-
- unsigned low_il = !n_big && !t_big && ntiny_n && ntiny_t;
- unsigned high_il = !n_big && !t_big && nlow_n && nlow_t;
-
- if (low_il | high_il) {
- s->interlaced_low += low_il;
- s->interlaced_high += high_il;
- } else {
- s->tiny.even += ntiny_e;
- s->tiny.odd += ntiny_o;
- s->tiny.noise += ntiny_n;
- s->tiny.temp += ntiny_t;
-
- s->low .even += nlow_e ;
- s->low .odd += nlow_o ;
- s->low .noise += nlow_n ;
- s->low .temp += nlow_t ;
-
- s->high.even += high_e ;
- s->high.odd += high_o ;
- s->high.noise += high_n ;
- s->high.temp += high_t ;
-
- if (m->even >= p->sad_thres) s->sad.even += m->even ;
- if (m->odd >= p->sad_thres) s->sad.odd += m->odd ;
- if (m->noise >= p->sad_thres) s->sad.noise += m->noise;
- if (m->temp >= p->sad_thres) s->sad.temp += m->temp ;
- }
- s->num_blocks++;
- s->max.even = MAX(s->max.even , m->even );
- s->max.odd = MAX(s->max.odd , m->odd );
- s->max.noise = MAX(s->max.noise, m->noise);
- s->max.temp = MAX(s->max.temp , m->temp );
-
- s->bigger.even += e_big ;
- s->bigger.odd += o_big ;
- s->bigger.noise += n_big ;
- s->bigger.temp += t_big ;
-
- s->twox.even += e2x ;
- s->twox.odd += o2x ;
- s->twox.noise += n2x ;
- s->twox.temp += t2x ;
-
-}
-
-static inline struct metrics
-block_metrics_c(unsigned char *a, unsigned char *b, int as, int bs,
- int lines, struct vf_priv_s *p, struct frame_stats *s)
-{
- struct metrics tm;
- tm.even = tm.odd = tm.noise = tm.temp = 0;
- get_metrics_c(a, b, as, bs, lines, &tm);
- if (sizeof(cmmx_t) < 8)
- get_metrics_c(a+4, b+4, as, bs, lines, &tm);
- get_block_stats(&tm, p, s);
- return tm;
-}
-
-static inline struct metrics
-block_metrics_fast_c(unsigned char *a, unsigned char *b, int as, int bs,
- int lines, struct vf_priv_s *p, struct frame_stats *s)
-{
- struct metrics tm;
- tm.even = tm.odd = tm.noise = tm.temp = 0;
- get_metrics_fast_c(a, b, as, bs, lines, &tm);
- if (sizeof(cmmx_t) < 8)
- get_metrics_fast_c(a+4, b+4, as, bs, lines, &tm);
- get_block_stats(&tm, p, s);
- return tm;
-}
-
-static inline struct metrics
-block_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs,
- int lines, struct vf_priv_s *p, struct frame_stats *s)
-{
- struct metrics tm;
- tm.even = tm.odd = tm.noise = tm.temp = 0;
- get_metrics_faster_c(a, b, as, bs, lines, &tm);
- if (sizeof(cmmx_t) < 8)
- get_metrics_faster_c(a+4, b+4, as, bs, lines, &tm);
- get_block_stats(&tm, p, s);
- return tm;
-}
-
-#define MEQ(X,Y) ((X).even == (Y).even && (X).odd == (Y).odd && (X).temp == (Y).temp && (X).noise == (Y).noise)
-
-#define BLOCK_METRICS_TEMPLATE() \
- __asm__ volatile("pxor %mm7, %mm7\n\t" /* The result is colleted in mm7 */ \
- "pxor %mm6, %mm6\n\t" /* Temp to stay at 0 */ \
- ); \
- a -= as; \
- b -= bs; \
- do { \
- __asm__ volatile( \
- "movq (%0,%2), %%mm0\n\t" \
- "movq (%1,%3), %%mm1\n\t" /* mm1 = even */ \
- PSADBW(%%mm1, %%mm0, %%mm4, %%mm6) \
- "paddusw %%mm0, %%mm7\n\t" /* even diff */ \
- "movq (%0,%2,2), %%mm0\n\t" /* mm0 = old odd */ \
- "movq (%1,%3,2), %%mm2\n\t" /* mm2 = odd */ \
- "movq (%0), %%mm3\n\t" \
- "psubusb %4, %%mm3\n\t" \
- PAVGB(%%mm0, %%mm3) \
- PAVGB(%%mm0, %%mm3) /* mm3 = qup old odd */ \
- "movq %%mm0, %%mm5\n\t" \
- PSADBW(%%mm2, %%mm0, %%mm4, %%mm6) \
- "psllq $16, %%mm0\n\t" \
- "paddusw %%mm0, %%mm7\n\t" \
- "movq (%1), %%mm4\n\t" \
- "lea (%0,%2,2), %0\n\t" \
- "lea (%1,%3,2), %1\n\t" \
- "psubusb %4, %%mm4\n\t" \
- PAVGB(%%mm2, %%mm4) \
- PAVGB(%%mm2, %%mm4) /* mm4 = qup odd */ \
- PDIFFUBT(%%mm5, %%mm2, %%mm0) /* mm2 =abs(oldodd-odd) */ \
- "movq (%1,%3), %%mm5\n\t" \
- "psubusb %4, %%mm5\n\t" \
- PAVGB(%%mm1, %%mm5) \
- PAVGB(%%mm5, %%mm1) /* mm1 = qdown even */ \
- PAVGB((%1,%3), %%mm5) /* mm5 = qup next even */ \
- PDIFFUBT(%%mm1, %%mm3, %%mm0) /* mm3 = abs(qupoldo-qde) */ \
- PDIFFUBT(%%mm1, %%mm4, %%mm0) /* mm4 = abs(qupodd-qde) */ \
- PMINUBT(%%mm2, %%mm3, %%mm0) /* limit temp to odd diff */ \
- PMINUBT(%%mm2, %%mm4, %%mm0) /* limit noise to odd diff */ \
- "movq (%1,%3,2), %%mm2\n\t" \
- "psubusb %4, %%mm2\n\t" \
- PAVGB((%1), %%mm2) \
- PAVGB((%1), %%mm2) /* mm2 = qdown odd */ \
- "movq (%0,%2,2), %%mm1\n\t" \
- "psubusb %4, %%mm1\n\t" \
- PAVGB((%0), %%mm1) \
- PAVGB((%0), %%mm1) /* mm1 = qdown old odd */ \
- PDIFFUBT(%%mm5, %%mm2, %%mm0) /* mm2 = abs(qdo-qune) */ \
- PDIFFUBT(%%mm5, %%mm1, %%mm0) /* mm1 = abs(qdoo-qune) */ \
- PMINUBT(%%mm4, %%mm2, %%mm0) /* current */ \
- PMINUBT(%%mm3, %%mm1, %%mm0) /* old */ \
- PSUMBW(%%mm2, %%mm0, %%mm6) \
- PSUMBW(%%mm1, %%mm0, %%mm6) \
- "psllq $32, %%mm2\n\t" \
- "psllq $48, %%mm1\n\t" \
- "paddusw %%mm2, %%mm7\n\t" \
- "paddusw %%mm1, %%mm7\n\t" \
- : "=r" (a), "=r" (b) \
- : "r"((x86_reg)as), "r"((x86_reg)bs), "m" (ones), "0"(a), "1"(b), "X"(*a), "X"(*b) \
- ); \
- } while (--lines);
-
-static inline struct metrics
-block_metrics_3dnow(unsigned char *a, unsigned char *b, int as, int bs,
- int lines, struct vf_priv_s *p, struct frame_stats *s)
-{
- struct metrics tm;
-#if !HAVE_AMD3DNOW
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_3dnow: internal error\n");
-#else
- static const unsigned long long ones = 0x0101010101010101ull;
-
- BLOCK_METRICS_TEMPLATE();
- __asm__ volatile("movq %%mm7, %0\n\temms" : "=m" (tm));
- get_block_stats(&tm, p, s);
-#endif
- return tm;
-}
-
-#undef PSUMBW
-#undef PSADBW
-#undef PMAXUB
-#undef PMINUBT
-#undef PAVGB
-
-#define PSUMBW(X,T,Z) "psadbw " #Z "," #X "\n\t"
-#define PSADBW(X,Y,T,Z) "psadbw " #X "," #Y "\n\t"
-#define PMAXUB(X,Y) "pmaxub " #X "," #Y "\n\t"
-#define PMINUBT(X,Y,T) "pminub " #X "," #Y "\n\t"
-#define PAVGB(X,Y) "pavgb " #X "," #Y "\n\t"
-
-static inline struct metrics
-block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
- int lines, struct vf_priv_s *p, struct frame_stats *s)
-{
- struct metrics tm;
-#if !HAVE_MMX
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_mmx2: internal error\n");
-#else
- static const unsigned long long ones = 0x0101010101010101ull;
- x86_reg interlaced;
- x86_reg prefetch_line = (((long)a>>3) & 7) + 10;
-#ifdef DEBUG
- struct frame_stats ts = *s;
-#endif
- __asm__ volatile("prefetcht0 (%0,%2)\n\t"
- "prefetcht0 (%1,%3)\n\t" :
- : "r" (a), "r" (b),
- "r" (prefetch_line * as), "r" (prefetch_line * bs));
-
- BLOCK_METRICS_TEMPLATE();
-
- s->num_blocks++;
- __asm__ volatile(
- "movq %3, %%mm0\n\t"
- "movq %%mm7, %%mm1\n\t"
- "psubusw %%mm0, %%mm1\n\t"
- "movq %%mm1, %%mm2\n\t"
- "paddusw %%mm0, %%mm2\n\t"
- "paddusw %%mm7, %%mm2\n\t"
- "pshufw $0xb1, %%mm2, %%mm3\n\t"
- "pavgw %%mm7, %%mm2\n\t"
- "pshufw $0xb1, %%mm2, %%mm2\n\t"
- "psubusw %%mm7, %%mm2\n\t"
- "pcmpeqw %%mm6, %%mm2\n\t" /* 1 if >= 1.5x */
- "psubusw %%mm7, %%mm3\n\t"
- "pcmpeqw %%mm6, %%mm3\n\t" /* 1 if >= 2x */
- "movq %1, %%mm4\n\t"
- "movq %2, %%mm5\n\t"
- "psubw %%mm2, %%mm4\n\t"
- "psubw %%mm3, %%mm5\n\t"
- "movq %%mm4, %1\n\t"
- "movq %%mm5, %2\n\t"
- "pxor %%mm4, %%mm4\n\t"
- "pcmpeqw %%mm1, %%mm4\n\t" /* 1 if <= t */
- "psubusw %%mm0, %%mm1\n\t"
- "pxor %%mm5, %%mm5\n\t"
- "pcmpeqw %%mm1, %%mm5\n\t" /* 1 if <= 2t */
- "psubusw %%mm0, %%mm1\n\t"
- "psubusw %%mm0, %%mm1\n\t"
- "pcmpeqw %%mm6, %%mm1\n\t" /* 1 if <= 4t */
- "pshufw $0xb1, %%mm2, %%mm0\n\t"
- "por %%mm2, %%mm0\n\t" /* 1 if not close */
- "punpckhdq %%mm0, %%mm0\n\t"
- "movq %%mm4, %%mm2\n\t" /* tttt */
- "punpckhdq %%mm5, %%mm2\n\t" /* ttll */
- "por %%mm2, %%mm0\n\t"
- "pcmpeqd %%mm6, %%mm0\n\t" /* close && big */
- "psrlq $16, %%mm0\n\t"
- "psrlw $15, %%mm0\n\t"
- "movd %%mm0, %0\n\t"
- : "=r" (interlaced), "=m" (s->bigger), "=m" (s->twox)
- : "m" (p->thres)
- );
-
- if (interlaced) {
- s->interlaced_high += interlaced >> 16;
- s->interlaced_low += interlaced;
- } else {
- __asm__ volatile(
- "pcmpeqw %%mm0, %%mm0\n\t" /* -1 */
- "psubw %%mm0, %%mm4\n\t"
- "psubw %%mm0, %%mm5\n\t"
- "psubw %%mm0, %%mm1\n\t"
- "paddw %0, %%mm4\n\t"
- "paddw %1, %%mm5\n\t"
- "paddw %2, %%mm1\n\t"
- "movq %%mm4, %0\n\t"
- "movq %%mm5, %1\n\t"
- "movq %%mm1, %2\n\t"
- : "=m" (s->tiny), "=m" (s->low), "=m" (s->high)
- );
-
- __asm__ volatile(
- "pshufw $0, %2, %%mm0\n\t"
- "psubusw %%mm7, %%mm0\n\t"
- "pcmpeqw %%mm6, %%mm0\n\t" /* 0 if below sad_thres */
- "pand %%mm7, %%mm0\n\t"
- "movq %%mm0, %%mm1\n\t"
- "punpcklwd %%mm6, %%mm0\n\t" /* sad even, odd */
- "punpckhwd %%mm6, %%mm1\n\t" /* sad noise, temp */
- "paddd %0, %%mm0\n\t"
- "paddd %1, %%mm1\n\t"
- "movq %%mm0, %0\n\t"
- "movq %%mm1, %1\n\t"
- : "=m" (s->sad.even), "=m" (s->sad.noise)
- : "m" (p->sad_thres)
- );
- }
-
- __asm__ volatile(
- "movq %%mm7, (%1)\n\t"
- PMAXUW((%0), %%mm7)
- "movq %%mm7, (%0)\n\t"
- "emms"
- : : "r" (&s->max), "r" (&tm), "X" (s->max)
- : "memory"
- );
-#ifdef DEBUG
- if (1) {
- struct metrics cm;
- a -= 7*as;
- b -= 7*bs;
- cm = block_metrics_c(a, b, as, bs, 4, p, &ts);
- if (!MEQ(tm, cm))
- ff_mp_msg(MSGT_VFILTER, MSGL_WARN, "Bad metrics\n");
- if (s) {
-# define CHECK(X) if (!MEQ(s->X, ts.X)) \
- ff_mp_msg(MSGT_VFILTER, MSGL_WARN, "Bad " #X "\n");
- CHECK(tiny);
- CHECK(low);
- CHECK(high);
- CHECK(sad);
- CHECK(max);
- }
- }
-#endif
-#endif
- return tm;
-}
-
-static inline int
-dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
- long cos, int ds, int ss, int w, int t)
-{
-#if !HAVE_MMX
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL, "dint_copy_line_mmx2: internal error\n");
- return 0;
-#else
- unsigned long len = (w+7) >> 3;
- int ret;
- __asm__ volatile (
- "pxor %%mm6, %%mm6 \n\t" /* deinterlaced pixel counter */
- "movd %0, %%mm7 \n\t"
- "punpcklbw %%mm7, %%mm7 \n\t"
- "punpcklwd %%mm7, %%mm7 \n\t"
- "punpckldq %%mm7, %%mm7 \n\t" /* mm7 = threshold */
- : /* no output */
- : "rm" (t)
- );
- do {
- __asm__ volatile (
- "movq (%0), %%mm0\n\t"
- "movq (%0,%3,2), %%mm1\n\t"
- "movq %%mm0, (%2)\n\t"
- "pmaxub %%mm1, %%mm0\n\t"
- "pavgb (%0), %%mm1\n\t"
- "psubusb %%mm1, %%mm0\n\t"
- "paddusb %%mm7, %%mm0\n\t" /* mm0 = max-avg+thr */
- "movq (%0,%1), %%mm2\n\t"
- "movq (%0,%5), %%mm3\n\t"
- "movq %%mm2, %%mm4\n\t"
- PDIFFUBT(%%mm1, %%mm2, %%mm5)
- PDIFFUBT(%%mm1, %%mm3, %%mm5)
- "pminub %%mm2, %%mm3\n\t"
- "pcmpeqb %%mm3, %%mm2\n\t" /* b = min */
- "pand %%mm2, %%mm4\n\t"
- "pandn (%0,%5), %%mm2\n\t"
- "por %%mm4, %%mm2\n\t"
- "pminub %%mm0, %%mm3\n\t"
- "pcmpeqb %%mm0, %%mm3\n\t" /* set to 1s if >= threshold */
- "psubb %%mm3, %%mm6\n\t" /* count pixels above thr. */
- "pand %%mm3, %%mm1 \n\t"
- "pandn %%mm2, %%mm3 \n\t"
- "por %%mm3, %%mm1 \n\t" /* avg if >= threshold */
- "movq %%mm1, (%2,%4) \n\t"
- : /* no output */
- : "r" (a), "r" ((x86_reg)bos), "r" ((x86_reg)dst), "r" ((x86_reg)ss), "r" ((x86_reg)ds), "r" ((x86_reg)cos)
- );
- a += 8;
- dst += 8;
- } while (--len);
-
- __asm__ volatile ("pxor %%mm7, %%mm7 \n\t"
- "psadbw %%mm6, %%mm7 \n\t"
- "movd %%mm7, %0 \n\t"
- "emms \n\t"
- : "=r" (ret)
- );
- return ret;
-#endif
-}
-
-static inline int
-dint_copy_line(unsigned char *dst, unsigned char *a, long bos,
- long cos, int ds, int ss, int w, int t)
-{
- unsigned long len = ((unsigned long)w+sizeof(cmmx_t)-1) / sizeof(cmmx_t);
- cmmx_t dint_count = 0;
- cmmx_t thr;
- t |= t << 8;
- thr = t | (t << 16);
- if (sizeof(cmmx_t) > 4)
- thr |= thr << (sizeof(cmmx_t)*4);
- do {
- cmmx_t e = *(cmmx_t*)a;
- cmmx_t ne = *(cmmx_t*)(a+2*ss);
- cmmx_t o = *(cmmx_t*)(a+bos);
- cmmx_t oo = *(cmmx_t*)(a+cos);
- cmmx_t maxe = pmaxub(e, ne);
- cmmx_t avge = pavgb(e, ne);
- cmmx_t max_diff = maxe - avge + thr; /* 0<=max-avg<128, thr<128 */
- cmmx_t diffo = pdiffub(avge, o);
- cmmx_t diffoo = pdiffub(avge, oo);
- cmmx_t diffcmp = pcmpgtub(diffo, diffoo);
- cmmx_t bo = ((oo ^ o) & diffcmp) ^ o;
- cmmx_t diffbo = ((diffoo ^ diffo) & diffcmp) ^ diffo;
- cmmx_t above_thr = ~pcmpgtub(max_diff, diffbo);
- cmmx_t bo_or_avg = ((avge ^ bo) & above_thr) ^ bo;
- dint_count += above_thr & ONE_BYTES;
- *(cmmx_t*)(dst) = e;
- *(cmmx_t*)(dst+ds) = bo_or_avg;
- a += sizeof(cmmx_t);
- dst += sizeof(cmmx_t);
- } while (--len);
- return psumbw(dint_count);
-}
-
-static int
-dint_copy_plane(unsigned char *d, unsigned char *a, unsigned char *b,
- unsigned char *c, unsigned long w, unsigned long h,
- unsigned long ds, unsigned long ss, unsigned long threshold,
- long field, long mmx2)
-{
- unsigned long ret = 0;
- long bos = b - a;
- long cos = c - a;
- if (field) {
- fast_memcpy(d, b, w);
- h--;
- d += ds;
- a += ss;
- }
- bos += ss;
- cos += ss;
- while (h > 2) {
- if (threshold >= 128) {
- fast_memcpy(d, a, w);
- fast_memcpy(d+ds, a+bos, w);
- } else if (mmx2 == 1) {
- ret += dint_copy_line_mmx2(d, a, bos, cos, ds, ss, w, threshold);
- } else
- ret += dint_copy_line(d, a, bos, cos, ds, ss, w, threshold);
- h -= 2;
- d += 2*ds;
- a += 2*ss;
- }
- fast_memcpy(d, a, w);
- if (h == 2)
- fast_memcpy(d+ds, a+bos, w);
- return ret;
-}
-
-static void
-copy_merge_fields(struct vf_priv_s *p, mp_image_t *dmpi,
- unsigned char **old, unsigned char **new, unsigned long show)
-{
- unsigned long threshold = 256;
- unsigned long field = p->swapped;
- unsigned long dint_pixels = 0;
- unsigned char **other = old;
- if (show >= 12 || !(show & 3))
- show >>= 2, other = new, new = old;
- if (show <= 2) { /* Single field: de-interlace */
- threshold = p->dint_thres;
- field ^= show & 1;
- old = new;
- } else if (show == 3)
- old = new;
- else
- field ^= 1;
- dint_pixels +=dint_copy_plane(dmpi->planes[0], old[0], new[0],
- other[0], p->w, p->h, dmpi->stride[0],
- p->stride, threshold, field, p->mmx2);
- if (dmpi->flags & MP_IMGFLAG_PLANAR) {
- if (p->luma_only)
- old = new, other = new;
- else
- threshold = threshold/2 + 1;
- field ^= p->chroma_swapped;
- dint_copy_plane(dmpi->planes[1], old[1], new[1],
- other[1], p->cw, p->ch, dmpi->stride[1],
- p->chroma_stride, threshold, field, p->mmx2);
- dint_copy_plane(dmpi->planes[2], old[2], new[2],
- other[2], p->cw, p->ch, dmpi->stride[2],
- p->chroma_stride, threshold, field, p->mmx2);
- }
- if (dint_pixels > 0 && p->verbose)
- ff_mp_msg(MSGT_VFILTER,MSGL_INFO,"Deinterlaced %lu pixels\n",dint_pixels);
-}
-
-static void diff_planes(struct vf_priv_s *p, struct frame_stats *s,
- unsigned char *of, unsigned char *nf,
- int w, int h, int os, int ns, int swapped)
-{
- int i, y;
- int align = -(long)nf & 7;
- of += align;
- nf += align;
- w -= align;
- if (swapped)
- of -= os, nf -= ns;
- i = (h*3 >> 7) & ~1;
- of += i*os + 8;
- nf += i*ns + 8;
- h -= i;
- w -= 16;
-
- memset(s, 0, sizeof(*s));
-
- for (y = (h-8) >> 3; y; y--) {
- if (p->mmx2 == 1) {
- for (i = 0; i < w; i += 8)
- block_metrics_mmx2(of+i, nf+i, os, ns, 4, p, s);
- } else if (p->mmx2 == 2) {
- for (i = 0; i < w; i += 8)
- block_metrics_3dnow(of+i, nf+i, os, ns, 4, p, s);
- } else if (p->fast > 3) {
- for (i = 0; i < w; i += 8)
- block_metrics_faster_c(of+i, nf+i, os, ns, 4, p, s);
- } else if (p->fast > 1) {
- for (i = 0; i < w; i += 8)
- block_metrics_fast_c(of+i, nf+i, os, ns, 4, p, s);
- } else {
- for (i = 0; i < w; i += 8)
- block_metrics_c(of+i, nf+i, os, ns, 4, p, s);
- }
- of += 8*os;
- nf += 8*ns;
- }
-}
-
-#define METRICS(X) (X).even, (X).odd, (X).noise, (X).temp
-
-static void diff_fields(struct vf_priv_s *p, struct frame_stats *s,
- unsigned char **old, unsigned char **new)
-{
- diff_planes(p, s, old[0], new[0], p->w, p->h,
- p->stride, p->stride, p->swapped);
- s->sad.even = (s->sad.even * 16ul) / s->num_blocks;
- s->sad.odd = (s->sad.odd * 16ul) / s->num_blocks;
- s->sad.noise = (s->sad.noise * 16ul) / s->num_blocks;
- s->sad.temp = (s->sad.temp * 16ul) / s->num_blocks;
- if (p->verbose)
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO, "%lu%c M:%d/%d/%d/%d - %d, "
- "t:%d/%d/%d/%d, l:%d/%d/%d/%d, h:%d/%d/%d/%d, bg:%d/%d/%d/%d, "
- "2x:%d/%d/%d/%d, sad:%d/%d/%d/%d, lil:%d, hil:%d, ios:%.1f\n",
- p->inframes, p->chflag, METRICS(s->max), s->num_blocks,
- METRICS(s->tiny), METRICS(s->low), METRICS(s->high),
- METRICS(s->bigger), METRICS(s->twox), METRICS(s->sad),
- s->interlaced_low, s->interlaced_high,
- p->iosync / (double) p->in_inc);
-}
-
-static const char *parse_args(struct vf_priv_s *p, const char *args)
-{
- args--;
- while (args && *++args &&
- (sscanf(args, "io=%lu:%lu", &p->out_dec, &p->in_inc) == 2 ||
- sscanf(args, "diff_thres=%hu", &p->thres.even ) == 1 ||
- sscanf(args, "comb_thres=%hu", &p->thres.noise) == 1 ||
- sscanf(args, "sad_thres=%lu", &p->sad_thres ) == 1 ||
- sscanf(args, "dint_thres=%lu", &p->dint_thres ) == 1 ||
- sscanf(args, "fast=%u", &p->fast ) == 1 ||
- sscanf(args, "mmx2=%lu", &p->mmx2 ) == 1 ||
- sscanf(args, "luma_only=%u", &p->luma_only ) == 1 ||
- sscanf(args, "verbose=%u", &p->verbose ) == 1 ||
- sscanf(args, "crop=%lu:%lu:%lu:%lu", &p->w,
- &p->h, &p->crop_x, &p->crop_y) == 4))
- args = strchr(args, '/');
- return args;
-}
-
-static unsigned long gcd(unsigned long x, unsigned long y)
-{
- unsigned long t;
- if (x > y)
- t = x, x = y, y = t;
-
- while (x) {
- t = y % x;
- y = x;
- x = t;
- }
- return y;
-}
-
-static void init(struct vf_priv_s *p, mp_image_t *mpi)
-{
- unsigned long i;
- unsigned long plane_size, chroma_plane_size;
- unsigned char *plane;
- unsigned long cos, los;
- p->crop_cx = p->crop_x >> mpi->chroma_x_shift;
- p->crop_cy = p->crop_y >> mpi->chroma_y_shift;
- if (mpi->flags & MP_IMGFLAG_ACCEPT_STRIDE) {
- p->stride = (mpi->w + 15) & ~15;
- p->chroma_stride = p->stride >> mpi->chroma_x_shift;
- } else {
- p->stride = mpi->width;
- p->chroma_stride = mpi->chroma_width;
- }
- p->cw = p->w >> mpi->chroma_x_shift;
- p->ch = p->h >> mpi->chroma_y_shift;
- p->nplanes = 1;
- p->static_idx = 0;
- p->temp_idx = 0;
- p->old_planes = p->planes[0];
- plane_size = mpi->h * p->stride;
- chroma_plane_size = mpi->flags & MP_IMGFLAG_PLANAR ?
- mpi->chroma_height * p->chroma_stride : 0;
- p->memory_allocated =
- malloc(NUM_STORED * (plane_size+2*chroma_plane_size) +
- 8*p->chroma_stride + 4096);
- /* align to page boundary */
- plane = p->memory_allocated + (-(long)p->memory_allocated & 4095);
- memset(plane, 0, NUM_STORED * plane_size);
- los = p->crop_x + p->crop_y * p->stride;
- cos = p->crop_cx + p->crop_cy * p->chroma_stride;
- for (i = 0; i != NUM_STORED; i++, plane += plane_size) {
- p->planes[i][0] = plane;
- p->planes[NUM_STORED + i][0] = plane + los;
- }
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- p->nplanes = 3;
- memset(plane, 0x80, NUM_STORED * 2 * chroma_plane_size);
- for (i = 0; i != NUM_STORED; i++) {
- p->planes[i][1] = plane;
- p->planes[NUM_STORED + i][1] = plane + cos;
- plane += chroma_plane_size;
- p->planes[i][2] = plane;
- p->planes[NUM_STORED + i][2] = plane + cos;
- plane += chroma_plane_size;
- }
- }
- p->out_dec <<= 2;
- i = gcd(p->in_inc, p->out_dec);
- p->in_inc /= i;
- p->out_dec /= i;
- p->iosync = 0;
- p->num_fields = 3;
-}
-
-static inline double get_time(void)
-{
- struct timeval tv;
- gettimeofday(&tv, 0);
- return tv.tv_sec + tv.tv_usec * 1e-6;
-}
-
-static void get_image(struct vf_instance *vf, mp_image_t *mpi)
-{
- struct vf_priv_s *p = vf->priv;
- static unsigned char **planes, planes_idx;
-
- if (mpi->type == MP_IMGTYPE_STATIC) return;
-
- if (!p->planes[0][0]) init(p, mpi);
-
- if (mpi->type == MP_IMGTYPE_TEMP ||
- (mpi->type == MP_IMGTYPE_IPB && !(mpi->flags & MP_IMGFLAG_READABLE)))
- planes_idx = NUM_STORED/2 + (++p->temp_idx % (NUM_STORED/2));
- else
- planes_idx = ++p->static_idx % (NUM_STORED/2);
- planes = p->planes[planes_idx];
- mpi->priv = p->planes[NUM_STORED + planes_idx];
- if (mpi->priv == p->old_planes) {
- unsigned char **old_planes =
- p->planes[NUM_STORED + 2 + (++p->temp_idx & 1)];
- my_memcpy_pic(old_planes[0], p->old_planes[0],
- p->w, p->h, p->stride, p->stride);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(old_planes[1], p->old_planes[1],
- p->cw, p->ch, p->chroma_stride, p->chroma_stride);
- my_memcpy_pic(old_planes[2], p->old_planes[2],
- p->cw, p->ch, p->chroma_stride, p->chroma_stride);
- }
- p->old_planes = old_planes;
- p->num_copies++;
- }
- mpi->planes[0] = planes[0];
- mpi->stride[0] = p->stride;
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- mpi->planes[1] = planes[1];
- mpi->planes[2] = planes[2];
- mpi->stride[1] = mpi->stride[2] = p->chroma_stride;
- }
- mpi->width = p->stride;
-
- mpi->flags |= MP_IMGFLAG_DIRECT;
- mpi->flags &= ~MP_IMGFLAG_DRAW_CALLBACK;
-}
-
-static inline long
-cmpe(unsigned long x, unsigned long y, unsigned long err, unsigned long e)
-{
- long diff = x-y;
- long unit = ((x+y+err) >> e);
- long ret = (diff > unit) - (diff < -unit);
- unit >>= 1;
- return ret + (diff > unit) - (diff < -unit);
-}
-
-static unsigned long
-find_breaks(struct vf_priv_s *p, struct frame_stats *s)
-{
- struct frame_stats *ps = &p->stats[(p->inframes-1) & 1];
- long notfilm = 5*p->in_inc - p->out_dec;
- unsigned long n = s->num_blocks >> 8;
- unsigned long sad_comb_cmp = cmpe(s->sad.temp, s->sad.noise, 512, 1);
- unsigned long ret = 8;
-
- if (cmpe(s->sad.temp, s->sad.even, 512, 1) > 0)
- ff_mp_msg(MSGT_VFILTER, MSGL_WARN,
- "@@@@@@@@ Bottom-first field??? @@@@@@@@\n");
- if (s->sad.temp > 1000 && s->sad.noise > 1000)
- return 3;
- if (s->interlaced_high >= 2*n && s->sad.temp > 256 && s->sad.noise > 256)
- return 3;
- if (s->high.noise > s->num_blocks/4 && s->sad.noise > 10000 &&
- s->sad.noise > 2*s->sad.even && s->sad.noise > 2*ps->sad.odd) {
- // Mid-frame scene change
- if (s->tiny.temp + s->interlaced_low < n ||
- s->low.temp + s->interlaced_high < n/4 ||
- s->high.temp + s->interlaced_high < n/8 ||
- s->sad.temp < 160)
- return 1;
- return 3;
- }
- if (s->high.temp > s->num_blocks/4 && s->sad.temp > 10000 &&
- s->sad.temp > 2*ps->sad.odd && s->sad.temp > 2*ps->sad.even) {
- // Start frame scene change
- if (s->tiny.noise + s->interlaced_low < n ||
- s->low.noise + s->interlaced_high < n/4 ||
- s->high.noise + s->interlaced_high < n/8 ||
- s->sad.noise < 160)
- return 2;
- return 3;
- }
- if (sad_comb_cmp == 2)
- return 2;
- if (sad_comb_cmp == -2)
- return 1;
-
- if (s->tiny.odd > 3*MAX(n,s->tiny.even) + s->interlaced_low)
- return 1;
- if (s->tiny.even > 3*MAX(n,s->tiny.odd)+s->interlaced_low &&
- (!sad_comb_cmp || (s->low.noise <= n/4 && s->low.temp <= n/4)))
- return 4;
-
- if (s->sad.noise < 64 && s->sad.temp < 64 &&
- s->low.noise <= n/2 && s->high.noise <= n/4 &&
- s->low.temp <= n/2 && s->high.temp <= n/4)
- goto still;
-
- if (s->tiny.temp > 3*MAX(n,s->tiny.noise) + s->interlaced_low)
- return 2;
- if (s->tiny.noise > 3*MAX(n,s->tiny.temp) + s->interlaced_low)
- return 1;
-
- if (s->low.odd > 3*MAX(n/4,s->low.even) + s->interlaced_high)
- return 1;
- if (s->low.even > 3*MAX(n/4,s->low.odd)+s->interlaced_high &&
- s->sad.even > 2*s->sad.odd &&
- (!sad_comb_cmp || (s->low.noise <= n/4 && s->low.temp <= n/4)))
- return 4;
-
- if (s->low.temp > 3*MAX(n/4,s->low.noise) + s->interlaced_high)
- return 2;
- if (s->low.noise > 3*MAX(n/4,s->low.temp) + s->interlaced_high)
- return 1;
-
- if (sad_comb_cmp == 1 && s->sad.noise < 64)
- return 2;
- if (sad_comb_cmp == -1 && s->sad.temp < 64)
- return 1;
-
- if (s->tiny.odd <= n || (s->tiny.noise <= n/2 && s->tiny.temp <= n/2)) {
- if (s->interlaced_low <= n) {
- if (p->num_fields == 1)
- goto still;
- if (s->tiny.even <= n || ps->tiny.noise <= n/2)
- /* Still frame */
- goto still;
- if (s->bigger.even >= 2*MAX(n,s->bigger.odd) + s->interlaced_low)
- return 4;
- if (s->low.even >= 2*n + s->interlaced_low)
- return 4;
- goto still;
- }
- }
- if (s->low.odd <= n/4) {
- if (s->interlaced_high <= n/4) {
- if (p->num_fields == 1)
- goto still;
- if (s->low.even <= n/4)
- /* Still frame */
- goto still;
- if (s->bigger.even >= 2*MAX(n/4,s->bigger.odd)+s->interlaced_high)
- return 4;
- if (s->low.even >= n/2 + s->interlaced_high)
- return 4;
- goto still;
- }
- }
- if (s->bigger.temp > 2*MAX(n,s->bigger.noise) + s->interlaced_low)
- return 2;
- if (s->bigger.noise > 2*MAX(n,s->bigger.temp) + s->interlaced_low)
- return 1;
- if (s->bigger.temp > 2*MAX(n,s->bigger.noise) + s->interlaced_high)
- return 2;
- if (s->bigger.noise > 2*MAX(n,s->bigger.temp) + s->interlaced_high)
- return 1;
- if (s->twox.temp > 2*MAX(n,s->twox.noise) + s->interlaced_high)
- return 2;
- if (s->twox.noise > 2*MAX(n,s->twox.temp) + s->interlaced_high)
- return 1;
- if (s->bigger.even > 2*MAX(n,s->bigger.odd) + s->interlaced_low &&
- s->bigger.temp < n && s->bigger.noise < n)
- return 4;
- if (s->interlaced_low > MIN(2*n, s->tiny.odd))
- return 3;
- ret = 8 + (1 << (s->sad.temp > s->sad.noise));
- still:
- if (p->num_fields == 1 && p->prev_fields == 3 && notfilm >= 0 &&
- (s->tiny.temp <= s->tiny.noise || s->sad.temp < s->sad.noise+16))
- return 1;
- if (p->notout < p->num_fields && p->iosync > 2*p->in_inc && notfilm < 0)
- notfilm = 0;
- if (p->num_fields < 2 ||
- (p->num_fields == 2 && p->prev_fields == 2 && notfilm < 0))
- return ret;
- if (!notfilm && (p->prev_fields&~1) == 2) {
- if (p->prev_fields + p->num_fields == 5) {
- if (s->tiny.noise <= s->tiny.temp ||
- s->low.noise == 0 || s->low.noise < s->low.temp ||
- s->sad.noise < s->sad.temp+16)
- return 2;
- }
- if (p->prev_fields + p->num_fields == 4) {
- if (s->tiny.temp <= s->tiny.noise ||
- s->low.temp == 0 || s->low.temp < s->low.noise ||
- s->sad.temp < s->sad.noise+16)
- return 1;
- }
- }
- if (p->num_fields > 2 &&
- ps->sad.noise > s->sad.noise && ps->sad.noise > s->sad.temp)
- return 4;
- return 2 >> (s->sad.noise > s->sad.temp);
-}
-
-#define ITOC(X) (!(X) ? ' ' : (X) + ((X)>9 ? 'a'-10 : '0'))
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- mp_image_t *dmpi;
- struct vf_priv_s *p = vf->priv;
- unsigned char **planes, **old_planes;
- struct frame_stats *s = &p->stats[p->inframes & 1];
- struct frame_stats *ps = &p->stats[(p->inframes-1) & 1];
- int swapped = 0;
- const int flags = mpi->fields;
- int breaks, prev;
- int show_fields = 0;
- int dropped_fields = 0;
- double start_time, diff_time;
- char prev_chflag = p->chflag;
- int keep_rate;
-
- if (!p->planes[0][0]) init(p, mpi);
-
- old_planes = p->old_planes;
-
- if ((mpi->flags & MP_IMGFLAG_DIRECT) && mpi->priv) {
- planes = mpi->priv;
- mpi->priv = 0;
- } else {
- planes = p->planes[2 + (++p->temp_idx & 1)];
- my_memcpy_pic(planes[0],
- mpi->planes[0] + p->crop_x + p->crop_y * mpi->stride[0],
- p->w, p->h, p->stride, mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(planes[1],
- mpi->planes[1] + p->crop_cx + p->crop_cy * mpi->stride[1],
- p->cw, p->ch, p->chroma_stride, mpi->stride[1]);
- my_memcpy_pic(planes[2],
- mpi->planes[2] + p->crop_cx + p->crop_cy * mpi->stride[2],
- p->cw, p->ch, p->chroma_stride, mpi->stride[2]);
- p->num_copies++;
- }
- }
-
- p->old_planes = planes;
- p->chflag = ';';
- if (flags & MP_IMGFIELD_ORDERED) {
- swapped = !(flags & MP_IMGFIELD_TOP_FIRST);
- p->chflag = (flags & MP_IMGFIELD_REPEAT_FIRST ? '|' :
- flags & MP_IMGFIELD_TOP_FIRST ? ':' : '.');
- }
- p->swapped = swapped;
-
- start_time = get_time();
- if (p->chflag == '|') {
- *s = ppzs;
- p->iosync += p->in_inc;
- } else if ((p->fast & 1) && prev_chflag == '|')
- *s = pprs;
- else
- diff_fields(p, s, old_planes, planes);
- diff_time = get_time();
- p->diff_time += diff_time - start_time;
- breaks = p->inframes ? find_breaks(p, s) : 2;
- p->inframes++;
- keep_rate = 4*p->in_inc == p->out_dec;
-
- switch (breaks) {
- case 0:
- case 8:
- case 9:
- case 10:
- if (!keep_rate && p->notout < p->num_fields && p->iosync < 2*p->in_inc)
- break;
- if (p->notout < p->num_fields)
- dropped_fields = -2;
- case 4:
- if (keep_rate || p->iosync >= -2*p->in_inc)
- show_fields = (4<<p->num_fields)-1;
- break;
- case 3:
- if (keep_rate)
- show_fields = 2;
- else if (p->iosync > 0) {
- if (p->notout >= p->num_fields && p->iosync > 2*p->in_inc) {
- show_fields = 4; /* prev odd only */
- if (p->num_fields > 1)
- show_fields |= 8; /* + prev even */
- } else {
- show_fields = 2; /* even only */
- if (p->notout >= p->num_fields)
- dropped_fields += p->num_fields;
- }
- }
- break;
- case 2:
- if (p->iosync <= -3*p->in_inc) {
- if (p->notout >= p->num_fields)
- dropped_fields = p->num_fields;
- break;
- }
- if (p->num_fields == 1) {
- int prevbreak = ps->sad.noise >= 128;
- if (p->iosync < 4*p->in_inc) {
- show_fields = 3;
- dropped_fields = prevbreak;
- } else {
- show_fields = 4 | (!prevbreak << 3);
- if (p->notout < 1 + p->prev_fields)
- dropped_fields = -!prevbreak;
- }
- break;
- }
- default:
- if (keep_rate)
- show_fields = 3 << (breaks & 1);
- else if (p->notout >= p->num_fields &&
- p->iosync >= (breaks == 1 ? -p->in_inc :
- p->in_inc << (p->num_fields == 1))) {
- show_fields = (1 << (2 + p->num_fields)) - (1<<breaks);
- } else {
- if (p->notout >= p->num_fields)
- dropped_fields += p->num_fields + 2 - breaks;
- if (breaks == 1) {
- if (p->iosync >= 4*p->in_inc)
- show_fields = 6;
- } else if (p->iosync > -3*p->in_inc)
- show_fields = 3; /* odd+even */
- }
- break;
- }
-
- show_fields &= 15;
- prev = p->prev_fields;
- if (breaks < 8) {
- if (p->num_fields == 1)
- breaks &= ~4;
- if (breaks)
- p->num_breaks++;
- if (breaks == 3)
- p->prev_fields = p->num_fields = 1;
- else if (breaks) {
- p->prev_fields = p->num_fields + (breaks==1) - (breaks==4);
- p->num_fields = breaks - (breaks == 4) + (p->chflag == '|');
- } else
- p->num_fields += 2;
- } else
- p->num_fields += 2;
-
- p->iosync += 4 * p->in_inc;
- if (p->chflag == '|')
- p->iosync += p->in_inc;
-
- if (show_fields) {
- p->iosync -= p->out_dec;
- p->notout = !(show_fields & 1) + !(show_fields & 3);
- if (((show_fields & 3) == 3 &&
- (s->low.noise + s->interlaced_low < (s->num_blocks>>8) ||
- s->sad.noise < 160)) ||
- ((show_fields & 12) == 12 &&
- (ps->low.noise + ps->interlaced_low < (s->num_blocks>>8) ||
- ps->sad.noise < 160))) {
- p->export_count++;
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT,
- MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE,
- p->w, p->h);
- if ((show_fields & 3) != 3) planes = old_planes;
- dmpi->planes[0] = planes[0];
- dmpi->stride[0] = p->stride;
- dmpi->width = mpi->width;
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- dmpi->planes[1] = planes[1];
- dmpi->planes[2] = planes[2];
- dmpi->stride[1] = p->chroma_stride;
- dmpi->stride[2] = p->chroma_stride;
- }
- } else {
- p->merge_count++;
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- p->w, p->h);
- copy_merge_fields(p, dmpi, old_planes, planes, show_fields);
- }
- p->outframes++;
- } else
- p->notout += 2;
-
- if (p->verbose)
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO, "%lu %lu: %x %c %c %lu%s%s%c%s\n",
- p->inframes, p->outframes,
- breaks, breaks<8 && breaks>0 ? (int) p->prev_fields+'0' : ' ',
- ITOC(show_fields),
- p->num_breaks, 5*p->in_inc == p->out_dec && breaks<8 &&
- breaks>0 && ((prev&~1)!=2 || prev+p->prev_fields!=5) ?
- " ######## bad telecine ########" : "",
- dropped_fields ? " ======== dropped ":"", ITOC(dropped_fields),
- !show_fields || (show_fields & (show_fields-1)) ?
- "" : " @@@@@@@@@@@@@@@@@");
-
- p->merge_time += get_time() - diff_time;
- return show_fields ? ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE) : 0;
-}
-
-static int query_format(struct vf_instance *vf, unsigned int fmt)
-{
- /* FIXME - support more formats */
- switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- case IMGFMT_411P:
- case IMGFMT_422P:
- case IMGFMT_444P:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- unsigned long cxm = 0;
- unsigned long cym = 0;
- struct vf_priv_s *p = vf->priv;
- // rounding:
- if(!IMGFMT_IS_RGB(outfmt) && !IMGFMT_IS_BGR(outfmt)){
- switch(outfmt){
- case IMGFMT_444P:
- case IMGFMT_Y800:
- case IMGFMT_Y8:
- break;
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- cym = 3;
- case IMGFMT_411P:
- cxm = 3;
- break;
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- cym = 1;
- default:
- cxm = 1;
- }
- }
- p->chroma_swapped = !!(p->crop_y & (cym+1));
- if (p->w) p->w += p->crop_x & cxm;
- if (p->h) p->h += p->crop_y & cym;
- p->crop_x &= ~cxm;
- p->crop_y &= ~cym;
- if (!p->w || p->w > width ) p->w = width;
- if (!p->h || p->h > height) p->h = height;
- if (p->crop_x + p->w > width ) p->crop_x = 0;
- if (p->crop_y + p->h > height) p->crop_y = 0;
-
- if(!opt_screen_size_x && !opt_screen_size_y){
- d_width = d_width * p->w/width;
- d_height = d_height * p->h/height;
- }
- return ff_vf_next_config(vf, p->w, p->h, d_width, d_height, flags, outfmt);
-}
-
-static void uninit(struct vf_instance *vf)
-{
- struct vf_priv_s *p = vf->priv;
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO, "diff_time: %.3f, merge_time: %.3f, "
- "export: %lu, merge: %lu, copy: %lu\n", p->diff_time, p->merge_time,
- p->export_count, p->merge_count, p->num_copies);
- free(p->memory_allocated);
- free(p);
-}
-
-static int vf_open(vf_instance_t *vf, char *args)
-{
- struct vf_priv_s *p;
- vf->get_image = get_image;
- vf->put_image = put_image;
- vf->config = config;
- vf->query_format = query_format;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
- vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
- p->out_dec = 5;
- p->in_inc = 4;
- p->thres.noise = 128;
- p->thres.even = 128;
- p->sad_thres = 64;
- p->dint_thres = 4;
- p->luma_only = 0;
- p->fast = 3;
- p->mmx2 = ff_gCpuCaps.hasMMX2 ? 1 : ff_gCpuCaps.has3DNow ? 2 : 0;
- if (args) {
- const char *args_remain = parse_args(p, args);
- if (args_remain) {
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL,
- "filmdint: unknown suboption: %s\n", args_remain);
- return 0;
- }
- if (p->out_dec < p->in_inc) {
- ff_mp_msg(MSGT_VFILTER, MSGL_FATAL,
- "filmdint: increasing the frame rate is not supported\n");
- return 0;
- }
- }
- if (p->mmx2 > 2)
- p->mmx2 = 0;
-#if !HAVE_MMX
- p->mmx2 = 0;
-#endif
-#if !HAVE_AMD3DNOW
- p->mmx2 &= 1;
-#endif
- p->thres.odd = p->thres.even;
- p->thres.temp = p->thres.noise;
- p->diff_time = 0;
- p->merge_time = 0;
- return 1;
-}
-
-const vf_info_t ff_vf_info_filmdint = {
- "Advanced inverse telecine filer",
- "filmdint",
- "Zoltan Hidvegi",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_ivtc.c b/ffmpeg/libavfilter/libmpcodecs/vf_ivtc.c
deleted file mode 100644
index 8a47a57..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_ivtc.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "cpudetect.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-#include "libavutil/x86/asm.h"
-#include "libvo/fastmemcpy.h"
-
-
-struct metrics {
- /* difference: total, even lines, odd lines */
- int d, e, o;
- /* noise: temporal, spacial (current), spacial (past) */
- int t, s, p;
-};
-
-struct frameinfo {
- /* peak, relative, mean */
- struct metrics p, r, m;
-};
-
-struct vf_priv_s {
- struct frameinfo fi[2];
- mp_image_t *dmpi;
- int first;
- int drop, lastdrop, dropnext;
- int inframes, outframes;
-};
-
-enum {
- F_DROP,
- F_MERGE,
- F_NEXT,
- F_SHOW
-};
-
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
-static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
-{
- int i;
- short out[24]; // output buffer for the partial metrics from the mmx code
-
- __asm__ (
- "movl $4, %%ecx \n\t"
- "pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
- "pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
- "pxor %%mm7, %%mm7 \n\t" // all zeros
-
- ASMALIGN(4)
- "1: \n\t"
-
- // Even difference
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_S"), %%mm2 \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "movq (%%"REG_D"), %%mm1 \n\t"
- "add %%"REG_b", %%"REG_D" \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "psubusb %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm0 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm0, %%mm4 \n\t"
- "paddw %%mm1, %%mm4 \n\t"
- "paddw %%mm2, %%mm4 \n\t"
- "paddw %%mm3, %%mm4 \n\t"
-
- // Odd difference
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_S"), %%mm2 \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "movq (%%"REG_D"), %%mm1 \n\t"
- "add %%"REG_b", %%"REG_D" \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "psubusb %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm0 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm0, %%mm5 \n\t"
- "paddw %%mm1, %%mm5 \n\t"
- "paddw %%mm2, %%mm5 \n\t"
- "paddw %%mm3, %%mm5 \n\t"
-
- "decl %%ecx \n\t"
- "jnz 1b \n\t"
- "movq %%mm4, (%%"REG_d") \n\t"
- "movq %%mm5, 8(%%"REG_d") \n\t"
- :
- : "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
- : "memory"
- );
- m->e = out[0]+out[1]+out[2]+out[3];
- m->o = out[4]+out[5]+out[6]+out[7];
- m->d = m->e + m->o;
-
- __asm__ (
- // First loop to measure first four columns
- "movl $4, %%ecx \n\t"
- "pxor %%mm4, %%mm4 \n\t" // Past spacial noise
- "pxor %%mm5, %%mm5 \n\t" // Temporal noise
- "pxor %%mm6, %%mm6 \n\t" // Current spacial noise
-
- ASMALIGN(4)
- "2: \n\t"
-
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "movq (%%"REG_D"), %%mm2 \n\t"
- "movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
- "add %%"REG_b", %%"REG_D" \n\t"
- "add %%"REG_b", %%"REG_D" \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpcklbw %%mm7, %%mm3 \n\t"
- "paddw %%mm1, %%mm4 \n\t"
- "paddw %%mm1, %%mm5 \n\t"
- "paddw %%mm3, %%mm6 \n\t"
- "psubw %%mm0, %%mm4 \n\t"
- "psubw %%mm2, %%mm5 \n\t"
- "psubw %%mm2, %%mm6 \n\t"
-
- "decl %%ecx \n\t"
- "jnz 2b \n\t"
-
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "movq %%mm0, %%mm3 \n\t"
- "pcmpgtw %%mm4, %%mm1 \n\t"
- "pcmpgtw %%mm5, %%mm2 \n\t"
- "pcmpgtw %%mm6, %%mm3 \n\t"
- "pxor %%mm1, %%mm4 \n\t"
- "pxor %%mm2, %%mm5 \n\t"
- "pxor %%mm3, %%mm6 \n\t"
- "psubw %%mm1, %%mm4 \n\t"
- "psubw %%mm2, %%mm5 \n\t"
- "psubw %%mm3, %%mm6 \n\t"
- "movq %%mm4, (%%"REG_d") \n\t"
- "movq %%mm5, 16(%%"REG_d") \n\t"
- "movq %%mm6, 32(%%"REG_d") \n\t"
-
- "mov %%"REG_a", %%"REG_c" \n\t"
- "shl $3, %%"REG_c" \n\t"
- "sub %%"REG_c", %%"REG_S" \n\t"
- "mov %%"REG_b", %%"REG_c" \n\t"
- "shl $3, %%"REG_c" \n\t"
- "sub %%"REG_c", %%"REG_D" \n\t"
-
- // Second loop for the last four columns
- "movl $4, %%ecx \n\t"
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm5, %%mm5 \n\t"
- "pxor %%mm6, %%mm6 \n\t"
-
- ASMALIGN(4)
- "3: \n\t"
-
- "movq (%%"REG_S"), %%mm0 \n\t"
- "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "add %%"REG_a", %%"REG_S" \n\t"
- "movq (%%"REG_D"), %%mm2 \n\t"
- "movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
- "add %%"REG_b", %%"REG_D" \n\t"
- "add %%"REG_b", %%"REG_D" \n\t"
- "punpckhbw %%mm7, %%mm0 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm1, %%mm4 \n\t"
- "paddw %%mm1, %%mm5 \n\t"
- "paddw %%mm3, %%mm6 \n\t"
- "psubw %%mm0, %%mm4 \n\t"
- "psubw %%mm2, %%mm5 \n\t"
- "psubw %%mm2, %%mm6 \n\t"
-
- "decl %%ecx \n\t"
- "jnz 3b \n\t"
-
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "movq %%mm0, %%mm3 \n\t"
- "pcmpgtw %%mm4, %%mm1 \n\t"
- "pcmpgtw %%mm5, %%mm2 \n\t"
- "pcmpgtw %%mm6, %%mm3 \n\t"
- "pxor %%mm1, %%mm4 \n\t"
- "pxor %%mm2, %%mm5 \n\t"
- "pxor %%mm3, %%mm6 \n\t"
- "psubw %%mm1, %%mm4 \n\t"
- "psubw %%mm2, %%mm5 \n\t"
- "psubw %%mm3, %%mm6 \n\t"
- "movq %%mm4, 8(%%"REG_d") \n\t"
- "movq %%mm5, 24(%%"REG_d") \n\t"
- "movq %%mm6, 40(%%"REG_d") \n\t"
-
- "emms \n\t"
- :
- : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
- : "memory"
- );
- m->p = m->t = m->s = 0;
- for (i=0; i<8; i++) {
- m->p += out[i];
- m->t += out[8+i];
- m->s += out[16+i];
- }
- //printf("e=%d o=%d d=%d p=%d t=%d s=%d\n", m->e, m->o, m->d, m->p, m->t, m->s);
-}
-#endif
-
-//#define MAG(a) ((a)*(a))
-//#define MAG(a) (abs(a))
-#define MAG(a) (((a)^((a)>>31))-((a)>>31))
-
-//#define LOWPASS(s) (((s)[-2] + 4*(s)[-1] + 6*(s)[0] + 4*(s)[1] + (s)[2])>>4)
-//#define LOWPASS(s) (((s)[-1] + 2*(s)[0] + (s)[1])>>2)
-#define LOWPASS(s) ((s)[0])
-
-
-static void block_diffs_C(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
-{
- int x, y, e=0, o=0, s=0, p=0, t=0;
- unsigned char *oldp, *newp;
- m->s = m->p = m->t = 0;
- for (x = 8; x; x--) {
- oldp = old++;
- newp = new++;
- s = p = t = 0;
- for (y = 4; y; y--) {
- e += MAG(newp[0]-oldp[0]);
- o += MAG(newp[ns]-oldp[os]);
- s += newp[ns]-newp[0];
- p += oldp[os]-oldp[0];
- t += oldp[os]-newp[0];
- oldp += os<<1;
- newp += ns<<1;
- }
- m->s += MAG(s);
- m->p += MAG(p);
- m->t += MAG(t);
- }
- m->e = e;
- m->o = o;
- m->d = e+o;
-}
-
-static void (*block_diffs)(struct metrics *, unsigned char *, unsigned char *, int, int);
-
-#define MAXUP(a,b) ((a) = ((a)>(b)) ? (a) : (b))
-
-static void diff_planes(struct frameinfo *fi,
- unsigned char *old, unsigned char *new, int w, int h, int os, int ns)
-{
- int x, y;
- struct metrics l;
- struct metrics *peak=&fi->p, *rel=&fi->r, *mean=&fi->m;
- memset(peak, 0, sizeof(struct metrics));
- memset(rel, 0, sizeof(struct metrics));
- memset(mean, 0, sizeof(struct metrics));
- for (y = 0; y < h-7; y += 8) {
- for (x = 8; x < w-8-7; x += 8) {
- block_diffs(&l, old+x+y*os, new+x+y*ns, os, ns);
- mean->d += l.d;
- mean->e += l.e;
- mean->o += l.o;
- mean->s += l.s;
- mean->p += l.p;
- mean->t += l.t;
- MAXUP(peak->d, l.d);
- MAXUP(peak->e, l.e);
- MAXUP(peak->o, l.o);
- MAXUP(peak->s, l.s);
- MAXUP(peak->p, l.p);
- MAXUP(peak->t, l.t);
- MAXUP(rel->e, l.e-l.o);
- MAXUP(rel->o, l.o-l.e);
- MAXUP(rel->s, l.s-l.t);
- MAXUP(rel->p, l.p-l.t);
- MAXUP(rel->t, l.t-l.p);
- MAXUP(rel->d, l.t-l.s); /* hack */
- }
- }
- x = (w/8-2)*(h/8);
- mean->d /= x;
- mean->e /= x;
- mean->o /= x;
- mean->s /= x;
- mean->p /= x;
- mean->t /= x;
-}
-
-static void diff_fields(struct frameinfo *fi, mp_image_t *old, mp_image_t *new)
-{
- diff_planes(fi, old->planes[0], new->planes[0],
- new->w, new->h, old->stride[0], new->stride[0]);
-}
-
-static void stats(struct frameinfo *f)
-{
- ff_mp_msg(MSGT_VFILTER, MSGL_V, " pd=%d re=%d ro=%d rp=%d rt=%d rs=%d rd=%d pp=%d pt=%d ps=%d\r",
- f->p.d, f->r.e, f->r.o, f->r.p, f->r.t, f->r.s, f->r.d, f->p.p, f->p.t, f->p.s);
-}
-
-static int foo(struct vf_priv_s *p, mp_image_t *new, mp_image_t *cur)
-{
- struct frameinfo *f = p->fi;
-
- f[0] = f[1];
- diff_fields(&f[1], cur, new);
- stats(&f[1]);
-
- // Immediately drop this frame if it's already been used.
- if (p->dropnext) {
- p->dropnext = 0;
- return F_DROP;
- }
-
- // Sometimes a pulldown frame comes all by itself, so both
- // its top and bottom field are duplicates from the adjacent
- // two frames. We can just drop such a frame, but we
- // immediately show the next frame instead to keep the frame
- // drops evenly spaced during normal 3:2 pulldown sequences.
- if ((3*f[1].r.o < f[1].r.e) && (f[1].r.s < f[1].r.d)) {
- p->dropnext = 1;
- return F_NEXT;
- }
-
- // If none of these conditions hold, we will consider the frame
- // progressive and just show it as-is.
- if (!( (3*f[0].r.e < f[0].r.o) ||
- ((2*f[0].r.d < f[0].r.s) && (f[0].r.s > 1200)) ||
- ((2*f[1].r.t < f[1].r.p) && (f[1].r.p > 1200)) ))
- return F_SHOW;
-
- // Otherwise, we have to decide whether to merge or drop.
- // If the noise metric only increases minimally, we're off
- // to a good start...
- if (((2*f[1].r.t < 3*f[1].r.p) && (f[1].r.t < 3600)) ||
- (f[1].r.t < 900) || (f[1].r.d < 900)) {
- // ...and if noise decreases or the duplicate even field
- // is detected, we go ahead with the merge.
- if ((3*f[0].r.e < f[0].r.o) || (2*f[1].r.t < f[1].r.p)) {
- p->dropnext = 1;
- return F_MERGE;
- }
- }
- return F_DROP;
-}
-
-
-
-static void copy_image(mp_image_t *dmpi, mp_image_t *mpi, int field)
-{
- switch (field) {
- case 0:
- my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- break;
- case 1:
- my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
- mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
- mpi->planes[1]+mpi->stride[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
- mpi->planes[2]+mpi->stride[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- break;
- case 2:
- memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
- dmpi->stride[0], mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(dmpi->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[1], mpi->stride[1]);
- memcpy_pic(dmpi->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[2], mpi->stride[2]);
- }
- break;
- }
-}
-
-static int do_put_image(struct vf_instance *vf, mp_image_t *dmpi)
-{
- struct vf_priv_s *p = vf->priv;
- int dropflag=0;
-
- if (!p->dropnext) switch (p->drop) {
- case 0:
- dropflag = 0;
- break;
- case 1:
- dropflag = (++p->lastdrop >= 5);
- break;
- case 2:
- dropflag = (++p->lastdrop >= 5) && (4*p->inframes <= 5*p->outframes);
- break;
- }
-
- if (dropflag) {
- //ff_mp_msg(MSGT_VFILTER, MSGL_V, "drop! [%d/%d=%g]\n",
- // p->outframes, p->inframes, (float)p->outframes/p->inframes);
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "!");
- p->lastdrop = 0;
- return 0;
- }
-
- p->outframes++;
- return ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- int ret=0;
- struct vf_priv_s *p = vf->priv;
-
- p->inframes++;
-
- if (p->first) { /* hack */
- p->first = 0;
- return 1;
- }
-
- if (!p->dmpi) p->dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
- mpi->width, mpi->height);
- /* FIXME -- not correct, off by one frame! */
- p->dmpi->qscale = mpi->qscale;
- p->dmpi->qstride = mpi->qstride;
- p->dmpi->qscale_type = mpi->qscale_type;
-
- switch (foo(p, mpi, p->dmpi)) {
- case F_DROP:
- copy_image(p->dmpi, mpi, 2);
- ret = 0;
- p->lastdrop = 0;
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "DROP\n");
- break;
- case F_MERGE:
- copy_image(p->dmpi, mpi, 0);
- ret = do_put_image(vf, p->dmpi);
- copy_image(p->dmpi, mpi, 1);
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "MERGE\n");
- p->dmpi = NULL;
- break;
- case F_NEXT:
- copy_image(p->dmpi, mpi, 2);
- ret = do_put_image(vf, p->dmpi);
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "NEXT\n");
- p->dmpi = NULL;
- break;
- case F_SHOW:
- ret = do_put_image(vf, p->dmpi);
- copy_image(p->dmpi, mpi, 2);
- ff_mp_msg(MSGT_VFILTER, MSGL_V, "OK\n");
- p->dmpi = NULL;
- break;
- }
- return ret;
-}
-
-static int query_format(struct vf_instance *vf, unsigned int fmt)
-{
- switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static void uninit(struct vf_instance *vf)
-{
- free(vf->priv);
-}
-
-static int vf_open(vf_instance_t *vf, char *args)
-{
- struct vf_priv_s *p;
- vf->put_image = put_image;
- vf->query_format = query_format;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
- vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
- p->drop = 0;
- p->first = 1;
- if (args) sscanf(args, "%d", &p->drop);
- block_diffs = block_diffs_C;
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
- if(ff_gCpuCaps.hasMMX) block_diffs = block_diffs_MMX;
-#endif
- return 1;
-}
-
-const vf_info_t ff_vf_info_ivtc = {
- "inverse telecine, take 2",
- "ivtc",
- "Rich Felker",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_mcdeint.c b/ffmpeg/libavfilter/libmpcodecs/vf_mcdeint.c
deleted file mode 100644
index b9ffaf2..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_mcdeint.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-/*
-Known Issues:
-* The motion estimation is somewhat at the mercy of the input, if the input
- frames are created purely based on spatial interpolation then for example
- a thin black line or another random and not interpolateable pattern
- will cause problems
- Note: completly ignoring the "unavailable" lines during motion estimation
- didnt look any better, so the most obvious solution would be to improve
- tfields or penalize problematic motion vectors ...
-
-* If non iterative ME is used then snow currently ignores the OBMC window
- and as a result sometimes creates artifacts
-
-* only past frames are used, we should ideally use future frames too, something
- like filtering the whole movie in forward and then backward direction seems
- like a interresting idea but the current filter framework is FAR from
- supporting such things
-
-* combining the motion compensated image with the input image also isnt
- as trivial as it seems, simple blindly taking even lines from one and
- odd ones from the other doesnt work at all as ME/MC sometimes simple
- has nothing in the previous frames which matches the current, the current
- algo has been found by trial and error and almost certainly can be
- improved ...
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <math.h>
-
-#include "mp_msg.h"
-#include "cpudetect.h"
-
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-
-#undef fprintf
-#undef free
-#undef malloc
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-#include "av_helpers.h"
-
-#define MIN(a,b) ((a) > (b) ? (b) : (a))
-#define MAX(a,b) ((a) < (b) ? (b) : (a))
-#define ABS(a) ((a) > 0 ? (a) : (-(a)))
-
-//===========================================================================//
-
-struct vf_priv_s {
- int mode;
- int qp;
- int parity;
-#if 0
- int temp_stride[3];
- uint8_t *src[3];
- int16_t *temp[3];
-#endif
- int outbuf_size;
- uint8_t *outbuf;
- AVCodecContext *avctx_enc;
- AVFrame *frame;
- AVFrame *frame_dec;
-};
-
-static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int dst_stride[3], int src_stride[3], int width, int height){
- int x, y, i;
-
- for(i=0; i<3; i++){
- p->frame->data[i]= src[i];
- p->frame->linesize[i]= src_stride[i];
- }
-
- p->avctx_enc->me_cmp=
- p->avctx_enc->me_sub_cmp= FF_CMP_SAD /*| (p->parity ? FF_CMP_ODD : FF_CMP_EVEN)*/;
- p->frame->quality= p->qp*FF_QP2LAMBDA;
- avcodec_encode_video(p->avctx_enc, p->outbuf, p->outbuf_size, p->frame);
- p->frame_dec = p->avctx_enc->coded_frame;
-
- for(i=0; i<3; i++){
- int is_chroma= !!i;
- int w= width >>is_chroma;
- int h= height>>is_chroma;
- int fils= p->frame_dec->linesize[i];
- int srcs= src_stride[i];
-
- for(y=0; y<h; y++){
- if((y ^ p->parity) & 1){
- for(x=0; x<w; x++){
- if((x-2)+(y-1)*w>=0 && (x+2)+(y+1)*w<w*h){ //FIXME either alloc larger images or optimize this
- uint8_t *filp= &p->frame_dec->data[i][x + y*fils];
- uint8_t *srcp= &src[i][x + y*srcs];
- int diff0= filp[-fils] - srcp[-srcs];
- int diff1= filp[+fils] - srcp[+srcs];
- int spatial_score= ABS(srcp[-srcs-1] - srcp[+srcs-1])
- +ABS(srcp[-srcs ] - srcp[+srcs ])
- +ABS(srcp[-srcs+1] - srcp[+srcs+1]) - 1;
- int temp= filp[0];
-
-#define CHECK(j)\
- { int score= ABS(srcp[-srcs-1+(j)] - srcp[+srcs-1-(j)])\
- + ABS(srcp[-srcs +(j)] - srcp[+srcs -(j)])\
- + ABS(srcp[-srcs+1+(j)] - srcp[+srcs+1-(j)]);\
- if(score < spatial_score){\
- spatial_score= score;\
- diff0= filp[-fils+(j)] - srcp[-srcs+(j)];\
- diff1= filp[+fils-(j)] - srcp[+srcs-(j)];
-
- CHECK(-1) CHECK(-2) }} }}
- CHECK( 1) CHECK( 2) }} }}
-#if 0
- if((diff0 ^ diff1) > 0){
- int mindiff= ABS(diff0) > ABS(diff1) ? diff1 : diff0;
- temp-= mindiff;
- }
-#elif 1
- if(diff0 + diff1 > 0)
- temp-= (diff0 + diff1 - ABS( ABS(diff0) - ABS(diff1) )/2)/2;
- else
- temp-= (diff0 + diff1 + ABS( ABS(diff0) - ABS(diff1) )/2)/2;
-#else
- temp-= (diff0 + diff1)/2;
-#endif
-#if 1
- filp[0]=
- dst[i][x + y*dst_stride[i]]= temp > 255U ? ~(temp>>31) : temp;
-#else
- dst[i][x + y*dst_stride[i]]= filp[0];
- filp[0]= temp > 255U ? ~(temp>>31) : temp;
-#endif
- }else
- dst[i][x + y*dst_stride[i]]= p->frame_dec->data[i][x + y*fils];
- }
- }
- }
- for(y=0; y<h; y++){
- if(!((y ^ p->parity) & 1)){
- for(x=0; x<w; x++){
-#if 1
- p->frame_dec->data[i][x + y*fils]=
- dst[i][x + y*dst_stride[i]]= src[i][x + y*srcs];
-#else
- dst[i][x + y*dst_stride[i]]= p->frame_dec->data[i][x + y*fils];
- p->frame_dec->data[i][x + y*fils]= src[i][x + y*srcs];
-#endif
- }
- }
- }
- }
- p->parity ^= 1;
-
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
- int i;
- AVCodec *enc= avcodec_find_encoder(AV_CODEC_ID_SNOW);
-
- for(i=0; i<3; i++){
- AVCodecContext *avctx_enc;
- AVDictionary *opts = NULL;
-#if 0
- int is_chroma= !!i;
- int w= ((width + 31) & (~31))>>is_chroma;
- int h= ((height + 31) & (~31))>>is_chroma;
-
- vf->priv->temp_stride[i]= w;
- vf->priv->temp[i]= malloc(vf->priv->temp_stride[i]*h*sizeof(int16_t));
- vf->priv->src [i]= malloc(vf->priv->temp_stride[i]*h*sizeof(uint8_t));
-#endif
- avctx_enc=
- vf->priv->avctx_enc= avcodec_alloc_context3(enc);
- avctx_enc->width = width;
- avctx_enc->height = height;
- avctx_enc->time_base= (AVRational){1,25}; // meaningless
- avctx_enc->gop_size = 300;
- avctx_enc->max_b_frames= 0;
- avctx_enc->pix_fmt = AV_PIX_FMT_YUV420P;
- avctx_enc->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY;
- avctx_enc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
- avctx_enc->global_quality= 1;
- av_dict_set(&opts, "memc_only", "1", 0);
- avctx_enc->me_cmp=
- avctx_enc->me_sub_cmp= FF_CMP_SAD; //SSE;
- avctx_enc->mb_cmp= FF_CMP_SSE;
-
- switch(vf->priv->mode){
- case 3:
- avctx_enc->refs= 3;
- case 2:
- avctx_enc->me_method= ME_ITER;
- case 1:
- avctx_enc->flags |= CODEC_FLAG_4MV;
- avctx_enc->dia_size=2;
-// avctx_enc->mb_decision = MB_DECISION_RD;
- case 0:
- avctx_enc->flags |= CODEC_FLAG_QPEL;
- }
-
- avcodec_open2(avctx_enc, enc, &opts);
- av_dict_free(&opts);
-
- }
- vf->priv->frame= avcodec_alloc_frame();
-
- vf->priv->outbuf_size= width*height*10;
- vf->priv->outbuf= malloc(vf->priv->outbuf_size);
-
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void get_image(struct vf_instance *vf, mp_image_t *mpi){
- if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
-return; //caused problems, dunno why
- // ok, we can do pp in-place (or pp disabled):
- vf->dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- mpi->type, mpi->flags | MP_IMGFLAG_READABLE, mpi->width, mpi->height);
- mpi->planes[0]=vf->dmpi->planes[0];
- mpi->stride[0]=vf->dmpi->stride[0];
- mpi->width=vf->dmpi->width;
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- mpi->planes[1]=vf->dmpi->planes[1];
- mpi->planes[2]=vf->dmpi->planes[2];
- mpi->stride[1]=vf->dmpi->stride[1];
- mpi->stride[2]=vf->dmpi->stride[2];
- }
- mpi->flags|=MP_IMGFLAG_DIRECT;
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- mp_image_t *dmpi;
-
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
- // no DR, so get a new image! hope we'll get DR buffer:
- dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- MP_IMGTYPE_TEMP,
- MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
- mpi->width,mpi->height);
- ff_vf_clone_mpi_attributes(dmpi, mpi);
- }else{
- dmpi=vf->dmpi;
- }
-
- filter(vf->priv, dmpi->planes, mpi->planes, dmpi->stride, mpi->stride, mpi->w, mpi->h);
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-static void uninit(struct vf_instance *vf){
- if(!vf->priv) return;
-
-#if 0
- for(i=0; i<3; i++){
- free(vf->priv->temp[i]);
- vf->priv->temp[i]= NULL;
- free(vf->priv->src[i]);
- vf->priv->src[i]= NULL;
- }
-#endif
- if (vf->priv->avctx_enc) {
- avcodec_close(vf->priv->avctx_enc);
- av_freep(&vf->priv->avctx_enc);
- }
-
- free(vf->priv->outbuf);
- free(vf->priv);
- vf->priv=NULL;
-}
-
-//===========================================================================//
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- switch(fmt){
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_Y800:
- case IMGFMT_Y8:
- return ff_vf_next_query_format(vf,fmt);
- }
- return 0;
-}
-
-static int vf_open(vf_instance_t *vf, char *args){
-
- vf->config=config;
- vf->put_image=put_image;
- vf->get_image=get_image;
- vf->query_format=query_format;
- vf->uninit=uninit;
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
-
- ff_init_avcodec();
-
- vf->priv->mode=0;
- vf->priv->parity= -1;
- vf->priv->qp=1;
-
- if (args) sscanf(args, "%d:%d:%d", &vf->priv->mode, &vf->priv->parity, &vf->priv->qp);
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_mcdeint = {
- "motion compensating deinterlacer",
- "mcdeint",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_noise.c b/ffmpeg/libavfilter/libmpcodecs/vf_noise.c
deleted file mode 100644
index 3b946e9..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_noise.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <math.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "cpudetect.h"
-
-#if HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-#include "libvo/fastmemcpy.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-
-#define MAX_NOISE 4096
-#define MAX_SHIFT 1024
-#define MAX_RES (MAX_NOISE-MAX_SHIFT)
-
-//===========================================================================//
-
-static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift);
-static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift);
-
-static void (*lineNoise)(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift)= lineNoise_C;
-static void (*lineNoiseAvg)(uint8_t *dst, uint8_t *src, int len, int8_t **shift)= lineNoiseAvg_C;
-
-typedef struct FilterParam{
- int strength;
- int uniform;
- int temporal;
- int quality;
- int averaged;
- int pattern;
- int shiftptr;
- int8_t *noise;
- int8_t *prev_shift[MAX_RES][3];
-}FilterParam;
-
-struct vf_priv_s {
- FilterParam lumaParam;
- FilterParam chromaParam;
- unsigned int outfmt;
-};
-
-static int nonTempRandShift_init;
-static int nonTempRandShift[MAX_RES];
-
-static int patt[4] = {
- -1,0,1,0
-};
-
-#define RAND_N(range) ((int) ((double)range*rand()/(RAND_MAX+1.0)))
-static int8_t *initNoise(FilterParam *fp){
- int strength= fp->strength;
- int uniform= fp->uniform;
- int averaged= fp->averaged;
- int pattern= fp->pattern;
- int8_t *noise= av_malloc(MAX_NOISE*sizeof(int8_t));
- int i, j;
-
- srand(123457);
-
- for(i=0,j=0; i<MAX_NOISE; i++,j++)
- {
- if(uniform) {
- if (averaged) {
- if (pattern) {
- noise[i]= (RAND_N(strength) - strength/2)/6
- +patt[j%4]*strength*0.25/3;
- } else {
- noise[i]= (RAND_N(strength) - strength/2)/3;
- }
- } else {
- if (pattern) {
- noise[i]= (RAND_N(strength) - strength/2)/2
- + patt[j%4]*strength*0.25;
- } else {
- noise[i]= RAND_N(strength) - strength/2;
- }
- }
- } else {
- double x1, x2, w, y1;
- do {
- x1 = 2.0 * rand()/(float)RAND_MAX - 1.0;
- x2 = 2.0 * rand()/(float)RAND_MAX - 1.0;
- w = x1 * x1 + x2 * x2;
- } while ( w >= 1.0 );
-
- w = sqrt( (-2.0 * log( w ) ) / w );
- y1= x1 * w;
- y1*= strength / sqrt(3.0);
- if (pattern) {
- y1 /= 2;
- y1 += patt[j%4]*strength*0.35;
- }
- if (y1<-128) y1=-128;
- else if(y1> 127) y1= 127;
- if (averaged) y1 /= 3.0;
- noise[i]= (int)y1;
- }
- if (RAND_N(6) == 0) j--;
- }
-
-
- for (i = 0; i < MAX_RES; i++)
- for (j = 0; j < 3; j++)
- fp->prev_shift[i][j] = noise + (rand()&(MAX_SHIFT-1));
-
- if(!nonTempRandShift_init){
- for(i=0; i<MAX_RES; i++){
- nonTempRandShift[i]= rand()&(MAX_SHIFT-1);
- }
- nonTempRandShift_init = 1;
- }
-
- fp->noise= noise;
- fp->shiftptr= 0;
- return noise;
-}
-
-/***************************************************************************/
-
-#if HAVE_MMX
-static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
- x86_reg mmx_len= len&(~7);
- noise+=shift;
-
- __asm__ volatile(
- "mov %3, %%"REG_a" \n\t"
- "pcmpeqb %%mm7, %%mm7 \n\t"
- "psllw $15, %%mm7 \n\t"
- "packsswb %%mm7, %%mm7 \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %%"REG_a"), %%mm0 \n\t"
- "movq (%1, %%"REG_a"), %%mm1 \n\t"
- "pxor %%mm7, %%mm0 \n\t"
- "paddsb %%mm1, %%mm0 \n\t"
- "pxor %%mm7, %%mm0 \n\t"
- "movq %%mm0, (%2, %%"REG_a") \n\t"
- "add $8, %%"REG_a" \n\t"
- " js 1b \n\t"
- :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
- : "%"REG_a
- );
- if(mmx_len!=len)
- lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
-}
-#endif
-
-//duplicate of previous except movntq
-#if HAVE_MMX2
-static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
- x86_reg mmx_len= len&(~7);
- noise+=shift;
-
- __asm__ volatile(
- "mov %3, %%"REG_a" \n\t"
- "pcmpeqb %%mm7, %%mm7 \n\t"
- "psllw $15, %%mm7 \n\t"
- "packsswb %%mm7, %%mm7 \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %%"REG_a"), %%mm0 \n\t"
- "movq (%1, %%"REG_a"), %%mm1 \n\t"
- "pxor %%mm7, %%mm0 \n\t"
- "paddsb %%mm1, %%mm0 \n\t"
- "pxor %%mm7, %%mm0 \n\t"
- "movntq %%mm0, (%2, %%"REG_a") \n\t"
- "add $8, %%"REG_a" \n\t"
- " js 1b \n\t"
- :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
- : "%"REG_a
- );
- if(mmx_len!=len)
- lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
-}
-#endif
-
-static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
- int i;
- noise+= shift;
- for(i=0; i<len; i++)
- {
- int v= src[i]+ noise[i];
- if(v>255) dst[i]=255; //FIXME optimize
- else if(v<0) dst[i]=0;
- else dst[i]=v;
- }
-}
-
-/***************************************************************************/
-
-#if HAVE_MMX
-static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
- x86_reg mmx_len= len&(~7);
-
- __asm__ volatile(
- "mov %5, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm1 \n\t"
- "movq (%0, %%"REG_a"), %%mm0 \n\t"
- "paddb (%2, %%"REG_a"), %%mm1 \n\t"
- "paddb (%3, %%"REG_a"), %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "punpcklbw %%mm0, %%mm0 \n\t"
- "punpckhbw %%mm2, %%mm2 \n\t"
- "punpcklbw %%mm1, %%mm1 \n\t"
- "punpckhbw %%mm3, %%mm3 \n\t"
- "pmulhw %%mm0, %%mm1 \n\t"
- "pmulhw %%mm2, %%mm3 \n\t"
- "paddw %%mm1, %%mm1 \n\t"
- "paddw %%mm3, %%mm3 \n\t"
- "paddw %%mm0, %%mm1 \n\t"
- "paddw %%mm2, %%mm3 \n\t"
- "psrlw $8, %%mm1 \n\t"
- "psrlw $8, %%mm3 \n\t"
- "packuswb %%mm3, %%mm1 \n\t"
- "movq %%mm1, (%4, %%"REG_a") \n\t"
- "add $8, %%"REG_a" \n\t"
- " js 1b \n\t"
- :: "r" (src+mmx_len), "r" (shift[0]+mmx_len), "r" (shift[1]+mmx_len), "r" (shift[2]+mmx_len),
- "r" (dst+mmx_len), "g" (-mmx_len)
- : "%"REG_a
- );
-
- if(mmx_len!=len){
- int8_t *shift2[3]={shift[0]+mmx_len, shift[1]+mmx_len, shift[2]+mmx_len};
- lineNoiseAvg_C(dst+mmx_len, src+mmx_len, len-mmx_len, shift2);
- }
-}
-#endif
-
-static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
- int i;
- int8_t *src2= (int8_t*)src;
-
- for(i=0; i<len; i++)
- {
- const int n= shift[0][i] + shift[1][i] + shift[2][i];
- dst[i]= src2[i]+((n*src2[i])>>7);
- }
-}
-
-/***************************************************************************/
-
-static void noise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, FilterParam *fp){
- int8_t *noise= fp->noise;
- int y;
- int shift=0;
-
- if(!noise)
- {
- if(src==dst) return;
-
- if(dstStride==srcStride) fast_memcpy(dst, src, srcStride*height);
- else
- {
- for(y=0; y<height; y++)
- {
- fast_memcpy(dst, src, width);
- dst+= dstStride;
- src+= srcStride;
- }
- }
- return;
- }
-
- for(y=0; y<height; y++)
- {
- if(fp->temporal) shift= rand()&(MAX_SHIFT -1);
- else shift= nonTempRandShift[y];
-
- if(fp->quality==0) shift&= ~7;
- if (fp->averaged) {
- lineNoiseAvg(dst, src, width, fp->prev_shift[y]);
- fp->prev_shift[y][fp->shiftptr] = noise + shift;
- } else {
- lineNoise(dst, src, noise, width, shift);
- }
- dst+= dstStride;
- src+= srcStride;
- }
- fp->shiftptr++;
- if (fp->shiftptr == 3) fp->shiftptr = 0;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
-
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void get_image(struct vf_instance *vf, mp_image_t *mpi){
- if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
- if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ
- // ok, we can do pp in-place (or pp disabled):
- vf->dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- mpi->type, mpi->flags, mpi->w, mpi->h);
- mpi->planes[0]=vf->dmpi->planes[0];
- mpi->stride[0]=vf->dmpi->stride[0];
- mpi->width=vf->dmpi->width;
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- mpi->planes[1]=vf->dmpi->planes[1];
- mpi->planes[2]=vf->dmpi->planes[2];
- mpi->stride[1]=vf->dmpi->stride[1];
- mpi->stride[2]=vf->dmpi->stride[2];
- }
- mpi->flags|=MP_IMGFLAG_DIRECT;
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- mp_image_t *dmpi;
-
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
- // no DR, so get a new image! hope we'll get DR buffer:
- vf->dmpi=ff_vf_get_image(vf->next,vf->priv->outfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->w,mpi->h);
-//printf("nodr\n");
- }
-//else printf("dr\n");
- dmpi= vf->dmpi;
-
- noise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam);
- noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
- noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
-
- ff_vf_clone_mpi_attributes(dmpi, mpi);
-
-#if HAVE_MMX
- if(ff_gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
-#endif
-#if HAVE_MMX2
- if(ff_gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
-#endif
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-static void uninit(struct vf_instance *vf){
- if(!vf->priv) return;
-
- av_free(vf->priv->chromaParam.noise);
- vf->priv->chromaParam.noise= NULL;
-
- av_free(vf->priv->lumaParam.noise);
- vf->priv->lumaParam.noise= NULL;
-
- free(vf->priv);
- vf->priv=NULL;
-}
-
-//===========================================================================//
-
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- switch(fmt)
- {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- return ff_vf_next_query_format(vf,vf->priv->outfmt);
- }
- return 0;
-}
-
-static void parse(FilterParam *fp, char* args){
- char *pos;
- char *max= strchr(args, ':');
-
- if(!max) max= args + strlen(args);
-
- fp->strength= atoi(args);
- pos= strchr(args, 'u');
- if(pos && pos<max) fp->uniform=1;
- pos= strchr(args, 't');
- if(pos && pos<max) fp->temporal=1;
- pos= strchr(args, 'h');
- if(pos && pos<max) fp->quality=1;
- pos= strchr(args, 'p');
- if(pos && pos<max) fp->pattern=1;
- pos= strchr(args, 'a');
- if(pos && pos<max) {
- fp->temporal=1;
- fp->averaged=1;
- }
-
- if(fp->strength) initNoise(fp);
-}
-
-static const unsigned int fmt_list[]={
- IMGFMT_YV12,
- IMGFMT_I420,
- IMGFMT_IYUV,
- 0
-};
-
-static int vf_open(vf_instance_t *vf, char *args){
- vf->config=config;
- vf->put_image=put_image;
- vf->get_image=get_image;
- vf->query_format=query_format;
- vf->uninit=uninit;
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
- if(args)
- {
- char *arg2= strchr(args,':');
- if(arg2) parse(&vf->priv->chromaParam, arg2+1);
- parse(&vf->priv->lumaParam, args);
- }
-
- // check csp:
- vf->priv->outfmt=ff_vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
- if(!vf->priv->outfmt)
- {
- uninit(vf);
- return 0; // no csp match :(
- }
-
-
-#if HAVE_MMX
- if(ff_gCpuCaps.hasMMX){
- lineNoise= lineNoise_MMX;
- lineNoiseAvg= lineNoiseAvg_MMX;
- }
-#endif
-#if HAVE_MMX2
- if(ff_gCpuCaps.hasMMX2) lineNoise= lineNoise_MMX2;
-// if(ff_gCpuCaps.hasMMX) lineNoiseAvg= lineNoiseAvg_MMX2;
-#endif
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_noise = {
- "noise generator",
- "noise",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
-
-//===========================================================================//
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_ow.c b/ffmpeg/libavfilter/libmpcodecs/vf_ow.c
deleted file mode 100644
index 69b07ef..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_ow.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/**
- * @todo try to change to int
- * @todo try lifting based implementation
- * @todo optimize optimize optimize
- * @todo hard tresholding
- * @todo use QP to decide filter strength
- * @todo wavelet normalization / least squares optimal signal vs. noise thresholds
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include <math.h>
-
-#include "mp_msg.h"
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-//===========================================================================//
-static const uint8_t __attribute__((aligned(8))) dither[8][8]={
-{ 0, 48, 12, 60, 3, 51, 15, 63, },
-{ 32, 16, 44, 28, 35, 19, 47, 31, },
-{ 8, 56, 4, 52, 11, 59, 7, 55, },
-{ 40, 24, 36, 20, 43, 27, 39, 23, },
-{ 2, 50, 14, 62, 1, 49, 13, 61, },
-{ 34, 18, 46, 30, 33, 17, 45, 29, },
-{ 10, 58, 6, 54, 9, 57, 5, 53, },
-{ 42, 26, 38, 22, 41, 25, 37, 21, },
-};
-//FIXME the above is duplicated in many filters
-
-struct vf_priv_s {
- float strength[2];
- float delta;
- int mode;
- int depth;
- float *plane[16][4];
- int stride;
-};
-
-#define S 1.41421356237 //sqrt(2)
-
-static const double coeff[2][5]={
- {
- 0.6029490182363579 *S,
- 0.2668641184428723 *S,
- -0.07822326652898785 *S,
- -0.01686411844287495 *S,
- 0.02674875741080976 *S
- },{
- 1.115087052456994 /S,
- -0.5912717631142470 /S,
- -0.05754352622849957 /S,
- 0.09127176311424948 /S
- }
-};
-
-static const double icoeff[2][5]={
- {
- 1.115087052456994 /S,
- 0.5912717631142470 /S,
- -0.05754352622849957 /S,
- -0.09127176311424948 /S
- },{
- 0.6029490182363579 *S,
- -0.2668641184428723 *S,
- -0.07822326652898785 *S,
- 0.01686411844287495 *S,
- 0.02674875741080976 *S
- }
-};
-#undef S
-
-static inline int mirror(int x, int w){
- while((unsigned)x > (unsigned)w){
- x=-x;
- if(x<0) x+= 2*w;
- }
- return x;
-}
-
-static inline void decompose(float *dstL, float *dstH, float *src, int stride, int w){
- int x, i;
- for(x=0; x<w; x++){
- double sumL= src[x*stride] * coeff[0][0];
- double sumH= src[x*stride] * coeff[1][0];
- for(i=1; i<=4; i++){
- double s= (src[mirror(x-i, w-1)*stride] + src[mirror(x+i, w-1)*stride]);
-
- sumL+= coeff[0][i]*s;
- sumH+= coeff[1][i]*s;
- }
- dstL[x*stride]= sumL;
- dstH[x*stride]= sumH;
- }
-}
-
-static inline void compose(float *dst, float *srcL, float *srcH, int stride, int w){
- int x, i;
- for(x=0; x<w; x++){
- double sumL= srcL[x*stride] * icoeff[0][0];
- double sumH= srcH[x*stride] * icoeff[1][0];
- for(i=1; i<=4; i++){
- int x0= mirror(x-i, w-1)*stride;
- int x1= mirror(x+i, w-1)*stride;
-
- sumL+= icoeff[0][i]*(srcL[x0] + srcL[x1]);
- sumH+= icoeff[1][i]*(srcH[x0] + srcH[x1]);
- }
- dst[x*stride]= (sumL + sumH)*0.5;
- }
-}
-
-static inline void decompose2D(float *dstL, float *dstH, float *src, int xstride, int ystride, int step, int w, int h){
- int y, x;
- for(y=0; y<h; y++)
- for(x=0; x<step; x++)
- decompose(dstL + ystride*y + xstride*x, dstH + ystride*y + xstride*x, src + ystride*y + xstride*x, step*xstride, (w-x+step-1)/step);
-}
-
-static inline void compose2D(float *dst, float *srcL, float *srcH, int xstride, int ystride, int step, int w, int h){
- int y, x;
- for(y=0; y<h; y++)
- for(x=0; x<step; x++)
- compose(dst + ystride*y + xstride*x, srcL + ystride*y + xstride*x, srcH + ystride*y + xstride*x, step*xstride, (w-x+step-1)/step);
-}
-
-static void decompose2D2(float *dst[4], float *src, float *temp[2], int stride, int step, int w, int h){
- decompose2D(temp[0], temp[1], src , 1, stride, step , w, h);
- decompose2D( dst[0], dst[1], temp[0], stride, 1, step , h, w);
- decompose2D( dst[2], dst[3], temp[1], stride, 1, step , h, w);
-}
-
-static void compose2D2(float *dst, float *src[4], float *temp[2], int stride, int step, int w, int h){
- compose2D(temp[0], src[0], src[1], stride, 1, step , h, w);
- compose2D(temp[1], src[2], src[3], stride, 1, step , h, w);
- compose2D(dst , temp[0], temp[1], 1, stride, step , w, h);
-}
-
-static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, int is_luma){
- int x,y, i, j;
-// double sum=0;
- double s= p->strength[!is_luma];
- int depth= p->depth;
-
- while(1<<depth > width || 1<<depth > height)
- depth--;
-
- for(y=0; y<height; y++)
- for(x=0; x<width; x++)
- p->plane[0][0][x + y*p->stride]= src[x + y*src_stride];
-
- for(i=0; i<depth; i++){
- decompose2D2(p->plane[i+1], p->plane[i][0], p->plane[0]+1,p->stride, 1<<i, width, height);
- }
- for(i=0; i<depth; i++){
- for(j=1; j<4; j++){
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- double v= p->plane[i+1][j][x + y*p->stride];
- if (v> s) v-=s;
- else if(v<-s) v+=s;
- else v =0;
- p->plane[i+1][j][x + y*p->stride]= v;
- }
- }
- }
- }
- for(i=depth-1; i>=0; i--){
- compose2D2(p->plane[i][0], p->plane[i+1], p->plane[0]+1, p->stride, 1<<i, width, height);
- }
-
- for(y=0; y<height; y++)
- for(x=0; x<width; x++){
- i= p->plane[0][0][x + y*p->stride] + dither[x&7][y&7]*(1.0/64) + 1.0/128; //yes the rounding is insane but optimal :)
-// double e= i - src[x + y*src_stride];
-// sum += e*e;
- if((unsigned)i > 255U) i= ~(i>>31);
- dst[x + y*dst_stride]= i;
- }
-
-// printf("%f\n", sum/height/width);
-}
-
-static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){
- int h= (height+15)&(~15);
- int i,j;
-
- vf->priv->stride= (width+15)&(~15);
- for(j=0; j<4; j++){
- for(i=0; i<=vf->priv->depth; i++)
- vf->priv->plane[i][j]= malloc(vf->priv->stride*h*sizeof(vf->priv->plane[0][0][0]));
- }
-
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void get_image(struct vf_instance *vf, mp_image_t *mpi){
- if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
- // ok, we can do pp in-place (or pp disabled):
- vf->dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- mpi->type, mpi->flags | MP_IMGFLAG_READABLE, mpi->width, mpi->height);
- mpi->planes[0]=vf->dmpi->planes[0];
- mpi->stride[0]=vf->dmpi->stride[0];
- mpi->width=vf->dmpi->width;
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- mpi->planes[1]=vf->dmpi->planes[1];
- mpi->planes[2]=vf->dmpi->planes[2];
- mpi->stride[1]=vf->dmpi->stride[1];
- mpi->stride[2]=vf->dmpi->stride[2];
- }
- mpi->flags|=MP_IMGFLAG_DIRECT;
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- mp_image_t *dmpi;
-
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
- // no DR, so get a new image! hope we'll get DR buffer:
- dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- MP_IMGTYPE_TEMP,
- MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
- mpi->width,mpi->height);
- ff_vf_clone_mpi_attributes(dmpi, mpi);
- }else{
- dmpi=vf->dmpi;
- }
-
- filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, 1);
- filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, 0);
- filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, 0);
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-static void uninit(struct vf_instance *vf){
- int i,j;
- if(!vf->priv) return;
-
- for(j=0; j<4; j++){
- for(i=0; i<16; i++){
- free(vf->priv->plane[i][j]);
- vf->priv->plane[i][j]= NULL;
- }
- }
-
- free(vf->priv);
- vf->priv=NULL;
-}
-
-//===========================================================================//
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- switch(fmt){
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_CLPL:
- case IMGFMT_Y800:
- case IMGFMT_Y8:
- case IMGFMT_444P:
- case IMGFMT_422P:
- case IMGFMT_411P:
- return ff_vf_next_query_format(vf,fmt);
- }
- return 0;
-}
-
-
-static int vf_open(vf_instance_t *vf, char *args){
- vf->config=config;
- vf->put_image=put_image;
- vf->get_image=get_image;
- vf->query_format=query_format;
- vf->uninit=uninit;
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
-
- vf->priv->depth= 8;
- vf->priv->strength[0]= 1.0;
- vf->priv->strength[1]= 1.0;
- vf->priv->delta= 1.0;
-
- if (args) sscanf(args, "%d:%f:%f:%d:%f", &vf->priv->depth,
- &vf->priv->strength[0],
- &vf->priv->strength[1],
- &vf->priv->mode,
- &vf->priv->delta);
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_ow = {
- "overcomplete wavelet denoiser",
- "ow",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_perspective.c b/ffmpeg/libavfilter/libmpcodecs/vf_perspective.c
deleted file mode 100644
index aed5c4d..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_perspective.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <assert.h>
-#include <math.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#if HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-#include "libavutil/mem.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#define SUB_PIXEL_BITS 8
-#define SUB_PIXELS (1<<SUB_PIXEL_BITS)
-#define COEFF_BITS 11
-
-//===========================================================================//
-
-struct vf_priv_s {
- double ref[4][2];
- int32_t coeff[1<<SUB_PIXEL_BITS][4];
- int32_t (*pv)[2];
- int pvStride;
- int cubic;
-};
-
-
-/***************************************************************************/
-
-static void initPv(struct vf_priv_s *priv, int W, int H){
- double a,b,c,d,e,f,g,h,D;
- double (*ref)[2]= priv->ref;
- int x,y;
-
- g= ( (ref[0][0] - ref[1][0] - ref[2][0] + ref[3][0])*(ref[2][1] - ref[3][1])
- - (ref[0][1] - ref[1][1] - ref[2][1] + ref[3][1])*(ref[2][0] - ref[3][0]))*H;
- h= ( (ref[0][1] - ref[1][1] - ref[2][1] + ref[3][1])*(ref[1][0] - ref[3][0])
- - (ref[0][0] - ref[1][0] - ref[2][0] + ref[3][0])*(ref[1][1] - ref[3][1]))*W;
- D= (ref[1][0] - ref[3][0])*(ref[2][1] - ref[3][1])
- - (ref[2][0] - ref[3][0])*(ref[1][1] - ref[3][1]);
-
- a= D*(ref[1][0] - ref[0][0])*H + g*ref[1][0];
- b= D*(ref[2][0] - ref[0][0])*W + h*ref[2][0];
- c= D*ref[0][0]*W*H;
- d= D*(ref[1][1] - ref[0][1])*H + g*ref[1][1];
- e= D*(ref[2][1] - ref[0][1])*W + h*ref[2][1];
- f= D*ref[0][1]*W*H;
-
- for(y=0; y<H; y++){
- for(x=0; x<W; x++){
- int u, v;
-
- u= (int)floor( SUB_PIXELS*(a*x + b*y + c)/(g*x + h*y + D*W*H) + 0.5);
- v= (int)floor( SUB_PIXELS*(d*x + e*y + f)/(g*x + h*y + D*W*H) + 0.5);
-
- priv->pv[x + y*W][0]= u;
- priv->pv[x + y*W][1]= v;
- }
- }
-}
-
-static double getCoeff(double d){
- double A= -0.60;
- double coeff;
-
- d= fabs(d);
-
- // Equation is from VirtualDub
- if(d<1.0)
- coeff = (1.0 - (A+3.0)*d*d + (A+2.0)*d*d*d);
- else if(d<2.0)
- coeff = (-4.0*A + 8.0*A*d - 5.0*A*d*d + A*d*d*d);
- else
- coeff=0.0;
-
- return coeff;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
- int i, j;
-
- vf->priv->pvStride= width;
- vf->priv->pv= av_malloc(width*height*2*sizeof(int32_t));
- initPv(vf->priv, width, height);
-
- for(i=0; i<SUB_PIXELS; i++){
- double d= i/(double)SUB_PIXELS;
- double temp[4];
- double sum=0;
-
- for(j=0; j<4; j++)
- temp[j]= getCoeff(j - d - 1);
-
- for(j=0; j<4; j++)
- sum+= temp[j];
-
- for(j=0; j<4; j++)
- vf->priv->coeff[i][j]= (int)floor((1<<COEFF_BITS)*temp[j]/sum + 0.5);
- }
-
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void uninit(struct vf_instance *vf){
- if(!vf->priv) return;
-
- av_free(vf->priv->pv);
- vf->priv->pv= NULL;
-
- free(vf->priv);
- vf->priv=NULL;
-}
-
-static inline void resampleCubic(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, struct vf_priv_s *privParam, int xShift, int yShift){
- int x, y;
- struct vf_priv_s priv= *privParam;
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int u, v, subU, subV, sum, sx, sy;
-
- sx= x << xShift;
- sy= y << yShift;
- u= priv.pv[sx + sy*priv.pvStride][0]>>xShift;
- v= priv.pv[sx + sy*priv.pvStride][1]>>yShift;
- subU= u & (SUB_PIXELS-1);
- subV= v & (SUB_PIXELS-1);
- u >>= SUB_PIXEL_BITS;
- v >>= SUB_PIXEL_BITS;
-
- if(u>0 && v>0 && u<w-2 && v<h-2){
- const int index= u + v*srcStride;
- const int a= priv.coeff[subU][0];
- const int b= priv.coeff[subU][1];
- const int c= priv.coeff[subU][2];
- const int d= priv.coeff[subU][3];
-
- sum=
- priv.coeff[subV][0]*( a*src[index - 1 - srcStride] + b*src[index - 0 - srcStride]
- + c*src[index + 1 - srcStride] + d*src[index + 2 - srcStride])
- +priv.coeff[subV][1]*( a*src[index - 1 ] + b*src[index - 0 ]
- + c*src[index + 1 ] + d*src[index + 2 ])
- +priv.coeff[subV][2]*( a*src[index - 1 + srcStride] + b*src[index - 0 + srcStride]
- + c*src[index + 1 + srcStride] + d*src[index + 2 + srcStride])
- +priv.coeff[subV][3]*( a*src[index - 1+2*srcStride] + b*src[index - 0+2*srcStride]
- + c*src[index + 1+2*srcStride] + d*src[index + 2+2*srcStride]);
- }else{
- int dx, dy;
- sum=0;
-
- for(dy=0; dy<4; dy++){
- int iy= v + dy - 1;
- if (iy< 0) iy=0;
- else if(iy>=h) iy=h-1;
- for(dx=0; dx<4; dx++){
- int ix= u + dx - 1;
- if (ix< 0) ix=0;
- else if(ix>=w) ix=w-1;
-
- sum+= priv.coeff[subU][dx]*priv.coeff[subV][dy]
- *src[ ix + iy*srcStride];
- }
- }
- }
- sum= (sum + (1<<(COEFF_BITS*2-1)) ) >> (COEFF_BITS*2);
- if(sum&~255){
- if(sum<0) sum=0;
- else sum=255;
- }
- dst[ x + y*dstStride]= sum;
- }
- }
-}
-
-static inline void resampleLinear(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride,
- struct vf_priv_s *privParam, int xShift, int yShift){
- int x, y;
- struct vf_priv_s priv= *privParam;
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int u, v, subU, subV, sum, sx, sy, index, subUI, subVI;
-
- sx= x << xShift;
- sy= y << yShift;
- u= priv.pv[sx + sy*priv.pvStride][0]>>xShift;
- v= priv.pv[sx + sy*priv.pvStride][1]>>yShift;
- subU= u & (SUB_PIXELS-1);
- subV= v & (SUB_PIXELS-1);
- u >>= SUB_PIXEL_BITS;
- v >>= SUB_PIXEL_BITS;
- index= u + v*srcStride;
- subUI= SUB_PIXELS - subU;
- subVI= SUB_PIXELS - subV;
-
- if((unsigned)u < (unsigned)(w - 1)){
- if((unsigned)v < (unsigned)(h - 1)){
- sum= subVI*(subUI*src[index ] + subU*src[index +1])
- +subV *(subUI*src[index+srcStride] + subU*src[index+srcStride+1]);
- sum= (sum + (1<<(SUB_PIXEL_BITS*2-1)) ) >> (SUB_PIXEL_BITS*2);
- }else{
- if(v<0) v= 0;
- else v= h-1;
- index= u + v*srcStride;
- sum= subUI*src[index] + subU*src[index+1];
- sum= (sum + (1<<(SUB_PIXEL_BITS-1)) ) >> SUB_PIXEL_BITS;
- }
- }else{
- if((unsigned)v < (unsigned)(h - 1)){
- if(u<0) u= 0;
- else u= w-1;
- index= u + v*srcStride;
- sum= subVI*src[index] + subV*src[index+srcStride];
- sum= (sum + (1<<(SUB_PIXEL_BITS-1)) ) >> SUB_PIXEL_BITS;
- }else{
- if(u<0) u= 0;
- else u= w-1;
- if(v<0) v= 0;
- else v= h-1;
- index= u + v*srcStride;
- sum= src[index];
- }
- }
- if(sum&~255){
- if(sum<0) sum=0;
- else sum=255;
- }
- dst[ x + y*dstStride]= sum;
- }
- }
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- int cw= mpi->w >> mpi->chroma_x_shift;
- int ch= mpi->h >> mpi->chroma_y_shift;
-
- mp_image_t *dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->w,mpi->h);
-
- assert(mpi->flags&MP_IMGFLAG_PLANAR);
-
- if(vf->priv->cubic){
- resampleCubic(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0],
- vf->priv, 0, 0);
- resampleCubic(dmpi->planes[1], mpi->planes[1], cw , ch , dmpi->stride[1], mpi->stride[1],
- vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
- resampleCubic(dmpi->planes[2], mpi->planes[2], cw , ch , dmpi->stride[2], mpi->stride[2],
- vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
- }else{
- resampleLinear(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0],
- vf->priv, 0, 0);
- resampleLinear(dmpi->planes[1], mpi->planes[1], cw , ch , dmpi->stride[1], mpi->stride[1],
- vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
- resampleLinear(dmpi->planes[2], mpi->planes[2], cw , ch , dmpi->stride[2], mpi->stride[2],
- vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
- }
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-//===========================================================================//
-
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- switch(fmt)
- {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_YVU9:
- case IMGFMT_444P:
- case IMGFMT_422P:
- case IMGFMT_411P:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static int vf_open(vf_instance_t *vf, char *args){
- int e;
-
- vf->config=config;
- vf->put_image=put_image;
-// vf->get_image=get_image;
- vf->query_format=query_format;
- vf->uninit=uninit;
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
-
- if(args==NULL) return 0;
-
- e=sscanf(args, "%lf:%lf:%lf:%lf:%lf:%lf:%lf:%lf:%d",
- &vf->priv->ref[0][0], &vf->priv->ref[0][1],
- &vf->priv->ref[1][0], &vf->priv->ref[1][1],
- &vf->priv->ref[2][0], &vf->priv->ref[2][1],
- &vf->priv->ref[3][0], &vf->priv->ref[3][1],
- &vf->priv->cubic
- );
-
- if(e!=9)
- return 0;
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_perspective = {
- "perspective correcture",
- "perspective",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
-
-//===========================================================================//
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_phase.c b/ffmpeg/libavfilter/libmpcodecs/vf_phase.c
deleted file mode 100644
index 25abc5b..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_phase.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#include "libvo/fastmemcpy.h"
-
-enum mode { PROGRESSIVE, TOP_FIRST, BOTTOM_FIRST,
- TOP_FIRST_ANALYZE, BOTTOM_FIRST_ANALYZE,
- ANALYZE, FULL_ANALYZE, AUTO, AUTO_ANALYZE };
-
-#define fixed_mode(p) ((p)<=BOTTOM_FIRST)
-
-struct vf_priv_s
- {
- enum mode mode;
- int verbose;
- unsigned char *buf[3];
- };
-
-/*
- * Copy fields from either current or buffered previous frame to the
- * output and store the current frame unmodified to the buffer.
- */
-
-static void do_plane(unsigned char *to, unsigned char *from,
- int w, int h, int ts, int fs,
- unsigned char **bufp, enum mode mode)
- {
- unsigned char *buf, *end;
- int top;
-
- if(!*bufp)
- {
- mode=PROGRESSIVE;
- if(!(*bufp=malloc(h*w))) return;
- }
-
- for(end=to+h*ts, buf=*bufp, top=1; to<end; from+=fs, to+=ts, buf+=w, top^=1)
- {
- fast_memcpy(to, mode==(top?BOTTOM_FIRST:TOP_FIRST)?buf:from, w);
- fast_memcpy(buf, from, w);
- }
- }
-
-/*
- * This macro interpolates the value of both fields at a point halfway
- * between lines and takes the squared difference. In field resolution
- * the point is a quarter pixel below a line in one field and a quarter
- * pixel above a line in other.
- *
- * (the result is actually multiplied by 25)
- */
-
-#define diff(a, as, b, bs) (t=((*a-b[bs])<<2)+a[as<<1]-b[-bs], t*t)
-
-/*
- * Find which field combination has the smallest average squared difference
- * between the fields.
- */
-
-static enum mode analyze_plane(unsigned char *old, unsigned char *new,
- int w, int h, int os, int ns, enum mode mode,
- int verbose, int fields)
- {
- double bdiff, pdiff, tdiff, scale;
- int bdif, tdif, pdif;
- int top, t;
- unsigned char *end, *rend;
-
- if(mode==AUTO)
- mode=fields&MP_IMGFIELD_ORDERED?fields&MP_IMGFIELD_TOP_FIRST?
- TOP_FIRST:BOTTOM_FIRST:PROGRESSIVE;
- else if(mode==AUTO_ANALYZE)
- mode=fields&MP_IMGFIELD_ORDERED?fields&MP_IMGFIELD_TOP_FIRST?
- TOP_FIRST_ANALYZE:BOTTOM_FIRST_ANALYZE:FULL_ANALYZE;
-
- if(fixed_mode(mode))
- bdiff=pdiff=tdiff=65536.0;
- else
- {
- bdiff=pdiff=tdiff=0.0;
-
- for(end=new+(h-2)*ns, new+=ns, old+=os, top=0;
- new<end; new+=ns-w, old+=os-w, top^=1)
- {
- pdif=tdif=bdif=0;
-
- switch(mode)
- {
- case TOP_FIRST_ANALYZE:
- if(top)
- for(rend=new+w; new<rend; new++, old++)
- pdif+=diff(new, ns, new, ns),
- tdif+=diff(new, ns, old, os);
- else
- for(rend=new+w; new<rend; new++, old++)
- pdif+=diff(new, ns, new, ns),
- tdif+=diff(old, os, new, ns);
- break;
-
- case BOTTOM_FIRST_ANALYZE:
- if(top)
- for(rend=new+w; new<rend; new++, old++)
- pdif+=diff(new, ns, new, ns),
- bdif+=diff(old, os, new, ns);
- else
- for(rend=new+w; new<rend; new++, old++)
- pdif+=diff(new, ns, new, ns),
- bdif+=diff(new, ns, old, os);
- break;
-
- case ANALYZE:
- if(top)
- for(rend=new+w; new<rend; new++, old++)
- tdif+=diff(new, ns, old, os),
- bdif+=diff(old, os, new, ns);
- else
- for(rend=new+w; new<rend; new++, old++)
- bdif+=diff(new, ns, old, os),
- tdif+=diff(old, os, new, ns);
- break;
-
- default: /* FULL_ANALYZE */
- if(top)
- for(rend=new+w; new<rend; new++, old++)
- pdif+=diff(new, ns, new, ns),
- tdif+=diff(new, ns, old, os),
- bdif+=diff(old, os, new, ns);
- else
- for(rend=new+w; new<rend; new++, old++)
- pdif+=diff(new, ns, new, ns),
- bdif+=diff(new, ns, old, os),
- tdif+=diff(old, os, new, ns);
- }
-
- pdiff+=(double)pdif;
- tdiff+=(double)tdif;
- bdiff+=(double)bdif;
- }
-
- scale=1.0/(w*(h-3))/25.0;
- pdiff*=scale;
- tdiff*=scale;
- bdiff*=scale;
-
- if(mode==TOP_FIRST_ANALYZE)
- bdiff=65536.0;
- else if(mode==BOTTOM_FIRST_ANALYZE)
- tdiff=65536.0;
- else if(mode==ANALYZE)
- pdiff=65536.0;
-
- if(bdiff<pdiff && bdiff<tdiff)
- mode=BOTTOM_FIRST;
- else if(tdiff<pdiff && tdiff<bdiff)
- mode=TOP_FIRST;
- else
- mode=PROGRESSIVE;
- }
-
- if( ff_mp_msg_test(MSGT_VFILTER,MSGL_V) )
- {
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO, "%c", mode==BOTTOM_FIRST?'b':mode==TOP_FIRST?'t':'p');
- if(tdiff==65536.0) ff_mp_msg(MSGT_VFILTER, MSGL_INFO," N/A "); else ff_mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", tdiff);
- if(bdiff==65536.0) ff_mp_msg(MSGT_VFILTER, MSGL_INFO," N/A "); else ff_mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", bdiff);
- if(pdiff==65536.0) ff_mp_msg(MSGT_VFILTER, MSGL_INFO," N/A "); else ff_mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", pdiff);
- ff_mp_msg(MSGT_VFILTER, MSGL_INFO," \n");
- }
-
- return mode;
- }
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
- {
- mp_image_t *dmpi;
- int w;
- enum mode mode;
-
- if(!(dmpi=ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->w, mpi->h)))
- return 0;
-
- w=dmpi->w;
- if(!(dmpi->flags&MP_IMGFLAG_PLANAR))
- w*=dmpi->bpp/8;
-
- mode=vf->priv->mode;
-
- if(!vf->priv->buf[0])
- mode=PROGRESSIVE;
- else
- mode=analyze_plane(vf->priv->buf[0], mpi->planes[0],
- w, dmpi->h, w, mpi->stride[0], mode,
- vf->priv->verbose, mpi->fields);
-
- do_plane(dmpi->planes[0], mpi->planes[0],
- w, dmpi->h,
- dmpi->stride[0], mpi->stride[0],
- &vf->priv->buf[0], mode);
-
- if(dmpi->flags&MP_IMGFLAG_PLANAR)
- {
- do_plane(dmpi->planes[1], mpi->planes[1],
- dmpi->chroma_width, dmpi->chroma_height,
- dmpi->stride[1], mpi->stride[1],
- &vf->priv->buf[1], mode);
- do_plane(dmpi->planes[2], mpi->planes[2],
- dmpi->chroma_width, dmpi->chroma_height,
- dmpi->stride[2], mpi->stride[2],
- &vf->priv->buf[2], mode);
- }
-
- return ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- }
-
-static void uninit(struct vf_instance *vf)
- {
- if (!vf->priv)
- return;
- free(vf->priv->buf[0]);
- free(vf->priv->buf[1]);
- free(vf->priv->buf[2]);
- free(vf->priv);
- }
-
-static int vf_open(vf_instance_t *vf, char *args)
- {
- vf->put_image = put_image;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-
- if(!(vf->priv = calloc(1, sizeof(struct vf_priv_s))))
- {
- uninit(vf);
- return 0;
- }
-
- vf->priv->mode=AUTO_ANALYZE;
- vf->priv->verbose=0;
-
- while(args && *args)
- {
- switch(*args)
- {
- case 't': vf->priv->mode=TOP_FIRST; break;
- case 'a': vf->priv->mode=AUTO; break;
- case 'b': vf->priv->mode=BOTTOM_FIRST; break;
- case 'u': vf->priv->mode=ANALYZE; break;
- case 'T': vf->priv->mode=TOP_FIRST_ANALYZE; break;
- case 'A': vf->priv->mode=AUTO_ANALYZE; break;
- case 'B': vf->priv->mode=BOTTOM_FIRST_ANALYZE; break;
- case 'U': vf->priv->mode=FULL_ANALYZE; break;
- case 'p': vf->priv->mode=PROGRESSIVE; break;
- case 'v': vf->priv->verbose=1; break;
- case ':': break;
-
- default:
- uninit(vf);
- return 0; /* bad args */
- }
-
- if( (args=strchr(args, ':')) ) args++;
- }
-
- return 1;
- }
-
-const vf_info_t ff_vf_info_phase =
- {
- "phase shift fields",
- "phase",
- "Ville Saari",
- "",
- vf_open,
- NULL
- };
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_pullup.c b/ffmpeg/libavfilter/libmpcodecs/vf_pullup.c
deleted file mode 100644
index e4a28c4..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_pullup.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-#include "cpudetect.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#include "libvo/fastmemcpy.h"
-
-#include "pullup.h"
-
-#undef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-
-struct vf_priv_s {
- struct pullup_context *ctx;
- int init;
- int fakecount;
- char *qbuf;
-};
-
-static void init_pullup(struct vf_instance *vf, mp_image_t *mpi)
-{
- struct pullup_context *c = vf->priv->ctx;
-
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- c->format = PULLUP_FMT_Y;
- c->nplanes = 4;
- ff_pullup_preinit_context(c);
- c->bpp[0] = c->bpp[1] = c->bpp[2] = 8;
- c->w[0] = mpi->w;
- c->h[0] = mpi->h;
- c->w[1] = c->w[2] = mpi->chroma_width;
- c->h[1] = c->h[2] = mpi->chroma_height;
- c->w[3] = ((mpi->w+15)/16) * ((mpi->h+15)/16);
- c->h[3] = 2;
- c->stride[0] = mpi->width;
- c->stride[1] = c->stride[2] = mpi->chroma_width;
- c->stride[3] = c->w[3];
- c->background[1] = c->background[2] = 128;
- }
-
- if (ff_gCpuCaps.hasMMX) c->cpu |= PULLUP_CPU_MMX;
- if (ff_gCpuCaps.hasMMX2) c->cpu |= PULLUP_CPU_MMX2;
- if (ff_gCpuCaps.has3DNow) c->cpu |= PULLUP_CPU_3DNOW;
- if (ff_gCpuCaps.has3DNowExt) c->cpu |= PULLUP_CPU_3DNOWEXT;
- if (ff_gCpuCaps.hasSSE) c->cpu |= PULLUP_CPU_SSE;
- if (ff_gCpuCaps.hasSSE2) c->cpu |= PULLUP_CPU_SSE2;
-
- ff_pullup_init_context(c);
-
- vf->priv->init = 1;
- vf->priv->qbuf = malloc(c->w[3]);
-}
-
-
-#if 0
-static void get_image(struct vf_instance *vf, mp_image_t *mpi)
-{
- struct pullup_context *c = vf->priv->ctx;
- struct pullup_buffer *b;
-
- if (mpi->type == MP_IMGTYPE_STATIC) return;
-
- if (!vf->priv->init) init_pullup(vf, mpi);
-
- b = ff_pullup_get_buffer(c, 2);
- if (!b) return; /* shouldn't happen... */
-
- mpi->priv = b;
-
- mpi->planes[0] = b->planes[0];
- mpi->planes[1] = b->planes[1];
- mpi->planes[2] = b->planes[2];
- mpi->stride[0] = c->stride[0];
- mpi->stride[1] = c->stride[1];
- mpi->stride[2] = c->stride[2];
-
- mpi->flags |= MP_IMGFLAG_DIRECT;
- mpi->flags &= ~MP_IMGFLAG_DRAW_CALLBACK;
-}
-#endif
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- struct pullup_context *c = vf->priv->ctx;
- struct pullup_buffer *b;
- struct pullup_frame *f;
- mp_image_t *dmpi;
- int ret;
- int p;
- int i;
-
- if (!vf->priv->init) init_pullup(vf, mpi);
-
- if (mpi->flags & MP_IMGFLAG_DIRECT) {
- b = mpi->priv;
- mpi->priv = 0;
- } else {
- b = ff_pullup_get_buffer(c, 2);
- if (!b) {
- ff_mp_msg(MSGT_VFILTER,MSGL_ERR,"Could not get buffer from pullup!\n");
- f = ff_pullup_get_frame(c);
- ff_pullup_release_frame(f);
- return 0;
- }
- memcpy_pic(b->planes[0], mpi->planes[0], mpi->w, mpi->h,
- c->stride[0], mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(b->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height,
- c->stride[1], mpi->stride[1]);
- memcpy_pic(b->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height,
- c->stride[2], mpi->stride[2]);
- }
- }
- if (mpi->qscale) {
- fast_memcpy(b->planes[3], mpi->qscale, c->w[3]);
- fast_memcpy(b->planes[3]+c->w[3], mpi->qscale, c->w[3]);
- }
-
- p = mpi->fields & MP_IMGFIELD_TOP_FIRST ? 0 :
- (mpi->fields & MP_IMGFIELD_ORDERED ? 1 : 0);
- ff_pullup_submit_field(c, b, p);
- ff_pullup_submit_field(c, b, p^1);
- if (mpi->fields & MP_IMGFIELD_REPEAT_FIRST)
- ff_pullup_submit_field(c, b, p);
-
- ff_pullup_release_buffer(b, 2);
-
- f = ff_pullup_get_frame(c);
-
- /* Fake yes for first few frames (buffer depth) to keep from
- * breaking A/V sync with G1's bad architecture... */
- if (!f) return vf->priv->fakecount ? (--vf->priv->fakecount,1) : 0;
-
- if (f->length < 2) {
- ff_pullup_release_frame(f);
- f = ff_pullup_get_frame(c);
- if (!f) return 0;
- if (f->length < 2) {
- ff_pullup_release_frame(f);
- if (!(mpi->fields & MP_IMGFIELD_REPEAT_FIRST))
- return 0;
- f = ff_pullup_get_frame(c);
- if (!f) return 0;
- if (f->length < 2) {
- ff_pullup_release_frame(f);
- return 0;
- }
- }
- }
-
-#if 0
- /* Average qscale tables from both frames. */
- if (mpi->qscale) {
- for (i=0; i<c->w[3]; i++) {
- vf->priv->qbuf[i] = (f->ofields[0]->planes[3][i]
- + f->ofields[1]->planes[3][i+c->w[3]])>>1;
- }
- }
-#else
- /* Take worst of qscale tables from both frames. */
- if (mpi->qscale) {
- for (i=0; i<c->w[3]; i++) {
- vf->priv->qbuf[i] = MAX(f->ofields[0]->planes[3][i], f->ofields[1]->planes[3][i+c->w[3]]);
- }
- }
-#endif
-
- /* If the frame isn't already exportable... */
- while (!f->buffer) {
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->width, mpi->height);
- /* FIXME: Is it ok to discard dmpi if it's not direct? */
- if (!(dmpi->flags & MP_IMGFLAG_DIRECT)) {
- ff_pullup_pack_frame(c, f);
- break;
- }
- /* Direct render fields into output buffer */
- my_memcpy_pic(dmpi->planes[0], f->ofields[0]->planes[0],
- mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
- my_memcpy_pic(dmpi->planes[0] + dmpi->stride[0],
- f->ofields[1]->planes[0] + c->stride[0],
- mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1], f->ofields[0]->planes[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, c->stride[1]*2);
- my_memcpy_pic(dmpi->planes[1] + dmpi->stride[1],
- f->ofields[1]->planes[1] + c->stride[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, c->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2], f->ofields[0]->planes[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, c->stride[2]*2);
- my_memcpy_pic(dmpi->planes[2] + dmpi->stride[2],
- f->ofields[1]->planes[2] + c->stride[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, c->stride[2]*2);
- }
- ff_pullup_release_frame(f);
- if (mpi->qscale) {
- dmpi->qscale = vf->priv->qbuf;
- dmpi->qstride = mpi->qstride;
- dmpi->qscale_type = mpi->qscale_type;
- }
- return ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- }
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->width, mpi->height);
-
- dmpi->planes[0] = f->buffer->planes[0];
- dmpi->planes[1] = f->buffer->planes[1];
- dmpi->planes[2] = f->buffer->planes[2];
-
- dmpi->stride[0] = c->stride[0];
- dmpi->stride[1] = c->stride[1];
- dmpi->stride[2] = c->stride[2];
-
- if (mpi->qscale) {
- dmpi->qscale = vf->priv->qbuf;
- dmpi->qstride = mpi->qstride;
- dmpi->qscale_type = mpi->qscale_type;
- }
- ret = ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- ff_pullup_release_frame(f);
- return ret;
-}
-
-static int query_format(struct vf_instance *vf, unsigned int fmt)
-{
- /* FIXME - support more formats */
- switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- if (height&3) {
- ff_mp_msg(MSGT_VFILTER, MSGL_ERR, "height must be divisible by four\n");
- return 0;
- }
- return ff_vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
-}
-
-static void uninit(struct vf_instance *vf)
-{
- ff_pullup_free_context(vf->priv->ctx);
- free(vf->priv);
-}
-
-static int vf_open(vf_instance_t *vf, char *args)
-{
- struct vf_priv_s *p;
- struct pullup_context *c;
- //vf->get_image = get_image;
- vf->put_image = put_image;
- vf->config = config;
- vf->query_format = query_format;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
- vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
- p->ctx = c = ff_pullup_alloc_context();
- p->fakecount = 1;
- c->junk_left = c->junk_right = 1;
- c->junk_top = c->junk_bottom = 4;
- c->strict_breaks = 0;
- c->metric_plane = 0;
- if (args) {
- sscanf(args, "%d:%d:%d:%d:%d:%d", &c->junk_left, &c->junk_right, &c->junk_top, &c->junk_bottom, &c->strict_breaks, &c->metric_plane);
- }
- return 1;
-}
-
-const vf_info_t ff_vf_info_pullup = {
- "pullup (from field sequence to frames)",
- "pullup",
- "Rich Felker",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_qp.c b/ffmpeg/libavfilter/libmpcodecs/vf_qp.c
deleted file mode 100644
index 579ec1c..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_qp.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <inttypes.h>
-
-#include "mp_msg.h"
-#include "cpudetect.h"
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-#include "libvo/fastmemcpy.h"
-
-#include "libavcodec/avcodec.h"
-#include "libavutil/eval.h"
-#include "libavutil/mem.h"
-
-
-struct vf_priv_s {
- char eq[200];
- int8_t *qp;
- int8_t lut[257];
- int qp_stride;
-};
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
- int h= (height+15)>>4;
- int i;
-
- vf->priv->qp_stride= (width+15)>>4;
- vf->priv->qp= av_malloc(vf->priv->qp_stride*h*sizeof(int8_t));
-
- for(i=-129; i<128; i++){
- double const_values[]={
- M_PI,
- M_E,
- i != -129,
- i,
- 0
- };
- static const char *const_names[]={
- "PI",
- "E",
- "known",
- "qp",
- NULL
- };
- double temp_val;
- int res;
-
- res= av_expr_parse_and_eval(&temp_val, vf->priv->eq, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, NULL);
-
- if (res < 0){
- ff_mp_msg(MSGT_VFILTER, MSGL_ERR, "qp: Error evaluating \"%s\" \n", vf->priv->eq);
- return 0;
- }
- vf->priv->lut[i+129]= lrintf(temp_val);
- }
-
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void get_image(struct vf_instance *vf, mp_image_t *mpi){
- if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
- // ok, we can do pp in-place (or pp disabled):
- vf->dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- mpi->type, mpi->flags, mpi->w, mpi->h);
- mpi->planes[0]=vf->dmpi->planes[0];
- mpi->stride[0]=vf->dmpi->stride[0];
- mpi->width=vf->dmpi->width;
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- mpi->planes[1]=vf->dmpi->planes[1];
- mpi->planes[2]=vf->dmpi->planes[2];
- mpi->stride[1]=vf->dmpi->stride[1];
- mpi->stride[2]=vf->dmpi->stride[2];
- }
- mpi->flags|=MP_IMGFLAG_DIRECT;
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- mp_image_t *dmpi;
- int x,y;
-
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
- // no DR, so get a new image! hope we'll get DR buffer:
- vf->dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
- mpi->w,mpi->h);
- }
-
- dmpi= vf->dmpi;
-
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
- memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
- memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
- }
- }
- ff_vf_clone_mpi_attributes(dmpi, mpi);
-
- dmpi->qscale = vf->priv->qp;
- dmpi->qstride= vf->priv->qp_stride;
- if(mpi->qscale){
- for(y=0; y<((dmpi->h+15)>>4); y++){
- for(x=0; x<vf->priv->qp_stride; x++){
- dmpi->qscale[x + dmpi->qstride*y]=
- vf->priv->lut[ 129 + ((int8_t)mpi->qscale[x + mpi->qstride*y]) ];
- }
- }
- }else{
- int qp= vf->priv->lut[0];
- for(y=0; y<((dmpi->h+15)>>4); y++){
- for(x=0; x<vf->priv->qp_stride; x++){
- dmpi->qscale[x + dmpi->qstride*y]= qp;
- }
- }
- }
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-static void uninit(struct vf_instance *vf){
- if(!vf->priv) return;
-
- av_free(vf->priv->qp);
- vf->priv->qp= NULL;
-
- av_free(vf->priv);
- vf->priv=NULL;
-}
-
-//===========================================================================//
-static int vf_open(vf_instance_t *vf, char *args){
- vf->config=config;
- vf->put_image=put_image;
- vf->get_image=get_image;
- vf->uninit=uninit;
- vf->priv=av_malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
-
-// avcodec_init();
-
- if (args) strncpy(vf->priv->eq, args, 199);
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_qp = {
- "QP changer",
- "qp",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_sab.c b/ffmpeg/libavfilter/libmpcodecs/vf_sab.c
deleted file mode 100644
index 2928a85..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_sab.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <assert.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#if HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-#include "libavutil/avutil.h"
-#include "libavutil/mem.h"
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-#include "libswscale/swscale.h"
-#include "vf_scale.h"
-
-
-//===========================================================================//
-
-typedef struct FilterParam{
- float radius;
- float preFilterRadius;
- float strength;
- float quality;
- struct SwsContext *preFilterContext;
- uint8_t *preFilterBuf;
- int preFilterStride;
- int distWidth;
- int distStride;
- int *distCoeff;
- int colorDiffCoeff[512];
-}FilterParam;
-
-struct vf_priv_s {
- FilterParam luma;
- FilterParam chroma;
-};
-
-
-/***************************************************************************/
-
-//FIXME stupid code duplication
-static void getSubSampleFactors(int *h, int *v, int format){
- switch(format){
- default:
- assert(0);
- case IMGFMT_YV12:
- case IMGFMT_I420:
- *h=1;
- *v=1;
- break;
- case IMGFMT_YVU9:
- *h=2;
- *v=2;
- break;
- case IMGFMT_444P:
- *h=0;
- *v=0;
- break;
- case IMGFMT_422P:
- *h=1;
- *v=0;
- break;
- case IMGFMT_411P:
- *h=2;
- *v=0;
- break;
- }
-}
-
-static int allocStuff(FilterParam *f, int width, int height){
- int stride= (width+7)&~7;
- SwsVector *vec;
- SwsFilter swsF;
- int i,x,y;
- f->preFilterBuf= av_malloc(stride*height);
- f->preFilterStride= stride;
-
- vec = sws_getGaussianVec(f->preFilterRadius, f->quality);
- swsF.lumH= swsF.lumV= vec;
- swsF.chrH= swsF.chrV= NULL;
- f->preFilterContext= sws_getContext(
- width, height, AV_PIX_FMT_GRAY8, width, height, AV_PIX_FMT_GRAY8, SWS_POINT, &swsF, NULL, NULL);
-
- sws_freeVec(vec);
- vec = sws_getGaussianVec(f->strength, 5.0);
- for(i=0; i<512; i++){
- double d;
- int index= i-256 + vec->length/2;
-
- if(index<0 || index>=vec->length) d= 0.0;
- else d= vec->coeff[index];
-
- f->colorDiffCoeff[i]= (int)(d/vec->coeff[vec->length/2]*(1<<12) + 0.5);
- }
- sws_freeVec(vec);
- vec = sws_getGaussianVec(f->radius, f->quality);
- f->distWidth= vec->length;
- f->distStride= (vec->length+7)&~7;
- f->distCoeff= av_malloc(f->distWidth*f->distStride*sizeof(int32_t));
-
- for(y=0; y<vec->length; y++){
- for(x=0; x<vec->length; x++){
- double d= vec->coeff[x] * vec->coeff[y];
-
- f->distCoeff[x + y*f->distStride]= (int)(d*(1<<10) + 0.5);
-// if(y==vec->length/2)
-// printf("%6d ", f->distCoeff[x + y*f->distStride]);
- }
- }
- sws_freeVec(vec);
-
- return 0;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
-
- int sw, sh;
-//__asm__ volatile("emms\n\t");
- allocStuff(&vf->priv->luma, width, height);
-
- getSubSampleFactors(&sw, &sh, outfmt);
- allocStuff(&vf->priv->chroma, width>>sw, height>>sh);
-
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void freeBuffers(FilterParam *f){
- if(f->preFilterContext) sws_freeContext(f->preFilterContext);
- f->preFilterContext=NULL;
-
- av_free(f->preFilterBuf);
- f->preFilterBuf=NULL;
-
- av_free(f->distCoeff);
- f->distCoeff=NULL;
-}
-
-static void uninit(struct vf_instance *vf){
- if(!vf->priv) return;
-
- freeBuffers(&vf->priv->luma);
- freeBuffers(&vf->priv->chroma);
-
- free(vf->priv);
- vf->priv=NULL;
-}
-
-static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, FilterParam *fp){
- int x, y;
- FilterParam f= *fp;
- const int radius= f.distWidth/2;
- const uint8_t* const srcArray[MP_MAX_PLANES] = {src};
- uint8_t *dstArray[MP_MAX_PLANES]= {f.preFilterBuf};
- int srcStrideArray[MP_MAX_PLANES]= {srcStride};
- int dstStrideArray[MP_MAX_PLANES]= {f.preFilterStride};
-
-// f.preFilterContext->swScale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
- sws_scale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int sum=0;
- int div=0;
- int dy;
- const int preVal= f.preFilterBuf[x + y*f.preFilterStride];
-#if 0
- const int srcVal= src[x + y*srcStride];
-if((x/32)&1){
- dst[x + y*dstStride]= srcVal;
- if(y%32==0) dst[x + y*dstStride]= 0;
- continue;
-}
-#endif
- if(x >= radius && x < w - radius){
- for(dy=0; dy<radius*2+1; dy++){
- int dx;
- int iy= y+dy - radius;
- if (iy<0) iy= -iy;
- else if(iy>=h) iy= h+h-iy-1;
-
- for(dx=0; dx<radius*2+1; dx++){
- const int ix= x+dx - radius;
- int factor;
-
- factor= f.colorDiffCoeff[256+preVal - f.preFilterBuf[ix + iy*f.preFilterStride] ]
- *f.distCoeff[dx + dy*f.distStride];
- sum+= src[ix + iy*srcStride] *factor;
- div+= factor;
- }
- }
- }else{
- for(dy=0; dy<radius*2+1; dy++){
- int dx;
- int iy= y+dy - radius;
- if (iy<0) iy= -iy;
- else if(iy>=h) iy= h+h-iy-1;
-
- for(dx=0; dx<radius*2+1; dx++){
- int ix= x+dx - radius;
- int factor;
- if (ix<0) ix= -ix;
- else if(ix>=w) ix= w+w-ix-1;
-
- factor= f.colorDiffCoeff[256+preVal - f.preFilterBuf[ix + iy*f.preFilterStride] ]
- *f.distCoeff[dx + dy*f.distStride];
- sum+= src[ix + iy*srcStride] *factor;
- div+= factor;
- }
- }
- }
- dst[x + y*dstStride]= (sum + div/2)/div;
- }
- }
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- int cw= mpi->w >> mpi->chroma_x_shift;
- int ch= mpi->h >> mpi->chroma_y_shift;
-
- mp_image_t *dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->w,mpi->h);
-
- assert(mpi->flags&MP_IMGFLAG_PLANAR);
-
- blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);
- blur(dmpi->planes[1], mpi->planes[1], cw , ch , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);
- blur(dmpi->planes[2], mpi->planes[2], cw , ch , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-//===========================================================================//
-
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- switch(fmt)
- {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_YVU9:
- case IMGFMT_444P:
- case IMGFMT_422P:
- case IMGFMT_411P:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static int vf_open(vf_instance_t *vf, char *args){
- int e;
-
- vf->config=config;
- vf->put_image=put_image;
-// vf->get_image=get_image;
- vf->query_format=query_format;
- vf->uninit=uninit;
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
-
- if(args==NULL) return 0;
-
- e=sscanf(args, "%f:%f:%f:%f:%f:%f",
- &vf->priv->luma.radius,
- &vf->priv->luma.preFilterRadius,
- &vf->priv->luma.strength,
- &vf->priv->chroma.radius,
- &vf->priv->chroma.preFilterRadius,
- &vf->priv->chroma.strength
- );
-
- vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
-
- if(e==3){
- vf->priv->chroma.radius= vf->priv->luma.radius;
- vf->priv->chroma.preFilterRadius = vf->priv->luma.preFilterRadius;
- vf->priv->chroma.strength= vf->priv->luma.strength;
- }else if(e!=6)
- return 0;
-
-// if(vf->priv->luma.radius < 0) return 0;
-// if(vf->priv->chroma.radius < 0) return 0;
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_sab = {
- "shape adaptive blur",
- "sab",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
-
-//===========================================================================//
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_scale.h b/ffmpeg/libavfilter/libmpcodecs/vf_scale.h
deleted file mode 100644
index 177fbe5..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_scale.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef MPLAYER_VF_SCALE_H
-#define MPLAYER_VF_SCALE_H
-
-extern int ff_sws_chr_vshift;
-extern int ff_sws_chr_hshift;
-
-extern float ff_sws_chr_gblur;
-extern float ff_sws_lum_gblur;
-extern float ff_sws_chr_sharpen;
-extern float ff_sws_lum_sharpen;
-
-extern int ff_sws_flags;
-
-struct SwsContext *ff_sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
-
-#endif /* MPLAYER_VF_SCALE_H */
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_spp.c b/ffmpeg/libavfilter/libmpcodecs/vf_spp.c
deleted file mode 100644
index 75ede23..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_spp.c
+++ /dev/null
@@ -1,621 +0,0 @@
-/*
- * Copyright (C) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/*
- * This implementation is based on an algorithm described in
- * "Aria Nosratinia Embedded Post-Processing for
- * Enhancement of Compressed Images (1999)"
- * (http://citeseer.nj.nec.com/nosratinia99embedded.html)
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <math.h>
-
-#include "config.h"
-
-#include "mp_msg.h"
-#include "cpudetect.h"
-
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-
-#undef fprintf
-#undef free
-#undef malloc
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-#include "av_helpers.h"
-#include "libvo/fastmemcpy.h"
-
-#define XMIN(a,b) ((a) < (b) ? (a) : (b))
-
-//===========================================================================//
-static const uint8_t __attribute__((aligned(8))) dither[8][8]={
-{ 0, 48, 12, 60, 3, 51, 15, 63, },
-{ 32, 16, 44, 28, 35, 19, 47, 31, },
-{ 8, 56, 4, 52, 11, 59, 7, 55, },
-{ 40, 24, 36, 20, 43, 27, 39, 23, },
-{ 2, 50, 14, 62, 1, 49, 13, 61, },
-{ 34, 18, 46, 30, 33, 17, 45, 29, },
-{ 10, 58, 6, 54, 9, 57, 5, 53, },
-{ 42, 26, 38, 22, 41, 25, 37, 21, },
-};
-
-static const uint8_t offset[127][2]= {
-{0,0},
-{0,0}, {4,4},
-{0,0}, {2,2}, {6,4}, {4,6},
-{0,0}, {5,1}, {2,2}, {7,3}, {4,4}, {1,5}, {6,6}, {3,7},
-
-{0,0}, {4,0}, {1,1}, {5,1}, {3,2}, {7,2}, {2,3}, {6,3},
-{0,4}, {4,4}, {1,5}, {5,5}, {3,6}, {7,6}, {2,7}, {6,7},
-
-{0,0}, {0,2}, {0,4}, {0,6}, {1,1}, {1,3}, {1,5}, {1,7},
-{2,0}, {2,2}, {2,4}, {2,6}, {3,1}, {3,3}, {3,5}, {3,7},
-{4,0}, {4,2}, {4,4}, {4,6}, {5,1}, {5,3}, {5,5}, {5,7},
-{6,0}, {6,2}, {6,4}, {6,6}, {7,1}, {7,3}, {7,5}, {7,7},
-
-{0,0}, {4,4}, {0,4}, {4,0}, {2,2}, {6,6}, {2,6}, {6,2},
-{0,2}, {4,6}, {0,6}, {4,2}, {2,0}, {6,4}, {2,4}, {6,0},
-{1,1}, {5,5}, {1,5}, {5,1}, {3,3}, {7,7}, {3,7}, {7,3},
-{1,3}, {5,7}, {1,7}, {5,3}, {3,1}, {7,5}, {3,5}, {7,1},
-{0,1}, {4,5}, {0,5}, {4,1}, {2,3}, {6,7}, {2,7}, {6,3},
-{0,3}, {4,7}, {0,7}, {4,3}, {2,1}, {6,5}, {2,5}, {6,1},
-{1,0}, {5,4}, {1,4}, {5,0}, {3,2}, {7,6}, {3,6}, {7,2},
-{1,2}, {5,6}, {1,6}, {5,2}, {3,0}, {7,4}, {3,4}, {7,0},
-};
-
-struct vf_priv_s {
- int log2_count;
- int qp;
- int mode;
- int mpeg2;
- int temp_stride;
- uint8_t *src;
- int16_t *temp;
- AVCodecContext *avctx;
- DSPContext dsp;
- char *non_b_qp;
-};
-
-#define SHIFT 22
-
-static void hardthresh_c(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){
- int i;
- int bias= 0; //FIXME
- unsigned int threshold1, threshold2;
-
- threshold1= qp*((1<<4) - bias) - 1;
- threshold2= (threshold1<<1);
-
- memset(dst, 0, 64*sizeof(int16_t));
- dst[0]= (src[0] + 4)>>3;
-
- for(i=1; i<64; i++){
- int level= src[i];
- if(((unsigned)(level+threshold1))>threshold2){
- const int j= permutation[i];
- dst[j]= (level + 4)>>3;
- }
- }
-}
-
-static void softthresh_c(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){
- int i;
- int bias= 0; //FIXME
- unsigned int threshold1, threshold2;
-
- threshold1= qp*((1<<4) - bias) - 1;
- threshold2= (threshold1<<1);
-
- memset(dst, 0, 64*sizeof(int16_t));
- dst[0]= (src[0] + 4)>>3;
-
- for(i=1; i<64; i++){
- int level= src[i];
- if(((unsigned)(level+threshold1))>threshold2){
- const int j= permutation[i];
- if(level>0)
- dst[j]= (level - threshold1 + 4)>>3;
- else
- dst[j]= (level + threshold1 + 4)>>3;
- }
- }
-}
-
-#if HAVE_MMX
-static void hardthresh_mmx(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){
- int bias= 0; //FIXME
- unsigned int threshold1;
-
- threshold1= qp*((1<<4) - bias) - 1;
-
- __asm__ volatile(
-#define REQUANT_CORE(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \
- "movq " #src0 ", %%mm0 \n\t"\
- "movq " #src1 ", %%mm1 \n\t"\
- "movq " #src2 ", %%mm2 \n\t"\
- "movq " #src3 ", %%mm3 \n\t"\
- "psubw %%mm4, %%mm0 \n\t"\
- "psubw %%mm4, %%mm1 \n\t"\
- "psubw %%mm4, %%mm2 \n\t"\
- "psubw %%mm4, %%mm3 \n\t"\
- "paddusw %%mm5, %%mm0 \n\t"\
- "paddusw %%mm5, %%mm1 \n\t"\
- "paddusw %%mm5, %%mm2 \n\t"\
- "paddusw %%mm5, %%mm3 \n\t"\
- "paddw %%mm6, %%mm0 \n\t"\
- "paddw %%mm6, %%mm1 \n\t"\
- "paddw %%mm6, %%mm2 \n\t"\
- "paddw %%mm6, %%mm3 \n\t"\
- "psubusw %%mm6, %%mm0 \n\t"\
- "psubusw %%mm6, %%mm1 \n\t"\
- "psubusw %%mm6, %%mm2 \n\t"\
- "psubusw %%mm6, %%mm3 \n\t"\
- "psraw $3, %%mm0 \n\t"\
- "psraw $3, %%mm1 \n\t"\
- "psraw $3, %%mm2 \n\t"\
- "psraw $3, %%mm3 \n\t"\
-\
- "movq %%mm0, %%mm7 \n\t"\
- "punpcklwd %%mm2, %%mm0 \n\t" /*A*/\
- "punpckhwd %%mm2, %%mm7 \n\t" /*C*/\
- "movq %%mm1, %%mm2 \n\t"\
- "punpcklwd %%mm3, %%mm1 \n\t" /*B*/\
- "punpckhwd %%mm3, %%mm2 \n\t" /*D*/\
- "movq %%mm0, %%mm3 \n\t"\
- "punpcklwd %%mm1, %%mm0 \n\t" /*A*/\
- "punpckhwd %%mm7, %%mm3 \n\t" /*C*/\
- "punpcklwd %%mm2, %%mm7 \n\t" /*B*/\
- "punpckhwd %%mm2, %%mm1 \n\t" /*D*/\
-\
- "movq %%mm0, " #dst0 " \n\t"\
- "movq %%mm7, " #dst1 " \n\t"\
- "movq %%mm3, " #dst2 " \n\t"\
- "movq %%mm1, " #dst3 " \n\t"
-
- "movd %2, %%mm4 \n\t"
- "movd %3, %%mm5 \n\t"
- "movd %4, %%mm6 \n\t"
- "packssdw %%mm4, %%mm4 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "packssdw %%mm4, %%mm4 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- REQUANT_CORE( (%1), 8(%1), 16(%1), 24(%1), (%0), 8(%0), 64(%0), 72(%0))
- REQUANT_CORE(32(%1), 40(%1), 48(%1), 56(%1),16(%0),24(%0), 48(%0), 56(%0))
- REQUANT_CORE(64(%1), 72(%1), 80(%1), 88(%1),32(%0),40(%0), 96(%0),104(%0))
- REQUANT_CORE(96(%1),104(%1),112(%1),120(%1),80(%0),88(%0),112(%0),120(%0))
- : : "r" (src), "r" (dst), "g" (threshold1+1), "g" (threshold1+5), "g" (threshold1-4) //FIXME maybe more accurate then needed?
- );
- dst[0]= (src[0] + 4)>>3;
-}
-
-static void softthresh_mmx(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){
- int bias= 0; //FIXME
- unsigned int threshold1;
-
- threshold1= qp*((1<<4) - bias) - 1;
-
- __asm__ volatile(
-#undef REQUANT_CORE
-#define REQUANT_CORE(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \
- "movq " #src0 ", %%mm0 \n\t"\
- "movq " #src1 ", %%mm1 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "pxor %%mm7, %%mm7 \n\t"\
- "pcmpgtw %%mm0, %%mm6 \n\t"\
- "pcmpgtw %%mm1, %%mm7 \n\t"\
- "pxor %%mm6, %%mm0 \n\t"\
- "pxor %%mm7, %%mm1 \n\t"\
- "psubusw %%mm4, %%mm0 \n\t"\
- "psubusw %%mm4, %%mm1 \n\t"\
- "pxor %%mm6, %%mm0 \n\t"\
- "pxor %%mm7, %%mm1 \n\t"\
- "movq " #src2 ", %%mm2 \n\t"\
- "movq " #src3 ", %%mm3 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "pxor %%mm7, %%mm7 \n\t"\
- "pcmpgtw %%mm2, %%mm6 \n\t"\
- "pcmpgtw %%mm3, %%mm7 \n\t"\
- "pxor %%mm6, %%mm2 \n\t"\
- "pxor %%mm7, %%mm3 \n\t"\
- "psubusw %%mm4, %%mm2 \n\t"\
- "psubusw %%mm4, %%mm3 \n\t"\
- "pxor %%mm6, %%mm2 \n\t"\
- "pxor %%mm7, %%mm3 \n\t"\
-\
- "paddsw %%mm5, %%mm0 \n\t"\
- "paddsw %%mm5, %%mm1 \n\t"\
- "paddsw %%mm5, %%mm2 \n\t"\
- "paddsw %%mm5, %%mm3 \n\t"\
- "psraw $3, %%mm0 \n\t"\
- "psraw $3, %%mm1 \n\t"\
- "psraw $3, %%mm2 \n\t"\
- "psraw $3, %%mm3 \n\t"\
-\
- "movq %%mm0, %%mm7 \n\t"\
- "punpcklwd %%mm2, %%mm0 \n\t" /*A*/\
- "punpckhwd %%mm2, %%mm7 \n\t" /*C*/\
- "movq %%mm1, %%mm2 \n\t"\
- "punpcklwd %%mm3, %%mm1 \n\t" /*B*/\
- "punpckhwd %%mm3, %%mm2 \n\t" /*D*/\
- "movq %%mm0, %%mm3 \n\t"\
- "punpcklwd %%mm1, %%mm0 \n\t" /*A*/\
- "punpckhwd %%mm7, %%mm3 \n\t" /*C*/\
- "punpcklwd %%mm2, %%mm7 \n\t" /*B*/\
- "punpckhwd %%mm2, %%mm1 \n\t" /*D*/\
-\
- "movq %%mm0, " #dst0 " \n\t"\
- "movq %%mm7, " #dst1 " \n\t"\
- "movq %%mm3, " #dst2 " \n\t"\
- "movq %%mm1, " #dst3 " \n\t"
-
- "movd %2, %%mm4 \n\t"
- "movd %3, %%mm5 \n\t"
- "packssdw %%mm4, %%mm4 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- "packssdw %%mm4, %%mm4 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- REQUANT_CORE( (%1), 8(%1), 16(%1), 24(%1), (%0), 8(%0), 64(%0), 72(%0))
- REQUANT_CORE(32(%1), 40(%1), 48(%1), 56(%1),16(%0),24(%0), 48(%0), 56(%0))
- REQUANT_CORE(64(%1), 72(%1), 80(%1), 88(%1),32(%0),40(%0), 96(%0),104(%0))
- REQUANT_CORE(96(%1),104(%1),112(%1),120(%1),80(%0),88(%0),112(%0),120(%0))
- : : "r" (src), "r" (dst), "g" (threshold1), "rm" (4) //FIXME maybe more accurate then needed?
- );
-
- dst[0]= (src[0] + 4)>>3;
-}
-#endif
-
-static inline void add_block(int16_t *dst, int stride, int16_t block[64]){
- int y;
-
- for(y=0; y<8; y++){
- *(uint32_t*)&dst[0 + y*stride]+= *(uint32_t*)&block[0 + y*8];
- *(uint32_t*)&dst[2 + y*stride]+= *(uint32_t*)&block[2 + y*8];
- *(uint32_t*)&dst[4 + y*stride]+= *(uint32_t*)&block[4 + y*8];
- *(uint32_t*)&dst[6 + y*stride]+= *(uint32_t*)&block[6 + y*8];
- }
-}
-
-static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
- int y, x;
-
-#define STORE(pos) \
- temp= ((src[x + y*src_stride + pos]<<log2_scale) + d[pos])>>6;\
- if(temp & 0x100) temp= ~(temp>>31);\
- dst[x + y*dst_stride + pos]= temp;
-
- for(y=0; y<height; y++){
- const uint8_t *d= dither[y];
- for(x=0; x<width; x+=8){
- int temp;
- STORE(0);
- STORE(1);
- STORE(2);
- STORE(3);
- STORE(4);
- STORE(5);
- STORE(6);
- STORE(7);
- }
- }
-}
-
-#if HAVE_MMX
-static void store_slice_mmx(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
- int y;
-
- for(y=0; y<height; y++){
- uint8_t *dst1= dst;
- int16_t *src1= src;
- __asm__ volatile(
- "movq (%3), %%mm3 \n\t"
- "movq (%3), %%mm4 \n\t"
- "movd %4, %%mm2 \n\t"
- "pxor %%mm0, %%mm0 \n\t"
- "punpcklbw %%mm0, %%mm3 \n\t"
- "punpckhbw %%mm0, %%mm4 \n\t"
- "psraw %%mm2, %%mm3 \n\t"
- "psraw %%mm2, %%mm4 \n\t"
- "movd %5, %%mm2 \n\t"
- "1: \n\t"
- "movq (%0), %%mm0 \n\t"
- "movq 8(%0), %%mm1 \n\t"
- "paddw %%mm3, %%mm0 \n\t"
- "paddw %%mm4, %%mm1 \n\t"
- "psraw %%mm2, %%mm0 \n\t"
- "psraw %%mm2, %%mm1 \n\t"
- "packuswb %%mm1, %%mm0 \n\t"
- "movq %%mm0, (%1) \n\t"
- "add $16, %0 \n\t"
- "add $8, %1 \n\t"
- "cmp %2, %1 \n\t"
- " jb 1b \n\t"
- : "+r" (src1), "+r"(dst1)
- : "r"(dst + width), "r"(dither[y]), "g"(log2_scale), "g"(6-log2_scale)
- );
- src += src_stride;
- dst += dst_stride;
- }
-// if(width != mmxw)
-// store_slice_c(dst + mmxw, src + mmxw, dst_stride, src_stride, width - mmxw, log2_scale);
-}
-#endif
-
-static void (*store_slice)(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)= store_slice_c;
-
-static void (*requantize)(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation)= hardthresh_c;
-
-static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma){
- int x, y, i;
- const int count= 1<<p->log2_count;
- const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15));
- uint64_t __attribute__((aligned(16))) block_align[32];
- int16_t *block = (int16_t *)block_align;
- int16_t *block2= (int16_t *)(block_align+16);
-
- if (!src || !dst) return; // HACK avoid crash for Y8 colourspace
- for(y=0; y<height; y++){
- int index= 8 + 8*stride + y*stride;
- fast_memcpy(p->src + index, src + y*src_stride, width);
- for(x=0; x<8; x++){
- p->src[index - x - 1]= p->src[index + x ];
- p->src[index + width + x ]= p->src[index + width - x - 1];
- }
- }
- for(y=0; y<8; y++){
- fast_memcpy(p->src + ( 7-y)*stride, p->src + ( y+8)*stride, stride);
- fast_memcpy(p->src + (height+8+y)*stride, p->src + (height-y+7)*stride, stride);
- }
- //FIXME (try edge emu)
-
- for(y=0; y<height+8; y+=8){
- memset(p->temp + (8+y)*stride, 0, 8*stride*sizeof(int16_t));
- for(x=0; x<width+8; x+=8){
- const int qps= 3 + is_luma;
- int qp;
-
- if(p->qp)
- qp= p->qp;
- else{
- qp= qp_store[ (XMIN(x, width-1)>>qps) + (XMIN(y, height-1)>>qps) * qp_stride];
- qp = FFMAX(1, norm_qscale(qp, p->mpeg2));
- }
- for(i=0; i<count; i++){
- const int x1= x + offset[i+count-1][0];
- const int y1= y + offset[i+count-1][1];
- const int index= x1 + y1*stride;
- p->dsp.get_pixels(block, p->src + index, stride);
- p->dsp.fdct(block);
- requantize(block2, block, qp, p->dsp.idct_permutation);
- p->dsp.idct(block2);
- add_block(p->temp + index, stride, block2);
- }
- }
- if(y)
- store_slice(dst + (y-8)*dst_stride, p->temp + 8 + y*stride, dst_stride, stride, width, XMIN(8, height+8-y), 6-p->log2_count);
- }
-#if 0
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- if((((x>>6) ^ (y>>6)) & 1) == 0)
- dst[x + y*dst_stride]= p->src[8 + 8*stride + x + y*stride];
- if((x&63) == 0 || (y&63)==0)
- dst[x + y*dst_stride] += 128;
- }
- }
-#endif
- //FIXME reorder for better caching
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
- int h= (height+16+15)&(~15);
-
- vf->priv->temp_stride= (width+16+15)&(~15);
- vf->priv->temp= malloc(vf->priv->temp_stride*h*sizeof(int16_t));
- vf->priv->src = malloc(vf->priv->temp_stride*h*sizeof(uint8_t));
-
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-
-static void get_image(struct vf_instance *vf, mp_image_t *mpi){
- if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
- // ok, we can do pp in-place (or pp disabled):
- vf->dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- mpi->type, mpi->flags | MP_IMGFLAG_READABLE, mpi->width, mpi->height);
- mpi->planes[0]=vf->dmpi->planes[0];
- mpi->stride[0]=vf->dmpi->stride[0];
- mpi->width=vf->dmpi->width;
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- mpi->planes[1]=vf->dmpi->planes[1];
- mpi->planes[2]=vf->dmpi->planes[2];
- mpi->stride[1]=vf->dmpi->stride[1];
- mpi->stride[2]=vf->dmpi->stride[2];
- }
- mpi->flags|=MP_IMGFLAG_DIRECT;
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- mp_image_t *dmpi;
-
- if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
- // no DR, so get a new image! hope we'll get DR buffer:
- dmpi=ff_vf_get_image(vf->next,mpi->imgfmt,
- MP_IMGTYPE_TEMP,
- MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
- mpi->width,mpi->height);
- ff_vf_clone_mpi_attributes(dmpi, mpi);
- }else{
- dmpi=vf->dmpi;
- }
-
- vf->priv->mpeg2= mpi->qscale_type;
- if(mpi->pict_type != 3 && mpi->qscale && !vf->priv->qp){
- int w = mpi->qstride;
- int h = (mpi->h + 15) >> 4;
- if (!w) {
- w = (mpi->w + 15) >> 4;
- h = 1;
- }
- if(!vf->priv->non_b_qp)
- vf->priv->non_b_qp= malloc(w*h);
- fast_memcpy(vf->priv->non_b_qp, mpi->qscale, w*h);
- }
- if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
- char *qp_tab= vf->priv->non_b_qp;
- if((vf->priv->mode&4) || !qp_tab)
- qp_tab= mpi->qscale;
-
- if(qp_tab || vf->priv->qp){
- filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
- filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
- filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
- }else{
- memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
- memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
- memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
- }
- }
-
-#if HAVE_MMX
- if(ff_gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
-#endif
-#if HAVE_MMX2
- if(ff_gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
-#endif
-
- return ff_vf_next_put_image(vf,dmpi, pts);
-}
-
-static void uninit(struct vf_instance *vf){
- if(!vf->priv) return;
-
- free(vf->priv->temp);
- vf->priv->temp= NULL;
- free(vf->priv->src);
- vf->priv->src= NULL;
- free(vf->priv->avctx);
- vf->priv->avctx= NULL;
- free(vf->priv->non_b_qp);
- vf->priv->non_b_qp= NULL;
-
- free(vf->priv);
- vf->priv=NULL;
-}
-
-//===========================================================================//
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- switch(fmt){
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_CLPL:
- case IMGFMT_Y800:
- case IMGFMT_Y8:
- case IMGFMT_444P:
- case IMGFMT_422P:
- case IMGFMT_411P:
- return ff_vf_next_query_format(vf,fmt);
- }
- return 0;
-}
-
-static int control(struct vf_instance *vf, int request, void* data){
- switch(request){
- case VFCTRL_QUERY_MAX_PP_LEVEL:
- return 6;
- case VFCTRL_SET_PP_LEVEL:
- vf->priv->log2_count= *((unsigned int*)data);
- return CONTROL_TRUE;
- }
- return ff_vf_next_control(vf,request,data);
-}
-
-static int vf_open(vf_instance_t *vf, char *args){
-
- int log2c=-1;
-
- vf->config=config;
- vf->put_image=put_image;
- vf->get_image=get_image;
- vf->query_format=query_format;
- vf->uninit=uninit;
- vf->control= control;
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
-
- ff_init_avcodec();
-
- vf->priv->avctx= avcodec_alloc_context3(NULL);
- ff_dsputil_init(&vf->priv->dsp, vf->priv->avctx);
-
- vf->priv->log2_count= 3;
-
- if (args) sscanf(args, "%d:%d:%d", &log2c, &vf->priv->qp, &vf->priv->mode);
-
- if( log2c >=0 && log2c <=6 )
- vf->priv->log2_count = log2c;
-
- if(vf->priv->qp < 0)
- vf->priv->qp = 0;
-
- switch(vf->priv->mode&3){
- default:
- case 0: requantize= hardthresh_c; break;
- case 1: requantize= softthresh_c; break;
- }
-
-#if HAVE_MMX
- if(ff_gCpuCaps.hasMMX){
- store_slice= store_slice_mmx;
- switch(vf->priv->mode&3){
- case 0: requantize= hardthresh_mmx; break;
- case 1: requantize= softthresh_mmx; break;
- }
- }
-#endif
-
- return 1;
-}
-
-const vf_info_t ff_vf_info_spp = {
- "simple postprocess",
- "spp",
- "Michael Niedermayer",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_telecine.c b/ffmpeg/libavfilter/libmpcodecs/vf_telecine.c
deleted file mode 100644
index 77f75f0..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_telecine.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#include "libvo/fastmemcpy.h"
-
-struct vf_priv_s {
- int frame;
-};
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- mp_image_t *dmpi;
- int ret;
- int w = (IMGFMT_IS_YUVP16(mpi->imgfmt) ? 2 : 1) * mpi->w;
- int chroma_width = (IMGFMT_IS_YUVP16(mpi->imgfmt) ? 2 : 1) * mpi->chroma_width;
-
- vf->priv->frame = (vf->priv->frame+1)%4;
-
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
-
- ret = 0;
- // 0/0 1/1 2/2 2/3 3/0
- switch (vf->priv->frame) {
- case 0:
- my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
- mpi->planes[0]+mpi->stride[0], w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
- mpi->planes[1]+mpi->stride[1],
- chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
- mpi->planes[2]+mpi->stride[2],
- chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- ret = ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- /* Fallthrough */
- case 1:
- case 2:
- memcpy_pic(dmpi->planes[0], mpi->planes[0], w, mpi->h,
- dmpi->stride[0], mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(dmpi->planes[1], mpi->planes[1],
- chroma_width, mpi->chroma_height,
- dmpi->stride[1], mpi->stride[1]);
- memcpy_pic(dmpi->planes[2], mpi->planes[2],
- chroma_width, mpi->chroma_height,
- dmpi->stride[2], mpi->stride[2]);
- }
- return ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE) || ret;
- case 3:
- my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
- mpi->planes[0]+mpi->stride[0], w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
- mpi->planes[1]+mpi->stride[1],
- chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
- mpi->planes[2]+mpi->stride[2],
- chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- ret = ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- my_memcpy_pic(dmpi->planes[0], mpi->planes[0], w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
- chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
- chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- return ret;
- }
- return 0;
-}
-
-#if 0
-static int query_format(struct vf_instance *vf, unsigned int fmt)
-{
- /* FIXME - figure out which other formats work */
- switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-}
-#endif
-
-static void uninit(struct vf_instance *vf)
-{
- free(vf->priv);
-}
-
-static int vf_open(vf_instance_t *vf, char *args)
-{
- //vf->config = config;
- vf->put_image = put_image;
- //vf->query_format = query_format;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
- vf->priv = calloc(1, sizeof(struct vf_priv_s));
- vf->priv->frame = 1;
- if (args) sscanf(args, "%d", &vf->priv->frame);
- vf->priv->frame--;
- return 1;
-}
-
-const vf_info_t ff_vf_info_telecine = {
- "telecine filter",
- "telecine",
- "Rich Felker",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_tinterlace.c b/ffmpeg/libavfilter/libmpcodecs/vf_tinterlace.c
deleted file mode 100644
index 6c7dbab..0000000
--- a/ffmpeg/libavfilter/libmpcodecs/vf_tinterlace.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (C) 2003 Michael Zucchi <notzed@ximian.com>
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-#include "libvo/fastmemcpy.h"
-
-struct vf_priv_s {
- int mode;
- int frame;
- mp_image_t *dmpi;
-};
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- int ret = 0;
- mp_image_t *dmpi;
-
- switch (vf->priv->mode) {
- case 0:
- dmpi = vf->priv->dmpi;
- if (dmpi == NULL) {
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_PRESERVE,
- mpi->width, mpi->height*2);
-
- vf->priv->dmpi = dmpi;
-
- memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
- dmpi->stride[0]*2, mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(dmpi->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[1]*2, mpi->stride[1]);
- memcpy_pic(dmpi->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[2]*2, mpi->stride[2]);
- }
- } else {
- vf->priv->dmpi = NULL;
-
- memcpy_pic(dmpi->planes[0]+dmpi->stride[0], mpi->planes[0], mpi->w, mpi->h,
- dmpi->stride[0]*2, mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(dmpi->planes[1]+dmpi->stride[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[1]*2, mpi->stride[1]);
- memcpy_pic(dmpi->planes[2]+dmpi->stride[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[2]*2, mpi->stride[2]);
- }
- ret = ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- }
- break;
- case 1:
- if (vf->priv->frame & 1)
- ret = ff_vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
- break;
- case 2:
- if ((vf->priv->frame & 1) == 0)
- ret = ff_vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
- break;
- case 3:
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->width, mpi->height*2);
- /* fixme, just clear alternate lines */
- ff_vf_mpi_clear(dmpi, 0, 0, dmpi->w, dmpi->h);
- if ((vf->priv->frame & 1) == 0) {
- memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
- dmpi->stride[0]*2, mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(dmpi->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[1]*2, mpi->stride[1]);
- memcpy_pic(dmpi->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[2]*2, mpi->stride[2]);
- }
- } else {
- memcpy_pic(dmpi->planes[0]+dmpi->stride[0], mpi->planes[0], mpi->w, mpi->h,
- dmpi->stride[0]*2, mpi->stride[0]);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- memcpy_pic(dmpi->planes[1]+dmpi->stride[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[1]*2, mpi->stride[1]);
- memcpy_pic(dmpi->planes[2]+dmpi->stride[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height,
- dmpi->stride[2]*2, mpi->stride[2]);
- }
- }
- ret = ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- break;
- case 4:
- // Interleave even lines (only) from Frame 'i' with odd
- // lines (only) from Frame 'i+1', halving the Frame
- // rate and preserving image height.
-
- dmpi = vf->priv->dmpi;
-
- // @@ Need help: Should I set dmpi->fields to indicate
- // that the (new) frame will be interlaced!? E.g. ...
- // dmpi->fields |= MP_IMGFIELD_INTERLACED;
- // dmpi->fields |= MP_IMGFIELD_TOP_FIRST;
- // etc.
-
- if (dmpi == NULL) {
- dmpi = ff_vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
- MP_IMGFLAG_PRESERVE,
- mpi->width, mpi->height);
-
- vf->priv->dmpi = dmpi;
-
- my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- } else {
- vf->priv->dmpi = NULL;
-
- my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
- mpi->planes[0]+mpi->stride[0],
- mpi->w, mpi->h/2,
- dmpi->stride[0]*2, mpi->stride[0]*2);
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
- mpi->planes[1]+mpi->stride[1],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[1]*2, mpi->stride[1]*2);
- my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
- mpi->planes[2]+mpi->stride[2],
- mpi->chroma_width, mpi->chroma_height/2,
- dmpi->stride[2]*2, mpi->stride[2]*2);
- }
- ret = ff_vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
- }
- break;
- }
-
- vf->priv->frame++;
-
- return ret;
-}
-
-static int query_format(struct vf_instance *vf, unsigned int fmt)
-{
- /* FIXME - figure out which other formats work */
- switch (fmt) {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- return ff_vf_next_query_format(vf, fmt);
- }
- return 0;
-}
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- switch (vf->priv->mode) {
- case 0:
- case 3:
- return ff_vf_next_config(vf,width,height*2,d_width,d_height*2,flags,outfmt);
- case 1: /* odd frames */
- case 2: /* even frames */
- case 4: /* alternate frame (height-preserving) interlacing */
- return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
- }
- return 0;
-}
-
-static void uninit(struct vf_instance *vf)
-{
- free(vf->priv);
-}
-
-static int vf_open(vf_instance_t *vf, char *args)
-{
- struct vf_priv_s *p;
- vf->config = config;
- vf->put_image = put_image;
- vf->query_format = query_format;
- vf->uninit = uninit;
- vf->default_reqs = VFCAP_ACCEPT_STRIDE;
- vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
- p->mode = 0;
- if (args)
- sscanf(args, "%d", &p->mode);
- p->frame = 0;
- return 1;
-}
-
-const vf_info_t ff_vf_info_tinterlace = {
- "temporal field interlacing",
- "tinterlace",
- "Michael Zucchi",
- "",
- vf_open,
- NULL
-};
diff --git a/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c b/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c
index 54cc0f9..1fb2523 100644
--- a/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c
+++ b/ffmpeg/libavfilter/libmpcodecs/vf_uspp.c
@@ -245,8 +245,8 @@ static int config(struct vf_instance *vf,
av_dict_free(&opts);
assert(avctx_enc->codec);
}
- vf->priv->frame= avcodec_alloc_frame();
- vf->priv->frame_dec= avcodec_alloc_frame();
+ vf->priv->frame= av_frame_alloc();
+ vf->priv->frame_dec= av_frame_alloc();
vf->priv->outbuf_size= (width + BLOCK)*(height + BLOCK)*10;
vf->priv->outbuf= malloc(vf->priv->outbuf_size);