From cc058a359efae422a26a275fcb2ebe35f633002b Mon Sep 17 00:00:00 2001 From: v0lt Date: Wed, 12 Jun 2024 06:57:54 +0300 Subject: [PATCH 001/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20Changelog.Rus.txt=20=D0=B8=20Changelog.txt?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 3 +++ docs/Changelog.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 70550f5ed6..5daedeed84 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -2,6 +2,9 @@ 1.7.2.x dev ============================= +Обновлен румынский перевод (автор Andrei Miloiu). +Обновлен корейский перевод (автор Hackjjang). + Обновлены библиотеки: ffmpeg git-n7.1-dev-1158-g7560db937d. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 607617f143..9c47cfa369 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -2,6 +2,9 @@ 1.7.2.x dev ============================= +Updated Romanian translation (by Andrei Miloiu). +Updated Korean translation (by Hackjjang). + Updated libraries: ffmpeg git-n7.1-dev-1158-g7560db937d. From f34e9dba13c865fae85f3f74d5e1e772a755babe Mon Sep 17 00:00:00 2001 From: v0lt Date: Wed, 12 Jun 2024 19:07:16 +0300 Subject: [PATCH 002/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=8F=D0=BF=D0=BE=D0=BD=D1=81=D0=BA=D0=B8=D0=B9?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20(=D0=B0=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D1=80=20tsubasanouta).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Authors.txt | 2 +- docs/Changelog.Rus.txt | 1 + docs/Changelog.txt | 1 + src/apps/mpcresources/mplayerc.ja.rc | 66 +++++++++---------- src/apps/mpcresources/text/mplayerc.ja.rc.txt | 66 +++++++++---------- 5 files changed, 69 insertions(+), 67 deletions(-) diff --git a/docs/Authors.txt b/docs/Authors.txt index 58f3d115ec..d8f013f9e9 100644 --- a/docs/Authors.txt +++ b/docs/Authors.txt @@ -37,7 +37,7 @@ Romanian : AndreiMiloiu Spanish : IPeluchito Turkish : Thingol, cmhrky Ukrainian : arestarh1986 -Japanese : Gyeong, Socket774 +Japanese : Gyeong, Socket774, tsubasanouta Official Beta testers: ---------------------- diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 5daedeed84..22b975dea3 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -4,6 +4,7 @@ ============================= Обновлен румынский перевод (автор Andrei Miloiu). Обновлен корейский перевод (автор Hackjjang). +Обновлен японский перевод (автор tsubasanouta). Обновлены библиотеки: ffmpeg git-n7.1-dev-1158-g7560db937d. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 9c47cfa369..ad41236c17 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -4,6 +4,7 @@ ============================= Updated Romanian translation (by Andrei Miloiu). Updated Korean translation (by Hackjjang). +Updated Japanese translation (by tsubasanouta). Updated libraries: ffmpeg git-n7.1-dev-1158-g7560db937d. diff --git a/src/apps/mpcresources/mplayerc.ja.rc b/src/apps/mpcresources/mplayerc.ja.rc index bc72268078..c9746fb809 100644 --- a/src/apps/mpcresources/mplayerc.ja.rc +++ b/src/apps/mpcresources/mplayerc.ja.rc @@ -3193,48 +3193,48 @@ END STRINGTABLE BEGIN - IDS_CMD_USAGE "使用方法: mpc-be.exe ""pathname"" [switches]\n\n""pathname""\t読み込むメイン ファイルまたはディレクトリ (ワイルドカード使用可)" - IDS_CMD_HELP "/help /h /?\tコマンド ライン スイッチに関するヘルプを表示する" - IDS_CMD_DUB "/dub ""dubname""\t追加の音声ファイルを読み込む" - IDS_CMD_DUBDELAY "/dubdelay ""file""\t追加の音声ファイルを XXms シフトして読み込む\n\t\t(ファイルが ""...DELAY XXms..."" を含んでいる場合)" + IDS_CMD_USAGE "使用方法: mpc-be.exe ""pathname"" [switches]\n\n""pathname""\t\t読み込むメイン ファイルまたはディレクトリ (ワイルドカード使用可)" + IDS_CMD_HELP "/help /h /?\t\tコマンド ライン スイッチに関するヘルプを表示する" + IDS_CMD_DUB "/dub ""dubname""\t\t追加の音声ファイルを読み込む" + IDS_CMD_DUBDELAY "/dubdelay ""file""\t\t追加の音声ファイルを XXms シフトして読み込む\n\t\t\t(ファイルが ""...DELAY XXms..."" を含んでいる場合)" END STRINGTABLE BEGIN - IDS_CMD_D3DFS "/d3dfs\t\t排他フルスクリーン モードでレンダリングを開始する" - IDS_CMD_SUB "/sub ""subname""\t追加の字幕ファイルを読み込む" - IDS_CMD_FILTER "/filter ""filtername""\tDLL から DirectShow フィルターを読み込む (ワイルドカード使用可)" - IDS_CMD_DVD "/dvd\t\tDVD モードで起動する\n\t\t""pathname"" は DVD フォルダーを表す (オプション)" - IDS_CMD_DVDPOS1 "/dvdpos T#C\tタイトル T、チャプター C から再生を開始する" - IDS_CMD_DVDPOS2 "/dvdpos T#P\tタイトル T、位置 P (hh:mm:ss) から再生を開始する" - IDS_CMD_CD "/cd\t\t音声 CD または (S)VCD の全トラックを読み込む\n\t\t""pathname"" はドライブ パスを表す (オプション)" - IDS_CMD_OPEN "/open\t\t自動で再生を開始せずにファイルを開く" - IDS_CMD_PLAY "/play\t\tプレーヤーの起動と同時にファイルを再生する" - IDS_CMD_CLOSE "/close\t\t再生終了後にプレーヤーを終了する (/play 使用時のみ有効)" - IDS_CMD_SHUTDOWN "/shutdown \t再生終了後に OS をシャットダウンする" - IDS_CMD_FULLSCREEN "/fullscreen\t全画面表示モードで起動する" - IDS_CMD_MINIMIZED "/minimized\t最小化モードで起動する" - IDS_CMD_NEW "/new\t\t新規プレーヤーを起動する" - IDS_CMD_ADD "/add\t\t""pathname"" をプレイリストに追加する\n\t\t/open および /play と同時に使用可能" - IDS_CMD_RANDOMIZE "/randomize\tプレイリストをランダム化する" + IDS_CMD_D3DFS "/d3dfs\t\t\t排他フルスクリーン モードでレンダリングを開始する" + IDS_CMD_SUB "/sub ""subname""\t\t追加の字幕ファイルを読み込む" + IDS_CMD_FILTER "/filter ""filtername""\t\tDLL から DirectShow フィルターを読み込む (ワイルドカード使用可)" + IDS_CMD_DVD "/dvd\t\t\tDVD モードで起動する\n\t\t\t""pathname"" は DVD フォルダーを表す (オプション)" + IDS_CMD_DVDPOS1 "/dvdpos T#C\t\tタイトル T、チャプター C から再生を開始する" + IDS_CMD_DVDPOS2 "/dvdpos T#P\t\tタイトル T、位置 P (hh:mm:ss) から再生を開始する" + IDS_CMD_CD "/cd\t\t\t音声 CD または (S)VCD の全トラックを読み込む\n\t\t\t""pathname"" はドライブ パスを表す (オプション)" + IDS_CMD_OPEN "/open\t\t\t自動で再生を開始せずにファイルを開く" + IDS_CMD_PLAY "/play\t\t\tプレーヤーの起動と同時にファイルを再生する" + IDS_CMD_CLOSE "/close\t\t\t再生終了後にプレーヤーを終了する (/play 使用時のみ有効)" + IDS_CMD_SHUTDOWN "/shutdown \t\t再生終了後に OS をシャットダウンする" + IDS_CMD_FULLSCREEN "/fullscreen\t\t全画面表示モードで起動する" + IDS_CMD_MINIMIZED "/minimized\t\t最小化モードで起動する" + IDS_CMD_NEW "/new\t\t\t新規プレーヤーを起動する" + IDS_CMD_ADD "/add\t\t\t""pathname"" をプレイリストに追加する\n\t\t/open および /play と同時に使用可能" + IDS_CMD_RANDOMIZE "/randomize\t\tプレイリストをランダム化する" END STRINGTABLE BEGIN - IDS_CMD_REGVID "/regvid\t\t動画ファイルに関連付ける" - IDS_CMD_REGAUD "/regaud\t\t音声ファイルに関連付ける" - IDS_CMD_REGPL "/regpl\t\tプレイリスト ファイルに関連付ける" - IDS_CMD_REGALL "/regall\t\tサポート対象のすべての種類のファイルに関連付ける" - IDS_CMD_UNREGALL "/unregall\t\tすべての関連付けを解除する" - IDS_CMD_START "/start ms\t\t""ms"" (ミリ秒) の位置から再生を開始する" + IDS_CMD_REGVID "/regvid\t\t\t動画ファイルに関連付ける" + IDS_CMD_REGAUD "/regaud\t\t\t音声ファイルに関連付ける" + IDS_CMD_REGPL "/regpl\t\t\tプレイリスト ファイルに関連付ける" + IDS_CMD_REGALL "/regall\t\t\tサポート対象のすべての種類のファイルに関連付ける" + IDS_CMD_UNREGALL "/unregall\t\t\tすべての関連付けを解除する" + IDS_CMD_START "/start ms\t\t\t""ms"" (ミリ秒) の位置から再生を開始する" IDS_CMD_STARTPOS "/startpos hh:mm:ss\t位置 hh:mm:ss から再生を開始する" - IDS_CMD_FIXEDSIZE "/fixedsize w,h\tウィンドウ サイズを固定する" - IDS_CMD_MONITOR "/monitor N\tN 番目 (N は 1 から始まる) のモニターで起動する" - IDS_CMD_AUDIORENDERER "/audiorenderer N\tN 番目 (N は 1 から始まる) の音声レンダラーを使用する\n\t\t(「音声」設定を参照)" - IDS_CMD_VOLUME "/volume N\t音量を設定する、N は 0 から 100 の範囲で指定する" - IDS_CMD_CLIPBOARD "/clipboard\tクリップボードからパス/リンクを開く" - IDS_CMD_DEVICE "/device\t\t既定のビデオ デバイスを開く" - IDS_CMD_RESET "/reset\t\t初期設定に戻す" + IDS_CMD_FIXEDSIZE "/fixedsize w,h\t\tウィンドウ サイズを固定する" + IDS_CMD_MONITOR "/monitor N\t\tN 番目 (N は 1 から始まる) のモニターで起動する" + IDS_CMD_AUDIORENDERER "/audiorenderer N\t\tN 番目 (N は 1 から始まる) の音声レンダラーを使用する\n\t\t\t(「音声」設定を参照)" + IDS_CMD_VOLUME "/volume N\t\t音量を設定する、N は 0 から 100 の範囲で指定する" + IDS_CMD_CLIPBOARD "/clipboard\t\tクリップボードからパス/リンクを開く" + IDS_CMD_DEVICE "/device\t\t\t既定のビデオ デバイスを開く" + IDS_CMD_RESET "/reset\t\t\t初期設定に戻す" END STRINGTABLE diff --git a/src/apps/mpcresources/text/mplayerc.ja.rc.txt b/src/apps/mpcresources/text/mplayerc.ja.rc.txt index 40ef192021..9032c0a42c 100644 --- a/src/apps/mpcresources/text/mplayerc.ja.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ja.rc.txt @@ -1380,40 +1380,40 @@ STRING IDS_CENTER_LEVEL_DEC "センター音量レベルの減少" STRING IDS_CENTER_LEVEL_INC "センター音量レベルの増加" STRING IDS_CENTER_LEVEL_OSD "センター音量レベル: %+.1f dB" STRING IDS_CLEAR "クリア" -STRING IDS_CMD_ADD "/add\t\t""pathname"" をプレイリストに追加する\n\t\t/open および /play と同時に使用可能" -STRING IDS_CMD_AUDIORENDERER "/audiorenderer N\tN 番目 (N は 1 から始まる) の音声レンダラーを使用する\n\t\t(「音声」設定を参照)" -STRING IDS_CMD_CD "/cd\t\t音声 CD または (S)VCD の全トラックを読み込む\n\t\t""pathname"" はドライブ パスを表す (オプション)" -STRING IDS_CMD_CLIPBOARD "/clipboard\tクリップボードからパス/リンクを開く" -STRING IDS_CMD_CLOSE "/close\t\t再生終了後にプレーヤーを終了する (/play 使用時のみ有効)" -STRING IDS_CMD_D3DFS "/d3dfs\t\t排他フルスクリーン モードでレンダリングを開始する" -STRING IDS_CMD_DEVICE "/device\t\t既定のビデオ デバイスを開く" -STRING IDS_CMD_DUB "/dub ""dubname""\t追加の音声ファイルを読み込む" -STRING IDS_CMD_DUBDELAY "/dubdelay ""file""\t追加の音声ファイルを XXms シフトして読み込む\n\t\t(ファイルが ""...DELAY XXms..."" を含んでいる場合)" -STRING IDS_CMD_DVD "/dvd\t\tDVD モードで起動する\n\t\t""pathname"" は DVD フォルダーを表す (オプション)" -STRING IDS_CMD_DVDPOS1 "/dvdpos T#C\tタイトル T、チャプター C から再生を開始する" -STRING IDS_CMD_DVDPOS2 "/dvdpos T#P\tタイトル T、位置 P (hh:mm:ss) から再生を開始する" -STRING IDS_CMD_FILTER "/filter ""filtername""\tDLL から DirectShow フィルターを読み込む (ワイルドカード使用可)" -STRING IDS_CMD_FIXEDSIZE "/fixedsize w,h\tウィンドウ サイズを固定する" -STRING IDS_CMD_FULLSCREEN "/fullscreen\t全画面表示モードで起動する" -STRING IDS_CMD_HELP "/help /h /?\tコマンド ライン スイッチに関するヘルプを表示する" -STRING IDS_CMD_MINIMIZED "/minimized\t最小化モードで起動する" -STRING IDS_CMD_MONITOR "/monitor N\tN 番目 (N は 1 から始まる) のモニターで起動する" -STRING IDS_CMD_NEW "/new\t\t新規プレーヤーを起動する" -STRING IDS_CMD_OPEN "/open\t\t自動で再生を開始せずにファイルを開く" -STRING IDS_CMD_PLAY "/play\t\tプレーヤーの起動と同時にファイルを再生する" -STRING IDS_CMD_RANDOMIZE "/randomize\tプレイリストをランダム化する" -STRING IDS_CMD_REGALL "/regall\t\tサポート対象のすべての種類のファイルに関連付ける" -STRING IDS_CMD_REGAUD "/regaud\t\t音声ファイルに関連付ける" -STRING IDS_CMD_REGPL "/regpl\t\tプレイリスト ファイルに関連付ける" -STRING IDS_CMD_REGVID "/regvid\t\t動画ファイルに関連付ける" -STRING IDS_CMD_RESET "/reset\t\t初期設定に戻す" -STRING IDS_CMD_SHUTDOWN "/shutdown \t再生終了後に OS をシャットダウンする" -STRING IDS_CMD_START "/start ms\t\t""ms"" (ミリ秒) の位置から再生を開始する" +STRING IDS_CMD_ADD "/add\t\t\t""pathname"" をプレイリストに追加する\n\t\t/open および /play と同時に使用可能" +STRING IDS_CMD_AUDIORENDERER "/audiorenderer N\t\tN 番目 (N は 1 から始まる) の音声レンダラーを使用する\n\t\t\t(「音声」設定を参照)" +STRING IDS_CMD_CD "/cd\t\t\t音声 CD または (S)VCD の全トラックを読み込む\n\t\t\t""pathname"" はドライブ パスを表す (オプション)" +STRING IDS_CMD_CLIPBOARD "/clipboard\t\tクリップボードからパス/リンクを開く" +STRING IDS_CMD_CLOSE "/close\t\t\t再生終了後にプレーヤーを終了する (/play 使用時のみ有効)" +STRING IDS_CMD_D3DFS "/d3dfs\t\t\t排他フルスクリーン モードでレンダリングを開始する" +STRING IDS_CMD_DEVICE "/device\t\t\t既定のビデオ デバイスを開く" +STRING IDS_CMD_DUB "/dub ""dubname""\t\t追加の音声ファイルを読み込む" +STRING IDS_CMD_DUBDELAY "/dubdelay ""file""\t\t追加の音声ファイルを XXms シフトして読み込む\n\t\t\t(ファイルが ""...DELAY XXms..."" を含んでいる場合)" +STRING IDS_CMD_DVD "/dvd\t\t\tDVD モードで起動する\n\t\t\t""pathname"" は DVD フォルダーを表す (オプション)" +STRING IDS_CMD_DVDPOS1 "/dvdpos T#C\t\tタイトル T、チャプター C から再生を開始する" +STRING IDS_CMD_DVDPOS2 "/dvdpos T#P\t\tタイトル T、位置 P (hh:mm:ss) から再生を開始する" +STRING IDS_CMD_FILTER "/filter ""filtername""\t\tDLL から DirectShow フィルターを読み込む (ワイルドカード使用可)" +STRING IDS_CMD_FIXEDSIZE "/fixedsize w,h\t\tウィンドウ サイズを固定する" +STRING IDS_CMD_FULLSCREEN "/fullscreen\t\t全画面表示モードで起動する" +STRING IDS_CMD_HELP "/help /h /?\t\tコマンド ライン スイッチに関するヘルプを表示する" +STRING IDS_CMD_MINIMIZED "/minimized\t\t最小化モードで起動する" +STRING IDS_CMD_MONITOR "/monitor N\t\tN 番目 (N は 1 から始まる) のモニターで起動する" +STRING IDS_CMD_NEW "/new\t\t\t新規プレーヤーを起動する" +STRING IDS_CMD_OPEN "/open\t\t\t自動で再生を開始せずにファイルを開く" +STRING IDS_CMD_PLAY "/play\t\t\tプレーヤーの起動と同時にファイルを再生する" +STRING IDS_CMD_RANDOMIZE "/randomize\t\tプレイリストをランダム化する" +STRING IDS_CMD_REGALL "/regall\t\t\tサポート対象のすべての種類のファイルに関連付ける" +STRING IDS_CMD_REGAUD "/regaud\t\t\t音声ファイルに関連付ける" +STRING IDS_CMD_REGPL "/regpl\t\t\tプレイリスト ファイルに関連付ける" +STRING IDS_CMD_REGVID "/regvid\t\t\t動画ファイルに関連付ける" +STRING IDS_CMD_RESET "/reset\t\t\t初期設定に戻す" +STRING IDS_CMD_SHUTDOWN "/shutdown \t\t再生終了後に OS をシャットダウンする" +STRING IDS_CMD_START "/start ms\t\t\t""ms"" (ミリ秒) の位置から再生を開始する" STRING IDS_CMD_STARTPOS "/startpos hh:mm:ss\t位置 hh:mm:ss から再生を開始する" -STRING IDS_CMD_SUB "/sub ""subname""\t追加の字幕ファイルを読み込む" -STRING IDS_CMD_UNREGALL "/unregall\t\tすべての関連付けを解除する" -STRING IDS_CMD_USAGE "使用方法: mpc-be.exe ""pathname"" [switches]\n\n""pathname""\t読み込むメイン ファイルまたはディレクトリ (ワイルドカード使用可)" -STRING IDS_CMD_VOLUME "/volume N\t音量を設定する、N は 0 から 100 の範囲で指定する" +STRING IDS_CMD_SUB "/sub ""subname""\t\t追加の字幕ファイルを読み込む" +STRING IDS_CMD_UNREGALL "/unregall\t\t\tすべての関連付けを解除する" +STRING IDS_CMD_USAGE "使用方法: mpc-be.exe ""pathname"" [switches]\n\n""pathname""\t\t読み込むメイン ファイルまたはディレクトリ (ワイルドカード使用可)" +STRING IDS_CMD_VOLUME "/volume N\t\t音量を設定する、N は 0 から 100 の範囲で指定する" STRING IDS_CM_AMBIENTLIGHT_BRIGHT "明るい (ガンマ値 2.2)" STRING IDS_CM_AMBIENTLIGHT_DARK "暗い (ガンマ値 2.4)" STRING IDS_CM_AMBIENTLIGHT_DIM "薄暗い (ガンマ値 2.35)" From 9c6025d3ade3ecfb5148ab22a2fe755e4ab6f70d Mon Sep 17 00:00:00 2001 From: v0lt Date: Fri, 14 Jun 2024 06:28:44 +0300 Subject: [PATCH 003/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=8F=D0=BF=D0=BE=D0=BD=D1=81=D0=BA=D0=B8=D0=B9?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20(=D0=B0=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D1=80=20tsubasanouta).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mpcresources/mplayerc.ja.rc | 2 +- src/apps/mpcresources/text/mplayerc.ja.rc.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/mpcresources/mplayerc.ja.rc b/src/apps/mpcresources/mplayerc.ja.rc index c9746fb809..200b727fb6 100644 --- a/src/apps/mpcresources/mplayerc.ja.rc +++ b/src/apps/mpcresources/mplayerc.ja.rc @@ -3215,7 +3215,7 @@ BEGIN IDS_CMD_FULLSCREEN "/fullscreen\t\t全画面表示モードで起動する" IDS_CMD_MINIMIZED "/minimized\t\t最小化モードで起動する" IDS_CMD_NEW "/new\t\t\t新規プレーヤーを起動する" - IDS_CMD_ADD "/add\t\t\t""pathname"" をプレイリストに追加する\n\t\t/open および /play と同時に使用可能" + IDS_CMD_ADD "/add\t\t\t""pathname"" をプレイリストに追加する\n\t\t\t/open および /play と同時に使用可能" IDS_CMD_RANDOMIZE "/randomize\t\tプレイリストをランダム化する" END diff --git a/src/apps/mpcresources/text/mplayerc.ja.rc.txt b/src/apps/mpcresources/text/mplayerc.ja.rc.txt index 9032c0a42c..744b188a9c 100644 --- a/src/apps/mpcresources/text/mplayerc.ja.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ja.rc.txt @@ -1380,7 +1380,7 @@ STRING IDS_CENTER_LEVEL_DEC "センター音量レベルの減少" STRING IDS_CENTER_LEVEL_INC "センター音量レベルの増加" STRING IDS_CENTER_LEVEL_OSD "センター音量レベル: %+.1f dB" STRING IDS_CLEAR "クリア" -STRING IDS_CMD_ADD "/add\t\t\t""pathname"" をプレイリストに追加する\n\t\t/open および /play と同時に使用可能" +STRING IDS_CMD_ADD "/add\t\t\t""pathname"" をプレイリストに追加する\n\t\t\t/open および /play と同時に使用可能" STRING IDS_CMD_AUDIORENDERER "/audiorenderer N\t\tN 番目 (N は 1 から始まる) の音声レンダラーを使用する\n\t\t\t(「音声」設定を参照)" STRING IDS_CMD_CD "/cd\t\t\t音声 CD または (S)VCD の全トラックを読み込む\n\t\t\t""pathname"" はドライブ パスを表す (オプション)" STRING IDS_CMD_CLIPBOARD "/clipboard\t\tクリップボードからパス/リンクを開く" From 5374cd59751832b598fc4b04c0f659e6e7849ed2 Mon Sep 17 00:00:00 2001 From: Andrei Miloiu Date: Sat, 15 Jun 2024 00:27:20 +0300 Subject: [PATCH 004/102] Update mplayerc.ro.rc.txt --- src/apps/mpcresources/text/mplayerc.ro.rc.txt | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.ro.rc.txt b/src/apps/mpcresources/text/mplayerc.ro.rc.txt index 2c39746528..7dd7e42dc0 100644 --- a/src/apps/mpcresources/text/mplayerc.ro.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ro.rc.txt @@ -7,7 +7,7 @@ 12 "Compilator FFmpeg :" 13 "Libavcodec / Libavutil :" 23 "Acesta program este gratuit și lansat sub licența GNU General Public License." -24 "În 2023-2024 traducător a fost Andrei Miloiu. În trecut, au contribuit Daniel Alămiță şi lordkag." +24 "În 2023-2024 traducătorul e Andrei-Valentin Miloiu. În trecut, au contribuit Daniel Alămiță şi lordkag." 25 "OK" END @@ -15,20 +15,20 @@ BEGIN DIALOGEX IDD_ADDCOMMAND_DLG LINES 11 3 "Comanda de selecție" 6 "Filtru:" 9 "OK" -10 "Revocare" +10 "Anulare" END BEGIN DIALOGEX IDD_ADDREGFILTER LINES 10 3 "Alege filtru" 7 "Răsfoire..." 8 "OK" -9 "Revocare" +9 "Anulare" END BEGIN DIALOGEX IDD_AUTH_DLG LINES 15 3 "Este necesară autentificarea" 6 "OK" -7 "Revocare" +7 "Anulare" 9 "Zonă restricționată" 10 "Nume utilizator:" 11 "Parolă:" @@ -60,7 +60,7 @@ BEGIN DIALOGEX IDD_FAVADD LINES 12 8 "Memorează poziția" 9 "Unitate relativă" 10 "OK" -11 "Revocare" +11 "Anulare" END BEGIN DIALOGEX IDD_FAVORGANIZE LINES 13 @@ -107,14 +107,14 @@ END BEGIN DIALOGEX IDD_HISTORY LINES 10 3 "History" 6 "MENU" -8 "Remove selected" +8 "Șterge selecția" END BEGIN DIALOGEX IDD_ITEMPROPERTIES_DIALOG LINES 11 -5 "&Save" -6 "&Revocare" -7 "Title:" -9 "Path:" +5 "&Salvează" +6 "&Anulare" +7 "Titlu:" +9 "Cale:" END BEGIN DIALOGEX IDD_MEDIATYPES_DLG LINES 12 @@ -137,15 +137,15 @@ BEGIN DIALOGEX IDD_OPEN_DLG LINES 18 11 "Dublaj:" 13 "Răsfoire..." 14 "OK" -15 "Revocare" +15 "Anulare" 16 "Adaugă la lista de redare fără a deschide" -17 "Paste URL from clipboard" +17 "Lipește URL-ul din clipboard" END BEGIN DIALOGEX IDD_PLAYLISTNAME LINES 10 3 "Dialogul numelui listei de redare" 6 "OK" -7 "Revocare" +7 "Anulare" 9 "Nume:" END @@ -156,7 +156,7 @@ BEGIN DIALOGEX IDD_PNSPRESET_DLG LINES 22 14 "Sus" 15 "Jos" 16 "&Setează" -18 "&Revocare" +18 "&Anulare" 19 "&Salvează" 20 "Poziție: 0.0 -> 1.0" 21 "Mărire: 0.2 -> 5.0" @@ -197,7 +197,7 @@ BEGIN DIALOGEX IDD_PPAGECAPTURE LINES 22 10 "Audio" 11 "Țară" 15 "Setări digital (BDA)" -16 "Furnizor rețea" +16 "Furnizor de rețea" 17 "Tuner" 18 "Receptor" END @@ -545,7 +545,7 @@ BEGIN DIALOGEX IDD_PPAGEVIDEO LINES 39 14 "Reinițializează la schimbarea ecranului" 15 "Preîncărcări EVR:" 18 "Formatul de suprafață:" -20 "Redimensionare:" +20 "Scalare:" 22 "Reducere la scară de <50%:" 24 "Interval de ieșire:" 26 "Setări pentru randorul video MPC Video Renderer" @@ -630,7 +630,7 @@ END BEGIN DIALOGEX IDD_SELECTMEDIATYPE LINES 9 3 "Selectează tipul media" 7 "OK" -8 "Revocare" +8 "Anulare" END BEGIN DIALOGEX IDD_SHADERCOMBINE_DLG LINES 19 @@ -642,7 +642,7 @@ BEGIN DIALOGEX IDD_SHADERCOMBINE_DLG LINES 19 15 "Mută în &sus" 16 "Mută în &jos" 17 "OK" -18 "Revocare" +18 "Anulare" END BEGIN DIALOGEX IDD_SHADEREDITOR_DLG LINES 13 @@ -655,7 +655,7 @@ BEGIN DIALOGEX IDD_SHADERNEW_DLG LINES 10 3 "Crează un nou nuanțator" 6 "Nume:" 8 "OK" -9 "Revocare" +9 "Anulare" END BEGIN DIALOGEX IDD_SUBTITLEDL_DLG LINES 9 @@ -667,7 +667,7 @@ END BEGIN DIALOGEX IDD_TUNER_SCAN LINES 25 3 "Scanare tuner" 6 "Pornește" -7 "Revocare" +7 "Anulare" 13 "Frecv. de pornire" 15 "Lățime de bandă" 17 "Frecv. de încheiere" @@ -1029,8 +1029,8 @@ BEGIN MENU IDR_POPUP_VIDEOFRAME LINES 26 7 "&Mărime dublă" 8 "&Întinde cât fereastra" 9 "Atinge fereastra din &interior" -10 "Zoom &1" -11 "Zoom &2" +10 "Scalare &1" +11 "Scalare &2" 12 "Atinge fereastra din exteri&or" 14 "&Menține raportul de aspect" 15 "Suprascrie raportul de aspect" @@ -1353,7 +1353,7 @@ STRING IDS_BDA_ERROR_DEMULTIPLEXER "Demultiplexorul nu poate fi creat." STRING IDS_BLOCK_EXTERNAL_VR "Puteți adăuga %s ca un filtru extern.\nTrebuie să vă selectați randorul video preferat de pe pagina de setări Video." STRING IDS_BRIGHTNESS_DEC "Micșorare luminozitate" STRING IDS_BRIGHTNESS_INC "Mărire luminozitate" -STRING IDS_CANCEL "Revocare" +STRING IDS_CANCEL "Anulare" STRING IDS_CANNOT_CHANGE_FORMAT "MPC-BE nu are destule drepturi pentru a schimba asocierea cu formatele de fișiere. Dați clic pe butonul ""Modifică"" pentru a obține drepturi de administrator." STRING IDS_CAPTURE_CHANNEL_FREQ "Canal %d (%.1f MHz)" STRING IDS_CAPTURE_ERROR "Eroare captură" @@ -1492,8 +1492,8 @@ STRING IDS_FRAME_HALF "Jumătate din mărime" STRING IDS_FRAME_NORMAL "Mărime normală" STRING IDS_FRAME_STEP_ERROR_RENDERER "Nu se poate face deplasare cadru cu cadru, încercați un randor video diferit." STRING IDS_FRAME_STRETCH "Întinde cât fereastra" -STRING IDS_FRAME_ZOOM1 "Redimensionare 1" -STRING IDS_FRAME_ZOOM2 "Redimensionare 2" +STRING IDS_FRAME_ZOOM1 "Scalare 1" +STRING IDS_FRAME_ZOOM2 "Scalare 2" STRING IDS_FRONT_CENTER "Centru față" STRING IDS_FRONT_LEFT "Stânga față" STRING IDS_FRONT_LEFT_OF_CENTER "Stânga față a centrului" @@ -1792,8 +1792,8 @@ STRING IDS_OSD_SHADERS_2_ON "Nuanțatoare pixel post-redimensionare: pornit" STRING IDS_OSD_SPEED "Viteză: %sx" STRING IDS_OSD_TEST "OSD Test" STRING IDS_OSD_THUMBS_SAVED "Miniaturi salvate cu succes" -STRING IDS_OSD_ZOOM "Redimensionare: %.0lf%%" -STRING IDS_OSD_ZOOM_AUTO "Redimensionare: Automat" +STRING IDS_OSD_ZOOM "Scalare: %.0lf%%" +STRING IDS_OSD_ZOOM_AUTO "Scalare: Automat" STRING IDS_PANSCAN_EDIT "Modificare..." STRING IDS_PIXELSHADERCOMPILER_0 "D3DX9_xx.dll nu poate fi încărcat, nuanțatoarele pixel nu vor funcționa." STRING IDS_PIXELSHADERCOMPILER_1 "Punctele de intrare necesare ale funcției nu pot fi găsite în D3DX9_xx.dll, nuanțatoarele pixel nu vor funcționa." @@ -1927,7 +1927,7 @@ STRING IDS_SUBDL_DLG_FORMAT_COL "Format" STRING IDS_SUBDL_DLG_LANGUAGE_COL "Limbă" STRING IDS_SUBDL_DLG_NOT_FOUND "Nu s-au găsit subtitrări." STRING IDS_SUBDL_DLG_PARSING "Analizarea listei..." -STRING IDS_SUBDL_DLG_SUBS_AVAIL " %d subtitrare(ări) disponibilă(le)." +STRING IDS_SUBDL_DLG_SUBS_AVAIL " %d subtitrare(ări) disponibilă(e)." STRING IDS_SUBDL_DLG_TITLES_COL "Titlu(ri)" STRING IDS_SUBRESYNC_CAPTION "Resincronizarea subtitrărilor" STRING IDS_SUBRESYNC_CLN_ACTOR "Actor" @@ -2076,23 +2076,23 @@ STRING IDS_VOLUME_GAIN_INC "Crește puterea volumului" STRING IDS_VOLUME_GAIN_MAX "Puterea maximă a volumului" STRING IDS_VOLUME_GAIN_OFF "Oprește puterea volumului" STRING IDS_VOLUME_OSD "Volum: %d%%" -STRING IDS_VOLUME_OSD_MUTE "Vol: %d%% [mut]" +STRING IDS_VOLUME_OSD_MUTE "Volum: %d%% [Mut]" STRING IDS_VTSREADER_LOAD_PGC "Activează o alegere de Titlu" STRING IDS_WEBSERVER_ERROR_TEST "Trebuie să aplicați noile setări înainte de a le testa." STRING IDS_WEBUI_DISABLED_PREVIEW_MSG "Previzualizarea este deocamdată dezactivată. Se poate activa în opțiunile lui MPC-BE." -STRING IDS_ZOOM1 "Redimensionare 1" -STRING IDS_ZOOM2 "Redimensionare 2" +STRING IDS_ZOOM1 "Scalare 1" +STRING IDS_ZOOM2 "Scalare 2" STRING IDS_ZOOM_AUTOFIT "Potrivire automată" STRING IDS_ZOOM_AUTOFITLARGE "Potrivire automată (doar mai mare)" STRING ID_NAVIGATE_SKIPBACK "Sari înapoi\nSari înapoi" STRING ID_NAVIGATE_SKIPFORWARD "Sari înainte\nSari înainte" -STRING ID_PLAY_DECRATE "Micșorează viteză\nMicșorează viteză" +STRING ID_PLAY_DECRATE "Micșorează viteza\nMicșorează viteza" STRING ID_PLAY_FRAMESTEP "Pas\nPas" -STRING ID_PLAY_INCRATE "Mărește viteză\nMărește viteză" +STRING ID_PLAY_INCRATE "Mărește viteza\nMărește viteza" STRING ID_PLAY_PAUSE "Pauză\nPauză" -STRING ID_PLAY_PLAY "Redare\nRedă" -STRING ID_PLAY_STOP "Stop\nOprește" +STRING ID_PLAY_PLAY "Redare\nRedare" +STRING ID_PLAY_STOP "Oprește\nOprește" STRING ID_SHOW_MILLISECONDS "Afișează milisecundele" STRING ID_VOLUME_MUTE "Silenţios\nSilenţios" -STRING ID_VOLUME_MUTE_DISABLED "Fără audio\nFără audio" -STRING ID_VOLUME_MUTE_OFF "Cu sunet\nCu sunet" +STRING ID_VOLUME_MUTE_DISABLED "Fără sunet\nFără sunet" +STRING ID_VOLUME_MUTE_OFF "Activează sunetul\nActivează sunetul" From 3df268f126a901ba0ddf36b536be24ece76ac0ea Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 15 Jun 2024 07:46:42 +0300 Subject: [PATCH 005/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=80=D1=83=D0=BC=D1=8B=D0=BD=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20(=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=20Andrei=20Miloiu).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mpcresources/mplayerc.ro.rc | 74 ++++++++++++++-------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/apps/mpcresources/mplayerc.ro.rc b/src/apps/mpcresources/mplayerc.ro.rc index f71e5b5e92..3cd36c85c4 100644 --- a/src/apps/mpcresources/mplayerc.ro.rc +++ b/src/apps/mpcresources/mplayerc.ro.rc @@ -66,7 +66,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN COMBOBOX IDC_COMBO1,5,5,215,37,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP DEFPUSHBUTTON "OK",IDOK,116,28,50,14 - PUSHBUTTON "Revocare",IDCANCEL,170,28,50,14 + PUSHBUTTON "Anulare",IDCANCEL,170,28,50,14 END IDD_CAPTURE_DLG DIALOGEX 0, 0, 132, 293 @@ -204,9 +204,9 @@ BEGIN COMBOBOX IDC_COMBO2,10,68,188,20,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Răsfoire...",IDC_BUTTON2,200,67,50,14 DEFPUSHBUTTON "OK",IDOK,148,94,50,14,WS_GROUP - PUSHBUTTON "Revocare",IDCANCEL,200,94,50,14 + PUSHBUTTON "Anulare",IDCANCEL,200,94,50,14 CONTROL "Adaugă la lista de redare fără a deschide",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,84,188,9 - CONTROL "Paste URL from clipboard",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,96,134,9 + CONTROL "Lipește URL-ul din clipboard",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,96,134,9 END IDD_ABOUTBOX DIALOGEX 0, 0, 241, 202 @@ -232,7 +232,7 @@ BEGIN CONTROL "https://github.com/Aleksoid1978/MPC-BE",IDC_GITHUB_LINK, "SysLink",WS_TABSTOP,30,126,200,8 LTEXT "Acesta program este gratuit și lansat sub licența GNU General Public License.",IDC_STATIC,30,138,200,18 - LTEXT "În 2023-2024 traducător a fost Andrei Miloiu. În trecut, au contribuit Daniel Alămiță şi lordkag.",IDC_STATIC,30,161,200,18 + LTEXT "În 2023-2024 traducătorul e Andrei-Valentin Miloiu. În trecut, au contribuit Daniel Alămiță şi lordkag.",IDC_STATIC,30,161,200,18 DEFPUSHBUTTON "OK",IDOK,185,183,50,14,WS_GROUP END @@ -590,7 +590,7 @@ BEGIN CONTROL "Memorează poziția",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,38,232,9 CONTROL "Unitate relativă",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,50,232,10 DEFPUSHBUTTON "OK",IDOK,143,62,50,14 - PUSHBUTTON "Revocare",IDCANCEL,197,62,50,14 + PUSHBUTTON "Anulare",IDCANCEL,197,62,50,14 END IDD_FAVORGANIZE DIALOGEX 0, 0, 276, 170 @@ -624,7 +624,7 @@ BEGIN PUSHBUTTON "Jos",IDC_BUTTON5,125,76,35,12 PUSHBUTTON "&Setează",IDC_BUTTON1,165,76,35,12 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,93,188,1 - PUSHBUTTON "&Revocare",IDCANCEL,49,100,50,14 + PUSHBUTTON "&Anulare",IDCANCEL,49,100,50,14 PUSHBUTTON "&Salvează",IDOK,105,100,50,14 LTEXT "Poziție: 0.0 -> 1.0",IDC_STATIC,134,5,70,8 LTEXT "Mărire: 0.2 -> 5.0",IDC_STATIC,134,32,70,8 @@ -715,7 +715,7 @@ BEGIN CONTROL "",IDC_LIST2,"SysListView32",LVS_LIST | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_TABSTOP,5,5,275,154,WS_EX_CLIENTEDGE PUSHBUTTON "Răsfoire...",IDC_BUTTON1,5,163,60,14 DEFPUSHBUTTON "OK",IDOK,177,163,50,14 - PUSHBUTTON "Revocare",IDCANCEL,230,163,50,14 + PUSHBUTTON "Anulare",IDCANCEL,230,163,50,14 END IDD_PPAGESUBSTYLE DIALOGEX 0, 0, 296, 264 @@ -886,7 +886,7 @@ BEGIN CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,33,120,12,13 LTEXT "Formatul de suprafață:",IDC_STATIC2,115,124,72,8 COMBOBOX IDC_COMBO1,188,122,98,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Redimensionare:",IDC_STATIC3,115,141,72,8 + LTEXT "Scalare:",IDC_STATIC3,115,141,72,8 COMBOBOX IDC_DX9RESIZER_COMBO,188,139,98,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Reducere la scară de <50%:",IDC_STATIC10,115,158,72,8 COMBOBOX IDC_COMBO7,188,156,98,49,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -943,7 +943,7 @@ CAPTION "Este necesară autentificarea" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,106,108,50,14 - PUSHBUTTON "Revocare",IDCANCEL,158,108,50,14 + PUSHBUTTON "Anulare",IDCANCEL,158,108,50,14 CONTROL 337,IDC_STATIC,"Static",SS_BITMAP,0,0,213,37 LTEXT "Zonă restricționată",IDC_STATIC,10,40,198,11 LTEXT "Nume utilizator:",IDC_STATIC,10,56,66,8 @@ -1017,7 +1017,7 @@ BEGIN PUSHBUTTON "Mută în &sus",IDC_BUTTON1,162,90,50,14 PUSHBUTTON "Mută în &jos",IDC_BUTTON4,162,108,50,14 DEFPUSHBUTTON "OK",IDOK,162,153,50,14 - PUSHBUTTON "Revocare",IDCANCEL,162,173,50,14 + PUSHBUTTON "Anulare",IDCANCEL,162,173,50,14 END IDD_SHADEREDITOR_DLG DIALOGEX 0, 0, 205, 73 @@ -1112,7 +1112,7 @@ CAPTION "Scanare tuner" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Pornește",ID_START,244,227,50,14 - PUSHBUTTON "Revocare",IDCANCEL,352,227,50,14 + PUSHBUTTON "Anulare",IDCANCEL,352,227,50,14 CONTROL "",IDC_STRENGTH,"msctls_progress32",PBS_VERTICAL | WS_BORDER,373,51,10,158 CONTROL "",IDC_QUALITY,"msctls_progress32",PBS_VERTICAL | WS_BORDER,387,51,10,158 CONTROL "",IDC_CHANNEL_LIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,5,37,343,172 @@ -1147,7 +1147,7 @@ BEGIN COMBOBOX IDC_COMBO2,84,60,202,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_COMBO9,84,75,202,102,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP GROUPBOX "Setări digital (BDA)",IDC_STATIC,5,92,286,59 - LTEXT "Furnizor rețea",IDC_STATIC4,10,106,70,8 + LTEXT "Furnizor de rețea",IDC_STATIC4,10,106,70,8 LTEXT "Tuner",IDC_STATIC5,10,121,70,8 LTEXT "Receptor",IDC_STATIC6,10,136,70,8 COMBOBOX IDC_COMBO4,84,104,202,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP @@ -1260,11 +1260,11 @@ IDD_ITEMPROPERTIES_DIALOG DIALOGEX 0, 0, 238, 100 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "&Save",IDOK,129,82,50,14 - PUSHBUTTON "&Revocare",IDCANCEL,182,82,50,14 - LTEXT "Title:",IDC_STATIC,10,6,50,8 + DEFPUSHBUTTON "&Salvează",IDOK,129,82,50,14 + PUSHBUTTON "&Anulare",IDCANCEL,182,82,50,14 + LTEXT "Titlu:",IDC_STATIC,10,6,50,8 EDITTEXT IDC_EDIT1,10,18,219,13,ES_AUTOHSCROLL - LTEXT "Path:",IDC_STATIC,10,36,50,8 + LTEXT "Cale:",IDC_STATIC,10,36,50,8 EDITTEXT IDC_EDIT2,10,48,219,13,ES_AUTOHSCROLL END @@ -1276,7 +1276,7 @@ BEGIN LTEXT "Nume:",IDC_STATIC,4,5,50,8 EDITTEXT IDC_EDIT1,58,4,188,13,ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,142,23,50,14 - PUSHBUTTON "Revocare",IDCANCEL,196,23,50,14 + PUSHBUTTON "Anulare",IDCANCEL,196,23,50,14 END IDD_CMD_LINE_HELP DIALOGEX 0, 0, 309, 177 @@ -1295,7 +1295,7 @@ CAPTION "Dialogul numelui listei de redare" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,150,42,50,14 - PUSHBUTTON "Revocare",IDCANCEL,204,42,50,14 + PUSHBUTTON "Anulare",IDCANCEL,204,42,50,14 EDITTEXT IDC_EDIT1,94,14,159,14,ES_AUTOHSCROLL RTEXT "Nume:",IDC_STATIC,7,16,84,8 END @@ -1309,7 +1309,7 @@ BEGIN EDITTEXT IDC_EDIT1,38,5,86,13,ES_AUTOHSCROLL CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,20,275,139,WS_EX_CLIENTEDGE DEFPUSHBUTTON "OK",IDOK,177,163,50,14 - PUSHBUTTON "Revocare",IDCANCEL,230,163,50,14 + PUSHBUTTON "Anulare",IDCANCEL,230,163,50,14 END IDD_HISTORY DIALOGEX 0, 0, 276, 170 @@ -1319,7 +1319,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN PUSHBUTTON "MENU",IDC_BUTTON1,4,4,31,14 EDITTEXT IDC_EDIT1,39,5,100,14,ES_AUTOHSCROLL - PUSHBUTTON "Remove selected",IDC_BUTTON2,143,4,76,14 + PUSHBUTTON "Șterge selecția",IDC_BUTTON2,143,4,76,14 CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,23,268,142,WS_EX_CLIENTEDGE END @@ -2043,8 +2043,8 @@ BEGIN MENUITEM "&Mărime dublă", ID_VIEW_VF_DOUBLE MENUITEM "&Întinde cât fereastra", ID_VIEW_VF_STRETCH MENUITEM "Atinge fereastra din &interior", ID_VIEW_VF_FROMINSIDE - MENUITEM "Zoom &1", ID_VIEW_VF_ZOOM1 - MENUITEM "Zoom &2", ID_VIEW_VF_ZOOM2 + MENUITEM "Scalare &1", ID_VIEW_VF_ZOOM1 + MENUITEM "Scalare &2", ID_VIEW_VF_ZOOM2 MENUITEM "Atinge fereastra din exteri&or", ID_VIEW_VF_FROMOUTSIDE MENUITEM SEPARATOR MENUITEM "&Menține raportul de aspect", ID_VIEW_VF_KEEPASPECTRATIO @@ -2598,19 +2598,19 @@ END STRINGTABLE BEGIN - ID_PLAY_PLAY "Redare\nRedă" + ID_PLAY_PLAY "Redare\nRedare" ID_PLAY_PAUSE "Pauză\nPauză" - ID_PLAY_STOP "Stop\nOprește" + ID_PLAY_STOP "Oprește\nOprește" ID_PLAY_FRAMESTEP "Pas\nPas" - ID_PLAY_DECRATE "Micșorează viteză\nMicșorează viteză" - ID_PLAY_INCRATE "Mărește viteză\nMărește viteză" + ID_PLAY_DECRATE "Micșorează viteza\nMicșorează viteza" + ID_PLAY_INCRATE "Mărește viteza\nMărește viteza" END STRINGTABLE BEGIN ID_VOLUME_MUTE "Silenţios\nSilenţios" - ID_VOLUME_MUTE_OFF "Cu sunet\nCu sunet" - ID_VOLUME_MUTE_DISABLED "Fără audio\nFără audio" + ID_VOLUME_MUTE_OFF "Activează sunetul\nActivează sunetul" + ID_VOLUME_MUTE_DISABLED "Fără sunet\nFără sunet" END STRINGTABLE @@ -2728,10 +2728,10 @@ BEGIN IDS_VIDEO_STREAM "Video: %s" IDS_APPLY "Aplică" IDS_CLEAR "Goleşte" - IDS_CANCEL "Revocare" + IDS_CANCEL "Anulare" IDS_TEXTFILE_ENC "Codare:" IDS_SAVE_FILE "Se salvează fișierul" - IDS_VOLUME_OSD_MUTE "Vol: %d%% [mut]" + IDS_VOLUME_OSD_MUTE "Volum: %d%% [Mut]" IDS_COPY_TO_CLIPBOARD "Copiază în clipboard" IDS_AUDIO_LEVEL "Nivel (%d):" IDS_AUDIO_RELEASETIME "Timp de eliberare (%d):" @@ -2742,7 +2742,7 @@ END STRINGTABLE BEGIN - IDS_OSD_ZOOM_AUTO "Redimensionare: Automat" + IDS_OSD_ZOOM_AUTO "Scalare: Automat" IDS_CUSTOM_CHANNEL_MAPPING "Comută repartizarea particularizată a canalelor" IDS_OSD_CUSTOM_CH_MAPPING_ON "Repartizare particularizată a canalelor: Pornită" IDS_OSD_CUSTOM_CH_MAPPING_OFF "Repartizare particularizată a canalelor: Oprită" @@ -2845,8 +2845,8 @@ END STRINGTABLE BEGIN IDS_FRAME_FROMINSIDE "Atinge fereastra din interior" - IDS_FRAME_ZOOM1 "Redimensionare 1" - IDS_FRAME_ZOOM2 "Redimensionare 2" + IDS_FRAME_ZOOM1 "Scalare 1" + IDS_FRAME_ZOOM2 "Scalare 2" IDS_FRAME_FROMOUTSIDE "Atinge fereastra din exteri&or" IDS_CENTER_LEVEL_INC "Crește nivelul central" IDS_CENTER_LEVEL_DEC "Scade nivelul central" @@ -3495,8 +3495,8 @@ BEGIN IDS_DISABLE_DXVA_FILTERS "Dezactivează filtrele DXVA" IDS_STRETCH_TO_WINDOW "Întinde cât fereastra" IDS_TOUCH_WINDOW_FROM_INSIDE "Atinge fereastra din interior" - IDS_ZOOM1 "Redimensionare 1" - IDS_ZOOM2 "Redimensionare 2" + IDS_ZOOM1 "Scalare 1" + IDS_ZOOM2 "Scalare 2" IDS_TOUCH_WINDOW_FROM_OUTSIDE "Atinge fereastra din exterior" IDS_AUDIO_STREAM "Audio %u/%u: %s" IDS_AG_REOPEN "Redeschide fișier" @@ -3659,7 +3659,7 @@ BEGIN IDS_NEW_UPDATE_AVAILABLE "O nouă %s este disponibilă.\n\nVrei să vizitezi site-ul programului MPC-BE ca să o descarci?" IDS_UPDATE_ERROR_CONNECT "Serverul pentru actualizare nu a fost găsit.\n\nVerificaţi conexiunea la internet sau încercaţi mai târziu." IDS_UPDATE_CLOSE "În&chide" - IDS_OSD_ZOOM "Redimensionare: %.0lf%%" + IDS_OSD_ZOOM "Scalare: %.0lf%%" END STRINGTABLE @@ -3745,7 +3745,7 @@ BEGIN IDS_SUBDL_DLG_DOWNLOADING "Descărcare subtitrare(ări), vă rugăm să aşteptaţi." IDS_SUBDL_DLG_PARSING "Analizarea listei..." IDS_SUBDL_DLG_NOT_FOUND "Nu s-au găsit subtitrări." - IDS_SUBDL_DLG_SUBS_AVAIL " %d subtitrare(ări) disponibilă(le)." + IDS_SUBDL_DLG_SUBS_AVAIL " %d subtitrare(ări) disponibilă(e)." IDS_TOOLTIP_MINIMIZE "Minimizează" IDS_TOOLTIP_RESTORE "Restabilește" IDS_TOOLTIP_MAXIMIZE "Maximizează" From ec55f0791b630b21a84bd9d1b934d71392e9ca87 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 15 Jun 2024 07:57:35 +0300 Subject: [PATCH 006/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20ffmpeg=20git-n7.1-dev-1370-gbe2cabce?= =?UTF-8?q?32.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- .../ffmpeg/libavcodec/aac/aacdec_usac.c | 29 +- src/ExtLib/ffmpeg/libavcodec/adpcm.c | 2 +- src/ExtLib/ffmpeg/libavcodec/amrwbdec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/atrac3plus.c | 2 +- src/ExtLib/ffmpeg/libavcodec/blockdsp.c | 4 +- .../libavcodec/cbs_h266_syntax_template.c | 2 +- src/ExtLib/ffmpeg/libavcodec/d3d12va_mpeg2.c | 10 +- src/ExtLib/ffmpeg/libavcodec/d3d12va_vc1.c | 10 +- src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c | 4 +- src/ExtLib/ffmpeg/libavcodec/dxva2_hevc.c | 8 +- src/ExtLib/ffmpeg/libavcodec/dxva2_mpeg2.c | 16 +- src/ExtLib/ffmpeg/libavcodec/dxva2_vc1.c | 20 +- .../ffmpeg/libavcodec/error_resilience.c | 33 +- .../ffmpeg/libavcodec/error_resilience.h | 1 + .../ffmpeg/libavcodec/ffv1dec_template.c | 2 +- src/ExtLib/ffmpeg/libavcodec/flvdec.c | 7 +- src/ExtLib/ffmpeg/libavcodec/g726.c | 2 +- src/ExtLib/ffmpeg/libavcodec/get_buffer.c | 20 +- src/ExtLib/ffmpeg/libavcodec/h261dec.c | 43 +- src/ExtLib/ffmpeg/libavcodec/h263.c | 51 +- src/ExtLib/ffmpeg/libavcodec/h263dec.c | 89 +- src/ExtLib/ffmpeg/libavcodec/h263dec.h | 1 - src/ExtLib/ffmpeg/libavcodec/h263enc.h | 2 +- src/ExtLib/ffmpeg/libavcodec/h264_refs.c | 2 +- src/ExtLib/ffmpeg/libavcodec/h264_slice.c | 4 +- src/ExtLib/ffmpeg/libavcodec/hevc/cabac.c | 154 +- src/ExtLib/ffmpeg/libavcodec/hevc/filter.c | 321 +-- src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c | 1571 +++++------ src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.h | 59 +- src/ExtLib/ffmpeg/libavcodec/hevc/mvs.c | 130 +- src/ExtLib/ffmpeg/libavcodec/hevc/parser.c | 65 +- src/ExtLib/ffmpeg/libavcodec/hevc/pred.h | 4 +- .../ffmpeg/libavcodec/hevc/pred_template.c | 74 +- src/ExtLib/ffmpeg/libavcodec/hevc/ps.c | 33 +- src/ExtLib/ffmpeg/libavcodec/hevc/ps.h | 5 +- src/ExtLib/ffmpeg/libavcodec/hevc/refs.c | 20 +- src/ExtLib/ffmpeg/libavcodec/hpeldsp.c | 2 - src/ExtLib/ffmpeg/libavcodec/idctdsp.c | 2 - src/ExtLib/ffmpeg/libavcodec/intelh263dec.c | 5 +- src/ExtLib/ffmpeg/libavcodec/intrax8.c | 2 +- src/ExtLib/ffmpeg/libavcodec/intrax8.h | 2 +- src/ExtLib/ffmpeg/libavcodec/ituh263dec.c | 34 +- src/ExtLib/ffmpeg/libavcodec/me_cmp.c | 8 +- src/ExtLib/ffmpeg/libavcodec/motion_est.c | 92 +- src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c | 184 +- src/ExtLib/ffmpeg/libavcodec/mpeg4video.c | 8 +- src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c | 98 +- src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c | 80 +- src/ExtLib/ffmpeg/libavcodec/mpeg_er.c | 16 +- src/ExtLib/ffmpeg/libavcodec/mpegpicture.c | 438 ++-- src/ExtLib/ffmpeg/libavcodec/mpegpicture.h | 108 +- src/ExtLib/ffmpeg/libavcodec/mpegvideo.c | 197 +- src/ExtLib/ffmpeg/libavcodec/mpegvideo.h | 38 +- src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c | 337 ++- .../ffmpeg/libavcodec/mpegvideo_motion.c | 83 +- src/ExtLib/ffmpeg/libavcodec/mpegvideodec.h | 14 +- src/ExtLib/ffmpeg/libavcodec/mpegvideoenc.h | 6 +- .../libavcodec/mpv_reconstruct_mb_template.c | 30 +- src/ExtLib/ffmpeg/libavcodec/msmpeg4.c | 21 +- src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c | 99 +- src/ExtLib/ffmpeg/libavcodec/mss2.c | 4 +- src/ExtLib/ffmpeg/libavcodec/nvdec_hevc.c | 12 +- src/ExtLib/ffmpeg/libavcodec/nvdec_mpeg12.c | 6 +- src/ExtLib/ffmpeg/libavcodec/nvdec_vc1.c | 6 +- src/ExtLib/ffmpeg/libavcodec/opus_pvq.c | 4 +- src/ExtLib/ffmpeg/libavcodec/opus_rc.c | 6 +- src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c | 2 - src/ExtLib/ffmpeg/libavcodec/pngdec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/pthread_frame.c | 5 - src/ExtLib/ffmpeg/libavcodec/put_bits.h | 2 +- src/ExtLib/ffmpeg/libavcodec/ratecontrol.h | 9 +- src/ExtLib/ffmpeg/libavcodec/rv10.c | 46 +- src/ExtLib/ffmpeg/libavcodec/rv30.c | 19 +- src/ExtLib/ffmpeg/libavcodec/rv34.c | 180 +- src/ExtLib/ffmpeg/libavcodec/rv40.c | 11 +- src/ExtLib/ffmpeg/libavcodec/vc1.c | 2 +- src/ExtLib/ffmpeg/libavcodec/vc1.h | 1 + src/ExtLib/ffmpeg/libavcodec/vc1_block.c | 194 +- src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c | 56 +- src/ExtLib/ffmpeg/libavcodec/vc1_mc.c | 130 +- src/ExtLib/ffmpeg/libavcodec/vc1_pred.c | 260 +- src/ExtLib/ffmpeg/libavcodec/vc1dec.c | 92 +- src/ExtLib/ffmpeg/libavcodec/vorbisdec.c | 6 +- src/ExtLib/ffmpeg/libavcodec/vvc/cabac.c | 8 +- src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c | 8 +- src/ExtLib/ffmpeg/libavcodec/vvc/inter.c | 27 +- .../ffmpeg/libavcodec/vvc/inter_template.c | 8 +- .../ffmpeg/libavcodec/vvc/intra_template.c | 2 +- .../ffmpeg/libavcodec/vvc/intra_utils.c | 4 +- src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c | 2 +- src/ExtLib/ffmpeg/libavcodec/vvc/ps.c | 14 +- src/ExtLib/ffmpeg/libavcodec/wmv2.c | 3 +- src/ExtLib/ffmpeg/libavcodec/wmv2.h | 3 +- src/ExtLib/ffmpeg/libavcodec/wmv2dec.c | 22 +- src/ExtLib/ffmpeg/libavutil/bswap.h | 8 +- src/ExtLib/ffmpeg/libavutil/common.h | 35 +- src/ExtLib/ffmpeg/libavutil/intmath.h | 4 +- src/ExtLib/ffmpeg/libavutil/intreadwrite.h | 4 +- src/ExtLib/ffmpeg/libavutil/timer.h | 10 + src/ExtLib/ffmpeg/libavutil/version.h | 3 +- src/ExtLib/ffmpeg/libavutil/x86/bswap.h | 13 +- src/ExtLib/ffmpeg/libavutil/x86/intmath.h | 20 +- src/ExtLib/ffmpeg/libswscale/swscale.c | 2 + .../ffmpeg/libswscale/swscale_internal.h | 1 + src/ExtLib/ffmpeg/libswscale/x86/input.asm | 199 +- src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb.c | 2316 ++++++++++++++++- .../ffmpeg/libswscale/x86/rgb_2_rgb.asm | 98 +- src/ExtLib/ffmpeg/libswscale/x86/swscale.c | 15 + 110 files changed, 5424 insertions(+), 3170 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 22b975dea3..6277da33eb 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -7,7 +7,7 @@ Обновлен японский перевод (автор tsubasanouta). Обновлены библиотеки: - ffmpeg git-n7.1-dev-1158-g7560db937d. + ffmpeg git-n7.1-dev-1370-gbe2cabce32. 1.7.2 - 2024-06-07 diff --git a/docs/Changelog.txt b/docs/Changelog.txt index ad41236c17..cc42391ded 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -7,7 +7,7 @@ Updated Korean translation (by Hackjjang). Updated Japanese translation (by tsubasanouta). Updated libraries: - ffmpeg git-n7.1-dev-1158-g7560db937d. + ffmpeg git-n7.1-dev-1370-gbe2cabce32. 1.7.2 - 2024-06-07 diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c index aa89b83182..98e8c1c0bc 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c @@ -560,10 +560,9 @@ static int decode_usac_scale_factors(AACDecContext *ac, * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_spectrum_and_dequant_ac(AACDecContext *s, float coef[1024], - GetBitContext *gb, const float sf[120], - AACArithState *state, int reset, - uint16_t len, uint16_t N) +static int decode_spectrum_ac(AACDecContext *s, float coef[1024], + GetBitContext *gb, AACArithState *state, + int reset, uint16_t len, uint16_t N) { AACArith ac; int i, a, b; @@ -691,10 +690,6 @@ static int decode_usac_stereo_cplx(AACDecContext *ac, AACUsacStereo *us, if (!indep_flag) delta_code_time = get_bits1(gb); - /* Alpha values must be zeroed out if pred_used is 0. */ - memset(us->alpha_q_re, 0, sizeof(us->alpha_q_re)); - memset(us->alpha_q_im, 0, sizeof(us->alpha_q_im)); - /* TODO: shouldn't be needed */ for (int g = 0; g < num_window_groups; g++) { for (int sfb = 0; sfb < cpe->max_sfb_ste; sfb += SFB_PER_PRED_BAND) { @@ -829,6 +824,11 @@ static int decode_usac_stereo_info(AACDecContext *ac, AACUSACConfig *usac, us->common_window = 0; us->common_tw = 0; + /* Alpha values must always be zeroed out for the current frame, + * as they are propagated to the next frame and may be used. */ + memset(us->alpha_q_re, 0, sizeof(us->alpha_q_re)); + memset(us->alpha_q_im, 0, sizeof(us->alpha_q_im)); + if (!(!ue1->core_mode && !ue2->core_mode)) return 0; @@ -971,7 +971,7 @@ static void apply_noise_fill(AACDecContext *ac, SingleChannelElement *sce, } if (band_quantized_to_zero) - sce->sf[g*ics->max_sfb + sfb] += noise_offset; + sce->sfo[g*ics->max_sfb + sfb] += noise_offset; } coef += g_len << 7; } @@ -987,6 +987,9 @@ static void spectrum_scale(AACDecContext *ac, SingleChannelElement *sce, if (ue->noise.level) apply_noise_fill(ac, sce, ue); + /* Noise filling may apply an offset to the scalefactor offset */ + ac->dsp.dequant_scalefactors(sce); + /* Apply scalefactors */ coef = sce->coeffs; for (int g = 0; g < ics->num_window_groups; g++) { @@ -1371,8 +1374,6 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac, if (ret < 0) return ret; - ac->dsp.dequant_scalefactors(sce); - if (ue->tns_data_present) { sce->tns.present = 1; ret = ff_aac_decode_tns(ac, &sce->tns, gb, ics); @@ -1395,10 +1396,8 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac, else N = usac->core_frame_len; - ret = decode_spectrum_and_dequant_ac(ac, sce->coeffs + win*128, gb, - sce->sf, &ue->ac, - arith_reset_flag && (win == 0), - lg, N); + ret = decode_spectrum_ac(ac, sce->coeffs + win*128, gb, &ue->ac, + arith_reset_flag && (win == 0), lg, N); if (ret < 0) return ret; } diff --git a/src/ExtLib/ffmpeg/libavcodec/adpcm.c b/src/ExtLib/ffmpeg/libavcodec/adpcm.c index 59b9ef3497..f63afefd63 100644 --- a/src/ExtLib/ffmpeg/libavcodec/adpcm.c +++ b/src/ExtLib/ffmpeg/libavcodec/adpcm.c @@ -493,7 +493,7 @@ static inline int16_t adpcm_ima_wav_expand_nibble(ADPCMChannelStatus *c, GetBitC step_index = av_clip(step_index, 0, 88); sign = nibble & (1 << shift); - delta = av_mod_uintp2(nibble, shift); + delta = av_zero_extend(nibble, shift); diff = ((2 * delta + 1) * step) >> shift; predictor = c->predictor; if (sign) predictor -= diff; diff --git a/src/ExtLib/ffmpeg/libavcodec/amrwbdec.c b/src/ExtLib/ffmpeg/libavcodec/amrwbdec.c index 21a730b835..bb0864587a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/amrwbdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/amrwbdec.c @@ -370,7 +370,7 @@ static void decode_pitch_vector(AMRWBContext *ctx, } /** Get x bits in the index interval [lsb,lsb+len-1] inclusive */ -#define BIT_STR(x,lsb,len) av_mod_uintp2((x) >> (lsb), (len)) +#define BIT_STR(x,lsb,len) av_zero_extend((x) >> (lsb), (len)) /** Get the bit at specified position */ #define BIT_POS(x, p) (((x) >> (p)) & 1) diff --git a/src/ExtLib/ffmpeg/libavcodec/atrac3plus.c b/src/ExtLib/ffmpeg/libavcodec/atrac3plus.c index c4da6548b9..de48c76633 100644 --- a/src/ExtLib/ffmpeg/libavcodec/atrac3plus.c +++ b/src/ExtLib/ffmpeg/libavcodec/atrac3plus.c @@ -734,7 +734,7 @@ static void decode_qu_spectra(GetBitContext *gb, const Atrac3pSpecCodeTab *tab, val = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1); for (i = 0; i < num_coeffs; i++) { - cf = av_mod_uintp2(val, bits); + cf = av_zero_extend(val, bits); if (is_signed) cf = sign_extend(cf, bits); else if (cf && get_bits1(gb)) diff --git a/src/ExtLib/ffmpeg/libavcodec/blockdsp.c b/src/ExtLib/ffmpeg/libavcodec/blockdsp.c index af932a264e..93eeac341c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/blockdsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/blockdsp.c @@ -63,9 +63,7 @@ av_cold void ff_blockdsp_init(BlockDSPContext *c) c->fill_block_tab[0] = fill_block16_c; c->fill_block_tab[1] = fill_block8_c; -#if ARCH_ALPHA - ff_blockdsp_init_alpha(c); -#elif ARCH_ARM +#if ARCH_ARM ff_blockdsp_init_arm(c); #elif ARCH_PPC ff_blockdsp_init_ppc(c); diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c index 38685704c5..53c4b60b0d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c @@ -3426,7 +3426,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->num_entry_points--; if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: " - "%" PRIu16 ".\n", current->num_entry_points); + "%" PRIu32 ".\n", current->num_entry_points); return AVERROR_PATCHWELCOME; } if (current->num_entry_points > 0) { diff --git a/src/ExtLib/ffmpeg/libavcodec/d3d12va_mpeg2.c b/src/ExtLib/ffmpeg/libavcodec/d3d12va_mpeg2.c index 936af5f86a..86a7d97b34 100644 --- a/src/ExtLib/ffmpeg/libavcodec/d3d12va_mpeg2.c +++ b/src/ExtLib/ffmpeg/libavcodec/d3d12va_mpeg2.c @@ -44,7 +44,7 @@ static int d3d12va_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint { const MpegEncContext *s = avctx->priv_data; D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx); - D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = s->cur_pic.ptr->hwaccel_picture_private; if (!ctx) return -1; @@ -69,7 +69,7 @@ static int d3d12va_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint static int d3d12va_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { const MpegEncContext *s = avctx->priv_data; - D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = s->cur_pic.ptr->hwaccel_picture_private; if (ctx_pic->slice_count >= MAX_SLICES) { return AVERROR(ERANGE); @@ -88,7 +88,7 @@ static int d3d12va_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buff static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer) { const MpegEncContext *s = avctx->priv_data; - D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = s->cur_pic.ptr->hwaccel_picture_private; const int is_field = s->picture_structure != PICT_FRAME; const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); @@ -137,12 +137,12 @@ static int d3d12va_mpeg2_end_frame(AVCodecContext *avctx) { int ret; MpegEncContext *s = avctx->priv_data; - D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = s->cur_pic.ptr->hwaccel_picture_private; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; - ret = ff_d3d12va_common_end_frame(avctx, s->current_picture_ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), + ret = ff_d3d12va_common_end_frame(avctx, s->cur_pic.ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), &ctx_pic->qm, sizeof(ctx_pic->qm), update_input_arguments); if (!ret) ff_mpeg_draw_horiz_band(s, 0, avctx->height); diff --git a/src/ExtLib/ffmpeg/libavcodec/d3d12va_vc1.c b/src/ExtLib/ffmpeg/libavcodec/d3d12va_vc1.c index 110926be82..dccc0fbffa 100644 --- a/src/ExtLib/ffmpeg/libavcodec/d3d12va_vc1.c +++ b/src/ExtLib/ffmpeg/libavcodec/d3d12va_vc1.c @@ -45,7 +45,7 @@ static int d3d12va_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_ { const VC1Context *v = avctx->priv_data; D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx); - D3D12DecodePictureContext *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = v->s.cur_pic.ptr->hwaccel_picture_private; if (!ctx) return -1; @@ -67,7 +67,7 @@ static int d3d12va_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_ static int d3d12va_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { const VC1Context *v = avctx->priv_data; - D3D12DecodePictureContext *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = v->s.cur_pic.ptr->hwaccel_picture_private; if (ctx_pic->slice_count >= MAX_SLICES) { return AVERROR(ERANGE); @@ -93,7 +93,7 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU { const VC1Context *v = avctx->priv_data; const MpegEncContext *s = &v->s; - D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = s->cur_pic.ptr->hwaccel_picture_private; D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args->FrameArguments[input_args->NumFrameArguments++]; const unsigned mb_count = s->mb_width * (s->mb_height >> v->field_mode); @@ -151,12 +151,12 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU static int d3d12va_vc1_end_frame(AVCodecContext *avctx) { const VC1Context *v = avctx->priv_data; - D3D12DecodePictureContext *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; + D3D12DecodePictureContext *ctx_pic = v->s.cur_pic.ptr->hwaccel_picture_private; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; - return ff_d3d12va_common_end_frame(avctx, v->s.current_picture_ptr->f, + return ff_d3d12va_common_end_frame(avctx, v->s.cur_pic.ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), NULL, 0, update_input_arguments); diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c index 7c7eda9d09..a477dbd4e3 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c @@ -142,7 +142,7 @@ static void parse_ext_v1(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm) dm->l2.trim_power = get_bits(gb, 12); dm->l2.trim_chroma_weight = get_bits(gb, 12); dm->l2.trim_saturation_gain = get_bits(gb, 12); - dm->l2.ms_weight = get_bits(gb, 13) - 8192; + dm->l2.ms_weight = get_sbits(gb, 13); break; case 4: dm->l4.anchor_pq = get_bits(gb, 12); @@ -197,7 +197,7 @@ static void parse_ext_v2(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm, dm->l8.trim_power = get_bits(gb, 12); dm->l8.trim_chroma_weight = get_bits(gb, 12); dm->l8.trim_saturation_gain = get_bits(gb, 12); - dm->l8.ms_weight = get_bits(gb, 12) - 8192; + dm->l8.ms_weight = get_bits(gb, 12); if (ext_block_length < 12) break; dm->l8.target_mid_contrast = get_bits(gb, 12); diff --git a/src/ExtLib/ffmpeg/libavcodec/dxva2_hevc.c b/src/ExtLib/ffmpeg/libavcodec/dxva2_hevc.c index fecfbb81df..cf42d8f645 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dxva2_hevc.c +++ b/src/ExtLib/ffmpeg/libavcodec/dxva2_hevc.c @@ -68,8 +68,8 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo { const HEVCContext *h = avctx->priv_data; const HEVCFrame *current_picture = h->cur_frame; - const HEVCSPS *sps = h->ps.sps; - const HEVCPPS *pps = h->ps.pps; + const HEVCPPS *pps = h->pps; + const HEVCSPS *sps = pps->sps; int i, j; // ==> Start patch MPC DXVA_PicParams_HEVC *pp = &ppext->main; @@ -246,8 +246,8 @@ void ff_dxva2_hevc_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext { const HEVCContext *h = avctx->priv_data; unsigned i, j, pos; - const ScalingList *sl = h->ps.pps->scaling_list_data_present_flag ? - &h->ps.pps->scaling_list : &h->ps.sps->scaling_list; + const ScalingList *sl = h->pps->scaling_list_data_present_flag ? + &h->pps->scaling_list : &h->pps->sps->scaling_list; memset(qm, 0, sizeof(*qm)); for (i = 0; i < 6; i++) { diff --git a/src/ExtLib/ffmpeg/libavcodec/dxva2_mpeg2.c b/src/ExtLib/ffmpeg/libavcodec/dxva2_mpeg2.c index e5d3b16044..02338b21f2 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dxva2_mpeg2.c +++ b/src/ExtLib/ffmpeg/libavcodec/dxva2_mpeg2.c @@ -45,17 +45,17 @@ void ff_dxva2_mpeg2_fill_picture_parameters(AVCodecContext *avctx, DXVA_PictureParameters *pp) { const struct MpegEncContext *s = avctx->priv_data; - const Picture *current_picture = s->current_picture_ptr; + const MPVPicture *current_picture = s->cur_pic.ptr; int is_field = s->picture_structure != PICT_FRAME; memset(pp, 0, sizeof(*pp)); pp->wDeblockedPictureIndex = 0; if (s->pict_type != AV_PICTURE_TYPE_I) - pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f, 0); + pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.ptr->f, 0); else pp->wForwardRefPictureIndex = 0xffff; if (s->pict_type == AV_PICTURE_TYPE_B) - pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f, 0); + pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.ptr->f, 0); else pp->wBackwardRefPictureIndex = 0xffff; pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f, 1); @@ -157,7 +157,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, const struct MpegEncContext *s = avctx->priv_data; AVDXVAContext *ctx = DXVA_CONTEXT(avctx); struct dxva2_picture_context *ctx_pic = - s->current_picture_ptr->hwaccel_picture_private; + s->cur_pic.ptr->hwaccel_picture_private; const int is_field = s->picture_structure != PICT_FRAME; const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); void *dxva_data_ptr; @@ -260,7 +260,7 @@ static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, const struct MpegEncContext *s = avctx->priv_data; AVDXVAContext *ctx = DXVA_CONTEXT(avctx); struct dxva2_picture_context *ctx_pic = - s->current_picture_ptr->hwaccel_picture_private; + s->cur_pic.ptr->hwaccel_picture_private; if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; @@ -280,7 +280,7 @@ static int dxva2_mpeg2_decode_slice(AVCodecContext *avctx, { const struct MpegEncContext *s = avctx->priv_data; struct dxva2_picture_context *ctx_pic = - s->current_picture_ptr->hwaccel_picture_private; + s->cur_pic.ptr->hwaccel_picture_private; unsigned position; if (ctx_pic->slice_count >= MAX_SLICES) { @@ -302,12 +302,12 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx) { struct MpegEncContext *s = avctx->priv_data; struct dxva2_picture_context *ctx_pic = - s->current_picture_ptr->hwaccel_picture_private; + s->cur_pic.ptr->hwaccel_picture_private; int ret; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; - ret = ff_dxva2_common_end_frame(avctx, s->current_picture_ptr->f, + ret = ff_dxva2_common_end_frame(avctx, s->cur_pic.ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), &ctx_pic->qm, sizeof(ctx_pic->qm), commit_bitstream_and_slice_buffer); diff --git a/src/ExtLib/ffmpeg/libavcodec/dxva2_vc1.c b/src/ExtLib/ffmpeg/libavcodec/dxva2_vc1.c index 6cba1da393..b54cb09fe9 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dxva2_vc1.c +++ b/src/ExtLib/ffmpeg/libavcodec/dxva2_vc1.c @@ -46,7 +46,7 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx, { const VC1Context *v = avctx->priv_data; const MpegEncContext *s = &v->s; - const Picture *current_picture = s->current_picture_ptr; + const MPVPicture *current_picture = s->cur_pic.ptr; int intcomp = 0; // determine if intensity compensation is needed @@ -58,12 +58,12 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx, } memset(pp, 0, sizeof(*pp)); - if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type) - pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f, 0); + if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_pic.ptr) + pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.ptr->f, 0); else pp->wForwardRefPictureIndex = 0xffff; - if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type) - pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f, 0); + if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_pic.ptr) + pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.ptr->f, 0); else pp->wBackwardRefPictureIndex = 0xffff; pp->wDecodedPictureIndex = @@ -191,7 +191,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, const VC1Context *v = avctx->priv_data; AVDXVAContext *ctx = DXVA_CONTEXT(avctx); const MpegEncContext *s = &v->s; - struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; + struct dxva2_picture_context *ctx_pic = s->cur_pic.ptr->hwaccel_picture_private; static const uint8_t start_code[] = { 0, 0, 1, 0x0d }; const unsigned start_code_size = avctx->codec_id == AV_CODEC_ID_VC1 ? sizeof(start_code) : 0; @@ -317,7 +317,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx, { const VC1Context *v = avctx->priv_data; AVDXVAContext *ctx = DXVA_CONTEXT(avctx); - struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; + struct dxva2_picture_context *ctx_pic = v->s.cur_pic.ptr->hwaccel_picture_private; if (!DXVA_CONTEXT_VALID(avctx, ctx)) return -1; @@ -336,7 +336,7 @@ static int dxva2_vc1_decode_slice(AVCodecContext *avctx, uint32_t size) { const VC1Context *v = avctx->priv_data; - const Picture *current_picture = v->s.current_picture_ptr; + const MPVPicture *current_picture = v->s.cur_pic.ptr; struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; unsigned position; @@ -364,13 +364,13 @@ static int dxva2_vc1_decode_slice(AVCodecContext *avctx, static int dxva2_vc1_end_frame(AVCodecContext *avctx) { VC1Context *v = avctx->priv_data; - struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; + struct dxva2_picture_context *ctx_pic = v->s.cur_pic.ptr->hwaccel_picture_private; int ret; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; - ret = ff_dxva2_common_end_frame(avctx, v->s.current_picture_ptr->f, + ret = ff_dxva2_common_end_frame(avctx, v->s.cur_pic.ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), NULL, 0, commit_bitstream_and_slice_buffer); diff --git a/src/ExtLib/ffmpeg/libavcodec/error_resilience.c b/src/ExtLib/ffmpeg/libavcodec/error_resilience.c index efbacb8760..56844d5084 100644 --- a/src/ExtLib/ffmpeg/libavcodec/error_resilience.c +++ b/src/ExtLib/ffmpeg/libavcodec/error_resilience.c @@ -34,6 +34,7 @@ #include "mpegutils.h" #include "mpegvideo.h" #include "threadframe.h" +#include "threadprogress.h" /** * @param stride the number of MVs to get to the next row @@ -409,8 +410,12 @@ static void guess_mv(ERContext *s) set_mv_strides(s, &mot_step, &mot_stride); num_avail = 0; - if (s->last_pic.motion_val[0]) - ff_thread_await_progress(s->last_pic.tf, mb_height-1, 0); + if (s->last_pic.motion_val[0]) { + if (s->last_pic.tf) + ff_thread_await_progress(s->last_pic.tf, mb_height-1, 0); + else + ff_thread_progress_await(s->last_pic.progress, mb_height - 1); + } for (i = 0; i < mb_width * mb_height; i++) { const int mb_xy = s->mb_index2xy[i]; int f = 0; @@ -763,7 +768,7 @@ static int is_intra_more_likely(ERContext *s) if (s->avctx->codec_id == AV_CODEC_ID_H264) { // FIXME } else { - ff_thread_await_progress(s->last_pic.tf, mb_y, 0); + ff_thread_progress_await(s->last_pic.progress, mb_y); } is_intra_likely += s->sad(NULL, last_mb_ptr, mb_ptr, linesize[0], 16); @@ -948,19 +953,10 @@ void ff_er_frame_end(ERContext *s, int *decode_error_flags) s->ref_index[i] = av_calloc(s->mb_stride * s->mb_height, 4 * sizeof(uint8_t)); s->motion_val_base[i] = av_calloc(size + 4, 2 * sizeof(uint16_t)); if (!s->ref_index[i] || !s->motion_val_base[i]) - break; + goto cleanup; s->cur_pic.ref_index[i] = s->ref_index[i]; s->cur_pic.motion_val[i] = s->motion_val_base[i] + 4; } - if (i < 2) { - for (i = 0; i < 2; i++) { - av_freep(&s->ref_index[i]); - av_freep(&s->motion_val_base[i]); - s->cur_pic.ref_index[i] = NULL; - s->cur_pic.motion_val[i] = NULL; - } - return; - } } if (s->avctx->debug & FF_DEBUG_ER) { @@ -1207,7 +1203,7 @@ void ff_er_frame_end(ERContext *s, int *decode_error_flags) int time_pb = s->pb_time; av_assert0(s->avctx->codec_id != AV_CODEC_ID_H264); - ff_thread_await_progress(s->next_pic.tf, mb_y, 0); + ff_thread_progress_await(s->next_pic.progress, mb_y); s->mv[0][0][0] = s->next_pic.motion_val[0][xy][0] * time_pb / time_pp; s->mv[0][0][1] = s->next_pic.motion_val[0][xy][1] * time_pb / time_pp; @@ -1344,14 +1340,15 @@ void ff_er_frame_end(ERContext *s, int *decode_error_flags) s->mbintra_table[mb_xy] = 1; } + memset(&s->cur_pic, 0, sizeof(ERPicture)); + memset(&s->last_pic, 0, sizeof(ERPicture)); + memset(&s->next_pic, 0, sizeof(ERPicture)); + +cleanup: for (i = 0; i < 2; i++) { av_freep(&s->ref_index[i]); av_freep(&s->motion_val_base[i]); s->cur_pic.ref_index[i] = NULL; s->cur_pic.motion_val[i] = NULL; } - - memset(&s->cur_pic, 0, sizeof(ERPicture)); - memset(&s->last_pic, 0, sizeof(ERPicture)); - memset(&s->next_pic, 0, sizeof(ERPicture)); } diff --git a/src/ExtLib/ffmpeg/libavcodec/error_resilience.h b/src/ExtLib/ffmpeg/libavcodec/error_resilience.h index 1346639c3c..a1b9b9ec1a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/error_resilience.h +++ b/src/ExtLib/ffmpeg/libavcodec/error_resilience.h @@ -40,6 +40,7 @@ typedef struct ERPicture { AVFrame *f; const struct ThreadFrame *tf; + const struct ThreadProgress *progress; // it is the caller's responsibility to allocate these buffers int16_t (*motion_val[2])[2]; diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c b/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c index 590ccac022..a90c28cd0e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c @@ -121,7 +121,7 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, if (sign) diff = -(unsigned)diff; - sample[1][x] = av_mod_uintp2(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits); + sample[1][x] = av_zero_extend(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits); } s->run_index = run_index; return 0; diff --git a/src/ExtLib/ffmpeg/libavcodec/flvdec.c b/src/ExtLib/ffmpeg/libavcodec/flvdec.c index 8baaed06a8..f4bfd99417 100644 --- a/src/ExtLib/ffmpeg/libavcodec/flvdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/flvdec.c @@ -24,7 +24,7 @@ #include "flvdec.h" #include "h263dec.h" #include "mpegvideo.h" -#include "mpegvideodata.h" +#include "mpegvideodec.h" int ff_flv_decode_picture_header(MpegEncContext *s) { @@ -118,9 +118,10 @@ const FFCodec ff_flv_decoder = { .p.id = AV_CODEC_ID_FLV1, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, }; diff --git a/src/ExtLib/ffmpeg/libavcodec/g726.c b/src/ExtLib/ffmpeg/libavcodec/g726.c index 6c5638760d..e048cd973e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/g726.c +++ b/src/ExtLib/ffmpeg/libavcodec/g726.c @@ -302,7 +302,7 @@ static int16_t g726_encode(G726Context* c, int16_t sig) { uint8_t i; - i = av_mod_uintp2(quant(c, sig/4 - c->se), c->code_size); + i = av_zero_extend(quant(c, sig/4 - c->se), c->code_size); g726_decode(c, i); return i; } diff --git a/src/ExtLib/ffmpeg/libavcodec/get_buffer.c b/src/ExtLib/ffmpeg/libavcodec/get_buffer.c index 9b35fde7c6..ff19f61e86 100644 --- a/src/ExtLib/ffmpeg/libavcodec/get_buffer.c +++ b/src/ExtLib/ffmpeg/libavcodec/get_buffer.c @@ -65,20 +65,15 @@ static void frame_pool_free(FFRefStructOpaque unused, void *obj) static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) { FramePool *pool = avctx->internal->pool; - int i, ret, ch, planes; - - if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { - int planar = av_sample_fmt_is_planar(frame->format); - ch = frame->ch_layout.nb_channels; - planes = planar ? ch : 1; - } + int i, ret; if (pool && pool->format == frame->format) { if (avctx->codec_type == AVMEDIA_TYPE_VIDEO && pool->width == frame->width && pool->height == frame->height) return 0; - if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && pool->planes == planes && - pool->channels == ch && frame->nb_samples == pool->samples) + if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && + pool->channels == frame->ch_layout.nb_channels && + frame->nb_samples == pool->samples) return 0; } @@ -141,7 +136,8 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) break; } case AVMEDIA_TYPE_AUDIO: { - ret = av_samples_get_buffer_size(&pool->linesize[0], ch, + ret = av_samples_get_buffer_size(&pool->linesize[0], + frame->ch_layout.nb_channels, frame->nb_samples, frame->format, 0); if (ret < 0) goto fail; @@ -153,9 +149,9 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) } pool->format = frame->format; - pool->planes = planes; - pool->channels = ch; + pool->channels = frame->ch_layout.nb_channels; pool->samples = frame->nb_samples; + pool->planes = av_sample_fmt_is_planar(pool->format) ? pool->channels : 1; break; } default: av_assert0(0); diff --git a/src/ExtLib/ffmpeg/libavcodec/h261dec.c b/src/ExtLib/ffmpeg/libavcodec/h261dec.c index 4fbd5985b3..392f1aef1d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h261dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/h261dec.c @@ -84,10 +84,13 @@ static av_cold int h261_decode_init(AVCodecContext *avctx) static AVOnce init_static_once = AV_ONCE_INIT; H261DecContext *const h = avctx->priv_data; MpegEncContext *const s = &h->s; + int ret; s->private_ctx = &h->common; // set defaults - ff_mpv_decode_init(s, avctx); + ret = ff_mpv_decode_init(s, avctx); + if (ret < 0) + return ret; s->out_format = FMT_H261; s->low_delay = 1; @@ -228,17 +231,17 @@ static int h261_decode_mb_skipped(H261DecContext *h, int mba1, int mba2) s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; s->mb_skipped = 1; h->common.mtype &= ~MB_TYPE_H261_FIL; - if (s->current_picture.motion_val[0]) { + if (s->cur_pic.motion_val[0]) { int b_stride = 2*s->mb_width + 1; int b_xy = 2 * s->mb_x + (2 * s->mb_y) * b_stride; - s->current_picture.motion_val[0][b_xy][0] = s->mv[0][0][0]; - s->current_picture.motion_val[0][b_xy][1] = s->mv[0][0][1]; + s->cur_pic.motion_val[0][b_xy][0] = s->mv[0][0][0]; + s->cur_pic.motion_val[0][b_xy][1] = s->mv[0][0][1]; } ff_mpv_reconstruct_mb(s, s->block); @@ -281,7 +284,7 @@ static int h261_decode_block(H261DecContext *h, int16_t *block, int n, int coded { MpegEncContext *const s = &h->s; int level, i, j, run; - RLTable *rl = &ff_h261_rl_tcoeff; + const RLTable *rl = &ff_h261_rl_tcoeff; const uint8_t *scan_table; /* For the variable length encoding there are two code tables, one being @@ -452,22 +455,22 @@ static int h261_decode_mb(H261DecContext *h) cbp = get_vlc2(&s->gb, h261_cbp_vlc, H261_CBP_VLC_BITS, 1) + 1; if (s->mb_intra) { - s->current_picture.mb_type[xy] = MB_TYPE_INTRA; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; goto intra; } //set motion vectors s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; - s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; s->mv[0][0][0] = h->current_mv_x * 2; // gets divided by 2 in motion compensation s->mv[0][0][1] = h->current_mv_y * 2; - if (s->current_picture.motion_val[0]) { + if (s->cur_pic.motion_val[0]) { int b_stride = 2*s->mb_width + 1; int b_xy = 2 * s->mb_x + (2 * s->mb_y) * b_stride; - s->current_picture.motion_val[0][b_xy][0] = s->mv[0][0][0]; - s->current_picture.motion_val[0][b_xy][1] = s->mv[0][0][1]; + s->cur_pic.motion_val[0][b_xy][0] = s->mv[0][0][0]; + s->cur_pic.motion_val[0][b_xy][1] = s->mv[0][0][1]; } intra: @@ -649,27 +652,17 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict, } ff_mpv_frame_end(s); - av_assert0(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); - av_assert0(s->current_picture.f->pict_type == s->pict_type); + av_assert0(s->pict_type == s->cur_pic.ptr->f->pict_type); - if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) + if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0) return ret; - ff_print_debug_info(s, s->current_picture_ptr, pict); + ff_print_debug_info(s, s->cur_pic.ptr, pict); *got_frame = 1; return get_consumed_bytes(s, buf_size); } -static av_cold int h261_decode_end(AVCodecContext *avctx) -{ - H261DecContext *const h = avctx->priv_data; - MpegEncContext *s = &h->s; - - ff_mpv_common_end(s); - return 0; -} - const FFCodec ff_h261_decoder = { .p.name = "h261", CODEC_LONG_NAME("H.261"), @@ -677,8 +670,8 @@ const FFCodec ff_h261_decoder = { .p.id = AV_CODEC_ID_H261, .priv_data_size = sizeof(H261DecContext), .init = h261_decode_init, - .close = h261_decode_end, FF_CODEC_DECODE_CB(h261_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, }; diff --git a/src/ExtLib/ffmpeg/libavcodec/h263.c b/src/ExtLib/ffmpeg/libavcodec/h263.c index b30ffaf878..19eb3ba52f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h263.c +++ b/src/ExtLib/ffmpeg/libavcodec/h263.c @@ -56,8 +56,6 @@ void ff_h263_update_motion_val(MpegEncContext * s){ const int wrap = s->b8_stride; const int xy = s->block_index[0]; - s->current_picture.mbskip_table[mb_xy] = s->mb_skipped; - if(s->mv_type != MV_TYPE_8X8){ int motion_x, motion_y; if (s->mb_intra) { @@ -75,30 +73,21 @@ void ff_h263_update_motion_val(MpegEncContext * s){ s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0]; s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1]; } - s->current_picture.ref_index[0][4*mb_xy ] = - s->current_picture.ref_index[0][4*mb_xy + 1] = s->field_select[0][0]; - s->current_picture.ref_index[0][4*mb_xy + 2] = - s->current_picture.ref_index[0][4*mb_xy + 3] = s->field_select[0][1]; + s->cur_pic.ref_index[0][4*mb_xy ] = + s->cur_pic.ref_index[0][4*mb_xy + 1] = s->field_select[0][0]; + s->cur_pic.ref_index[0][4*mb_xy + 2] = + s->cur_pic.ref_index[0][4*mb_xy + 3] = s->field_select[0][1]; } /* no update if 8X8 because it has been done during parsing */ - s->current_picture.motion_val[0][xy][0] = motion_x; - s->current_picture.motion_val[0][xy][1] = motion_y; - s->current_picture.motion_val[0][xy + 1][0] = motion_x; - s->current_picture.motion_val[0][xy + 1][1] = motion_y; - s->current_picture.motion_val[0][xy + wrap][0] = motion_x; - s->current_picture.motion_val[0][xy + wrap][1] = motion_y; - s->current_picture.motion_val[0][xy + 1 + wrap][0] = motion_x; - s->current_picture.motion_val[0][xy + 1 + wrap][1] = motion_y; - } - - if(s->encoding){ //FIXME encoding MUST be cleaned up - if (s->mv_type == MV_TYPE_8X8) - s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_8x8; - else if(s->mb_intra) - s->current_picture.mb_type[mb_xy] = MB_TYPE_INTRA; - else - s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_16x16; + s->cur_pic.motion_val[0][xy][0] = motion_x; + s->cur_pic.motion_val[0][xy][1] = motion_y; + s->cur_pic.motion_val[0][xy + 1][0] = motion_x; + s->cur_pic.motion_val[0][xy + 1][1] = motion_y; + s->cur_pic.motion_val[0][xy + wrap][0] = motion_x; + s->cur_pic.motion_val[0][xy + wrap][1] = motion_y; + s->cur_pic.motion_val[0][xy + 1 + wrap][0] = motion_x; + s->cur_pic.motion_val[0][xy + 1 + wrap][1] = motion_y; } } @@ -115,7 +104,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ Diag Top Left Center */ - if (!IS_SKIP(s->current_picture.mb_type[xy])) { + if (!IS_SKIP(s->cur_pic.mb_type[xy])) { qp_c= s->qscale; s->h263dsp.h263_v_loop_filter(dest_y + 8 * linesize, linesize, qp_c); s->h263dsp.h263_v_loop_filter(dest_y + 8 * linesize + 8, linesize, qp_c); @@ -125,10 +114,10 @@ void ff_h263_loop_filter(MpegEncContext * s){ if(s->mb_y){ int qp_dt, qp_tt, qp_tc; - if (IS_SKIP(s->current_picture.mb_type[xy - s->mb_stride])) + if (IS_SKIP(s->cur_pic.mb_type[xy - s->mb_stride])) qp_tt=0; else - qp_tt = s->current_picture.qscale_table[xy - s->mb_stride]; + qp_tt = s->cur_pic.qscale_table[xy - s->mb_stride]; if(qp_c) qp_tc= qp_c; @@ -148,10 +137,10 @@ void ff_h263_loop_filter(MpegEncContext * s){ s->h263dsp.h263_h_loop_filter(dest_y - 8 * linesize + 8, linesize, qp_tt); if(s->mb_x){ - if (qp_tt || IS_SKIP(s->current_picture.mb_type[xy - 1 - s->mb_stride])) + if (qp_tt || IS_SKIP(s->cur_pic.mb_type[xy - 1 - s->mb_stride])) qp_dt= qp_tt; else - qp_dt = s->current_picture.qscale_table[xy - 1 - s->mb_stride]; + qp_dt = s->cur_pic.qscale_table[xy - 1 - s->mb_stride]; if(qp_dt){ const int chroma_qp= s->chroma_qscale_table[qp_dt]; @@ -170,10 +159,10 @@ void ff_h263_loop_filter(MpegEncContext * s){ if(s->mb_x){ int qp_lc; - if (qp_c || IS_SKIP(s->current_picture.mb_type[xy - 1])) + if (qp_c || IS_SKIP(s->cur_pic.mb_type[xy - 1])) qp_lc= qp_c; else - qp_lc = s->current_picture.qscale_table[xy - 1]; + qp_lc = s->cur_pic.qscale_table[xy - 1]; if(qp_lc){ s->h263dsp.h263_h_loop_filter(dest_y, linesize, qp_lc); @@ -195,7 +184,7 @@ int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir, static const int off[4]= {2, 1, 1, -1}; wrap = s->b8_stride; - mot_val = s->current_picture.motion_val[dir] + s->block_index[block]; + mot_val = s->cur_pic.motion_val[dir] + s->block_index[block]; A = mot_val[ - 1]; /* special case for first (slice) line */ diff --git a/src/ExtLib/ffmpeg/libavcodec/h263dec.c b/src/ExtLib/ffmpeg/libavcodec/h263dec.c index 48bd467f30..eee7978452 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h263dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/h263dec.c @@ -95,7 +95,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) s->out_format = FMT_H263; // set defaults - ff_mpv_decode_init(s, avctx); + ret = ff_mpv_decode_init(s, avctx); + if (ret < 0) + return ret; s->quant_precision = 5; s->decode_mb = ff_h263_decode_mb; @@ -111,23 +113,23 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) break; case AV_CODEC_ID_MSMPEG4V1: s->h263_pred = 1; - s->msmpeg4_version = 1; + s->msmpeg4_version = MSMP4_V1; break; case AV_CODEC_ID_MSMPEG4V2: s->h263_pred = 1; - s->msmpeg4_version = 2; + s->msmpeg4_version = MSMP4_V2; break; case AV_CODEC_ID_MSMPEG4V3: s->h263_pred = 1; - s->msmpeg4_version = 3; + s->msmpeg4_version = MSMP4_V3; break; case AV_CODEC_ID_WMV1: s->h263_pred = 1; - s->msmpeg4_version = 4; + s->msmpeg4_version = MSMP4_WMV1; break; case AV_CODEC_ID_WMV2: s->h263_pred = 1; - s->msmpeg4_version = 5; + s->msmpeg4_version = MSMP4_WMV2; break; case AV_CODEC_ID_H263I: break; @@ -159,14 +161,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) return 0; } -av_cold int ff_h263_decode_end(AVCodecContext *avctx) -{ - MpegEncContext *s = avctx->priv_data; - - ff_mpv_common_end(s); - return 0; -} - /** * Return the number of bytes consumed for building the current frame. */ @@ -233,7 +227,7 @@ static int decode_slice(MpegEncContext *s) for (; s->mb_y < s->mb_height; s->mb_y++) { /* per-row end of slice checks */ - if (s->msmpeg4_version) { + if (s->msmpeg4_version != MSMP4_UNUSED) { if (s->resync_mb_y + s->slice_height == s->mb_y) { ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x - 1, s->mb_y, ER_MB_END); @@ -242,7 +236,7 @@ static int decode_slice(MpegEncContext *s) } } - if (s->msmpeg4_version == 1) { + if (s->msmpeg4_version == MSMP4_V1) { s->last_dc[0] = s->last_dc[1] = s->last_dc[2] = 128; @@ -381,12 +375,12 @@ static int decode_slice(MpegEncContext *s) } // handle formats which don't have unique end markers - if (s->msmpeg4_version || (s->workaround_bugs & FF_BUG_NO_PADDING)) { // FIXME perhaps solve this more cleanly + if (s->msmpeg4_version != MSMP4_UNUSED || (s->workaround_bugs & FF_BUG_NO_PADDING)) { // FIXME perhaps solve this more cleanly int left = get_bits_left(&s->gb); int max_extra = 7; /* no markers in M$ crap */ - if (s->msmpeg4_version && s->pict_type == AV_PICTURE_TYPE_I) + if (s->msmpeg4_version != MSMP4_UNUSED && s->pict_type == AV_PICTURE_TYPE_I) max_extra += 17; /* buggy padding but the frame should still end approximately at @@ -432,22 +426,22 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, /* no supplementary picture */ if (buf_size == 0) { /* special case for last picture */ - if (s->low_delay == 0 && s->next_picture_ptr) { - if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) + if (s->low_delay == 0 && s->next_pic.ptr) { + if ((ret = av_frame_ref(pict, s->next_pic.ptr->f)) < 0) return ret; - s->next_picture_ptr = NULL; + ff_mpv_unref_picture(&s->next_pic); *got_frame = 1; - } else if (s->skipped_last_frame && s->current_picture_ptr) { + } else if (s->skipped_last_frame && s->cur_pic.ptr) { /* Output the last picture we decoded again if the stream ended with * an NVOP */ - if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) + if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0) return ret; /* Copy props from the last input packet. Otherwise, props from the last * returned picture would be reused */ if ((ret = ff_decode_frame_props(avctx, pict)) < 0) return ret; - s->current_picture_ptr = NULL; + ff_mpv_unref_picture(&s->cur_pic); *got_frame = 1; } @@ -480,10 +474,12 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, return ret; /* let's go :-) */ - if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) { + if (CONFIG_WMV2_DECODER && s->msmpeg4_version == MSMP4_WMV2) { ret = ff_wmv2_decode_picture_header(s); - } else if (CONFIG_MSMPEG4DEC && s->msmpeg4_version) { +#if CONFIG_MSMPEG4DEC + } else if (s->msmpeg4_version != MSMP4_UNUSED) { ret = ff_msmpeg4_decode_picture_header(s); +#endif } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb, 0, 0); s->skipped_last_frame = (ret == FRAME_SKIPPED); @@ -561,7 +557,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, s->gob_index = H263_GOB_HEIGHT(s->height); /* skip B-frames if we don't have reference frames */ - if (!s->last_picture_ptr && + if (!s->last_pic.ptr && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) return get_consumed_bytes(s, buf_size); if ((avctx->skip_frame >= AVDISCARD_NONREF && @@ -589,13 +585,15 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, /* the second part of the wmv2 header contains the MB skip bits which * are stored in current_picture->mb_type which is not available before * ff_mpv_frame_start() */ - if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) { +#if CONFIG_WMV2_DECODER + if (s->msmpeg4_version == MSMP4_WMV2) { ret = ff_wmv2_decode_secondary_picture_header(s); if (ret < 0) return ret; if (ret == 1) goto frame_end; } +#endif /* decode each macroblock */ s->mb_x = 0; @@ -603,7 +601,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, slice_ret = decode_slice(s); while (s->mb_y < s->mb_height) { - if (s->msmpeg4_version) { + if (s->msmpeg4_version != MSMP4_UNUSED) { if (s->slice_height == 0 || s->mb_x != 0 || slice_ret < 0 || (s->mb_y % s->slice_height) != 0 || get_bits_left(&s->gb) < 0) break; @@ -615,14 +613,14 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, s->er.error_occurred = 1; } - if (s->msmpeg4_version < 4 && s->h263_pred) + if (s->msmpeg4_version < MSMP4_WMV1 && s->h263_pred) ff_mpeg4_clean_buffers(s); if (decode_slice(s) < 0) slice_ret = AVERROR_INVALIDDATA; } - if (s->msmpeg4_version && s->msmpeg4_version < 4 && + if (s->msmpeg4_version != MSMP4_UNUSED && s->msmpeg4_version < MSMP4_WMV1 && s->pict_type == AV_PICTURE_TYPE_I) if (!CONFIG_MSMPEG4DEC || ff_msmpeg4_decode_ext_header(s, buf_size) < 0) @@ -647,21 +645,20 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, if (!s->divx_packed && avctx->hwaccel) ff_thread_finish_setup(avctx); - av_assert1(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); - av_assert1(s->current_picture.f->pict_type == s->pict_type); + av_assert1(s->pict_type == s->cur_pic.ptr->f->pict_type); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { - if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) + if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0) return ret; - ff_print_debug_info(s, s->current_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); - } else if (s->last_picture_ptr) { - if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) + ff_print_debug_info(s, s->cur_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict, s->cur_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG1); + } else if (s->last_pic.ptr) { + if ((ret = av_frame_ref(pict, s->last_pic.ptr->f)) < 0) return ret; - ff_print_debug_info(s, s->last_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); + ff_print_debug_info(s, s->last_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict, s->last_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG1); } - if (s->last_picture_ptr || s->low_delay) { + if (s->last_pic.ptr || s->low_delay) { if ( pict->format == AV_PIX_FMT_YUV420P && (s->codec_tag == AV_RL32("GEOV") || s->codec_tag == AV_RL32("GEOX"))) { for (int p = 0; p < 3; p++) { @@ -703,11 +700,12 @@ const FFCodec ff_h263_decoder = { .p.id = AV_CODEC_ID_H263, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, .p.max_lowres = 3, .hw_configs = h263_hw_config_list, @@ -720,11 +718,12 @@ const FFCodec ff_h263p_decoder = { .p.id = AV_CODEC_ID_H263P, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, .p.max_lowres = 3, .hw_configs = h263_hw_config_list, diff --git a/src/ExtLib/ffmpeg/libavcodec/h263dec.h b/src/ExtLib/ffmpeg/libavcodec/h263dec.h index a01acc0834..633d4aa577 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h263dec.h +++ b/src/ExtLib/ffmpeg/libavcodec/h263dec.h @@ -47,7 +47,6 @@ int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code); int ff_h263_decode_init(AVCodecContext *avctx); int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt); -int ff_h263_decode_end(AVCodecContext *avctx); void ff_h263_decode_init_vlc(void); int ff_h263_decode_picture_header(MpegEncContext *s); int ff_h263_decode_gob_header(MpegEncContext *s); diff --git a/src/ExtLib/ffmpeg/libavcodec/h263enc.h b/src/ExtLib/ffmpeg/libavcodec/h263enc.h index e45475686e..cd5ded1593 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h263enc.h +++ b/src/ExtLib/ffmpeg/libavcodec/h263enc.h @@ -36,7 +36,7 @@ void ff_init_qscale_tab(MpegEncContext *s); void ff_clean_h263_qscales(MpegEncContext *s); void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code); - +void ff_h263_update_mb(MpegEncContext *s); static inline int h263_get_motion_length(int val, int f_code) { diff --git a/src/ExtLib/ffmpeg/libavcodec/h264_refs.c b/src/ExtLib/ffmpeg/libavcodec/h264_refs.c index 224c9f3095..2dd47fdd78 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h264_refs.c +++ b/src/ExtLib/ffmpeg/libavcodec/h264_refs.c @@ -791,7 +791,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h) for (int i = 0; i < h->short_ref_count; i++) { H264Picture *pic = h->short_ref[i]; if (pic->invalid_gap) { - int d = av_mod_uintp2(h->cur_pic_ptr->frame_num - pic->frame_num, h->ps.sps->log2_max_frame_num); + int d = av_zero_extend(h->cur_pic_ptr->frame_num - pic->frame_num, h->ps.sps->log2_max_frame_num); if (d > h->ps.sps->ref_frame_count) remove_short(h, pic->frame_num, 0); } diff --git a/src/ExtLib/ffmpeg/libavcodec/h264_slice.c b/src/ExtLib/ffmpeg/libavcodec/h264_slice.c index 30dca40968..b50204c461 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h264_slice.c +++ b/src/ExtLib/ffmpeg/libavcodec/h264_slice.c @@ -1661,8 +1661,8 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, h->valid_recovery_point = 1; if ( h->recovery_frame < 0 - || av_mod_uintp2(h->recovery_frame - h->poc.frame_num, h->ps.sps->log2_max_frame_num) > sei_recovery_frame_cnt) { - h->recovery_frame = av_mod_uintp2(h->poc.frame_num + sei_recovery_frame_cnt, h->ps.sps->log2_max_frame_num); + || av_zero_extend(h->recovery_frame - h->poc.frame_num, h->ps.sps->log2_max_frame_num) > sei_recovery_frame_cnt) { + h->recovery_frame = av_zero_extend(h->poc.frame_num + sei_recovery_frame_cnt, h->ps.sps->log2_max_frame_num); if (!h->valid_recovery_point) h->recovery_frame = h->poc.frame_num; diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/cabac.c b/src/ExtLib/ffmpeg/libavcodec/hevc/cabac.c index 37f144758a..33f8241bb3 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/cabac.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/cabac.c @@ -399,25 +399,25 @@ static const uint8_t diag_scan8x8_inv[8][8] = { { 28, 36, 43, 49, 54, 58, 61, 63, }, }; -void ff_hevc_save_states(HEVCLocalContext *lc, int ctb_addr_ts) +void ff_hevc_save_states(HEVCLocalContext *lc, const HEVCPPS *pps, + int ctb_addr_ts) { - const HEVCContext *const s = lc->parent; - - if (s->ps.pps->entropy_coding_sync_enabled_flag && - (ctb_addr_ts % s->ps.sps->ctb_width == 2 || - (s->ps.sps->ctb_width == 2 && - ctb_addr_ts % s->ps.sps->ctb_width == 0))) { + const HEVCSPS *const sps = pps->sps; + if (pps->entropy_coding_sync_enabled_flag && + (ctb_addr_ts % sps->ctb_width == 2 || + (sps->ctb_width == 2 && + ctb_addr_ts % sps->ctb_width == 0))) { memcpy(lc->common_cabac_state->state, lc->cabac_state, HEVC_CONTEXTS); - if (s->ps.sps->persistent_rice_adaptation_enabled) { + if (sps->persistent_rice_adaptation_enabled) { memcpy(lc->common_cabac_state->stat_coeff, lc->stat_coeff, HEVC_STAT_COEFFS); } } } -static void load_states(HEVCLocalContext *lc, const HEVCContext *s) +static void load_states(HEVCLocalContext *lc, const HEVCSPS *sps) { memcpy(lc->cabac_state, lc->common_cabac_state->state, HEVC_CONTEXTS); - if (s->ps.sps->persistent_rice_adaptation_enabled) { + if (sps->persistent_rice_adaptation_enabled) { memcpy(lc->stat_coeff, lc->common_cabac_state->stat_coeff, HEVC_STAT_COEFFS); } } @@ -451,34 +451,36 @@ static void cabac_init_state(HEVCLocalContext *lc, const HEVCContext *s) lc->stat_coeff[i] = 0; } -int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts, - const uint8_t *data, size_t size) +int ff_hevc_cabac_init(HEVCLocalContext *lc, const HEVCPPS *pps, + int ctb_addr_ts, const uint8_t *data, size_t size, + int is_wpp) { const HEVCContext *const s = lc->parent; + const HEVCSPS *const sps = pps->sps; - if (ctb_addr_ts == s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) { + if (ctb_addr_ts == pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) { int ret = ff_init_cabac_decoder(&lc->cc, data, size); if (ret < 0) return ret; if (s->sh.dependent_slice_segment_flag == 0 || - (s->ps.pps->tiles_enabled_flag && - s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1])) + (pps->tiles_enabled_flag && + pps->tile_id[ctb_addr_ts] != pps->tile_id[ctb_addr_ts - 1])) cabac_init_state(lc, s); if (!s->sh.first_slice_in_pic_flag && - s->ps.pps->entropy_coding_sync_enabled_flag) { - if (ctb_addr_ts % s->ps.sps->ctb_width == 0) { - if (s->ps.sps->ctb_width == 1) + pps->entropy_coding_sync_enabled_flag) { + if (ctb_addr_ts % sps->ctb_width == 0) { + if (sps->ctb_width == 1) cabac_init_state(lc, s); else if (s->sh.dependent_slice_segment_flag == 1) - load_states(lc, s); + load_states(lc, sps); } } } else { - if (s->ps.pps->tiles_enabled_flag && - s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1]) { + if (pps->tiles_enabled_flag && + pps->tile_id[ctb_addr_ts] != pps->tile_id[ctb_addr_ts - 1]) { int ret; - if (s->threads_number == 1) + if (!is_wpp) ret = cabac_reinit(lc); else { ret = ff_init_cabac_decoder(&lc->cc, data, size); @@ -487,11 +489,11 @@ int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts, return ret; cabac_init_state(lc, s); } - if (s->ps.pps->entropy_coding_sync_enabled_flag) { - if (ctb_addr_ts % s->ps.sps->ctb_width == 0) { + if (pps->entropy_coding_sync_enabled_flag) { + if (ctb_addr_ts % sps->ctb_width == 0) { int ret; get_cabac_terminate(&lc->cc); - if (s->threads_number == 1) + if (!is_wpp) ret = cabac_reinit(lc); else { ret = ff_init_cabac_decoder(&lc->cc, data, size); @@ -499,10 +501,10 @@ int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts, if (ret < 0) return ret; - if (s->ps.sps->ctb_width == 1) + if (sps->ctb_width == 1) cabac_init_state(lc, s); else - load_states(lc, s); + load_states(lc, sps); } } } @@ -536,10 +538,10 @@ int ff_hevc_sao_band_position_decode(HEVCLocalContext *lc) return value; } -int ff_hevc_sao_offset_abs_decode(HEVCLocalContext *lc) +int ff_hevc_sao_offset_abs_decode(HEVCLocalContext *lc, int bit_depth) { int i = 0; - int length = (1 << (FFMIN(lc->parent->ps.sps->bit_depth, 10) - 5)) - 1; + int length = (1 << (FFMIN(bit_depth, 10) - 5)) - 1; while (i < length && get_cabac_bypass(&lc->cc)) i++; @@ -568,17 +570,15 @@ int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc) return GET_CABAC(CU_TRANSQUANT_BYPASS_FLAG_OFFSET); } -int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, int x0, int y0, int x_cb, int y_cb) +int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, int x0, int y0, + int x_cb, int y_cb, int min_cb_width) { const HEVCContext *const s = lc->parent; - int min_cb_width = s->ps.sps->min_cb_width; int inc = 0; - int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size); - int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size); - if (lc->ctb_left_flag || x0b) + if (lc->ctb_left_flag || x0) inc = !!SAMPLE_CTB(s->skip_flag, x_cb - 1, y_cb); - if (lc->ctb_up_flag || y0b) + if (lc->ctb_up_flag || y0) inc += !!SAMPLE_CTB(s->skip_flag, x_cb, y_cb - 1); return GET_CABAC(SKIP_FLAG_OFFSET + inc); @@ -621,9 +621,9 @@ int ff_hevc_cu_chroma_qp_offset_flag(HEVCLocalContext *lc) return GET_CABAC(CU_CHROMA_QP_OFFSET_FLAG_OFFSET); } -int ff_hevc_cu_chroma_qp_offset_idx(HEVCLocalContext *lc) +int ff_hevc_cu_chroma_qp_offset_idx(HEVCLocalContext *lc, int chroma_qp_offset_list_len_minus1) { - int c_max= FFMAX(5, lc->parent->ps.pps->chroma_qp_offset_list_len_minus1); + int c_max= FFMAX(5, chroma_qp_offset_list_len_minus1); int i = 0; while (i < c_max && GET_CABAC(CU_CHROMA_QP_OFFSET_IDX_OFFSET)) @@ -637,13 +637,13 @@ int ff_hevc_pred_mode_decode(HEVCLocalContext *lc) return GET_CABAC(PRED_MODE_FLAG_OFFSET); } -int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, int ct_depth, int x0, int y0) +int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *sps, + int ct_depth, int x0, int y0) { const HEVCContext *const s = lc->parent; - const HEVCSPS *const sps = s->ps.sps; int inc = 0, depth_left = 0, depth_top = 0; - int x0b = av_mod_uintp2(x0, sps->log2_ctb_size); - int y0b = av_mod_uintp2(y0, sps->log2_ctb_size); + int x0b = av_zero_extend(x0, sps->log2_ctb_size); + int y0b = av_zero_extend(y0, sps->log2_ctb_size); int x_cb = x0 >> sps->log2_min_cb_size; int y_cb = y0 >> sps->log2_min_cb_size; @@ -658,11 +658,11 @@ int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, int ct_depth, in return GET_CABAC(SPLIT_CODING_UNIT_FLAG_OFFSET + inc); } -int ff_hevc_part_mode_decode(HEVCLocalContext *lc, int log2_cb_size) +int ff_hevc_part_mode_decode(HEVCLocalContext *lc, const HEVCSPS *sps, int log2_cb_size) { if (GET_CABAC(PART_MODE_OFFSET)) // 1 return PART_2Nx2N; - if (log2_cb_size == lc->parent->ps.sps->log2_min_cb_size) { + if (log2_cb_size == sps->log2_min_cb_size) { if (lc->cu.pred_mode == MODE_INTRA) // 0 return PART_NxN; if (GET_CABAC(PART_MODE_OFFSET + 1)) // 01 @@ -674,7 +674,7 @@ int ff_hevc_part_mode_decode(HEVCLocalContext *lc, int log2_cb_size) return PART_NxN; // 000 } - if (!lc->parent->ps.sps->amp_enabled) { + if (!sps->amp_enabled) { if (GET_CABAC(PART_MODE_OFFSET + 1)) // 01 return PART_2NxN; return PART_Nx2N; @@ -979,7 +979,8 @@ static av_always_inline int coeff_sign_flag_decode(HEVCLocalContext *lc, uint8_t return ret; } -void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, +void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx) { @@ -989,6 +990,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, y_c = (y_cg << 2) + scan_y_off[n]; \ } while (0) const HEVCContext *const s = lc->parent; + const HEVCSPS *const sps = pps->sps; int transform_skip_flag = 0; int last_significant_coeff_x, last_significant_coeff_y; @@ -1003,10 +1005,10 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, const uint8_t *scan_x_cg, *scan_y_cg, *scan_x_off, *scan_y_off; ptrdiff_t stride = s->cur_frame->f->linesize[c_idx]; - int hshift = s->ps.sps->hshift[c_idx]; - int vshift = s->ps.sps->vshift[c_idx]; + int hshift = sps->hshift[c_idx]; + int vshift = sps->vshift[c_idx]; uint8_t *dst = &s->cur_frame->f->data[c_idx][(y0 >> vshift) * stride + - ((x0 >> hshift) << s->ps.sps->pixel_shift)]; + ((x0 >> hshift) << sps->pixel_shift)]; int16_t *coeffs = (int16_t*)(c_idx ? lc->edge_emu_buffer2 : lc->edge_emu_buffer); uint8_t significant_coeff_group_flag[8][8] = {{0}}; int explicit_rdpcm_flag = 0; @@ -1041,25 +1043,25 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, }; int qp_y = lc->qp_y; - if (s->ps.pps->transform_skip_enabled_flag && - log2_trafo_size <= s->ps.pps->log2_max_transform_skip_block_size) { + if (pps->transform_skip_enabled_flag && + log2_trafo_size <= pps->log2_max_transform_skip_block_size) { transform_skip_flag = hevc_transform_skip_flag_decode(lc, c_idx); } if (c_idx == 0) { - qp = qp_y + s->ps.sps->qp_bd_offset; + qp = qp_y + sps->qp_bd_offset; } else { int qp_i, offset; if (c_idx == 1) - offset = s->ps.pps->cb_qp_offset + s->sh.slice_cb_qp_offset + + offset = pps->cb_qp_offset + s->sh.slice_cb_qp_offset + lc->tu.cu_qp_offset_cb; else - offset = s->ps.pps->cr_qp_offset + s->sh.slice_cr_qp_offset + + offset = pps->cr_qp_offset + s->sh.slice_cr_qp_offset + lc->tu.cu_qp_offset_cr; - qp_i = av_clip(qp_y + offset, - s->ps.sps->qp_bd_offset, 57); - if (s->ps.sps->chroma_format_idc == 1) { + qp_i = av_clip(qp_y + offset, - sps->qp_bd_offset, 57); + if (sps->chroma_format_idc == 1) { if (qp_i < 30) qp = qp_i; else if (qp_i > 43) @@ -1073,18 +1075,18 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, qp = qp_i; } - qp += s->ps.sps->qp_bd_offset; + qp += sps->qp_bd_offset; } - shift = s->ps.sps->bit_depth + log2_trafo_size - 5; + shift = sps->bit_depth + log2_trafo_size - 5; add = 1 << (shift-1); scale = level_scale[rem6[qp]] << (div6[qp]); scale_m = 16; // default when no custom scaling lists. dc_scale = 16; - if (s->ps.sps->scaling_list_enabled && !(transform_skip_flag && log2_trafo_size > 2)) { - const ScalingList *sl = s->ps.pps->scaling_list_data_present_flag ? - &s->ps.pps->scaling_list : &s->ps.sps->scaling_list; + if (sps->scaling_list_enabled && !(transform_skip_flag && log2_trafo_size > 2)) { + const ScalingList *sl = pps->scaling_list_data_present_flag ? + &pps->scaling_list : &sps->scaling_list; int matrix_id = lc->cu.pred_mode != MODE_INTRA; matrix_id = 3 * matrix_id + c_idx; @@ -1100,7 +1102,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, dc_scale = 0; } - if (lc->cu.pred_mode == MODE_INTER && s->ps.sps->explicit_rdpcm_enabled && + if (lc->cu.pred_mode == MODE_INTER && sps->explicit_rdpcm_enabled && (transform_skip_flag || lc->cu.cu_transquant_bypass_flag)) { explicit_rdpcm_flag = explicit_rdpcm_flag_decode(lc, c_idx); if (explicit_rdpcm_flag) { @@ -1231,7 +1233,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, }; const uint8_t *ctx_idx_map_p; int scf_offset = 0; - if (s->ps.sps->transform_skip_context_enabled && + if (sps->transform_skip_context_enabled && (transform_skip_flag || lc->cu.cu_transquant_bypass_flag)) { ctx_idx_map_p = &ctx_idx_map[4 * 16]; if (c_idx == 0) { @@ -1272,7 +1274,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, } } if (implicit_non_zero_coeff == 0) { - if (s->ps.sps->transform_skip_context_enabled && + if (sps->transform_skip_context_enabled && (transform_skip_flag || lc->cu.cu_transquant_bypass_flag)) { if (c_idx == 0) { scf_offset = 42; @@ -1317,7 +1319,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, // initialize first elem of coeff_bas_level_greater1_flag int ctx_set = (i > 0 && c_idx == 0) ? 2 : 0; - if (s->ps.sps->persistent_rice_adaptation_enabled) { + if (sps->persistent_rice_adaptation_enabled) { if (!transform_skip_flag && !lc->cu.cu_transquant_bypass_flag) sb_type = 2 * (c_idx == 0 ? 1 : 0); else @@ -1346,7 +1348,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, if (lc->cu.cu_transquant_bypass_flag || (lc->cu.pred_mode == MODE_INTRA && - s->ps.sps->implicit_rdpcm_enabled && transform_skip_flag && + sps->implicit_rdpcm_enabled && transform_skip_flag && (pred_mode_intra == 10 || pred_mode_intra == 26 )) || explicit_rdpcm_flag) sign_hidden = 0; @@ -1356,7 +1358,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, if (first_greater1_coeff_idx != -1) { coeff_abs_level_greater1_flag[first_greater1_coeff_idx] += coeff_abs_level_greater2_flag_decode(lc, c_idx, ctx_set); } - if (!s->ps.pps->sign_data_hiding_flag || !sign_hidden ) { + if (!pps->sign_data_hiding_flag || !sign_hidden ) { coeff_sign_flag = coeff_sign_flag_decode(lc, nb_significant_coeff_flag) << (16 - nb_significant_coeff_flag); } else { coeff_sign_flag = coeff_sign_flag_decode(lc, nb_significant_coeff_flag - 1) << (16 - (nb_significant_coeff_flag - 1)); @@ -1372,8 +1374,8 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, trans_coeff_level += last_coeff_abs_level_remaining; if (trans_coeff_level > (3 << c_rice_param)) - c_rice_param = s->ps.sps->persistent_rice_adaptation_enabled ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4); - if (s->ps.sps->persistent_rice_adaptation_enabled && !rice_init) { + c_rice_param = sps->persistent_rice_adaptation_enabled ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4); + if (sps->persistent_rice_adaptation_enabled && !rice_init) { int c_rice_p_init = lc->stat_coeff[sb_type] / 4; if (last_coeff_abs_level_remaining >= (3 << c_rice_p_init)) lc->stat_coeff[sb_type]++; @@ -1388,8 +1390,8 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, trans_coeff_level = 1 + last_coeff_abs_level_remaining; if (trans_coeff_level > (3 << c_rice_param)) - c_rice_param = s->ps.sps->persistent_rice_adaptation_enabled ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4); - if (s->ps.sps->persistent_rice_adaptation_enabled && !rice_init) { + c_rice_param = sps->persistent_rice_adaptation_enabled ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4); + if (sps->persistent_rice_adaptation_enabled && !rice_init) { int c_rice_p_init = lc->stat_coeff[sb_type] / 4; if (last_coeff_abs_level_remaining >= (3 << c_rice_p_init)) lc->stat_coeff[sb_type]++; @@ -1399,7 +1401,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, rice_init = 1; } } - if (s->ps.pps->sign_data_hiding_flag && sign_hidden) { + if (pps->sign_data_hiding_flag && sign_hidden) { sum_abs += trans_coeff_level; if (n == first_nz_pos_in_cg && (sum_abs&1)) trans_coeff_level = -trans_coeff_level; @@ -1408,7 +1410,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, trans_coeff_level = -trans_coeff_level; coeff_sign_flag <<= 1; if(!lc->cu.cu_transquant_bypass_flag) { - if (s->ps.sps->scaling_list_enabled && !(transform_skip_flag && log2_trafo_size > 2)) { + if (sps->scaling_list_enabled && !(transform_skip_flag && log2_trafo_size > 2)) { if(y_c || x_c || log2_trafo_size < 4) { switch(log2_trafo_size) { case 3: pos = (y_c << 3) + x_c; break; @@ -1436,15 +1438,15 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, } if (lc->cu.cu_transquant_bypass_flag) { - if (explicit_rdpcm_flag || (s->ps.sps->implicit_rdpcm_enabled && + if (explicit_rdpcm_flag || (sps->implicit_rdpcm_enabled && (pred_mode_intra == 10 || pred_mode_intra == 26))) { - int mode = s->ps.sps->implicit_rdpcm_enabled ? (pred_mode_intra == 26) : explicit_rdpcm_dir_flag; + int mode = sps->implicit_rdpcm_enabled ? (pred_mode_intra == 26) : explicit_rdpcm_dir_flag; s->hevcdsp.transform_rdpcm(coeffs, log2_trafo_size, mode); } } else { if (transform_skip_flag) { - int rot = s->ps.sps->transform_skip_rotation_enabled && + int rot = sps->transform_skip_rotation_enabled && log2_trafo_size == 2 && lc->cu.pred_mode == MODE_INTRA; if (rot) { @@ -1454,7 +1456,7 @@ void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, s->hevcdsp.dequant(coeffs, log2_trafo_size); - if (explicit_rdpcm_flag || (s->ps.sps->implicit_rdpcm_enabled && + if (explicit_rdpcm_flag || (sps->implicit_rdpcm_enabled && lc->cu.pred_mode == MODE_INTRA && (pred_mode_intra == 10 || pred_mode_intra == 26))) { int mode = explicit_rdpcm_flag ? explicit_rdpcm_dir_flag : (pred_mode_intra == 26); diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/filter.c b/src/ExtLib/ffmpeg/libavcodec/hevc/filter.c index db7525170d..56e354b486 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/filter.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/filter.c @@ -44,7 +44,8 @@ static const uint8_t betatable[52] = { 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64 // QP 38...51 }; -static int chroma_tc(const HEVCContext *s, int qp_y, int c_idx, int tc_offset) +static int chroma_tc(const HEVCPPS *pps, const HEVCSPS *sps, + int qp_y, int c_idx, int tc_offset) { static const int qp_c[] = { 29, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37 @@ -53,12 +54,12 @@ static int chroma_tc(const HEVCContext *s, int qp_y, int c_idx, int tc_offset) // slice qp offset is not used for deblocking if (c_idx == 1) - offset = s->ps.pps->cb_qp_offset; + offset = pps->cb_qp_offset; else - offset = s->ps.pps->cr_qp_offset; + offset = pps->cr_qp_offset; qp_i = av_clip(qp_y + offset, 0, 57); - if (s->ps.sps->chroma_format_idc == 1) { + if (sps->chroma_format_idc == 1) { if (qp_i < 30) qp = qp_i; else if (qp_i > 43) @@ -74,16 +75,17 @@ static int chroma_tc(const HEVCContext *s, int qp_y, int c_idx, int tc_offset) } static int get_qPy_pred(HEVCLocalContext *lc, const HEVCContext *s, + const HEVCPPS *pps, const HEVCSPS *sps, int xBase, int yBase, int log2_cb_size) { - int ctb_size_mask = (1 << s->ps.sps->log2_ctb_size) - 1; - int MinCuQpDeltaSizeMask = (1 << (s->ps.sps->log2_ctb_size - - s->ps.pps->diff_cu_qp_delta_depth)) - 1; + int ctb_size_mask = (1 << sps->log2_ctb_size) - 1; + int MinCuQpDeltaSizeMask = (1 << (sps->log2_ctb_size - + pps->diff_cu_qp_delta_depth)) - 1; int xQgBase = xBase - (xBase & MinCuQpDeltaSizeMask); int yQgBase = yBase - (yBase & MinCuQpDeltaSizeMask); - int min_cb_width = s->ps.sps->min_cb_width; - int x_cb = xQgBase >> s->ps.sps->log2_min_cb_size; - int y_cb = yQgBase >> s->ps.sps->log2_min_cb_size; + int min_cb_width = sps->min_cb_width; + int x_cb = xQgBase >> sps->log2_min_cb_size; + int y_cb = yQgBase >> sps->log2_min_cb_size; int availableA = (xBase & ctb_size_mask) && (xQgBase & ctb_size_mask); int availableB = (yBase & ctb_size_mask) && @@ -110,31 +112,33 @@ static int get_qPy_pred(HEVCLocalContext *lc, const HEVCContext *s, else qPy_b = s->qp_y_tab[x_cb + (y_cb - 1) * min_cb_width]; - av_assert2(qPy_a >= -s->ps.sps->qp_bd_offset && qPy_a < 52); - av_assert2(qPy_b >= -s->ps.sps->qp_bd_offset && qPy_b < 52); + av_assert2(qPy_a >= -sps->qp_bd_offset && qPy_a < 52); + av_assert2(qPy_b >= -sps->qp_bd_offset && qPy_b < 52); return (qPy_a + qPy_b + 1) >> 1; } -void ff_hevc_set_qPy(HEVCLocalContext *lc, int xBase, int yBase, int log2_cb_size) +void ff_hevc_set_qPy(HEVCLocalContext *lc, const HEVCPPS *pps, + int xBase, int yBase, int log2_cb_size) { + const HEVCSPS *const sps = pps->sps; const HEVCContext *const s = lc->parent; - int qp_y = get_qPy_pred(lc, s, xBase, yBase, log2_cb_size); + int qp_y = get_qPy_pred(lc, s, pps, sps, xBase, yBase, log2_cb_size); if (lc->tu.cu_qp_delta != 0) { - int off = s->ps.sps->qp_bd_offset; + int off = sps->qp_bd_offset; lc->qp_y = FFUMOD(qp_y + lc->tu.cu_qp_delta + 52 + 2 * off, 52 + off) - off; } else lc->qp_y = qp_y; } -static int get_qPy(const HEVCContext *s, int xC, int yC) +static int get_qPy(const HEVCSPS *sps, const int8_t *qp_y_tab, int xC, int yC) { - int log2_min_cb_size = s->ps.sps->log2_min_cb_size; + int log2_min_cb_size = sps->log2_min_cb_size; int x = xC >> log2_min_cb_size; int y = yC >> log2_min_cb_size; - return s->qp_y_tab[x + y * s->ps.sps->min_cb_width]; + return qp_y_tab[x + y * sps->min_cb_width]; } static void copy_CTB(uint8_t *dst, const uint8_t *src, int width, int height, @@ -198,13 +202,14 @@ static void copy_vert(uint8_t *dst, const uint8_t *src, } } -static void copy_CTB_to_hv(const HEVCContext *s, const uint8_t *src, +static void copy_CTB_to_hv(const HEVCContext *s, const HEVCSPS *sps, + const uint8_t *src, ptrdiff_t stride_src, int x, int y, int width, int height, int c_idx, int x_ctb, int y_ctb) { - int sh = s->ps.sps->pixel_shift; - int w = s->ps.sps->width >> s->ps.sps->hshift[c_idx]; - int h = s->ps.sps->height >> s->ps.sps->vshift[c_idx]; + int sh = sps->pixel_shift; + int w = sps->width >> sps->hshift[c_idx]; + int h = sps->height >> sps->vshift[c_idx]; /* copy horizontal edges */ memcpy(s->sao_pixel_buffer_h[c_idx] + (((2 * y_ctb) * w + x) << sh), @@ -219,27 +224,33 @@ static void copy_CTB_to_hv(const HEVCContext *s, const uint8_t *src, } static void restore_tqb_pixels(const HEVCContext *s, + const HEVCPPS *pps, const HEVCSPS *sps, uint8_t *src1, const uint8_t *dst1, ptrdiff_t stride_src, ptrdiff_t stride_dst, int x0, int y0, int width, int height, int c_idx) { - if ( s->ps.pps->transquant_bypass_enable_flag || - (s->ps.sps->pcm_loop_filter_disabled && s->ps.sps->pcm_enabled)) { + if (pps->transquant_bypass_enable_flag || + (sps->pcm_loop_filter_disabled && sps->pcm_enabled)) { int x, y; - int min_pu_size = 1 << s->ps.sps->log2_min_pu_size; - int hshift = s->ps.sps->hshift[c_idx]; - int vshift = s->ps.sps->vshift[c_idx]; - int x_min = ((x0 ) >> s->ps.sps->log2_min_pu_size); - int y_min = ((y0 ) >> s->ps.sps->log2_min_pu_size); - int x_max = ((x0 + width ) >> s->ps.sps->log2_min_pu_size); - int y_max = ((y0 + height) >> s->ps.sps->log2_min_pu_size); - int len = (min_pu_size >> hshift) << s->ps.sps->pixel_shift; + int min_pu_size = 1 << sps->log2_min_pu_size; + int hshift = sps->hshift[c_idx]; + int vshift = sps->vshift[c_idx]; + int x_min = ((x0 ) >> sps->log2_min_pu_size); + int y_min = ((y0 ) >> sps->log2_min_pu_size); + int x_max = ((x0 + width ) >> sps->log2_min_pu_size); + int y_max = ((y0 + height) >> sps->log2_min_pu_size); + int len = (min_pu_size >> hshift) << sps->pixel_shift; for (y = y_min; y < y_max; y++) { for (x = x_min; x < x_max; x++) { - if (s->is_pcm[y * s->ps.sps->min_pu_width + x]) { + if (s->is_pcm[y * sps->min_pu_width + x]) { int n; - uint8_t *src = src1 + (((y << s->ps.sps->log2_min_pu_size) - y0) >> vshift) * stride_src + ((((x << s->ps.sps->log2_min_pu_size) - x0) >> hshift) << s->ps.sps->pixel_shift); - const uint8_t *dst = dst1 + (((y << s->ps.sps->log2_min_pu_size) - y0) >> vshift) * stride_dst + ((((x << s->ps.sps->log2_min_pu_size) - x0) >> hshift) << s->ps.sps->pixel_shift); + uint8_t *src = src1 + + (((y << sps->log2_min_pu_size) - y0) >> vshift) * stride_src + + ((((x << sps->log2_min_pu_size) - x0) >> hshift) << sps->pixel_shift); + const uint8_t *dst = dst1 + + (((y << sps->log2_min_pu_size) - y0) >> vshift) * stride_dst + + ((((x << sps->log2_min_pu_size) - x0) >> hshift) << sps->pixel_shift); + for (n = 0; n < (min_pu_size >> vshift); n++) { memcpy(src, dst, len); src += stride_src; @@ -251,25 +262,27 @@ static void restore_tqb_pixels(const HEVCContext *s, } } -#define CTB(tab, x, y) ((tab)[(y) * s->ps.sps->ctb_width + (x)]) +#define CTB(tab, x, y) ((tab)[(y) * sps->ctb_width + (x)]) -static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, int y) +static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, + const HEVCPPS *pps, const HEVCSPS *sps, + int x, int y) { static const uint8_t sao_tab[8] = { 0, 1, 2, 2, 3, 3, 4, 4 }; int c_idx; int edges[4]; // 0 left 1 top 2 right 3 bottom - int x_ctb = x >> s->ps.sps->log2_ctb_size; - int y_ctb = y >> s->ps.sps->log2_ctb_size; - int ctb_addr_rs = y_ctb * s->ps.sps->ctb_width + x_ctb; - int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs]; + int x_ctb = x >> sps->log2_ctb_size; + int y_ctb = y >> sps->log2_ctb_size; + int ctb_addr_rs = y_ctb * sps->ctb_width + x_ctb; + int ctb_addr_ts = pps->ctb_addr_rs_to_ts[ctb_addr_rs]; SAOParams *sao = &CTB(s->sao, x_ctb, y_ctb); // flags indicating unfilterable edges uint8_t vert_edge[] = { 0, 0 }; uint8_t horiz_edge[] = { 0, 0 }; uint8_t diag_edge[] = { 0, 0, 0, 0 }; uint8_t lfase = CTB(s->filter_slice_edges, x_ctb, y_ctb); - uint8_t no_tile_filter = s->ps.pps->tiles_enabled_flag && - !s->ps.pps->loop_filter_across_tiles_enabled_flag; + uint8_t no_tile_filter = pps->tiles_enabled_flag && + !pps->loop_filter_across_tiles_enabled_flag; uint8_t restore = no_tile_filter || !lfase; uint8_t left_tile_edge = 0; uint8_t right_tile_edge = 0; @@ -278,24 +291,24 @@ static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, in edges[0] = x_ctb == 0; edges[1] = y_ctb == 0; - edges[2] = x_ctb == s->ps.sps->ctb_width - 1; - edges[3] = y_ctb == s->ps.sps->ctb_height - 1; + edges[2] = x_ctb == sps->ctb_width - 1; + edges[3] = y_ctb == sps->ctb_height - 1; if (restore) { if (!edges[0]) { - left_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]]; + left_tile_edge = no_tile_filter && pps->tile_id[ctb_addr_ts] != pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]]; vert_edge[0] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb - 1, y_ctb)) || left_tile_edge; } if (!edges[2]) { - right_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs+1]]; + right_tile_edge = no_tile_filter && pps->tile_id[ctb_addr_ts] != pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs+1]]; vert_edge[1] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb + 1, y_ctb)) || right_tile_edge; } if (!edges[1]) { - up_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->ps.sps->ctb_width]]; + up_tile_edge = no_tile_filter && pps->tile_id[ctb_addr_ts] != pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs - sps->ctb_width]]; horiz_edge[0] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb, y_ctb - 1)) || up_tile_edge; } if (!edges[3]) { - bottom_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs + s->ps.sps->ctb_width]]; + bottom_tile_edge = no_tile_filter && pps->tile_id[ctb_addr_ts] != pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs + sps->ctb_width]]; horiz_edge[1] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb, y_ctb + 1)) || bottom_tile_edge; } if (!edges[0] && !edges[1]) { @@ -312,32 +325,32 @@ static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, in } } - for (c_idx = 0; c_idx < (s->ps.sps->chroma_format_idc ? 3 : 1); c_idx++) { - int x0 = x >> s->ps.sps->hshift[c_idx]; - int y0 = y >> s->ps.sps->vshift[c_idx]; + for (c_idx = 0; c_idx < (sps->chroma_format_idc ? 3 : 1); c_idx++) { + int x0 = x >> sps->hshift[c_idx]; + int y0 = y >> sps->vshift[c_idx]; ptrdiff_t stride_src = s->cur_frame->f->linesize[c_idx]; - int ctb_size_h = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->hshift[c_idx]; - int ctb_size_v = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->vshift[c_idx]; - int width = FFMIN(ctb_size_h, (s->ps.sps->width >> s->ps.sps->hshift[c_idx]) - x0); - int height = FFMIN(ctb_size_v, (s->ps.sps->height >> s->ps.sps->vshift[c_idx]) - y0); + int ctb_size_h = (1 << (sps->log2_ctb_size)) >> sps->hshift[c_idx]; + int ctb_size_v = (1 << (sps->log2_ctb_size)) >> sps->vshift[c_idx]; + int width = FFMIN(ctb_size_h, (sps->width >> sps->hshift[c_idx]) - x0); + int height = FFMIN(ctb_size_v, (sps->height >> sps->vshift[c_idx]) - y0); int tab = sao_tab[(FFALIGN(width, 8) >> 3) - 1]; - uint8_t *src = &s->cur_frame->f->data[c_idx][y0 * stride_src + (x0 << s->ps.sps->pixel_shift)]; + uint8_t *src = &s->cur_frame->f->data[c_idx][y0 * stride_src + (x0 << sps->pixel_shift)]; ptrdiff_t stride_dst; uint8_t *dst; switch (sao->type_idx[c_idx]) { case SAO_BAND: - copy_CTB_to_hv(s, src, stride_src, x0, y0, width, height, c_idx, + copy_CTB_to_hv(s, sps, src, stride_src, x0, y0, width, height, c_idx, x_ctb, y_ctb); - if (s->ps.pps->transquant_bypass_enable_flag || - (s->ps.sps->pcm_loop_filter_disabled && s->ps.sps->pcm_enabled)) { + if (pps->transquant_bypass_enable_flag || + (sps->pcm_loop_filter_disabled && sps->pcm_enabled)) { dst = lc->edge_emu_buffer; stride_dst = 2*MAX_PB_SIZE; - copy_CTB(dst, src, width << s->ps.sps->pixel_shift, height, stride_dst, stride_src); + copy_CTB(dst, src, width << sps->pixel_shift, height, stride_dst, stride_src); s->hevcdsp.sao_band_filter[tab](src, dst, stride_src, stride_dst, sao->offset_val[c_idx], sao->band_position[c_idx], width, height); - restore_tqb_pixels(s, src, dst, stride_src, stride_dst, + restore_tqb_pixels(s, pps, sps, src, dst, stride_src, stride_dst, x, y, width, height, c_idx); } else { s->hevcdsp.sao_band_filter[tab](src, src, stride_src, stride_src, @@ -348,13 +361,13 @@ static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, in break; case SAO_EDGE: { - int w = s->ps.sps->width >> s->ps.sps->hshift[c_idx]; - int h = s->ps.sps->height >> s->ps.sps->vshift[c_idx]; + int w = sps->width >> sps->hshift[c_idx]; + int h = sps->height >> sps->vshift[c_idx]; int left_edge = edges[0]; int top_edge = edges[1]; int right_edge = edges[2]; int bottom_edge = edges[3]; - int sh = s->ps.sps->pixel_shift; + int sh = sps->pixel_shift; int left_pixels, right_pixels; stride_dst = 2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE; @@ -440,7 +453,7 @@ static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, in (width + left_pixels + right_pixels) << sh, height, stride_dst, stride_src); - copy_CTB_to_hv(s, src, stride_src, x0, y0, width, height, c_idx, + copy_CTB_to_hv(s, sps, src, stride_src, x0, y0, width, height, c_idx, x_ctb, y_ctb); s->hevcdsp.sao_edge_filter[tab](src, dst, stride_src, sao->offset_val[c_idx], sao->eo_class[c_idx], width, height); @@ -452,7 +465,7 @@ static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, in vert_edge, horiz_edge, diag_edge); - restore_tqb_pixels(s, src, dst, stride_src, stride_dst, + restore_tqb_pixels(s, pps, sps, src, dst, stride_src, stride_dst, x, y, width, height, c_idx); sao->type_idx[c_idx] = SAO_APPLIED; break; @@ -461,9 +474,9 @@ static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, in } } -static int get_pcm(const HEVCContext *s, int x, int y) +static int get_pcm(const HEVCSPS *sps, const uint8_t *is_pcm, int x, int y) { - int log2_min_pu_size = s->ps.sps->log2_min_pu_size; + int log2_min_pu_size = sps->log2_min_pu_size; int x_pu, y_pu; if (x < 0 || y < 0) @@ -472,9 +485,9 @@ static int get_pcm(const HEVCContext *s, int x, int y) x_pu = x >> log2_min_pu_size; y_pu = y >> log2_min_pu_size; - if (x_pu >= s->ps.sps->min_pu_width || y_pu >= s->ps.sps->min_pu_height) + if (x_pu >= sps->min_pu_width || y_pu >= sps->min_pu_height) return 2; - return s->is_pcm[y_pu * s->ps.sps->min_pu_width + x_pu]; + return is_pcm[y_pu * sps->min_pu_width + x_pu]; } #define TC_CALC(qp, bs) \ @@ -482,7 +495,9 @@ static int get_pcm(const HEVCContext *s, int x, int y) (tc_offset & -2), \ 0, MAX_QP + DEFAULT_INTRA_TC_OFFSET)] -static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) +static void deblocking_filter_CTB(const HEVCContext *s, + const HEVCPPS *pps, const HEVCSPS *sps, + int x0, int y0) { uint8_t **data = s->cur_frame->f->data; int *linesize = s->cur_frame->f->linesize; @@ -494,18 +509,18 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) uint8_t no_p[2] = { 0 }; uint8_t no_q[2] = { 0 }; - int log2_ctb_size = s->ps.sps->log2_ctb_size; + int log2_ctb_size = sps->log2_ctb_size; int x_end, x_end2, y_end; int ctb_size = 1 << log2_ctb_size; int ctb = (x0 >> log2_ctb_size) + - (y0 >> log2_ctb_size) * s->ps.sps->ctb_width; + (y0 >> log2_ctb_size) * sps->ctb_width; int cur_tc_offset = s->deblock[ctb].tc_offset; int cur_beta_offset = s->deblock[ctb].beta_offset; int left_tc_offset, left_beta_offset; int tc_offset, beta_offset; - int pcmf = (s->ps.sps->pcm_enabled && - s->ps.sps->pcm_loop_filter_disabled) || - s->ps.pps->transquant_bypass_enable_flag; + int pcmf = (sps->pcm_enabled && + sps->pcm_loop_filter_disabled) || + pps->transquant_bypass_enable_flag; if (x0) { left_tc_offset = s->deblock[ctb - 1].tc_offset; @@ -516,17 +531,17 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) } x_end = x0 + ctb_size; - if (x_end > s->ps.sps->width) - x_end = s->ps.sps->width; + if (x_end > sps->width) + x_end = sps->width; y_end = y0 + ctb_size; - if (y_end > s->ps.sps->height) - y_end = s->ps.sps->height; + if (y_end > sps->height) + y_end = sps->height; tc_offset = cur_tc_offset; beta_offset = cur_beta_offset; x_end2 = x_end; - if (x_end2 != s->ps.sps->width) + if (x_end2 != sps->width) x_end2 -= 8; for (y = y0; y < y_end; y += 8) { // vertical filtering luma @@ -534,18 +549,19 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) const int bs0 = s->vertical_bs[(x + y * s->bs_width) >> 2]; const int bs1 = s->vertical_bs[(x + (y + 4) * s->bs_width) >> 2]; if (bs0 || bs1) { - const int qp = (get_qPy(s, x - 1, y) + get_qPy(s, x, y) + 1) >> 1; + const int qp = (get_qPy(sps, s->qp_y_tab, x - 1, y) + + get_qPy(sps, s->qp_y_tab, x, y) + 1) >> 1; beta = betatable[av_clip(qp + beta_offset, 0, MAX_QP)]; tc[0] = bs0 ? TC_CALC(qp, bs0) : 0; tc[1] = bs1 ? TC_CALC(qp, bs1) : 0; - src = &data[LUMA][y * linesize[LUMA] + (x << s->ps.sps->pixel_shift)]; + src = &data[LUMA][y * linesize[LUMA] + (x << sps->pixel_shift)]; if (pcmf) { - no_p[0] = get_pcm(s, x - 1, y); - no_p[1] = get_pcm(s, x - 1, y + 4); - no_q[0] = get_pcm(s, x, y); - no_q[1] = get_pcm(s, x, y + 4); + no_p[0] = get_pcm(sps, s->is_pcm, x - 1, y); + no_p[1] = get_pcm(sps, s->is_pcm, x - 1, y + 4); + no_q[0] = get_pcm(sps, s->is_pcm, x, y); + no_q[1] = get_pcm(sps, s->is_pcm, x, y + 4); s->hevcdsp.hevc_v_loop_filter_luma_c(src, linesize[LUMA], beta, tc, no_p, no_q); } else @@ -562,7 +578,8 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) const int bs0 = s->horizontal_bs[( x + y * s->bs_width) >> 2]; const int bs1 = s->horizontal_bs[((x + 4) + y * s->bs_width) >> 2]; if (bs0 || bs1) { - const int qp = (get_qPy(s, x, y - 1) + get_qPy(s, x, y) + 1) >> 1; + const int qp = (get_qPy(sps, s->qp_y_tab, x, y - 1) + + get_qPy(sps, s->qp_y_tab, x, y) + 1) >> 1; tc_offset = x >= x0 ? cur_tc_offset : left_tc_offset; beta_offset = x >= x0 ? cur_beta_offset : left_beta_offset; @@ -570,12 +587,12 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) beta = betatable[av_clip(qp + beta_offset, 0, MAX_QP)]; tc[0] = bs0 ? TC_CALC(qp, bs0) : 0; tc[1] = bs1 ? TC_CALC(qp, bs1) : 0; - src = &data[LUMA][y * linesize[LUMA] + (x << s->ps.sps->pixel_shift)]; + src = &data[LUMA][y * linesize[LUMA] + (x << sps->pixel_shift)]; if (pcmf) { - no_p[0] = get_pcm(s, x, y - 1); - no_p[1] = get_pcm(s, x + 4, y - 1); - no_q[0] = get_pcm(s, x, y); - no_q[1] = get_pcm(s, x + 4, y); + no_p[0] = get_pcm(sps, s->is_pcm, x, y - 1); + no_p[1] = get_pcm(sps, s->is_pcm, x + 4, y - 1); + no_q[0] = get_pcm(sps, s->is_pcm, x, y); + no_q[1] = get_pcm(sps, s->is_pcm, x + 4, y); s->hevcdsp.hevc_h_loop_filter_luma_c(src, linesize[LUMA], beta, tc, no_p, no_q); } else @@ -585,10 +602,10 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) } } - if (s->ps.sps->chroma_format_idc) { + if (sps->chroma_format_idc) { for (chroma = 1; chroma <= 2; chroma++) { - int h = 1 << s->ps.sps->hshift[chroma]; - int v = 1 << s->ps.sps->vshift[chroma]; + int h = 1 << sps->hshift[chroma]; + int v = 1 << sps->vshift[chroma]; // vertical filtering chroma for (y = y0; y < y_end; y += (8 * v)) { @@ -597,17 +614,19 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) const int bs1 = s->vertical_bs[(x + (y + (4 * v)) * s->bs_width) >> 2]; if ((bs0 == 2) || (bs1 == 2)) { - const int qp0 = (get_qPy(s, x - 1, y) + get_qPy(s, x, y) + 1) >> 1; - const int qp1 = (get_qPy(s, x - 1, y + (4 * v)) + get_qPy(s, x, y + (4 * v)) + 1) >> 1; - - c_tc[0] = (bs0 == 2) ? chroma_tc(s, qp0, chroma, tc_offset) : 0; - c_tc[1] = (bs1 == 2) ? chroma_tc(s, qp1, chroma, tc_offset) : 0; - src = &data[chroma][(y >> s->ps.sps->vshift[chroma]) * linesize[chroma] + ((x >> s->ps.sps->hshift[chroma]) << s->ps.sps->pixel_shift)]; + const int qp0 = (get_qPy(sps, s->qp_y_tab, x - 1, y) + + get_qPy(sps, s->qp_y_tab, x, y) + 1) >> 1; + const int qp1 = (get_qPy(sps, s->qp_y_tab, x - 1, y + (4 * v)) + + get_qPy(sps, s->qp_y_tab, x, y + (4 * v)) + 1) >> 1; + + c_tc[0] = (bs0 == 2) ? chroma_tc(pps, sps, qp0, chroma, tc_offset) : 0; + c_tc[1] = (bs1 == 2) ? chroma_tc(pps, sps, qp1, chroma, tc_offset) : 0; + src = &data[chroma][(y >> sps->vshift[chroma]) * linesize[chroma] + ((x >> sps->hshift[chroma]) << sps->pixel_shift)]; if (pcmf) { - no_p[0] = get_pcm(s, x - 1, y); - no_p[1] = get_pcm(s, x - 1, y + (4 * v)); - no_q[0] = get_pcm(s, x, y); - no_q[1] = get_pcm(s, x, y + (4 * v)); + no_p[0] = get_pcm(sps, s->is_pcm, x - 1, y); + no_p[1] = get_pcm(sps, s->is_pcm, x - 1, y + (4 * v)); + no_q[0] = get_pcm(sps, s->is_pcm, x, y); + no_q[1] = get_pcm(sps, s->is_pcm, x, y + (4 * v)); s->hevcdsp.hevc_v_loop_filter_chroma_c(src, linesize[chroma], c_tc, no_p, no_q); } else @@ -622,23 +641,25 @@ static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) // horizontal filtering chroma tc_offset = x0 ? left_tc_offset : cur_tc_offset; x_end2 = x_end; - if (x_end != s->ps.sps->width) + if (x_end != sps->width) x_end2 = x_end - 8 * h; for (x = x0 ? x0 - 8 * h : 0; x < x_end2; x += (8 * h)) { const int bs0 = s->horizontal_bs[( x + y * s->bs_width) >> 2]; const int bs1 = s->horizontal_bs[((x + 4 * h) + y * s->bs_width) >> 2]; if ((bs0 == 2) || (bs1 == 2)) { - const int qp0 = bs0 == 2 ? (get_qPy(s, x, y - 1) + get_qPy(s, x, y) + 1) >> 1 : 0; - const int qp1 = bs1 == 2 ? (get_qPy(s, x + (4 * h), y - 1) + get_qPy(s, x + (4 * h), y) + 1) >> 1 : 0; - - c_tc[0] = bs0 == 2 ? chroma_tc(s, qp0, chroma, tc_offset) : 0; - c_tc[1] = bs1 == 2 ? chroma_tc(s, qp1, chroma, cur_tc_offset) : 0; - src = &data[chroma][(y >> s->ps.sps->vshift[1]) * linesize[chroma] + ((x >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)]; + const int qp0 = bs0 == 2 ? (get_qPy(sps, s->qp_y_tab, x, y - 1) + + get_qPy(sps, s->qp_y_tab, x, y) + 1) >> 1 : 0; + const int qp1 = bs1 == 2 ? (get_qPy(sps, s->qp_y_tab, x + (4 * h), y - 1) + + get_qPy(sps, s->qp_y_tab, x + (4 * h), y) + 1) >> 1 : 0; + + c_tc[0] = bs0 == 2 ? chroma_tc(pps, sps, qp0, chroma, tc_offset) : 0; + c_tc[1] = bs1 == 2 ? chroma_tc(pps, sps, qp1, chroma, cur_tc_offset) : 0; + src = &data[chroma][(y >> sps->vshift[1]) * linesize[chroma] + ((x >> sps->hshift[1]) << sps->pixel_shift)]; if (pcmf) { - no_p[0] = get_pcm(s, x, y - 1); - no_p[1] = get_pcm(s, x + (4 * h), y - 1); - no_q[0] = get_pcm(s, x, y); - no_q[1] = get_pcm(s, x + (4 * h), y); + no_p[0] = get_pcm(sps, s->is_pcm, x, y - 1); + no_p[1] = get_pcm(sps, s->is_pcm, x + (4 * h), y - 1); + no_q[0] = get_pcm(sps, s->is_pcm, x, y); + no_q[1] = get_pcm(sps, s->is_pcm, x + (4 * h), y); s->hevcdsp.hevc_h_loop_filter_chroma_c(src, linesize[chroma], c_tc, no_p, no_q); } else @@ -715,15 +736,16 @@ static int boundary_strength(const HEVCContext *s, const MvField *curr, const Mv return 1; } -void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, - int log2_trafo_size) +void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int log2_trafo_size) { + const HEVCSPS *const sps = pps->sps; const HEVCContext *s = lc->parent; const MvField *tab_mvf = s->cur_frame->tab_mvf; - int log2_min_pu_size = s->ps.sps->log2_min_pu_size; - int log2_min_tu_size = s->ps.sps->log2_min_tb_size; - int min_pu_width = s->ps.sps->min_pu_width; - int min_tu_width = s->ps.sps->min_tb_width; + int log2_min_pu_size = sps->log2_min_pu_size; + int log2_min_tu_size = sps->log2_min_tb_size; + int min_pu_width = sps->min_pu_width; + int min_tu_width = sps->min_tb_width; int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width + (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA; int boundary_upper, boundary_left; @@ -733,10 +755,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, if (boundary_upper && ((!s->sh.slice_loop_filter_across_slices_enabled_flag && lc->boundary_flags & BOUNDARY_UPPER_SLICE && - (y0 % (1 << s->ps.sps->log2_ctb_size)) == 0) || - (!s->ps.pps->loop_filter_across_tiles_enabled_flag && + (y0 % (1 << sps->log2_ctb_size)) == 0) || + (!pps->loop_filter_across_tiles_enabled_flag && lc->boundary_flags & BOUNDARY_UPPER_TILE && - (y0 % (1 << s->ps.sps->log2_ctb_size)) == 0))) + (y0 % (1 << sps->log2_ctb_size)) == 0))) boundary_upper = 0; if (boundary_upper) { @@ -771,10 +793,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, if (boundary_left && ((!s->sh.slice_loop_filter_across_slices_enabled_flag && lc->boundary_flags & BOUNDARY_LEFT_SLICE && - (x0 % (1 << s->ps.sps->log2_ctb_size)) == 0) || - (!s->ps.pps->loop_filter_across_tiles_enabled_flag && + (x0 % (1 << sps->log2_ctb_size)) == 0) || + (!pps->loop_filter_across_tiles_enabled_flag && lc->boundary_flags & BOUNDARY_LEFT_TILE && - (x0 % (1 << s->ps.sps->log2_ctb_size)) == 0))) + (x0 % (1 << sps->log2_ctb_size)) == 0))) boundary_left = 0; if (boundary_left) { @@ -843,10 +865,12 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, #undef CB #undef CR -void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size) +void ff_hevc_hls_filter(HEVCLocalContext *lc, const HEVCPPS *pps, + int x, int y, int ctb_size) { + const HEVCSPS *const sps = pps->sps; const HEVCContext *const s = lc->parent; - int x_end = x >= s->ps.sps->width - ctb_size; + int x_end = x >= sps->width - ctb_size; int skip = 0; if (s->avctx->skip_loop_filter >= AVDISCARD_ALL || (s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && !IS_IDR(s)) || @@ -859,35 +883,36 @@ void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size) skip = 1; if (!skip) - deblocking_filter_CTB(s, x, y); - if (s->ps.sps->sao_enabled && !skip) { - int y_end = y >= s->ps.sps->height - ctb_size; + deblocking_filter_CTB(s, pps, sps, x, y); + if (sps->sao_enabled && !skip) { + int y_end = y >= sps->height - ctb_size; if (y && x) - sao_filter_CTB(lc, s, x - ctb_size, y - ctb_size); + sao_filter_CTB(lc, s, pps, sps, x - ctb_size, y - ctb_size); if (x && y_end) - sao_filter_CTB(lc, s, x - ctb_size, y); + sao_filter_CTB(lc, s, pps, sps, x - ctb_size, y); if (y && x_end) { - sao_filter_CTB(lc, s, x, y - ctb_size); - if (s->threads_type & FF_THREAD_FRAME ) + sao_filter_CTB(lc, s, pps, sps, x, y - ctb_size); + if (s->avctx->active_thread_type & FF_THREAD_FRAME ) ff_progress_frame_report(&s->cur_frame->tf, y); } if (x_end && y_end) { - sao_filter_CTB(lc, s, x , y); - if (s->threads_type & FF_THREAD_FRAME ) + sao_filter_CTB(lc, s, pps, sps, x , y); + if (s->avctx->active_thread_type & FF_THREAD_FRAME ) ff_progress_frame_report(&s->cur_frame->tf, y + ctb_size); } - } else if (s->threads_type & FF_THREAD_FRAME && x_end) + } else if (s->avctx->active_thread_type & FF_THREAD_FRAME && x_end) ff_progress_frame_report(&s->cur_frame->tf, y + ctb_size - 4); } -void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size) +void ff_hevc_hls_filters(HEVCLocalContext *lc, const HEVCPPS *pps, + int x_ctb, int y_ctb, int ctb_size) { - int x_end = x_ctb >= lc->parent->ps.sps->width - ctb_size; - int y_end = y_ctb >= lc->parent->ps.sps->height - ctb_size; + int x_end = x_ctb >= pps->sps->width - ctb_size; + int y_end = y_ctb >= pps->sps->height - ctb_size; if (y_ctb && x_ctb) - ff_hevc_hls_filter(lc, x_ctb - ctb_size, y_ctb - ctb_size, ctb_size); + ff_hevc_hls_filter(lc, pps, x_ctb - ctb_size, y_ctb - ctb_size, ctb_size); if (y_ctb && x_end) - ff_hevc_hls_filter(lc, x_ctb, y_ctb - ctb_size, ctb_size); + ff_hevc_hls_filter(lc, pps, x_ctb, y_ctb - ctb_size, ctb_size); if (x_ctb && y_end) - ff_hevc_hls_filter(lc, x_ctb - ctb_size, y_ctb, ctb_size); + ff_hevc_hls_filter(lc, pps, x_ctb - ctb_size, y_ctb, ctb_size); } diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c index 5fb9d863c9..e75768f303 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c @@ -84,10 +84,6 @@ static void pic_arrays_free(HEVCContext *s) av_freep(&s->horizontal_bs); av_freep(&s->vertical_bs); - av_freep(&s->sh.entry_point_offset); - av_freep(&s->sh.size); - av_freep(&s->sh.offset); - ff_refstruct_pool_uninit(&s->tab_mvf_pool); ff_refstruct_pool_uninit(&s->rpl_tab_pool); } @@ -147,7 +143,8 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) return AVERROR(ENOMEM); } -static int pred_weight_table(HEVCContext *s, GetBitContext *gb) +static int pred_weight_table(SliceHeader *sh, void *logctx, + const HEVCSPS *sps, GetBitContext *gb) { int i = 0; int j = 0; @@ -159,40 +156,40 @@ static int pred_weight_table(HEVCContext *s, GetBitContext *gb) luma_log2_weight_denom = get_ue_golomb_long(gb); if (luma_log2_weight_denom < 0 || luma_log2_weight_denom > 7) { - av_log(s->avctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is invalid\n", luma_log2_weight_denom); + av_log(logctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is invalid\n", luma_log2_weight_denom); return AVERROR_INVALIDDATA; } - s->sh.luma_log2_weight_denom = av_clip_uintp2(luma_log2_weight_denom, 3); - if (s->ps.sps->chroma_format_idc != 0) { + sh->luma_log2_weight_denom = av_clip_uintp2(luma_log2_weight_denom, 3); + if (sps->chroma_format_idc != 0) { int64_t chroma_log2_weight_denom = luma_log2_weight_denom + (int64_t)get_se_golomb(gb); if (chroma_log2_weight_denom < 0 || chroma_log2_weight_denom > 7) { - av_log(s->avctx, AV_LOG_ERROR, "chroma_log2_weight_denom %"PRId64" is invalid\n", chroma_log2_weight_denom); + av_log(logctx, AV_LOG_ERROR, "chroma_log2_weight_denom %"PRId64" is invalid\n", chroma_log2_weight_denom); return AVERROR_INVALIDDATA; } - s->sh.chroma_log2_weight_denom = chroma_log2_weight_denom; + sh->chroma_log2_weight_denom = chroma_log2_weight_denom; } - for (i = 0; i < s->sh.nb_refs[L0]; i++) { + for (i = 0; i < sh->nb_refs[L0]; i++) { luma_weight_l0_flag[i] = get_bits1(gb); if (!luma_weight_l0_flag[i]) { - s->sh.luma_weight_l0[i] = 1 << s->sh.luma_log2_weight_denom; - s->sh.luma_offset_l0[i] = 0; + sh->luma_weight_l0[i] = 1 << sh->luma_log2_weight_denom; + sh->luma_offset_l0[i] = 0; } } - if (s->ps.sps->chroma_format_idc != 0) { - for (i = 0; i < s->sh.nb_refs[L0]; i++) + if (sps->chroma_format_idc != 0) { + for (i = 0; i < sh->nb_refs[L0]; i++) chroma_weight_l0_flag[i] = get_bits1(gb); } else { - for (i = 0; i < s->sh.nb_refs[L0]; i++) + for (i = 0; i < sh->nb_refs[L0]; i++) chroma_weight_l0_flag[i] = 0; } - for (i = 0; i < s->sh.nb_refs[L0]; i++) { + for (i = 0; i < sh->nb_refs[L0]; i++) { if (luma_weight_l0_flag[i]) { int delta_luma_weight_l0 = get_se_golomb(gb); if ((int8_t)delta_luma_weight_l0 != delta_luma_weight_l0) return AVERROR_INVALIDDATA; - s->sh.luma_weight_l0[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l0; - s->sh.luma_offset_l0[i] = get_se_golomb(gb); + sh->luma_weight_l0[i] = (1 << sh->luma_log2_weight_denom) + delta_luma_weight_l0; + sh->luma_offset_l0[i] = get_se_golomb(gb); } if (chroma_weight_l0_flag[i]) { for (j = 0; j < 2; j++) { @@ -204,39 +201,39 @@ static int pred_weight_table(HEVCContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; } - s->sh.chroma_weight_l0[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l0; - s->sh.chroma_offset_l0[i][j] = av_clip((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j]) - >> s->sh.chroma_log2_weight_denom) + 128), -128, 127); + sh->chroma_weight_l0[i][j] = (1 << sh->chroma_log2_weight_denom) + delta_chroma_weight_l0; + sh->chroma_offset_l0[i][j] = av_clip((delta_chroma_offset_l0 - ((128 * sh->chroma_weight_l0[i][j]) + >> sh->chroma_log2_weight_denom) + 128), -128, 127); } } else { - s->sh.chroma_weight_l0[i][0] = 1 << s->sh.chroma_log2_weight_denom; - s->sh.chroma_offset_l0[i][0] = 0; - s->sh.chroma_weight_l0[i][1] = 1 << s->sh.chroma_log2_weight_denom; - s->sh.chroma_offset_l0[i][1] = 0; + sh->chroma_weight_l0[i][0] = 1 << sh->chroma_log2_weight_denom; + sh->chroma_offset_l0[i][0] = 0; + sh->chroma_weight_l0[i][1] = 1 << sh->chroma_log2_weight_denom; + sh->chroma_offset_l0[i][1] = 0; } } - if (s->sh.slice_type == HEVC_SLICE_B) { - for (i = 0; i < s->sh.nb_refs[L1]; i++) { + if (sh->slice_type == HEVC_SLICE_B) { + for (i = 0; i < sh->nb_refs[L1]; i++) { luma_weight_l1_flag[i] = get_bits1(gb); if (!luma_weight_l1_flag[i]) { - s->sh.luma_weight_l1[i] = 1 << s->sh.luma_log2_weight_denom; - s->sh.luma_offset_l1[i] = 0; + sh->luma_weight_l1[i] = 1 << sh->luma_log2_weight_denom; + sh->luma_offset_l1[i] = 0; } } - if (s->ps.sps->chroma_format_idc != 0) { - for (i = 0; i < s->sh.nb_refs[L1]; i++) + if (sps->chroma_format_idc != 0) { + for (i = 0; i < sh->nb_refs[L1]; i++) chroma_weight_l1_flag[i] = get_bits1(gb); } else { - for (i = 0; i < s->sh.nb_refs[L1]; i++) + for (i = 0; i < sh->nb_refs[L1]; i++) chroma_weight_l1_flag[i] = 0; } - for (i = 0; i < s->sh.nb_refs[L1]; i++) { + for (i = 0; i < sh->nb_refs[L1]; i++) { if (luma_weight_l1_flag[i]) { int delta_luma_weight_l1 = get_se_golomb(gb); if ((int8_t)delta_luma_weight_l1 != delta_luma_weight_l1) return AVERROR_INVALIDDATA; - s->sh.luma_weight_l1[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l1; - s->sh.luma_offset_l1[i] = get_se_golomb(gb); + sh->luma_weight_l1[i] = (1 << sh->luma_log2_weight_denom) + delta_luma_weight_l1; + sh->luma_offset_l1[i] = get_se_golomb(gb); } if (chroma_weight_l1_flag[i]) { for (j = 0; j < 2; j++) { @@ -248,24 +245,24 @@ static int pred_weight_table(HEVCContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; } - s->sh.chroma_weight_l1[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l1; - s->sh.chroma_offset_l1[i][j] = av_clip((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j]) - >> s->sh.chroma_log2_weight_denom) + 128), -128, 127); + sh->chroma_weight_l1[i][j] = (1 << sh->chroma_log2_weight_denom) + delta_chroma_weight_l1; + sh->chroma_offset_l1[i][j] = av_clip((delta_chroma_offset_l1 - ((128 * sh->chroma_weight_l1[i][j]) + >> sh->chroma_log2_weight_denom) + 128), -128, 127); } } else { - s->sh.chroma_weight_l1[i][0] = 1 << s->sh.chroma_log2_weight_denom; - s->sh.chroma_offset_l1[i][0] = 0; - s->sh.chroma_weight_l1[i][1] = 1 << s->sh.chroma_log2_weight_denom; - s->sh.chroma_offset_l1[i][1] = 0; + sh->chroma_weight_l1[i][0] = 1 << sh->chroma_log2_weight_denom; + sh->chroma_offset_l1[i][0] = 0; + sh->chroma_weight_l1[i][1] = 1 << sh->chroma_log2_weight_denom; + sh->chroma_offset_l1[i][1] = 0; } } } return 0; } -static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) +static int decode_lt_rps(const HEVCSPS *sps, LongTermRPS *rps, + GetBitContext *gb, int cur_poc, int poc_lsb) { - const HEVCSPS *sps = s->ps.sps; int max_poc_lsb = 1 << sps->log2_max_poc_lsb; int prev_delta_msb = 0; unsigned int nb_sps = 0, nb_sh; @@ -309,7 +306,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) if (i && i != nb_sps) delta += prev_delta_msb; - poc = rps->poc[i] + s->poc - delta * max_poc_lsb - s->sh.pic_order_cnt_lsb; + poc = rps->poc[i] + cur_poc - delta * max_poc_lsb - poc_lsb; if (poc != (int32_t)poc) return AVERROR_INVALIDDATA; rps->poc[i] = poc; @@ -323,8 +320,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) static void export_stream_params(HEVCContext *s, const HEVCSPS *sps) { AVCodecContext *avctx = s->avctx; - const HEVCParamSets *ps = &s->ps; - const HEVCVPS *vps = ps->vps_list[sps->vps_id]; + const HEVCVPS *vps = sps->vps; const HEVCWindow *ow = &sps->output_window; unsigned int num = 0, den = 0; @@ -603,7 +599,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, } s->ps.sps = sps; - s->ps.vps = s->ps.vps_list[s->ps.sps->vps_id]; + s->ps.vps = sps->vps; return 0; @@ -617,76 +613,48 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, return ret; } -static int hls_slice_header(HEVCContext *s, GetBitContext *gb) +static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext *gb) { - SliceHeader *sh = &s->sh; + const HEVCPPS *pps; + const HEVCSPS *sps; + unsigned pps_id; int i, ret; // Coded parameters sh->first_slice_in_pic_flag = get_bits1(gb); - if (s->cur_frame && sh->first_slice_in_pic_flag) { - av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n"); - return 1; // This slice will be skipped later, do not corrupt state - } - if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) { - s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; - s->max_ra = INT_MAX; - if (IS_IDR(s)) - ff_hevc_clear_refs(s); - } sh->no_output_of_prior_pics_flag = 0; if (IS_IRAP(s)) sh->no_output_of_prior_pics_flag = get_bits1(gb); - sh->pps_id = get_ue_golomb_long(gb); - if (sh->pps_id >= HEVC_MAX_PPS_COUNT || !s->ps.pps_list[sh->pps_id]) { - av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id); + pps_id = get_ue_golomb_long(gb); + if (pps_id >= HEVC_MAX_PPS_COUNT || !s->ps.pps_list[pps_id]) { + av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id); return AVERROR_INVALIDDATA; } - if (!sh->first_slice_in_pic_flag && - s->ps.pps != s->ps.pps_list[sh->pps_id]) { + if (!sh->first_slice_in_pic_flag && pps_id != sh->pps_id) { av_log(s->avctx, AV_LOG_ERROR, "PPS changed between slices.\n"); return AVERROR_INVALIDDATA; } - s->ps.pps = s->ps.pps_list[sh->pps_id]; - if (s->nal_unit_type == HEVC_NAL_CRA_NUT && s->last_eos == 1) - sh->no_output_of_prior_pics_flag = 1; - - if (s->ps.sps != s->ps.sps_list[s->ps.pps->sps_id]) { - const HEVCSPS *sps = s->ps.sps_list[s->ps.pps->sps_id]; - enum AVPixelFormat pix_fmt; - - ff_hevc_clear_refs(s); - - ret = set_sps(s, sps, sps->pix_fmt); - if (ret < 0) - return ret; + sh->pps_id = pps_id; - pix_fmt = get_format(s, sps); - if (pix_fmt < 0) - return pix_fmt; - s->avctx->pix_fmt = pix_fmt; + pps = s->ps.pps_list[pps_id]; + sps = pps->sps; - s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; - s->max_ra = INT_MAX; - } - - ret = export_stream_params_from_sei(s); - if (ret < 0) - return ret; + if (s->nal_unit_type == HEVC_NAL_CRA_NUT && s->last_eos == 1) + sh->no_output_of_prior_pics_flag = 1; sh->dependent_slice_segment_flag = 0; if (!sh->first_slice_in_pic_flag) { int slice_address_length; - if (s->ps.pps->dependent_slice_segments_enabled_flag) + if (pps->dependent_slice_segments_enabled_flag) sh->dependent_slice_segment_flag = get_bits1(gb); - slice_address_length = av_ceil_log2(s->ps.sps->ctb_width * - s->ps.sps->ctb_height); + slice_address_length = av_ceil_log2(sps->ctb_width * + sps->ctb_height); sh->slice_segment_addr = get_bitsz(gb, slice_address_length); - if (sh->slice_segment_addr >= s->ps.sps->ctb_width * s->ps.sps->ctb_height) { + if (sh->slice_segment_addr >= sps->ctb_width * sps->ctb_height) { av_log(s->avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n", sh->slice_segment_addr); @@ -695,18 +663,13 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) if (!sh->dependent_slice_segment_flag) { sh->slice_addr = sh->slice_segment_addr; - s->slice_idx++; } } else { sh->slice_segment_addr = sh->slice_addr = 0; - s->slice_idx = 0; - s->slice_initialized = 0; } if (!sh->dependent_slice_segment_flag) { - s->slice_initialized = 0; - - for (i = 0; i < s->ps.pps->num_extra_slice_header_bits; i++) + for (i = 0; i < pps->num_extra_slice_header_bits; i++) skip_bits(gb, 1); // slice_reserved_undetermined_flag[] sh->slice_type = get_ue_golomb_long(gb); @@ -718,37 +681,37 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; } if (IS_IRAP(s) && sh->slice_type != HEVC_SLICE_I && - !s->ps.pps->pps_curr_pic_ref_enabled_flag) { + !pps->pps_curr_pic_ref_enabled_flag) { av_log(s->avctx, AV_LOG_ERROR, "Inter slices in an IRAP frame.\n"); return AVERROR_INVALIDDATA; } // when flag is not present, picture is inferred to be output sh->pic_output_flag = 1; - if (s->ps.pps->output_flag_present_flag) + if (pps->output_flag_present_flag) sh->pic_output_flag = get_bits1(gb); - if (s->ps.sps->separate_colour_plane) + if (sps->separate_colour_plane) sh->colour_plane_id = get_bits(gb, 2); if (!IS_IDR(s)) { int poc, pos; - sh->pic_order_cnt_lsb = get_bits(gb, s->ps.sps->log2_max_poc_lsb); - poc = ff_hevc_compute_poc(s->ps.sps, s->pocTid0, sh->pic_order_cnt_lsb, s->nal_unit_type); - if (!sh->first_slice_in_pic_flag && poc != s->poc) { + sh->pic_order_cnt_lsb = get_bits(gb, sps->log2_max_poc_lsb); + poc = ff_hevc_compute_poc(sps, s->poc_tid0, sh->pic_order_cnt_lsb, s->nal_unit_type); + if (!sh->first_slice_in_pic_flag && poc != sh->poc) { av_log(s->avctx, AV_LOG_WARNING, - "Ignoring POC change between slices: %d -> %d\n", s->poc, poc); + "Ignoring POC change between slices: %d -> %d\n", poc, sh->poc); if (s->avctx->err_recognition & AV_EF_EXPLODE) return AVERROR_INVALIDDATA; - poc = s->poc; + poc = sh->poc; } - s->poc = poc; + sh->poc = poc; sh->short_term_ref_pic_set_sps_flag = get_bits1(gb); pos = get_bits_left(gb); if (!sh->short_term_ref_pic_set_sps_flag) { - ret = ff_hevc_decode_short_term_rps(gb, s->avctx, &sh->slice_rps, s->ps.sps, 1); + ret = ff_hevc_decode_short_term_rps(gb, s->avctx, &sh->slice_rps, sps, 1); if (ret < 0) return ret; @@ -756,19 +719,19 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) } else { int numbits, rps_idx; - if (!s->ps.sps->nb_st_rps) { + if (!sps->nb_st_rps) { av_log(s->avctx, AV_LOG_ERROR, "No ref lists in the SPS.\n"); return AVERROR_INVALIDDATA; } - numbits = av_ceil_log2(s->ps.sps->nb_st_rps); + numbits = av_ceil_log2(sps->nb_st_rps); rps_idx = numbits > 0 ? get_bits(gb, numbits) : 0; - sh->short_term_rps = &s->ps.sps->st_rps[rps_idx]; + sh->short_term_rps = &sps->st_rps[rps_idx]; } sh->short_term_ref_pic_set_size = pos - get_bits_left(gb); pos = get_bits_left(gb); - ret = decode_lt_rps(s, &sh->long_term_rps, gb); + ret = decode_lt_rps(sps, &sh->long_term_rps, gb, sh->poc, sh->pic_order_cnt_lsb); if (ret < 0) { av_log(s->avctx, AV_LOG_WARNING, "Invalid long term RPS.\n"); if (s->avctx->err_recognition & AV_EF_EXPLODE) @@ -776,12 +739,12 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) } sh->long_term_ref_pic_set_size = pos - get_bits_left(gb); - if (s->ps.sps->temporal_mvp_enabled) + if (sps->temporal_mvp_enabled) sh->slice_temporal_mvp_enabled_flag = get_bits1(gb); else sh->slice_temporal_mvp_enabled_flag = 0; } else { - s->poc = 0; + sh->poc = 0; sh->pic_order_cnt_lsb = 0; sh->short_term_ref_pic_set_sps_flag = 0; sh->short_term_ref_pic_set_size = 0; @@ -790,20 +753,9 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) sh->slice_temporal_mvp_enabled_flag = 0; } - /* 8.3.1 */ - if (sh->first_slice_in_pic_flag && s->temporal_id == 0 && - s->nal_unit_type != HEVC_NAL_TRAIL_N && - s->nal_unit_type != HEVC_NAL_TSA_N && - s->nal_unit_type != HEVC_NAL_STSA_N && - s->nal_unit_type != HEVC_NAL_RADL_N && - s->nal_unit_type != HEVC_NAL_RADL_R && - s->nal_unit_type != HEVC_NAL_RASL_N && - s->nal_unit_type != HEVC_NAL_RASL_R) - s->pocTid0 = s->poc; - - if (s->ps.sps->sao_enabled) { + if (sps->sao_enabled) { sh->slice_sample_adaptive_offset_flag[0] = get_bits1(gb); - if (s->ps.sps->chroma_format_idc) { + if (sps->chroma_format_idc) { sh->slice_sample_adaptive_offset_flag[1] = sh->slice_sample_adaptive_offset_flag[2] = get_bits1(gb); } @@ -817,9 +769,9 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) if (sh->slice_type == HEVC_SLICE_P || sh->slice_type == HEVC_SLICE_B) { int nb_refs; - sh->nb_refs[L0] = s->ps.pps->num_ref_idx_l0_default_active; + sh->nb_refs[L0] = pps->num_ref_idx_l0_default_active; if (sh->slice_type == HEVC_SLICE_B) - sh->nb_refs[L1] = s->ps.pps->num_ref_idx_l1_default_active; + sh->nb_refs[L1] = pps->num_ref_idx_l1_default_active; if (get_bits1(gb)) { // num_ref_idx_active_override_flag sh->nb_refs[L0] = get_ue_golomb_31(gb) + 1; @@ -834,13 +786,13 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) sh->rpl_modification_flag[0] = 0; sh->rpl_modification_flag[1] = 0; - nb_refs = ff_hevc_frame_nb_refs(s); + nb_refs = ff_hevc_frame_nb_refs(sh, pps); if (!nb_refs) { av_log(s->avctx, AV_LOG_ERROR, "Zero refs for a frame with P or B slices.\n"); return AVERROR_INVALIDDATA; } - if (s->ps.pps->lists_modification_present_flag && nb_refs > 1) { + if (pps->lists_modification_present_flag && nb_refs > 1) { sh->rpl_modification_flag[0] = get_bits1(gb); if (sh->rpl_modification_flag[0]) { for (i = 0; i < sh->nb_refs[L0]; i++) @@ -858,7 +810,7 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) if (sh->slice_type == HEVC_SLICE_B) sh->mvd_l1_zero_flag = get_bits1(gb); - if (s->ps.pps->cabac_init_present_flag) + if (pps->cabac_init_present_flag) sh->cabac_init_flag = get_bits1(gb); else sh->cabac_init_flag = 0; @@ -880,9 +832,9 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) } } - if ((s->ps.pps->weighted_pred_flag && sh->slice_type == HEVC_SLICE_P) || - (s->ps.pps->weighted_bipred_flag && sh->slice_type == HEVC_SLICE_B)) { - int ret = pred_weight_table(s, gb); + if ((pps->weighted_pred_flag && sh->slice_type == HEVC_SLICE_P) || + (pps->weighted_bipred_flag && sh->slice_type == HEVC_SLICE_B)) { + int ret = pred_weight_table(sh, s->avctx, sps, gb); if (ret < 0) return ret; } @@ -896,17 +848,17 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) } // Syntax in 7.3.6.1 - if (s->ps.sps->motion_vector_resolution_control_idc == 2) + if (sps->motion_vector_resolution_control_idc == 2) sh->use_integer_mv_flag = get_bits1(gb); else // Inferred to be equal to motion_vector_resolution_control_idc if not present - sh->use_integer_mv_flag = s->ps.sps->motion_vector_resolution_control_idc; + sh->use_integer_mv_flag = sps->motion_vector_resolution_control_idc; } sh->slice_qp_delta = get_se_golomb(gb); - if (s->ps.pps->pic_slice_level_chroma_qp_offsets_present_flag) { + if (pps->pic_slice_level_chroma_qp_offsets_present_flag) { sh->slice_cb_qp_offset = get_se_golomb(gb); sh->slice_cr_qp_offset = get_se_golomb(gb); if (sh->slice_cb_qp_offset < -12 || sh->slice_cb_qp_offset > 12 || @@ -919,21 +871,21 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) sh->slice_cr_qp_offset = 0; } - if (s->ps.pps->pps_slice_act_qp_offsets_present_flag) { + if (pps->pps_slice_act_qp_offsets_present_flag) { sh->slice_act_y_qp_offset = get_se_golomb(gb); sh->slice_act_cb_qp_offset = get_se_golomb(gb); sh->slice_act_cr_qp_offset = get_se_golomb(gb); } - if (s->ps.pps->chroma_qp_offset_list_enabled_flag) + if (pps->chroma_qp_offset_list_enabled_flag) sh->cu_chroma_qp_offset_enabled_flag = get_bits1(gb); else sh->cu_chroma_qp_offset_enabled_flag = 0; - if (s->ps.pps->deblocking_filter_control_present_flag) { + if (pps->deblocking_filter_control_present_flag) { int deblocking_filter_override_flag = 0; - if (s->ps.pps->deblocking_filter_override_enabled_flag) + if (pps->deblocking_filter_override_enabled_flag) deblocking_filter_override_flag = get_bits1(gb); if (deblocking_filter_override_flag) { @@ -952,9 +904,9 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) sh->tc_offset = tc_offset_div2 * 2; } } else { - sh->disable_deblocking_filter_flag = s->ps.pps->disable_dbf; - sh->beta_offset = s->ps.pps->beta_offset; - sh->tc_offset = s->ps.pps->tc_offset; + sh->disable_deblocking_filter_flag = pps->disable_dbf; + sh->beta_offset = pps->beta_offset; + sh->tc_offset = pps->tc_offset; } } else { sh->disable_deblocking_filter_flag = 0; @@ -962,13 +914,13 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) sh->tc_offset = 0; } - if (s->ps.pps->seq_loop_filter_across_slices_enabled_flag && + if (pps->seq_loop_filter_across_slices_enabled_flag && (sh->slice_sample_adaptive_offset_flag[0] || sh->slice_sample_adaptive_offset_flag[1] || !sh->disable_deblocking_filter_flag)) { sh->slice_loop_filter_across_slices_enabled_flag = get_bits1(gb); } else { - sh->slice_loop_filter_across_slices_enabled_flag = s->ps.pps->seq_loop_filter_across_slices_enabled_flag; + sh->slice_loop_filter_across_slices_enabled_flag = pps->seq_loop_filter_across_slices_enabled_flag; } } else if (!s->slice_initialized) { av_log(s->avctx, AV_LOG_ERROR, "Independent slice segment missing.\n"); @@ -976,7 +928,7 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) } sh->num_entry_point_offsets = 0; - if (s->ps.pps->tiles_enabled_flag || s->ps.pps->entropy_coding_sync_enabled_flag) { + if (pps->tiles_enabled_flag || pps->entropy_coding_sync_enabled_flag) { unsigned num_entry_point_offsets = get_ue_golomb_long(gb); // It would be possible to bound this tighter but this here is simpler if (num_entry_point_offsets > get_bits_left(gb)) { @@ -1009,16 +961,10 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) unsigned val = get_bits_long(gb, offset_len); sh->entry_point_offset[i] = val + 1; // +1; // +1 to get the size } - if (s->threads_number > 1 && (s->ps.pps->num_tile_rows > 1 || s->ps.pps->num_tile_columns > 1)) { - s->enable_parallel_tiles = 0; // TODO: you can enable tiles in parallel here - s->threads_number = 1; - } else - s->enable_parallel_tiles = 0; - } else - s->enable_parallel_tiles = 0; + } } - if (s->ps.pps->slice_header_extension_present_flag) { + if (pps->slice_header_extension_present_flag) { unsigned int length = get_ue_golomb_long(gb); if (length*8LL > get_bits_left(gb)) { av_log(s->avctx, AV_LOG_ERROR, "too many slice_header_extension_data_bytes\n"); @@ -1036,20 +982,21 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) sh->data_offset = align_get_bits(gb) - gb->buffer; // Inferred parameters - sh->slice_qp = 26U + s->ps.pps->pic_init_qp_minus26 + sh->slice_qp_delta; + sh->slice_qp = 26U + pps->pic_init_qp_minus26 + sh->slice_qp_delta; if (sh->slice_qp > 51 || - sh->slice_qp < -s->ps.sps->qp_bd_offset) { + sh->slice_qp < -sps->qp_bd_offset) { av_log(s->avctx, AV_LOG_ERROR, "The slice_qp %d is outside the valid range " "[%d, 51].\n", sh->slice_qp, - -s->ps.sps->qp_bd_offset); + -sps->qp_bd_offset); return AVERROR_INVALIDDATA; } sh->slice_ctb_addr_rs = sh->slice_segment_addr; - if (!s->sh.slice_ctb_addr_rs && s->sh.dependent_slice_segment_flag) { + if (sh->dependent_slice_segment_flag && + (!sh->slice_ctb_addr_rs || !pps->ctb_addr_rs_to_ts[sh->slice_ctb_addr_rs])) { av_log(s->avctx, AV_LOG_ERROR, "Impossible slice segment.\n"); return AVERROR_INVALIDDATA; } @@ -1060,19 +1007,10 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; } - s->local_ctx[0].first_qp_group = !s->sh.dependent_slice_segment_flag; - - if (!s->ps.pps->cu_qp_delta_enabled_flag) - s->local_ctx[0].qp_y = s->sh.slice_qp; - - s->slice_initialized = 1; - s->local_ctx[0].tu.cu_qp_offset_cb = 0; - s->local_ctx[0].tu.cu_qp_offset_cr = 0; - return 0; } -#define CTB(tab, x, y) ((tab)[(y) * s->ps.sps->ctb_width + (x)]) +#define CTB(tab, x, y) ((tab)[(y) * sps->ctb_width + (x)]) #define SET_SAO(elem, value) \ do { \ @@ -1086,7 +1024,9 @@ do { \ sao->elem = 0; \ } while (0) -static void hls_sao_param(HEVCLocalContext *lc, int rx, int ry) +static void hls_sao_param(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + int rx, int ry) { const HEVCContext *const s = lc->parent; int sao_merge_left_flag = 0; @@ -1106,9 +1046,9 @@ static void hls_sao_param(HEVCLocalContext *lc, int rx, int ry) } } - for (c_idx = 0; c_idx < (s->ps.sps->chroma_format_idc ? 3 : 1); c_idx++) { - int log2_sao_offset_scale = c_idx == 0 ? s->ps.pps->log2_sao_offset_scale_luma : - s->ps.pps->log2_sao_offset_scale_chroma; + for (c_idx = 0; c_idx < (sps->chroma_format_idc ? 3 : 1); c_idx++) { + int log2_sao_offset_scale = c_idx == 0 ? pps->log2_sao_offset_scale_luma : + pps->log2_sao_offset_scale_chroma; if (!s->sh.slice_sample_adaptive_offset_flag[c_idx]) { sao->type_idx[c_idx] = SAO_NOT_APPLIED; @@ -1126,7 +1066,7 @@ static void hls_sao_param(HEVCLocalContext *lc, int rx, int ry) continue; for (i = 0; i < 4; i++) - SET_SAO(offset_abs[c_idx][i], ff_hevc_sao_offset_abs_decode(lc)); + SET_SAO(offset_abs[c_idx][i], ff_hevc_sao_offset_abs_decode(lc, sps->bit_depth)); if (sao->type_idx[c_idx] == SAO_BAND) { for (i = 0; i < 4; i++) { @@ -1176,49 +1116,51 @@ static int hls_cross_component_pred(HEVCLocalContext *lc, int idx) return 0; } -static int hls_transform_unit(HEVCLocalContext *lc, int x0, int y0, +static int hls_transform_unit(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + int x0, int y0, int xBase, int yBase, int cb_xBase, int cb_yBase, int log2_cb_size, int log2_trafo_size, int blk_idx, int cbf_luma, int *cbf_cb, int *cbf_cr) { const HEVCContext *const s = lc->parent; - const int log2_trafo_size_c = log2_trafo_size - s->ps.sps->hshift[1]; + const int log2_trafo_size_c = log2_trafo_size - sps->hshift[1]; int i; if (lc->cu.pred_mode == MODE_INTRA) { int trafo_size = 1 << log2_trafo_size; - ff_hevc_set_neighbour_available(lc, x0, y0, trafo_size, trafo_size); + ff_hevc_set_neighbour_available(lc, x0, y0, trafo_size, trafo_size, sps->log2_ctb_size); - s->hpc.intra_pred[log2_trafo_size - 2](lc, x0, y0, 0); + s->hpc.intra_pred[log2_trafo_size - 2](lc, pps, x0, y0, 0); } if (cbf_luma || cbf_cb[0] || cbf_cr[0] || - (s->ps.sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) { + (sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) { int scan_idx = SCAN_DIAG; int scan_idx_c = SCAN_DIAG; int cbf_chroma = cbf_cb[0] || cbf_cr[0] || - (s->ps.sps->chroma_format_idc == 2 && + (sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1])); - if (s->ps.pps->cu_qp_delta_enabled_flag && !lc->tu.is_cu_qp_delta_coded) { + if (pps->cu_qp_delta_enabled_flag && !lc->tu.is_cu_qp_delta_coded) { lc->tu.cu_qp_delta = ff_hevc_cu_qp_delta_abs(lc); if (lc->tu.cu_qp_delta != 0) if (ff_hevc_cu_qp_delta_sign_flag(lc) == 1) lc->tu.cu_qp_delta = -lc->tu.cu_qp_delta; lc->tu.is_cu_qp_delta_coded = 1; - if (lc->tu.cu_qp_delta < -(26 + s->ps.sps->qp_bd_offset / 2) || - lc->tu.cu_qp_delta > (25 + s->ps.sps->qp_bd_offset / 2)) { + if (lc->tu.cu_qp_delta < -(26 + sps->qp_bd_offset / 2) || + lc->tu.cu_qp_delta > (25 + sps->qp_bd_offset / 2)) { av_log(s->avctx, AV_LOG_ERROR, "The cu_qp_delta %d is outside the valid range " "[%d, %d].\n", lc->tu.cu_qp_delta, - -(26 + s->ps.sps->qp_bd_offset / 2), - (25 + s->ps.sps->qp_bd_offset / 2)); + -(26 + sps->qp_bd_offset / 2), + (25 + sps->qp_bd_offset / 2)); return AVERROR_INVALIDDATA; } - ff_hevc_set_qPy(lc, cb_xBase, cb_yBase, log2_cb_size); + ff_hevc_set_qPy(lc, pps, cb_xBase, cb_yBase, log2_cb_size); } if (s->sh.cu_chroma_qp_offset_enabled_flag && cbf_chroma && @@ -1226,13 +1168,13 @@ static int hls_transform_unit(HEVCLocalContext *lc, int x0, int y0, int cu_chroma_qp_offset_flag = ff_hevc_cu_chroma_qp_offset_flag(lc); if (cu_chroma_qp_offset_flag) { int cu_chroma_qp_offset_idx = 0; - if (s->ps.pps->chroma_qp_offset_list_len_minus1 > 0) { - cu_chroma_qp_offset_idx = ff_hevc_cu_chroma_qp_offset_idx(lc); + if (pps->chroma_qp_offset_list_len_minus1 > 0) { + cu_chroma_qp_offset_idx = ff_hevc_cu_chroma_qp_offset_idx(lc, pps->chroma_qp_offset_list_len_minus1); av_log(s->avctx, AV_LOG_ERROR, "cu_chroma_qp_offset_idx not yet tested.\n"); } - lc->tu.cu_qp_offset_cb = s->ps.pps->cb_qp_offset_list[cu_chroma_qp_offset_idx]; - lc->tu.cu_qp_offset_cr = s->ps.pps->cr_qp_offset_list[cu_chroma_qp_offset_idx]; + lc->tu.cu_qp_offset_cb = pps->cb_qp_offset_list[cu_chroma_qp_offset_idx]; + lc->tu.cu_qp_offset_cr = pps->cr_qp_offset_list[cu_chroma_qp_offset_idx]; } else { lc->tu.cu_qp_offset_cb = 0; lc->tu.cu_qp_offset_cr = 0; @@ -1261,36 +1203,37 @@ static int hls_transform_unit(HEVCLocalContext *lc, int x0, int y0, lc->tu.cross_pf = 0; if (cbf_luma) - ff_hevc_hls_residual_coding(lc, x0, y0, log2_trafo_size, scan_idx, 0); - if (s->ps.sps->chroma_format_idc && (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3)) { - int trafo_size_h = 1 << (log2_trafo_size_c + s->ps.sps->hshift[1]); - int trafo_size_v = 1 << (log2_trafo_size_c + s->ps.sps->vshift[1]); - lc->tu.cross_pf = (s->ps.pps->cross_component_prediction_enabled_flag && cbf_luma && + ff_hevc_hls_residual_coding(lc, pps, x0, y0, log2_trafo_size, scan_idx, 0); + if (sps->chroma_format_idc && (log2_trafo_size > 2 || sps->chroma_format_idc == 3)) { + int trafo_size_h = 1 << (log2_trafo_size_c + sps->hshift[1]); + int trafo_size_v = 1 << (log2_trafo_size_c + sps->vshift[1]); + lc->tu.cross_pf = (pps->cross_component_prediction_enabled_flag && cbf_luma && (lc->cu.pred_mode == MODE_INTER || (lc->tu.chroma_mode_c == 4))); if (lc->tu.cross_pf) { hls_cross_component_pred(lc, 0); } - for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { + for (i = 0; i < (sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { - ff_hevc_set_neighbour_available(lc, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (i << log2_trafo_size_c), 1); + ff_hevc_set_neighbour_available(lc, x0, y0 + (i << log2_trafo_size_c), + trafo_size_h, trafo_size_v, sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, pps, x0, y0 + (i << log2_trafo_size_c), 1); } if (cbf_cb[i]) - ff_hevc_hls_residual_coding(lc, x0, y0 + (i << log2_trafo_size_c), + ff_hevc_hls_residual_coding(lc, pps, x0, y0 + (i << log2_trafo_size_c), log2_trafo_size_c, scan_idx_c, 1); else if (lc->tu.cross_pf) { ptrdiff_t stride = s->cur_frame->f->linesize[1]; - int hshift = s->ps.sps->hshift[1]; - int vshift = s->ps.sps->vshift[1]; + int hshift = sps->hshift[1]; + int vshift = sps->vshift[1]; const int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer; int16_t *coeffs = (int16_t*)lc->edge_emu_buffer2; int size = 1 << log2_trafo_size_c; uint8_t *dst = &s->cur_frame->f->data[1][(y0 >> vshift) * stride + - ((x0 >> hshift) << s->ps.sps->pixel_shift)]; + ((x0 >> hshift) << sps->pixel_shift)]; for (i = 0; i < (size * size); i++) { coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3); } @@ -1301,81 +1244,82 @@ static int hls_transform_unit(HEVCLocalContext *lc, int x0, int y0, if (lc->tu.cross_pf) { hls_cross_component_pred(lc, 1); } - for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { + for (i = 0; i < (sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { ff_hevc_set_neighbour_available(lc, x0, y0 + (i << log2_trafo_size_c), - trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (i << log2_trafo_size_c), 2); + trafo_size_h, trafo_size_v, sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, pps, x0, y0 + (i << log2_trafo_size_c), 2); } if (cbf_cr[i]) - ff_hevc_hls_residual_coding(lc, x0, y0 + (i << log2_trafo_size_c), + ff_hevc_hls_residual_coding(lc, pps, x0, y0 + (i << log2_trafo_size_c), log2_trafo_size_c, scan_idx_c, 2); else if (lc->tu.cross_pf) { ptrdiff_t stride = s->cur_frame->f->linesize[2]; - int hshift = s->ps.sps->hshift[2]; - int vshift = s->ps.sps->vshift[2]; + int hshift = sps->hshift[2]; + int vshift = sps->vshift[2]; const int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer; int16_t *coeffs = (int16_t*)lc->edge_emu_buffer2; int size = 1 << log2_trafo_size_c; uint8_t *dst = &s->cur_frame->f->data[2][(y0 >> vshift) * stride + - ((x0 >> hshift) << s->ps.sps->pixel_shift)]; + ((x0 >> hshift) << sps->pixel_shift)]; for (i = 0; i < (size * size); i++) { coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3); } s->hevcdsp.add_residual[log2_trafo_size_c-2](dst, coeffs, stride); } } - } else if (s->ps.sps->chroma_format_idc && blk_idx == 3) { + } else if (sps->chroma_format_idc && blk_idx == 3) { int trafo_size_h = 1 << (log2_trafo_size + 1); - int trafo_size_v = 1 << (log2_trafo_size + s->ps.sps->vshift[1]); - for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { + int trafo_size_v = 1 << (log2_trafo_size + sps->vshift[1]); + for (i = 0; i < (sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { ff_hevc_set_neighbour_available(lc, xBase, yBase + (i << log2_trafo_size), - trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (i << log2_trafo_size), 1); + trafo_size_h, trafo_size_v, sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size - 2](lc, pps, xBase, yBase + (i << log2_trafo_size), 1); } if (cbf_cb[i]) - ff_hevc_hls_residual_coding(lc, xBase, yBase + (i << log2_trafo_size), + ff_hevc_hls_residual_coding(lc, pps, xBase, yBase + (i << log2_trafo_size), log2_trafo_size, scan_idx_c, 1); } - for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { + for (i = 0; i < (sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { ff_hevc_set_neighbour_available(lc, xBase, yBase + (i << log2_trafo_size), - trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (i << log2_trafo_size), 2); + trafo_size_h, trafo_size_v, sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size - 2](lc, pps, xBase, yBase + (i << log2_trafo_size), 2); } if (cbf_cr[i]) - ff_hevc_hls_residual_coding(lc, xBase, yBase + (i << log2_trafo_size), + ff_hevc_hls_residual_coding(lc, pps, xBase, yBase + (i << log2_trafo_size), log2_trafo_size, scan_idx_c, 2); } } - } else if (s->ps.sps->chroma_format_idc && lc->cu.pred_mode == MODE_INTRA) { - if (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3) { - int trafo_size_h = 1 << (log2_trafo_size_c + s->ps.sps->hshift[1]); - int trafo_size_v = 1 << (log2_trafo_size_c + s->ps.sps->vshift[1]); - ff_hevc_set_neighbour_available(lc, x0, y0, trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0, 1); - s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0, 2); - if (s->ps.sps->chroma_format_idc == 2) { + } else if (sps->chroma_format_idc && lc->cu.pred_mode == MODE_INTRA) { + if (log2_trafo_size > 2 || sps->chroma_format_idc == 3) { + int trafo_size_h = 1 << (log2_trafo_size_c + sps->hshift[1]); + int trafo_size_v = 1 << (log2_trafo_size_c + sps->vshift[1]); + ff_hevc_set_neighbour_available(lc, x0, y0, trafo_size_h, trafo_size_v, + sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, pps, x0, y0, 1); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, pps, x0, y0, 2); + if (sps->chroma_format_idc == 2) { ff_hevc_set_neighbour_available(lc, x0, y0 + (1 << log2_trafo_size_c), - trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (1 << log2_trafo_size_c), 1); - s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (1 << log2_trafo_size_c), 2); + trafo_size_h, trafo_size_v, sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, pps, x0, y0 + (1 << log2_trafo_size_c), 1); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, pps, x0, y0 + (1 << log2_trafo_size_c), 2); } } else if (blk_idx == 3) { int trafo_size_h = 1 << (log2_trafo_size + 1); - int trafo_size_v = 1 << (log2_trafo_size + s->ps.sps->vshift[1]); + int trafo_size_v = 1 << (log2_trafo_size + sps->vshift[1]); ff_hevc_set_neighbour_available(lc, xBase, yBase, - trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase, 1); - s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase, 2); - if (s->ps.sps->chroma_format_idc == 2) { + trafo_size_h, trafo_size_v, sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size - 2](lc, pps, xBase, yBase, 1); + s->hpc.intra_pred[log2_trafo_size - 2](lc, pps, xBase, yBase, 2); + if (sps->chroma_format_idc == 2) { ff_hevc_set_neighbour_available(lc, xBase, yBase + (1 << log2_trafo_size), - trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (1 << log2_trafo_size), 1); - s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (1 << log2_trafo_size), 2); + trafo_size_h, trafo_size_v, sps->log2_ctb_size); + s->hpc.intra_pred[log2_trafo_size - 2](lc, pps, xBase, yBase + (1 << log2_trafo_size), 1); + s->hpc.intra_pred[log2_trafo_size - 2](lc, pps, xBase, yBase + (1 << log2_trafo_size), 2); } } } @@ -1383,14 +1327,15 @@ static int hls_transform_unit(HEVCLocalContext *lc, int x0, int y0, return 0; } -static void set_deblocking_bypass(const HEVCContext *s, int x0, int y0, int log2_cb_size) +static void set_deblocking_bypass(const HEVCContext *s, const HEVCSPS *sps, + int x0, int y0, int log2_cb_size) { int cb_size = 1 << log2_cb_size; - int log2_min_pu_size = s->ps.sps->log2_min_pu_size; + int log2_min_pu_size = sps->log2_min_pu_size; - int min_pu_width = s->ps.sps->min_pu_width; - int x_end = FFMIN(x0 + cb_size, s->ps.sps->width); - int y_end = FFMIN(y0 + cb_size, s->ps.sps->height); + int min_pu_width = sps->min_pu_width; + int x_end = FFMIN(x0 + cb_size, sps->width); + int y_end = FFMIN(y0 + cb_size, sps->height); int i, j; for (j = (y0 >> log2_min_pu_size); j < (y_end >> log2_min_pu_size); j++) @@ -1398,7 +1343,9 @@ static void set_deblocking_bypass(const HEVCContext *s, int x0, int y0, int log2 s->is_pcm[i + j * min_pu_width] = 2; } -static int hls_transform_tree(HEVCLocalContext *lc, int x0, int y0, +static int hls_transform_tree(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + int x0, int y0, int xBase, int yBase, int cb_xBase, int cb_yBase, int log2_cb_size, int log2_trafo_size, int trafo_depth, int blk_idx, @@ -1418,7 +1365,7 @@ static int hls_transform_tree(HEVCLocalContext *lc, int x0, int y0, if (lc->cu.intra_split_flag) { if (trafo_depth == 1) { lc->tu.intra_pred_mode = lc->pu.intra_pred_mode[blk_idx]; - if (s->ps.sps->chroma_format_idc == 3) { + if (sps->chroma_format_idc == 3) { lc->tu.intra_pred_mode_c = lc->pu.intra_pred_mode_c[blk_idx]; lc->tu.chroma_mode_c = lc->pu.chroma_mode_c[blk_idx]; } else { @@ -1432,33 +1379,33 @@ static int hls_transform_tree(HEVCLocalContext *lc, int x0, int y0, lc->tu.chroma_mode_c = lc->pu.chroma_mode_c[0]; } - if (log2_trafo_size <= s->ps.sps->log2_max_trafo_size && - log2_trafo_size > s->ps.sps->log2_min_tb_size && + if (log2_trafo_size <= sps->log2_max_trafo_size && + log2_trafo_size > sps->log2_min_tb_size && trafo_depth < lc->cu.max_trafo_depth && !(lc->cu.intra_split_flag && trafo_depth == 0)) { split_transform_flag = ff_hevc_split_transform_flag_decode(lc, log2_trafo_size); } else { - int inter_split = s->ps.sps->max_transform_hierarchy_depth_inter == 0 && + int inter_split = sps->max_transform_hierarchy_depth_inter == 0 && lc->cu.pred_mode == MODE_INTER && lc->cu.part_mode != PART_2Nx2N && trafo_depth == 0; - split_transform_flag = log2_trafo_size > s->ps.sps->log2_max_trafo_size || + split_transform_flag = log2_trafo_size > sps->log2_max_trafo_size || (lc->cu.intra_split_flag && trafo_depth == 0) || inter_split; } - if (s->ps.sps->chroma_format_idc && (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3)) { + if (sps->chroma_format_idc && (log2_trafo_size > 2 || sps->chroma_format_idc == 3)) { if (trafo_depth == 0 || cbf_cb[0]) { cbf_cb[0] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); - if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) { + if (sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) { cbf_cb[1] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); } } if (trafo_depth == 0 || cbf_cr[0]) { cbf_cr[0] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); - if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) { + if (sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) { cbf_cr[1] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); } } @@ -1471,7 +1418,8 @@ static int hls_transform_tree(HEVCLocalContext *lc, int x0, int y0, #define SUBDIVIDE(x, y, idx) \ do { \ - ret = hls_transform_tree(lc, x, y, x0, y0, cb_xBase, cb_yBase, log2_cb_size,\ + ret = hls_transform_tree(lc, pps, sps, \ + x, y, x0, y0, cb_xBase, cb_yBase, log2_cb_size, \ log2_trafo_size - 1, trafo_depth + 1, idx, \ cbf_cb, cbf_cr); \ if (ret < 0) \ @@ -1485,18 +1433,19 @@ do { #undef SUBDIVIDE } else { - int min_tu_size = 1 << s->ps.sps->log2_min_tb_size; - int log2_min_tu_size = s->ps.sps->log2_min_tb_size; - int min_tu_width = s->ps.sps->min_tb_width; + int min_tu_size = 1 << sps->log2_min_tb_size; + int log2_min_tu_size = sps->log2_min_tb_size; + int min_tu_width = sps->min_tb_width; int cbf_luma = 1; if (lc->cu.pred_mode == MODE_INTRA || trafo_depth != 0 || cbf_cb[0] || cbf_cr[0] || - (s->ps.sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) { + (sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) { cbf_luma = ff_hevc_cbf_luma_decode(lc, trafo_depth); } - ret = hls_transform_unit(lc, x0, y0, xBase, yBase, cb_xBase, cb_yBase, + ret = hls_transform_unit(lc, pps, sps, + x0, y0, xBase, yBase, cb_xBase, cb_yBase, log2_cb_size, log2_trafo_size, blk_idx, cbf_luma, cbf_cb, cbf_cr); if (ret < 0) @@ -1512,51 +1461,53 @@ do { } } if (!s->sh.disable_deblocking_filter_flag) { - ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_trafo_size); - if (s->ps.pps->transquant_bypass_enable_flag && + ff_hevc_deblocking_boundary_strengths(lc, pps, x0, y0, log2_trafo_size); + if (pps->transquant_bypass_enable_flag && lc->cu.cu_transquant_bypass_flag) - set_deblocking_bypass(s, x0, y0, log2_trafo_size); + set_deblocking_bypass(s, sps, x0, y0, log2_trafo_size); } } return 0; } -static int hls_pcm_sample(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size) +static int hls_pcm_sample(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int log2_cb_size) { const HEVCContext *const s = lc->parent; + const HEVCSPS *const sps = pps->sps; GetBitContext gb; int cb_size = 1 << log2_cb_size; ptrdiff_t stride0 = s->cur_frame->f->linesize[0]; ptrdiff_t stride1 = s->cur_frame->f->linesize[1]; ptrdiff_t stride2 = s->cur_frame->f->linesize[2]; - uint8_t *dst0 = &s->cur_frame->f->data[0][y0 * stride0 + (x0 << s->ps.sps->pixel_shift)]; - uint8_t *dst1 = &s->cur_frame->f->data[1][(y0 >> s->ps.sps->vshift[1]) * stride1 + ((x0 >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)]; - uint8_t *dst2 = &s->cur_frame->f->data[2][(y0 >> s->ps.sps->vshift[2]) * stride2 + ((x0 >> s->ps.sps->hshift[2]) << s->ps.sps->pixel_shift)]; - - int length = cb_size * cb_size * s->ps.sps->pcm.bit_depth + - (((cb_size >> s->ps.sps->hshift[1]) * (cb_size >> s->ps.sps->vshift[1])) + - ((cb_size >> s->ps.sps->hshift[2]) * (cb_size >> s->ps.sps->vshift[2]))) * - s->ps.sps->pcm.bit_depth_chroma; + uint8_t *dst0 = &s->cur_frame->f->data[0][y0 * stride0 + (x0 << sps->pixel_shift)]; + uint8_t *dst1 = &s->cur_frame->f->data[1][(y0 >> sps->vshift[1]) * stride1 + ((x0 >> sps->hshift[1]) << sps->pixel_shift)]; + uint8_t *dst2 = &s->cur_frame->f->data[2][(y0 >> sps->vshift[2]) * stride2 + ((x0 >> sps->hshift[2]) << sps->pixel_shift)]; + + int length = cb_size * cb_size * sps->pcm.bit_depth + + (((cb_size >> sps->hshift[1]) * (cb_size >> sps->vshift[1])) + + ((cb_size >> sps->hshift[2]) * (cb_size >> sps->vshift[2]))) * + sps->pcm.bit_depth_chroma; const uint8_t *pcm = skip_bytes(&lc->cc, (length + 7) >> 3); int ret; if (!s->sh.disable_deblocking_filter_flag) - ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_cb_size); + ff_hevc_deblocking_boundary_strengths(lc, pps, x0, y0, log2_cb_size); ret = init_get_bits(&gb, pcm, length); if (ret < 0) return ret; - s->hevcdsp.put_pcm(dst0, stride0, cb_size, cb_size, &gb, s->ps.sps->pcm.bit_depth); - if (s->ps.sps->chroma_format_idc) { + s->hevcdsp.put_pcm(dst0, stride0, cb_size, cb_size, &gb, sps->pcm.bit_depth); + if (sps->chroma_format_idc) { s->hevcdsp.put_pcm(dst1, stride1, - cb_size >> s->ps.sps->hshift[1], - cb_size >> s->ps.sps->vshift[1], - &gb, s->ps.sps->pcm.bit_depth_chroma); + cb_size >> sps->hshift[1], + cb_size >> sps->vshift[1], + &gb, sps->pcm.bit_depth_chroma); s->hevcdsp.put_pcm(dst2, stride2, - cb_size >> s->ps.sps->hshift[2], - cb_size >> s->ps.sps->vshift[2], - &gb, s->ps.sps->pcm.bit_depth_chroma); + cb_size >> sps->hshift[2], + cb_size >> sps->vshift[2], + &gb, sps->pcm.bit_depth_chroma); } return 0; @@ -1578,32 +1529,34 @@ static int hls_pcm_sample(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size * @param luma_offset additive offset applied to the luma prediction value */ -static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, +static void luma_mc_uni(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + uint8_t *dst, ptrdiff_t dststride, const AVFrame *ref, const Mv *mv, int x_off, int y_off, int block_w, int block_h, int luma_weight, int luma_offset) { const HEVCContext *const s = lc->parent; const uint8_t *src = ref->data[0]; ptrdiff_t srcstride = ref->linesize[0]; - int pic_width = s->ps.sps->width; - int pic_height = s->ps.sps->height; + int pic_width = sps->width; + int pic_height = sps->height; int mx = mv->x & 3; int my = mv->y & 3; - int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && s->ps.pps->weighted_pred_flag) || - (s->sh.slice_type == HEVC_SLICE_B && s->ps.pps->weighted_bipred_flag); + int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && pps->weighted_pred_flag) || + (s->sh.slice_type == HEVC_SLICE_B && pps->weighted_bipred_flag); int idx = hevc_pel_weight[block_w]; x_off += mv->x >> 2; y_off += mv->y >> 2; - src += y_off * srcstride + (x_off * (1 << s->ps.sps->pixel_shift)); + src += y_off * srcstride + (x_off * (1 << sps->pixel_shift)); if (x_off < QPEL_EXTRA_BEFORE || y_off < QPEL_EXTRA_AFTER || x_off >= pic_width - block_w - QPEL_EXTRA_AFTER || y_off >= pic_height - block_h - QPEL_EXTRA_AFTER || ref == s->cur_frame->f) { - const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift; - int offset = QPEL_EXTRA_BEFORE * srcstride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift); - int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift); + const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << sps->pixel_shift; + int offset = QPEL_EXTRA_BEFORE * srcstride + (QPEL_EXTRA_BEFORE << sps->pixel_shift); + int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << sps->pixel_shift); s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src - offset, edge_emu_stride, srcstride, @@ -1640,7 +1593,9 @@ static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, * @param mv1 motion vector1 (relative to block position) to get pixel data from * @param current_mv current motion vector structure */ - static void luma_mc_bi(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, +static void luma_mc_bi(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + uint8_t *dst, ptrdiff_t dststride, const AVFrame *ref0, const Mv *mv0, int x_off, int y_off, int block_w, int block_h, const AVFrame *ref1, const Mv *mv1, struct MvField *current_mv) @@ -1648,29 +1603,29 @@ static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, const HEVCContext *const s = lc->parent; ptrdiff_t src0stride = ref0->linesize[0]; ptrdiff_t src1stride = ref1->linesize[0]; - int pic_width = s->ps.sps->width; - int pic_height = s->ps.sps->height; + int pic_width = sps->width; + int pic_height = sps->height; int mx0 = mv0->x & 3; int my0 = mv0->y & 3; int mx1 = mv1->x & 3; int my1 = mv1->y & 3; - int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && s->ps.pps->weighted_pred_flag) || - (s->sh.slice_type == HEVC_SLICE_B && s->ps.pps->weighted_bipred_flag); + int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && pps->weighted_pred_flag) || + (s->sh.slice_type == HEVC_SLICE_B && pps->weighted_bipred_flag); int x_off0 = x_off + (mv0->x >> 2); int y_off0 = y_off + (mv0->y >> 2); int x_off1 = x_off + (mv1->x >> 2); int y_off1 = y_off + (mv1->y >> 2); int idx = hevc_pel_weight[block_w]; - const uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << s->ps.sps->pixel_shift); - const uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << s->ps.sps->pixel_shift); + const uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << sps->pixel_shift); + const uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << sps->pixel_shift); if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER || x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER || y_off0 >= pic_height - block_h - QPEL_EXTRA_AFTER) { - const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift; - int offset = QPEL_EXTRA_BEFORE * src0stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift); - int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift); + const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << sps->pixel_shift; + int offset = QPEL_EXTRA_BEFORE * src0stride + (QPEL_EXTRA_BEFORE << sps->pixel_shift); + int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << sps->pixel_shift); s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src0 - offset, edge_emu_stride, src0stride, @@ -1685,9 +1640,9 @@ static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, if (x_off1 < QPEL_EXTRA_BEFORE || y_off1 < QPEL_EXTRA_AFTER || x_off1 >= pic_width - block_w - QPEL_EXTRA_AFTER || y_off1 >= pic_height - block_h - QPEL_EXTRA_AFTER) { - const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift; - int offset = QPEL_EXTRA_BEFORE * src1stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift); - int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift); + const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << sps->pixel_shift; + int offset = QPEL_EXTRA_BEFORE * src1stride + (QPEL_EXTRA_BEFORE << sps->pixel_shift); + int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << sps->pixel_shift); s->vdsp.emulated_edge_mc(lc->edge_emu_buffer2, src1 - offset, edge_emu_stride, src1stride, @@ -1732,38 +1687,40 @@ static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, * @param chroma_offset additive offset applied to the chroma prediction value */ -static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, +static void chroma_mc_uni(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + uint8_t *dst0, ptrdiff_t dststride, const uint8_t *src0, ptrdiff_t srcstride, int reflist, int x_off, int y_off, int block_w, int block_h, const struct MvField *current_mv, int chroma_weight, int chroma_offset) { const HEVCContext *const s = lc->parent; - int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; - int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; + int pic_width = sps->width >> sps->hshift[1]; + int pic_height = sps->height >> sps->vshift[1]; const Mv *mv = ¤t_mv->mv[reflist]; - int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && s->ps.pps->weighted_pred_flag) || - (s->sh.slice_type == HEVC_SLICE_B && s->ps.pps->weighted_bipred_flag); + int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && pps->weighted_pred_flag) || + (s->sh.slice_type == HEVC_SLICE_B && pps->weighted_bipred_flag); int idx = hevc_pel_weight[block_w]; - int hshift = s->ps.sps->hshift[1]; - int vshift = s->ps.sps->vshift[1]; - intptr_t mx = av_mod_uintp2(mv->x, 2 + hshift); - intptr_t my = av_mod_uintp2(mv->y, 2 + vshift); + int hshift = sps->hshift[1]; + int vshift = sps->vshift[1]; + intptr_t mx = av_zero_extend(mv->x, 2 + hshift); + intptr_t my = av_zero_extend(mv->y, 2 + vshift); intptr_t _mx = mx << (1 - hshift); intptr_t _my = my << (1 - vshift); int emu = src0 == s->cur_frame->f->data[1] || src0 == s->cur_frame->f->data[2]; x_off += mv->x >> (2 + hshift); y_off += mv->y >> (2 + vshift); - src0 += y_off * srcstride + (x_off * (1 << s->ps.sps->pixel_shift)); + src0 += y_off * srcstride + (x_off * (1 << sps->pixel_shift)); if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER || x_off >= pic_width - block_w - EPEL_EXTRA_AFTER || y_off >= pic_height - block_h - EPEL_EXTRA_AFTER || emu) { - const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift; - int offset0 = EPEL_EXTRA_BEFORE * (srcstride + (1 << s->ps.sps->pixel_shift)); + const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << sps->pixel_shift; + int offset0 = EPEL_EXTRA_BEFORE * (srcstride + (1 << sps->pixel_shift)); int buf_offset0 = EPEL_EXTRA_BEFORE * - (edge_emu_stride + (1 << s->ps.sps->pixel_shift)); + (edge_emu_stride + (1 << sps->pixel_shift)); s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src0 - offset0, edge_emu_stride, srcstride, block_w + EPEL_EXTRA, block_h + EPEL_EXTRA, @@ -1800,7 +1757,9 @@ static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, * @param current_mv current motion vector structure * @param cidx chroma component(cb, cr) */ -static void chroma_mc_bi(HEVCLocalContext *lc, uint8_t *dst0, ptrdiff_t dststride, +static void chroma_mc_bi(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + uint8_t *dst0, ptrdiff_t dststride, const AVFrame *ref0, const AVFrame *ref1, int x_off, int y_off, int block_w, int block_h, const MvField *current_mv, int cidx) { @@ -1809,19 +1768,19 @@ static void chroma_mc_bi(HEVCLocalContext *lc, uint8_t *dst0, ptrdiff_t dststrid const uint8_t *src2 = ref1->data[cidx+1]; ptrdiff_t src1stride = ref0->linesize[cidx+1]; ptrdiff_t src2stride = ref1->linesize[cidx+1]; - int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && s->ps.pps->weighted_pred_flag) || - (s->sh.slice_type == HEVC_SLICE_B && s->ps.pps->weighted_bipred_flag); - int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; - int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; + int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && pps->weighted_pred_flag) || + (s->sh.slice_type == HEVC_SLICE_B && pps->weighted_bipred_flag); + int pic_width = sps->width >> sps->hshift[1]; + int pic_height = sps->height >> sps->vshift[1]; const Mv *const mv0 = ¤t_mv->mv[0]; const Mv *const mv1 = ¤t_mv->mv[1]; - int hshift = s->ps.sps->hshift[1]; - int vshift = s->ps.sps->vshift[1]; + int hshift = sps->hshift[1]; + int vshift = sps->vshift[1]; - intptr_t mx0 = av_mod_uintp2(mv0->x, 2 + hshift); - intptr_t my0 = av_mod_uintp2(mv0->y, 2 + vshift); - intptr_t mx1 = av_mod_uintp2(mv1->x, 2 + hshift); - intptr_t my1 = av_mod_uintp2(mv1->y, 2 + vshift); + intptr_t mx0 = av_zero_extend(mv0->x, 2 + hshift); + intptr_t my0 = av_zero_extend(mv0->y, 2 + vshift); + intptr_t mx1 = av_zero_extend(mv1->x, 2 + hshift); + intptr_t my1 = av_zero_extend(mv1->y, 2 + vshift); intptr_t _mx0 = mx0 << (1 - hshift); intptr_t _my0 = my0 << (1 - vshift); intptr_t _mx1 = mx1 << (1 - hshift); @@ -1832,16 +1791,16 @@ static void chroma_mc_bi(HEVCLocalContext *lc, uint8_t *dst0, ptrdiff_t dststrid int x_off1 = x_off + (mv1->x >> (2 + hshift)); int y_off1 = y_off + (mv1->y >> (2 + vshift)); int idx = hevc_pel_weight[block_w]; - src1 += y_off0 * src1stride + (int)((unsigned)x_off0 << s->ps.sps->pixel_shift); - src2 += y_off1 * src2stride + (int)((unsigned)x_off1 << s->ps.sps->pixel_shift); + src1 += y_off0 * src1stride + (int)((unsigned)x_off0 << sps->pixel_shift); + src2 += y_off1 * src2stride + (int)((unsigned)x_off1 << sps->pixel_shift); if (x_off0 < EPEL_EXTRA_BEFORE || y_off0 < EPEL_EXTRA_AFTER || x_off0 >= pic_width - block_w - EPEL_EXTRA_AFTER || y_off0 >= pic_height - block_h - EPEL_EXTRA_AFTER) { - const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift; - int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << s->ps.sps->pixel_shift)); + const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << sps->pixel_shift; + int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << sps->pixel_shift)); int buf_offset1 = EPEL_EXTRA_BEFORE * - (edge_emu_stride + (1 << s->ps.sps->pixel_shift)); + (edge_emu_stride + (1 << sps->pixel_shift)); s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1 - offset1, edge_emu_stride, src1stride, @@ -1857,10 +1816,10 @@ static void chroma_mc_bi(HEVCLocalContext *lc, uint8_t *dst0, ptrdiff_t dststrid if (x_off1 < EPEL_EXTRA_BEFORE || y_off1 < EPEL_EXTRA_AFTER || x_off1 >= pic_width - block_w - EPEL_EXTRA_AFTER || y_off1 >= pic_height - block_h - EPEL_EXTRA_AFTER) { - const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift; - int offset1 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->ps.sps->pixel_shift)); + const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << sps->pixel_shift; + int offset1 = EPEL_EXTRA_BEFORE * (src2stride + (1 << sps->pixel_shift)); int buf_offset1 = EPEL_EXTRA_BEFORE * - (edge_emu_stride + (1 << s->ps.sps->pixel_shift)); + (edge_emu_stride + (1 << sps->pixel_shift)); s->vdsp.emulated_edge_mc(lc->edge_emu_buffer2, src2 - offset1, edge_emu_stride, src2stride, @@ -1894,14 +1853,16 @@ static void chroma_mc_bi(HEVCLocalContext *lc, uint8_t *dst0, ptrdiff_t dststrid static void hevc_await_progress(const HEVCContext *s, const HEVCFrame *ref, const Mv *mv, int y0, int height) { - if (s->threads_type == FF_THREAD_FRAME ) { + if (s->avctx->active_thread_type == FF_THREAD_FRAME ) { int y = FFMAX(0, (mv->y >> 2) + y0 + height + 9); ff_progress_frame_await(&ref->tf, y); } } -static void hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, +static void hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv) { @@ -1909,7 +1870,7 @@ static void hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW enum InterPredIdc inter_pred_idc = PRED_L0; int mvp_flag; - ff_hevc_set_neighbour_available(lc, x0, y0, nPbW, nPbH); + ff_hevc_set_neighbour_available(lc, x0, y0, nPbW, nPbH, sps->log2_ctb_size); mv->pred_flag = 0; if (s->sh.slice_type == HEVC_SLICE_B) inter_pred_idc = ff_hevc_inter_pred_idc_decode(lc, nPbW, nPbH); @@ -1921,7 +1882,7 @@ static void hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW mv->pred_flag = PF_L0; ff_hevc_hls_mvd_coding(lc, x0, y0, 0); mvp_flag = ff_hevc_mvp_lx_flag_decode(lc); - ff_hevc_luma_mv_mvp_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, + ff_hevc_luma_mv_mvp_mode(lc, pps, x0, y0, nPbW, nPbH, log2_cb_size, part_idx, merge_idx, mv, mvp_flag, 0); mv->mv[0].x += lc->pu.mvd.x; mv->mv[0].y += lc->pu.mvd.y; @@ -1939,25 +1900,26 @@ static void hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW mv->pred_flag += PF_L1; mvp_flag = ff_hevc_mvp_lx_flag_decode(lc); - ff_hevc_luma_mv_mvp_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, + ff_hevc_luma_mv_mvp_mode(lc, pps, x0, y0, nPbW, nPbH, log2_cb_size, part_idx, merge_idx, mv, mvp_flag, 1); mv->mv[1].x += lc->pu.mvd.x; mv->mv[1].y += lc->pu.mvd.y; } } -static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, - int nPbW, int nPbH, +static void hls_prediction_unit(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int partIdx, int idx) { #define POS(c_idx, x, y) \ - &s->cur_frame->f->data[c_idx][((y) >> s->ps.sps->vshift[c_idx]) * linesize[c_idx] + \ - (((x) >> s->ps.sps->hshift[c_idx]) << s->ps.sps->pixel_shift)] + &s->cur_frame->f->data[c_idx][((y) >> sps->vshift[c_idx]) * linesize[c_idx] + \ + (((x) >> sps->hshift[c_idx]) << sps->pixel_shift)] const HEVCContext *const s = lc->parent; int merge_idx = 0; struct MvField current_mv = {{{ 0 }}}; - int min_pu_width = s->ps.sps->min_pu_width; + int min_pu_width = sps->min_pu_width; MvField *tab_mvf = s->cur_frame->tab_mvf; const RefPicList *refPicList = s->cur_frame->refPicList; @@ -1966,8 +1928,8 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, uint8_t *dst0 = POS(0, x0, y0); uint8_t *dst1 = POS(1, x0, y0); uint8_t *dst2 = POS(2, x0, y0); - int log2_min_cb_size = s->ps.sps->log2_min_cb_size; - int min_cb_width = s->ps.sps->min_cb_width; + int log2_min_cb_size = sps->log2_min_cb_size; + int min_cb_width = sps->min_cb_width; int x_cb = x0 >> log2_min_cb_size; int y_cb = y0 >> log2_min_cb_size; int x_pu, y_pu; @@ -1984,18 +1946,18 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, else merge_idx = 0; - ff_hevc_luma_mv_merge_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, + ff_hevc_luma_mv_merge_mode(lc, pps, x0, y0, nPbW, nPbH, log2_cb_size, partIdx, merge_idx, ¤t_mv); } else { - hevc_luma_mv_mvp_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, + hevc_luma_mv_mvp_mode(lc, pps, sps, x0, y0, nPbW, nPbH, log2_cb_size, partIdx, merge_idx, ¤t_mv); } - x_pu = x0 >> s->ps.sps->log2_min_pu_size; - y_pu = y0 >> s->ps.sps->log2_min_pu_size; + x_pu = x0 >> sps->log2_min_pu_size; + y_pu = y0 >> sps->log2_min_pu_size; - for (j = 0; j < nPbH >> s->ps.sps->log2_min_pu_size; j++) - for (i = 0; i < nPbW >> s->ps.sps->log2_min_pu_size; i++) + for (j = 0; j < nPbH >> sps->log2_min_pu_size; j++) + for (i = 0; i < nPbW >> sps->log2_min_pu_size; i++) tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv; if (current_mv.pred_flag & PF_L0) { @@ -2012,59 +1974,59 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, } if (current_mv.pred_flag == PF_L0) { - int x0_c = x0 >> s->ps.sps->hshift[1]; - int y0_c = y0 >> s->ps.sps->vshift[1]; - int nPbW_c = nPbW >> s->ps.sps->hshift[1]; - int nPbH_c = nPbH >> s->ps.sps->vshift[1]; + int x0_c = x0 >> sps->hshift[1]; + int y0_c = y0 >> sps->vshift[1]; + int nPbW_c = nPbW >> sps->hshift[1]; + int nPbH_c = nPbH >> sps->vshift[1]; - luma_mc_uni(lc, dst0, linesize[0], ref0->f, + luma_mc_uni(lc, pps, sps, dst0, linesize[0], ref0->f, ¤t_mv.mv[0], x0, y0, nPbW, nPbH, s->sh.luma_weight_l0[current_mv.ref_idx[0]], s->sh.luma_offset_l0[current_mv.ref_idx[0]]); - if (s->ps.sps->chroma_format_idc) { - chroma_mc_uni(lc, dst1, linesize[1], ref0->f->data[1], ref0->f->linesize[1], + if (sps->chroma_format_idc) { + chroma_mc_uni(lc, pps, sps, dst1, linesize[1], ref0->f->data[1], ref0->f->linesize[1], 0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]); - chroma_mc_uni(lc, dst2, linesize[2], ref0->f->data[2], ref0->f->linesize[2], + chroma_mc_uni(lc, pps, sps, dst2, linesize[2], ref0->f->data[2], ref0->f->linesize[2], 0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]); } } else if (current_mv.pred_flag == PF_L1) { - int x0_c = x0 >> s->ps.sps->hshift[1]; - int y0_c = y0 >> s->ps.sps->vshift[1]; - int nPbW_c = nPbW >> s->ps.sps->hshift[1]; - int nPbH_c = nPbH >> s->ps.sps->vshift[1]; + int x0_c = x0 >> sps->hshift[1]; + int y0_c = y0 >> sps->vshift[1]; + int nPbW_c = nPbW >> sps->hshift[1]; + int nPbH_c = nPbH >> sps->vshift[1]; - luma_mc_uni(lc, dst0, linesize[0], ref1->f, + luma_mc_uni(lc, pps, sps, dst0, linesize[0], ref1->f, ¤t_mv.mv[1], x0, y0, nPbW, nPbH, s->sh.luma_weight_l1[current_mv.ref_idx[1]], s->sh.luma_offset_l1[current_mv.ref_idx[1]]); - if (s->ps.sps->chroma_format_idc) { - chroma_mc_uni(lc, dst1, linesize[1], ref1->f->data[1], ref1->f->linesize[1], + if (sps->chroma_format_idc) { + chroma_mc_uni(lc, pps, sps, dst1, linesize[1], ref1->f->data[1], ref1->f->linesize[1], 1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]); - chroma_mc_uni(lc, dst2, linesize[2], ref1->f->data[2], ref1->f->linesize[2], + chroma_mc_uni(lc, pps, sps, dst2, linesize[2], ref1->f->data[2], ref1->f->linesize[2], 1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]); } } else if (current_mv.pred_flag == PF_BI) { - int x0_c = x0 >> s->ps.sps->hshift[1]; - int y0_c = y0 >> s->ps.sps->vshift[1]; - int nPbW_c = nPbW >> s->ps.sps->hshift[1]; - int nPbH_c = nPbH >> s->ps.sps->vshift[1]; + int x0_c = x0 >> sps->hshift[1]; + int y0_c = y0 >> sps->vshift[1]; + int nPbW_c = nPbW >> sps->hshift[1]; + int nPbH_c = nPbH >> sps->vshift[1]; - luma_mc_bi(lc, dst0, linesize[0], ref0->f, + luma_mc_bi(lc, pps, sps, dst0, linesize[0], ref0->f, ¤t_mv.mv[0], x0, y0, nPbW, nPbH, ref1->f, ¤t_mv.mv[1], ¤t_mv); - if (s->ps.sps->chroma_format_idc) { - chroma_mc_bi(lc, dst1, linesize[1], ref0->f, ref1->f, + if (sps->chroma_format_idc) { + chroma_mc_bi(lc, pps, sps, dst1, linesize[1], ref0->f, ref1->f, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 0); - chroma_mc_bi(lc, dst2, linesize[2], ref0->f, ref1->f, + chroma_mc_bi(lc, pps, sps, dst2, linesize[2], ref0->f, ref1->f, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 1); } } @@ -2073,23 +2035,24 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, /** * 8.4.1 */ -static int luma_intra_pred_mode(HEVCLocalContext *lc, int x0, int y0, int pu_size, +static int luma_intra_pred_mode(HEVCLocalContext *lc, const HEVCSPS *sps, + int x0, int y0, int pu_size, int prev_intra_luma_pred_flag) { const HEVCContext *const s = lc->parent; - int x_pu = x0 >> s->ps.sps->log2_min_pu_size; - int y_pu = y0 >> s->ps.sps->log2_min_pu_size; - int min_pu_width = s->ps.sps->min_pu_width; - int size_in_pus = pu_size >> s->ps.sps->log2_min_pu_size; - int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size); - int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size); + int x_pu = x0 >> sps->log2_min_pu_size; + int y_pu = y0 >> sps->log2_min_pu_size; + int min_pu_width = sps->min_pu_width; + int size_in_pus = pu_size >> sps->log2_min_pu_size; + int x0b = av_zero_extend(x0, sps->log2_ctb_size); + int y0b = av_zero_extend(y0, sps->log2_ctb_size); int cand_up = (lc->ctb_up_flag || y0b) ? s->tab_ipm[(y_pu - 1) * min_pu_width + x_pu] : INTRA_DC; int cand_left = (lc->ctb_left_flag || x0b) ? s->tab_ipm[y_pu * min_pu_width + x_pu - 1] : INTRA_DC; - int y_ctb = (y0 >> (s->ps.sps->log2_ctb_size)) << (s->ps.sps->log2_ctb_size); + int y_ctb = (y0 >> (sps->log2_ctb_size)) << (sps->log2_ctb_size); MvField *tab_mvf = s->cur_frame->tab_mvf; int intra_pred_mode; @@ -2153,16 +2116,17 @@ static int luma_intra_pred_mode(HEVCLocalContext *lc, int x0, int y0, int pu_siz return intra_pred_mode; } -static av_always_inline void set_ct_depth(const HEVCContext *s, int x0, int y0, +static av_always_inline void set_ct_depth(const HEVCSPS *sps, uint8_t *tab_ct_depth, + int x0, int y0, int log2_cb_size, int ct_depth) { - int length = (1 << log2_cb_size) >> s->ps.sps->log2_min_cb_size; - int x_cb = x0 >> s->ps.sps->log2_min_cb_size; - int y_cb = y0 >> s->ps.sps->log2_min_cb_size; + int length = (1 << log2_cb_size) >> sps->log2_min_cb_size; + int x_cb = x0 >> sps->log2_min_cb_size; + int y_cb = y0 >> sps->log2_min_cb_size; int y; for (y = 0; y < length; y++) - memset(&s->tab_ct_depth[(y_cb + y) * s->ps.sps->min_cb_width + x_cb], + memset(&tab_ct_depth[(y_cb + y) * sps->min_cb_width + x_cb], ct_depth, length); } @@ -2170,10 +2134,10 @@ static const uint8_t tab_mode_idx[] = { 0, 1, 2, 2, 2, 2, 3, 5, 7, 8, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31}; -static void intra_prediction_unit(HEVCLocalContext *lc, int x0, int y0, +static void intra_prediction_unit(HEVCLocalContext *lc, const HEVCSPS *sps, + int x0, int y0, int log2_cb_size) { - const HEVCContext *const s = lc->parent; static const uint8_t intra_chroma_table[4] = { 0, 26, 10, 1 }; uint8_t prev_intra_luma_pred_flag[4]; int split = lc->cu.part_mode == PART_NxN; @@ -2194,12 +2158,12 @@ static void intra_prediction_unit(HEVCLocalContext *lc, int x0, int y0, lc->pu.rem_intra_luma_pred_mode = ff_hevc_rem_intra_luma_pred_mode_decode(lc); lc->pu.intra_pred_mode[2 * i + j] = - luma_intra_pred_mode(lc, x0 + pb_size * j, y0 + pb_size * i, pb_size, + luma_intra_pred_mode(lc, sps, x0 + pb_size * j, y0 + pb_size * i, pb_size, prev_intra_luma_pred_flag[2 * i + j]); } } - if (s->ps.sps->chroma_format_idc == 3) { + if (sps->chroma_format_idc == 3) { for (i = 0; i < side; i++) { for (j = 0; j < side; j++) { lc->pu.chroma_mode_c[2 * i + j] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(lc); @@ -2213,7 +2177,7 @@ static void intra_prediction_unit(HEVCLocalContext *lc, int x0, int y0, } } } - } else if (s->ps.sps->chroma_format_idc == 2) { + } else if (sps->chroma_format_idc == 2) { int mode_idx; lc->pu.chroma_mode_c[0] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(lc); if (chroma_mode != 4) { @@ -2225,7 +2189,7 @@ static void intra_prediction_unit(HEVCLocalContext *lc, int x0, int y0, mode_idx = lc->pu.intra_pred_mode[0]; } lc->pu.intra_pred_mode_c[0] = tab_mode_idx[mode_idx]; - } else if (s->ps.sps->chroma_format_idc != 0) { + } else if (sps->chroma_format_idc != 0) { chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(lc); if (chroma_mode != 4) { if (lc->pu.intra_pred_mode[0] == intra_chroma_table[chroma_mode]) @@ -2239,16 +2203,17 @@ static void intra_prediction_unit(HEVCLocalContext *lc, int x0, int y0, } static void intra_prediction_unit_default_value(HEVCLocalContext *lc, + const HEVCSPS *sps, int x0, int y0, int log2_cb_size) { const HEVCContext *const s = lc->parent; int pb_size = 1 << log2_cb_size; - int size_in_pus = pb_size >> s->ps.sps->log2_min_pu_size; - int min_pu_width = s->ps.sps->min_pu_width; + int size_in_pus = pb_size >> sps->log2_min_pu_size; + int min_pu_width = sps->min_pu_width; MvField *tab_mvf = s->cur_frame->tab_mvf; - int x_pu = x0 >> s->ps.sps->log2_min_pu_size; - int y_pu = y0 >> s->ps.sps->log2_min_pu_size; + int x_pu = x0 >> sps->log2_min_pu_size; + int y_pu = y0 >> sps->log2_min_pu_size; int j, k; if (size_in_pus == 0) @@ -2261,16 +2226,18 @@ static void intra_prediction_unit_default_value(HEVCLocalContext *lc, tab_mvf[(y_pu + j) * min_pu_width + x_pu + k].pred_flag = PF_INTRA; } -static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, int x0, int y0, int log2_cb_size) +static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, + const HEVCPPS *pps, const HEVCSPS *sps, + int x0, int y0, int log2_cb_size) { int cb_size = 1 << log2_cb_size; - int log2_min_cb_size = s->ps.sps->log2_min_cb_size; + int log2_min_cb_size = sps->log2_min_cb_size; int length = cb_size >> log2_min_cb_size; - int min_cb_width = s->ps.sps->min_cb_width; + int min_cb_width = sps->min_cb_width; int x_cb = x0 >> log2_min_cb_size; int y_cb = y0 >> log2_min_cb_size; int idx = log2_cb_size - 2; - int qp_block_mask = (1<<(s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth)) - 1; + int qp_block_mask = (1 << (sps->log2_ctb_size - pps->diff_cu_qp_delta_depth)) - 1; int x, y, ret; lc->cu.x = x0; @@ -2282,15 +2249,18 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, int x0, i SAMPLE_CTB(s->skip_flag, x_cb, y_cb) = 0; for (x = 0; x < 4; x++) lc->pu.intra_pred_mode[x] = 1; - if (s->ps.pps->transquant_bypass_enable_flag) { + if (pps->transquant_bypass_enable_flag) { lc->cu.cu_transquant_bypass_flag = ff_hevc_cu_transquant_bypass_flag_decode(lc); if (lc->cu.cu_transquant_bypass_flag) - set_deblocking_bypass(s, x0, y0, log2_cb_size); + set_deblocking_bypass(s, sps, x0, y0, log2_cb_size); } else lc->cu.cu_transquant_bypass_flag = 0; if (s->sh.slice_type != HEVC_SLICE_I) { - uint8_t skip_flag = ff_hevc_skip_flag_decode(lc, x0, y0, x_cb, y_cb); + const int x0b = av_zero_extend(x0, sps->log2_ctb_size); + const int y0b = av_zero_extend(y0, sps->log2_ctb_size); + uint8_t skip_flag = ff_hevc_skip_flag_decode(lc, x0b, y0b, x_cb, y_cb, + min_cb_width); x = y_cb * min_cb_width + x_cb; for (y = 0; y < length; y++) { @@ -2307,75 +2277,93 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, int x0, i } if (SAMPLE_CTB(s->skip_flag, x_cb, y_cb)) { - hls_prediction_unit(lc, x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); - intra_prediction_unit_default_value(lc, x0, y0, log2_cb_size); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); + intra_prediction_unit_default_value(lc, sps, x0, y0, log2_cb_size); if (!s->sh.disable_deblocking_filter_flag) - ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_cb_size); + ff_hevc_deblocking_boundary_strengths(lc, pps, x0, y0, log2_cb_size); } else { int pcm_flag = 0; if (s->sh.slice_type != HEVC_SLICE_I) lc->cu.pred_mode = ff_hevc_pred_mode_decode(lc); if (lc->cu.pred_mode != MODE_INTRA || - log2_cb_size == s->ps.sps->log2_min_cb_size) { - lc->cu.part_mode = ff_hevc_part_mode_decode(lc, log2_cb_size); + log2_cb_size == sps->log2_min_cb_size) { + lc->cu.part_mode = ff_hevc_part_mode_decode(lc, sps, log2_cb_size); lc->cu.intra_split_flag = lc->cu.part_mode == PART_NxN && lc->cu.pred_mode == MODE_INTRA; } if (lc->cu.pred_mode == MODE_INTRA) { - if (lc->cu.part_mode == PART_2Nx2N && s->ps.sps->pcm_enabled && - log2_cb_size >= s->ps.sps->pcm.log2_min_pcm_cb_size && - log2_cb_size <= s->ps.sps->pcm.log2_max_pcm_cb_size) { + if (lc->cu.part_mode == PART_2Nx2N && sps->pcm_enabled && + log2_cb_size >= sps->pcm.log2_min_pcm_cb_size && + log2_cb_size <= sps->pcm.log2_max_pcm_cb_size) { pcm_flag = ff_hevc_pcm_flag_decode(lc); } if (pcm_flag) { - intra_prediction_unit_default_value(lc, x0, y0, log2_cb_size); - ret = hls_pcm_sample(lc, x0, y0, log2_cb_size); - if (s->ps.sps->pcm_loop_filter_disabled) - set_deblocking_bypass(s, x0, y0, log2_cb_size); + intra_prediction_unit_default_value(lc, sps, x0, y0, log2_cb_size); + ret = hls_pcm_sample(lc, pps, x0, y0, log2_cb_size); + if (sps->pcm_loop_filter_disabled) + set_deblocking_bypass(s, sps, x0, y0, log2_cb_size); if (ret < 0) return ret; } else { - intra_prediction_unit(lc, x0, y0, log2_cb_size); + intra_prediction_unit(lc, sps, x0, y0, log2_cb_size); } } else { - intra_prediction_unit_default_value(lc, x0, y0, log2_cb_size); + intra_prediction_unit_default_value(lc, sps, x0, y0, log2_cb_size); switch (lc->cu.part_mode) { case PART_2Nx2N: - hls_prediction_unit(lc, x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); break; case PART_2NxN: - hls_prediction_unit(lc, x0, y0, cb_size, cb_size / 2, log2_cb_size, 0, idx); - hls_prediction_unit(lc, x0, y0 + cb_size / 2, cb_size, cb_size / 2, log2_cb_size, 1, idx); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size, cb_size / 2, log2_cb_size, 0, idx); + hls_prediction_unit(lc, pps, sps, + x0, y0 + cb_size / 2, cb_size, cb_size / 2, log2_cb_size, 1, idx); break; case PART_Nx2N: - hls_prediction_unit(lc, x0, y0, cb_size / 2, cb_size, log2_cb_size, 0, idx - 1); - hls_prediction_unit(lc, x0 + cb_size / 2, y0, cb_size / 2, cb_size, log2_cb_size, 1, idx - 1); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size / 2, cb_size, log2_cb_size, 0, idx - 1); + hls_prediction_unit(lc, pps, sps, + x0 + cb_size / 2, y0, cb_size / 2, cb_size, log2_cb_size, 1, idx - 1); break; case PART_2NxnU: - hls_prediction_unit(lc, x0, y0, cb_size, cb_size / 4, log2_cb_size, 0, idx); - hls_prediction_unit(lc, x0, y0 + cb_size / 4, cb_size, cb_size * 3 / 4, log2_cb_size, 1, idx); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size, cb_size / 4, log2_cb_size, 0, idx); + hls_prediction_unit(lc, pps, sps, + x0, y0 + cb_size / 4, cb_size, cb_size * 3 / 4, log2_cb_size, 1, idx); break; case PART_2NxnD: - hls_prediction_unit(lc, x0, y0, cb_size, cb_size * 3 / 4, log2_cb_size, 0, idx); - hls_prediction_unit(lc, x0, y0 + cb_size * 3 / 4, cb_size, cb_size / 4, log2_cb_size, 1, idx); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size, cb_size * 3 / 4, log2_cb_size, 0, idx); + hls_prediction_unit(lc, pps, sps, + x0, y0 + cb_size * 3 / 4, cb_size, cb_size / 4, log2_cb_size, 1, idx); break; case PART_nLx2N: - hls_prediction_unit(lc, x0, y0, cb_size / 4, cb_size, log2_cb_size, 0, idx - 2); - hls_prediction_unit(lc, x0 + cb_size / 4, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 1, idx - 2); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size / 4, cb_size, log2_cb_size, 0, idx - 2); + hls_prediction_unit(lc, pps, sps, + x0 + cb_size / 4, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 1, idx - 2); break; case PART_nRx2N: - hls_prediction_unit(lc, x0, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 0, idx - 2); - hls_prediction_unit(lc, x0 + cb_size * 3 / 4, y0, cb_size / 4, cb_size, log2_cb_size, 1, idx - 2); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 0, idx - 2); + hls_prediction_unit(lc, pps, sps, + x0 + cb_size * 3 / 4, y0, cb_size / 4, cb_size, log2_cb_size, 1, idx - 2); break; case PART_NxN: - hls_prediction_unit(lc, x0, y0, cb_size / 2, cb_size / 2, log2_cb_size, 0, idx - 1); - hls_prediction_unit(lc, x0 + cb_size / 2, y0, cb_size / 2, cb_size / 2, log2_cb_size, 1, idx - 1); - hls_prediction_unit(lc, x0, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2, idx - 1); - hls_prediction_unit(lc, x0 + cb_size / 2, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 3, idx - 1); + hls_prediction_unit(lc, pps, sps, + x0, y0, cb_size / 2, cb_size / 2, log2_cb_size, 0, idx - 1); + hls_prediction_unit(lc, pps, sps, + x0 + cb_size / 2, y0, cb_size / 2, cb_size / 2, log2_cb_size, 1, idx - 1); + hls_prediction_unit(lc, pps, sps, + x0, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2, idx - 1); + hls_prediction_unit(lc, pps, sps, + x0 + cb_size / 2, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 3, idx - 1); break; } } @@ -2390,22 +2378,22 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, int x0, i if (rqt_root_cbf) { const static int cbf[2] = { 0 }; lc->cu.max_trafo_depth = lc->cu.pred_mode == MODE_INTRA ? - s->ps.sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag : - s->ps.sps->max_transform_hierarchy_depth_inter; - ret = hls_transform_tree(lc, x0, y0, x0, y0, x0, y0, + sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag : + sps->max_transform_hierarchy_depth_inter; + ret = hls_transform_tree(lc, pps, sps, x0, y0, x0, y0, x0, y0, log2_cb_size, log2_cb_size, 0, 0, cbf, cbf); if (ret < 0) return ret; } else { if (!s->sh.disable_deblocking_filter_flag) - ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_cb_size); + ff_hevc_deblocking_boundary_strengths(lc, pps, x0, y0, log2_cb_size); } } } - if (s->ps.pps->cu_qp_delta_enabled_flag && lc->tu.is_cu_qp_delta_coded == 0) - ff_hevc_set_qPy(lc, x0, y0, log2_cb_size); + if (pps->cu_qp_delta_enabled_flag && lc->tu.is_cu_qp_delta_coded == 0) + ff_hevc_set_qPy(lc, pps, x0, y0, log2_cb_size); x = y_cb * min_cb_width + x_cb; for (y = 0; y < length; y++) { @@ -2418,12 +2406,14 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, int x0, i lc->qPy_pred = lc->qp_y; } - set_ct_depth(s, x0, y0, log2_cb_size, lc->ct_depth); + set_ct_depth(sps, s->tab_ct_depth, x0, y0, log2_cb_size, lc->ct_depth); return 0; } -static int hls_coding_quadtree(HEVCLocalContext *lc, int x0, int y0, +static int hls_coding_quadtree(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + int x0, int y0, int log2_cb_size, int cb_depth) { const HEVCContext *const s = lc->parent; @@ -2432,49 +2422,49 @@ static int hls_coding_quadtree(HEVCLocalContext *lc, int x0, int y0, int split_cu; lc->ct_depth = cb_depth; - if (x0 + cb_size <= s->ps.sps->width && - y0 + cb_size <= s->ps.sps->height && - log2_cb_size > s->ps.sps->log2_min_cb_size) { - split_cu = ff_hevc_split_coding_unit_flag_decode(lc, cb_depth, x0, y0); + if (x0 + cb_size <= sps->width && + y0 + cb_size <= sps->height && + log2_cb_size > sps->log2_min_cb_size) { + split_cu = ff_hevc_split_coding_unit_flag_decode(lc, sps, cb_depth, x0, y0); } else { - split_cu = (log2_cb_size > s->ps.sps->log2_min_cb_size); + split_cu = (log2_cb_size > sps->log2_min_cb_size); } - if (s->ps.pps->cu_qp_delta_enabled_flag && - log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth) { + if (pps->cu_qp_delta_enabled_flag && + log2_cb_size >= sps->log2_ctb_size - pps->diff_cu_qp_delta_depth) { lc->tu.is_cu_qp_delta_coded = 0; lc->tu.cu_qp_delta = 0; } if (s->sh.cu_chroma_qp_offset_enabled_flag && - log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_chroma_qp_offset_depth) { + log2_cb_size >= sps->log2_ctb_size - pps->diff_cu_chroma_qp_offset_depth) { lc->tu.is_cu_chroma_qp_offset_coded = 0; } if (split_cu) { - int qp_block_mask = (1<<(s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth)) - 1; + int qp_block_mask = (1 << (sps->log2_ctb_size - pps->diff_cu_qp_delta_depth)) - 1; const int cb_size_split = cb_size >> 1; const int x1 = x0 + cb_size_split; const int y1 = y0 + cb_size_split; int more_data = 0; - more_data = hls_coding_quadtree(lc, x0, y0, log2_cb_size - 1, cb_depth + 1); + more_data = hls_coding_quadtree(lc, pps, sps, x0, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; - if (more_data && x1 < s->ps.sps->width) { - more_data = hls_coding_quadtree(lc, x1, y0, log2_cb_size - 1, cb_depth + 1); + if (more_data && x1 < sps->width) { + more_data = hls_coding_quadtree(lc, pps, sps, x1, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } - if (more_data && y1 < s->ps.sps->height) { - more_data = hls_coding_quadtree(lc, x0, y1, log2_cb_size - 1, cb_depth + 1); + if (more_data && y1 < sps->height) { + more_data = hls_coding_quadtree(lc, pps, sps, x0, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } - if (more_data && x1 < s->ps.sps->width && - y1 < s->ps.sps->height) { - more_data = hls_coding_quadtree(lc, x1, y1, log2_cb_size - 1, cb_depth + 1); + if (more_data && x1 < sps->width && + y1 < sps->height) { + more_data = hls_coding_quadtree(lc, pps, sps, x1, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } @@ -2484,20 +2474,20 @@ static int hls_coding_quadtree(HEVCLocalContext *lc, int x0, int y0, lc->qPy_pred = lc->qp_y; if (more_data) - return ((x1 + cb_size_split) < s->ps.sps->width || - (y1 + cb_size_split) < s->ps.sps->height); + return ((x1 + cb_size_split) < sps->width || + (y1 + cb_size_split) < sps->height); else return 0; } else { - ret = hls_coding_unit(lc, s, x0, y0, log2_cb_size); + ret = hls_coding_unit(lc, s, pps, sps, x0, y0, log2_cb_size); if (ret < 0) return ret; if ((!((x0 + cb_size) % - (1 << (s->ps.sps->log2_ctb_size))) || - (x0 + cb_size >= s->ps.sps->width)) && + (1 << (sps->log2_ctb_size))) || + (x0 + cb_size >= sps->width)) && (!((y0 + cb_size) % - (1 << (s->ps.sps->log2_ctb_size))) || - (y0 + cb_size >= s->ps.sps->height))) { + (1 << (sps->log2_ctb_size))) || + (y0 + cb_size >= sps->height))) { int end_of_slice_flag = ff_hevc_end_of_slice_flag_decode(lc); return !end_of_slice_flag; } else { @@ -2508,100 +2498,91 @@ static int hls_coding_quadtree(HEVCLocalContext *lc, int x0, int y0, return 0; } -static void hls_decode_neighbour(HEVCLocalContext *lc, int x_ctb, int y_ctb, - int ctb_addr_ts) +static void hls_decode_neighbour(HEVCLocalContext *lc, + const HEVCPPS *pps, const HEVCSPS *sps, + int x_ctb, int y_ctb, int ctb_addr_ts) { const HEVCContext *const s = lc->parent; - int ctb_size = 1 << s->ps.sps->log2_ctb_size; - int ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts]; + int ctb_size = 1 << sps->log2_ctb_size; + int ctb_addr_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts]; int ctb_addr_in_slice = ctb_addr_rs - s->sh.slice_addr; s->tab_slice_address[ctb_addr_rs] = s->sh.slice_addr; - if (s->ps.pps->entropy_coding_sync_enabled_flag) { + if (pps->entropy_coding_sync_enabled_flag) { if (x_ctb == 0 && (y_ctb & (ctb_size - 1)) == 0) lc->first_qp_group = 1; - lc->end_of_tiles_x = s->ps.sps->width; - } else if (s->ps.pps->tiles_enabled_flag) { - if (ctb_addr_ts && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1]) { - int idxX = s->ps.pps->col_idxX[x_ctb >> s->ps.sps->log2_ctb_size]; - lc->end_of_tiles_x = x_ctb + (s->ps.pps->column_width[idxX] << s->ps.sps->log2_ctb_size); + lc->end_of_tiles_x = sps->width; + } else if (pps->tiles_enabled_flag) { + if (ctb_addr_ts && pps->tile_id[ctb_addr_ts] != pps->tile_id[ctb_addr_ts - 1]) { + int idxX = pps->col_idxX[x_ctb >> sps->log2_ctb_size]; + lc->end_of_tiles_x = x_ctb + (pps->column_width[idxX] << sps->log2_ctb_size); lc->first_qp_group = 1; } } else { - lc->end_of_tiles_x = s->ps.sps->width; + lc->end_of_tiles_x = sps->width; } - lc->end_of_tiles_y = FFMIN(y_ctb + ctb_size, s->ps.sps->height); + lc->end_of_tiles_y = FFMIN(y_ctb + ctb_size, sps->height); lc->boundary_flags = 0; - if (s->ps.pps->tiles_enabled_flag) { - if (x_ctb > 0 && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs - 1]]) + if (pps->tiles_enabled_flag) { + if (x_ctb > 0 && pps->tile_id[ctb_addr_ts] != pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs - 1]]) lc->boundary_flags |= BOUNDARY_LEFT_TILE; if (x_ctb > 0 && s->tab_slice_address[ctb_addr_rs] != s->tab_slice_address[ctb_addr_rs - 1]) lc->boundary_flags |= BOUNDARY_LEFT_SLICE; - if (y_ctb > 0 && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->ps.sps->ctb_width]]) + if (y_ctb > 0 && pps->tile_id[ctb_addr_ts] != pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs - sps->ctb_width]]) lc->boundary_flags |= BOUNDARY_UPPER_TILE; - if (y_ctb > 0 && s->tab_slice_address[ctb_addr_rs] != s->tab_slice_address[ctb_addr_rs - s->ps.sps->ctb_width]) + if (y_ctb > 0 && s->tab_slice_address[ctb_addr_rs] != s->tab_slice_address[ctb_addr_rs - sps->ctb_width]) lc->boundary_flags |= BOUNDARY_UPPER_SLICE; } else { if (ctb_addr_in_slice <= 0) lc->boundary_flags |= BOUNDARY_LEFT_SLICE; - if (ctb_addr_in_slice < s->ps.sps->ctb_width) + if (ctb_addr_in_slice < sps->ctb_width) lc->boundary_flags |= BOUNDARY_UPPER_SLICE; } lc->ctb_left_flag = ((x_ctb > 0) && (ctb_addr_in_slice > 0) && !(lc->boundary_flags & BOUNDARY_LEFT_TILE)); - lc->ctb_up_flag = ((y_ctb > 0) && (ctb_addr_in_slice >= s->ps.sps->ctb_width) && !(lc->boundary_flags & BOUNDARY_UPPER_TILE)); - lc->ctb_up_right_flag = ((y_ctb > 0) && (ctb_addr_in_slice+1 >= s->ps.sps->ctb_width) && (s->ps.pps->tile_id[ctb_addr_ts] == s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs+1 - s->ps.sps->ctb_width]])); - lc->ctb_up_left_flag = ((x_ctb > 0) && (y_ctb > 0) && (ctb_addr_in_slice-1 >= s->ps.sps->ctb_width) && (s->ps.pps->tile_id[ctb_addr_ts] == s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs-1 - s->ps.sps->ctb_width]])); + lc->ctb_up_flag = ((y_ctb > 0) && (ctb_addr_in_slice >= sps->ctb_width) && !(lc->boundary_flags & BOUNDARY_UPPER_TILE)); + lc->ctb_up_right_flag = ((y_ctb > 0) && (ctb_addr_in_slice+1 >= sps->ctb_width) && (pps->tile_id[ctb_addr_ts] == pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs+1 - sps->ctb_width]])); + lc->ctb_up_left_flag = ((x_ctb > 0) && (y_ctb > 0) && (ctb_addr_in_slice-1 >= sps->ctb_width) && (pps->tile_id[ctb_addr_ts] == pps->tile_id[pps->ctb_addr_rs_to_ts[ctb_addr_rs-1 - sps->ctb_width]])); } static int hls_decode_entry(HEVCContext *s, GetBitContext *gb) { HEVCLocalContext *const lc = &s->local_ctx[0]; + const HEVCPPS *const pps = s->pps; + const HEVCSPS *const sps = pps->sps; const uint8_t *slice_data = gb->buffer + s->sh.data_offset; const size_t slice_size = gb->buffer_end - gb->buffer - s->sh.data_offset; - int ctb_size = 1 << s->ps.sps->log2_ctb_size; + int ctb_size = 1 << sps->log2_ctb_size; int more_data = 1; int x_ctb = 0; int y_ctb = 0; - int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; + int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; int ret; - if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) { - av_log(s->avctx, AV_LOG_ERROR, "Impossible initial tile.\n"); - return AVERROR_INVALIDDATA; - } - - if (s->sh.dependent_slice_segment_flag) { - int prev_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1]; - if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) { - av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n"); - return AVERROR_INVALIDDATA; - } - } + while (more_data && ctb_addr_ts < sps->ctb_size) { + int ctb_addr_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts]; - while (more_data && ctb_addr_ts < s->ps.sps->ctb_size) { - int ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts]; + x_ctb = (ctb_addr_rs % ((sps->width + ctb_size - 1) >> sps->log2_ctb_size)) << sps->log2_ctb_size; + y_ctb = (ctb_addr_rs / ((sps->width + ctb_size - 1) >> sps->log2_ctb_size)) << sps->log2_ctb_size; + hls_decode_neighbour(lc, pps, sps, x_ctb, y_ctb, ctb_addr_ts); - x_ctb = (ctb_addr_rs % ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size; - y_ctb = (ctb_addr_rs / ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size; - hls_decode_neighbour(lc, x_ctb, y_ctb, ctb_addr_ts); - - ret = ff_hevc_cabac_init(lc, ctb_addr_ts, slice_data, slice_size); + ret = ff_hevc_cabac_init(lc, pps, ctb_addr_ts, slice_data, slice_size, 0); if (ret < 0) { s->tab_slice_address[ctb_addr_rs] = -1; return ret; } - hls_sao_param(lc, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size); + hls_sao_param(lc, pps, sps, + x_ctb >> sps->log2_ctb_size, y_ctb >> sps->log2_ctb_size); s->deblock[ctb_addr_rs].beta_offset = s->sh.beta_offset; s->deblock[ctb_addr_rs].tc_offset = s->sh.tc_offset; s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag; - more_data = hls_coding_quadtree(lc, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); + more_data = hls_coding_quadtree(lc, pps, sps, x_ctb, y_ctb, sps->log2_ctb_size, 0); if (more_data < 0) { s->tab_slice_address[ctb_addr_rs] = -1; return more_data; @@ -2609,28 +2590,30 @@ static int hls_decode_entry(HEVCContext *s, GetBitContext *gb) ctb_addr_ts++; - ff_hevc_save_states(lc, ctb_addr_ts); - ff_hevc_hls_filters(lc, x_ctb, y_ctb, ctb_size); + ff_hevc_save_states(lc, pps, ctb_addr_ts); + ff_hevc_hls_filters(lc, pps, x_ctb, y_ctb, ctb_size); } - if (x_ctb + ctb_size >= s->ps.sps->width && - y_ctb + ctb_size >= s->ps.sps->height) - ff_hevc_hls_filter(lc, x_ctb, y_ctb, ctb_size); + if (x_ctb + ctb_size >= sps->width && + y_ctb + ctb_size >= sps->height) + ff_hevc_hls_filter(lc, pps, x_ctb, y_ctb, ctb_size); return ctb_addr_ts; } -static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *hevc_lclist, +static int hls_decode_entry_wpp(AVCodecContext *avctx, void *hevc_lclist, int job, int self_id) { HEVCLocalContext *lc = &((HEVCLocalContext*)hevc_lclist)[self_id]; const HEVCContext *const s = lc->parent; - int ctb_size = 1 << s->ps.sps->log2_ctb_size; + const HEVCPPS *const pps = s->pps; + const HEVCSPS *const sps = pps->sps; + int ctb_size = 1 << sps->log2_ctb_size; int more_data = 1; int ctb_row = job; - int ctb_addr_rs = s->sh.slice_ctb_addr_rs + ctb_row * ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size); - int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs]; - int thread = ctb_row % s->threads_number; + int ctb_addr_rs = s->sh.slice_ctb_addr_rs + ctb_row * ((sps->width + ctb_size - 1) >> sps->log2_ctb_size); + int ctb_addr_ts = pps->ctb_addr_rs_to_ts[ctb_addr_rs]; + int thread = ctb_row % avctx->thread_count; const uint8_t *data = s->data + s->sh.offset[ctb_row]; const size_t data_size = s->sh.size[ctb_row]; @@ -2640,11 +2623,11 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *hevc_lclist, if (ctb_row) ff_init_cabac_decoder(&lc->cc, data, data_size); - while(more_data && ctb_addr_ts < s->ps.sps->ctb_size) { - int x_ctb = (ctb_addr_rs % s->ps.sps->ctb_width) << s->ps.sps->log2_ctb_size; - int y_ctb = (ctb_addr_rs / s->ps.sps->ctb_width) << s->ps.sps->log2_ctb_size; + while(more_data && ctb_addr_ts < sps->ctb_size) { + int x_ctb = (ctb_addr_rs % sps->ctb_width) << sps->log2_ctb_size; + int y_ctb = (ctb_addr_rs / sps->ctb_width) << sps->log2_ctb_size; - hls_decode_neighbour(lc, x_ctb, y_ctb, ctb_addr_ts); + hls_decode_neighbour(lc, pps, sps, x_ctb, y_ctb, ctb_addr_ts); ff_thread_await_progress2(s->avctx, ctb_row, thread, SHIFT_CTB_WPP); @@ -2656,11 +2639,12 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *hevc_lclist, return 0; } - ret = ff_hevc_cabac_init(lc, ctb_addr_ts, data, data_size); + ret = ff_hevc_cabac_init(lc, pps, ctb_addr_ts, data, data_size, 1); if (ret < 0) goto error; - hls_sao_param(lc, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size); - more_data = hls_coding_quadtree(lc, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); + hls_sao_param(lc, pps, sps, + x_ctb >> sps->log2_ctb_size, y_ctb >> sps->log2_ctb_size); + more_data = hls_coding_quadtree(lc, pps, sps, x_ctb, y_ctb, sps->log2_ctb_size, 0); if (more_data < 0) { ret = more_data; @@ -2669,26 +2653,26 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *hevc_lclist, ctb_addr_ts++; - ff_hevc_save_states(lc, ctb_addr_ts); + ff_hevc_save_states(lc, pps, ctb_addr_ts); ff_thread_report_progress2(s->avctx, ctb_row, thread, 1); - ff_hevc_hls_filters(lc, x_ctb, y_ctb, ctb_size); + ff_hevc_hls_filters(lc, pps, x_ctb, y_ctb, ctb_size); - if (!more_data && (x_ctb+ctb_size) < s->ps.sps->width && ctb_row != s->sh.num_entry_point_offsets) { + if (!more_data && (x_ctb+ctb_size) < sps->width && ctb_row != s->sh.num_entry_point_offsets) { /* Casting const away here is safe, because it is an atomic operation. */ atomic_store((atomic_int*)&s->wpp_err, 1); ff_thread_report_progress2(s->avctx, ctb_row ,thread, SHIFT_CTB_WPP); return 0; } - if ((x_ctb+ctb_size) >= s->ps.sps->width && (y_ctb+ctb_size) >= s->ps.sps->height ) { - ff_hevc_hls_filter(lc, x_ctb, y_ctb, ctb_size); + if ((x_ctb+ctb_size) >= sps->width && (y_ctb+ctb_size) >= sps->height ) { + ff_hevc_hls_filter(lc, pps, x_ctb, y_ctb, ctb_size); ff_thread_report_progress2(s->avctx, ctb_row , thread, SHIFT_CTB_WPP); return ctb_addr_ts; } - ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts]; + ctb_addr_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts]; x_ctb+=ctb_size; - if(x_ctb >= s->ps.sps->width) { + if(x_ctb >= sps->width) { break; } } @@ -2705,6 +2689,8 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *hevc_lclist, static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) { + const HEVCPPS *const pps = s->pps; + const HEVCSPS *const sps = pps->sps; const uint8_t *data = nal->data; int length = nal->size; int *ret; @@ -2712,16 +2698,16 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) int64_t startheader, cmpt = 0; int i, j, res = 0; - if (s->sh.slice_ctb_addr_rs + s->sh.num_entry_point_offsets * s->ps.sps->ctb_width >= s->ps.sps->ctb_width * s->ps.sps->ctb_height) { + if (s->sh.slice_ctb_addr_rs + s->sh.num_entry_point_offsets * sps->ctb_width >= sps->ctb_width * sps->ctb_height) { av_log(s->avctx, AV_LOG_ERROR, "WPP ctb addresses are wrong (%d %d %d %d)\n", s->sh.slice_ctb_addr_rs, s->sh.num_entry_point_offsets, - s->ps.sps->ctb_width, s->ps.sps->ctb_height + sps->ctb_width, sps->ctb_height ); return AVERROR_INVALIDDATA; } - if (s->threads_number > s->nb_local_ctx) { - HEVCLocalContext *tmp = av_malloc_array(s->threads_number, sizeof(*s->local_ctx)); + if (s->avctx->thread_count > s->nb_local_ctx) { + HEVCLocalContext *tmp = av_malloc_array(s->avctx->thread_count, sizeof(*s->local_ctx)); if (!tmp) return AVERROR(ENOMEM); @@ -2730,7 +2716,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) av_free(s->local_ctx); s->local_ctx = tmp; - for (unsigned i = s->nb_local_ctx; i < s->threads_number; i++) { + for (unsigned i = s->nb_local_ctx; i < s->avctx->thread_count; i++) { tmp = &s->local_ctx[i]; memset(tmp, 0, sizeof(*tmp)); @@ -2740,7 +2726,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) tmp->common_cabac_state = &s->cabac; } - s->nb_local_ctx = s->threads_number; + s->nb_local_ctx = s->avctx->thread_count; } offset = s->sh.data_offset; @@ -2779,7 +2765,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) s->data = data; - for (i = 1; i < s->threads_number; i++) { + for (i = 1; i < s->nb_local_ctx; i++) { s->local_ctx[i].first_qp_group = 1; s->local_ctx[i].qp_y = s->local_ctx[0].qp_y; } @@ -2793,7 +2779,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) if (!ret) return AVERROR(ENOMEM); - if (s->ps.pps->entropy_coding_sync_enabled_flag) + if (pps->entropy_coding_sync_enabled_flag) s->avctx->execute2(s->avctx, hls_decode_entry_wpp, s->local_ctx, ret, s->sh.num_entry_point_offsets + 1); for (i = 0; i <= s->sh.num_entry_point_offsets; i++) @@ -2803,6 +2789,58 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) return res; } +static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext *gb) +{ + const HEVCPPS *pps = s->pps; + int ret; + + if (s->sh.dependent_slice_segment_flag) { + int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; + int prev_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1]; + if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) { + av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n"); + return AVERROR_INVALIDDATA; + } + } + + if (!s->sh.dependent_slice_segment_flag && s->sh.slice_type != HEVC_SLICE_I) { + ret = ff_hevc_slice_rpl(s); + if (ret < 0) { + av_log(s->avctx, AV_LOG_WARNING, + "Error constructing the reference lists for the current slice.\n"); + return ret; + } + } + + s->slice_initialized = 1; + + if (s->avctx->hwaccel) + return FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size); + + if (s->avctx->profile == AV_PROFILE_HEVC_SCC) { + av_log(s->avctx, AV_LOG_ERROR, + "SCC profile is not yet implemented in hevc native decoder.\n"); + return AVERROR_PATCHWELCOME; + } + + s->local_ctx[0].first_qp_group = !s->sh.dependent_slice_segment_flag; + + if (!pps->cu_qp_delta_enabled_flag) + s->local_ctx[0].qp_y = s->sh.slice_qp; + + s->local_ctx[0].tu.cu_qp_offset_cb = 0; + s->local_ctx[0].tu.cu_qp_offset_cr = 0; + + s->slice_idx += !s->sh.dependent_slice_segment_flag; + + if (s->avctx->active_thread_type == FF_THREAD_SLICE && + s->sh.num_entry_point_offsets > 0 && + pps->num_tile_rows == 1 && pps->num_tile_columns == 1) + return hls_slice_data_wpp(s, nal); + + return hls_decode_entry(s, gb); +} + static int set_side_data(HEVCContext *s) { AVFrame *out = s->cur_frame->f; @@ -2900,23 +2938,63 @@ static int set_side_data(HEVCContext *s) static int hevc_frame_start(HEVCContext *s) { - int pic_size_in_ctb = ((s->ps.sps->width >> s->ps.sps->log2_min_cb_size) + 1) * - ((s->ps.sps->height >> s->ps.sps->log2_min_cb_size) + 1); + const HEVCPPS *const pps = s->ps.pps_list[s->sh.pps_id]; + const HEVCSPS *const sps = pps->sps; + int pic_size_in_ctb = ((sps->width >> sps->log2_min_cb_size) + 1) * + ((sps->height >> sps->log2_min_cb_size) + 1); int ret; + ff_refstruct_replace(&s->pps, pps); + if (s->ps.sps != sps) { + enum AVPixelFormat pix_fmt; + + ff_hevc_clear_refs(s); + + ret = set_sps(s, sps, sps->pix_fmt); + if (ret < 0) + return ret; + + pix_fmt = get_format(s, sps); + if (pix_fmt < 0) + return pix_fmt; + s->avctx->pix_fmt = pix_fmt; + + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; + } + memset(s->horizontal_bs, 0, s->bs_width * s->bs_height); memset(s->vertical_bs, 0, s->bs_width * s->bs_height); - memset(s->cbf_luma, 0, s->ps.sps->min_tb_width * s->ps.sps->min_tb_height); - memset(s->is_pcm, 0, (s->ps.sps->min_pu_width + 1) * (s->ps.sps->min_pu_height + 1)); + memset(s->cbf_luma, 0, sps->min_tb_width * sps->min_tb_height); + memset(s->is_pcm, 0, (sps->min_pu_width + 1) * (sps->min_pu_height + 1)); memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address)); - s->is_decoded = 0; - s->first_nal_type = s->nal_unit_type; + if ((IS_IDR(s) || IS_BLA(s))) { + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; + if (IS_IDR(s)) + ff_hevc_clear_refs(s); + } - s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || (s->nal_unit_type == HEVC_NAL_CRA_NUT && s->last_eos); + s->slice_idx = 0; + s->first_nal_type = s->nal_unit_type; + s->poc = s->sh.poc; - if (s->ps.pps->tiles_enabled_flag) - s->local_ctx[0].end_of_tiles_x = s->ps.pps->column_width[0] << s->ps.sps->log2_ctb_size; + if (IS_IRAP(s)) + s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || + (s->nal_unit_type == HEVC_NAL_CRA_NUT && s->last_eos); + + /* 8.3.1 */ + if (s->temporal_id == 0 && + s->nal_unit_type != HEVC_NAL_TRAIL_N && + s->nal_unit_type != HEVC_NAL_TSA_N && + s->nal_unit_type != HEVC_NAL_STSA_N && + s->nal_unit_type != HEVC_NAL_RADL_N && + s->nal_unit_type != HEVC_NAL_RADL_R && + s->nal_unit_type != HEVC_NAL_RASL_N && + s->nal_unit_type != HEVC_NAL_RASL_R) + s->poc_tid0 = s->poc; + + if (pps->tiles_enabled_flag) + s->local_ctx[0].end_of_tiles_x = pps->column_width[0] << sps->log2_ctb_size; ret = ff_hevc_set_new_ref(s, s->poc); if (ret < 0) @@ -2938,6 +3016,10 @@ static int hevc_frame_start(HEVCContext *s) !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && !s->avctx->hwaccel; + ret = export_stream_params_from_sei(s); + if (ret < 0) + return ret; + ret = set_side_data(s); if (ret < 0) goto fail; @@ -2970,7 +3052,11 @@ static int hevc_frame_start(HEVCContext *s) if (ret < 0) goto fail; - if (!s->avctx->hwaccel) + if (s->avctx->hwaccel) { + ret = FF_HW_CALL(s->avctx, start_frame, NULL, 0); + if (ret < 0) + goto fail; + } else ff_thread_finish_setup(s->avctx); return 0; @@ -2979,9 +3065,79 @@ static int hevc_frame_start(HEVCContext *s) if (s->cur_frame) ff_hevc_unref_frame(s->cur_frame, ~0); s->cur_frame = s->collocated_ref = NULL; + s->slice_initialized = 0; return ret; } +static int verify_md5(HEVCContext *s, AVFrame *frame) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); + char msg_buf[4 * (50 + 2 * 2 * 16 /* MD5-size */)]; + int pixel_shift; + int err = 0; + int i, j; + + if (!desc) + return AVERROR(EINVAL); + + pixel_shift = desc->comp[0].depth > 8; + + /* the checksums are LE, so we have to byteswap for >8bpp formats + * on BE arches */ +#if HAVE_BIGENDIAN + if (pixel_shift && !s->checksum_buf) { + av_fast_malloc(&s->checksum_buf, &s->checksum_buf_size, + FFMAX3(frame->linesize[0], frame->linesize[1], + frame->linesize[2])); + if (!s->checksum_buf) + return AVERROR(ENOMEM); + } +#endif + + msg_buf[0] = '\0'; + for (i = 0; frame->data[i]; i++) { + int width = s->avctx->coded_width; + int height = s->avctx->coded_height; + int w = (i == 1 || i == 2) ? (width >> desc->log2_chroma_w) : width; + int h = (i == 1 || i == 2) ? (height >> desc->log2_chroma_h) : height; + uint8_t md5[16]; + + av_md5_init(s->md5_ctx); + for (j = 0; j < h; j++) { + const uint8_t *src = frame->data[i] + j * frame->linesize[i]; +#if HAVE_BIGENDIAN + if (pixel_shift) { + s->bdsp.bswap16_buf((uint16_t *) s->checksum_buf, + (const uint16_t *) src, w); + src = s->checksum_buf; + } +#endif + av_md5_update(s->md5_ctx, src, w << pixel_shift); + } + av_md5_final(s->md5_ctx, md5); + +#define MD5_PRI "%016" PRIx64 "%016" PRIx64 +#define MD5_PRI_ARG(buf) AV_RB64(buf), AV_RB64((const uint8_t*)(buf) + 8) + + if (!memcmp(md5, s->sei.picture_hash.md5[i], 16)) { + av_strlcatf(msg_buf, sizeof(msg_buf), + "plane %d - correct " MD5_PRI "; ", + i, MD5_PRI_ARG(md5)); + } else { + av_strlcatf(msg_buf, sizeof(msg_buf), + "mismatching checksum of plane %d - " MD5_PRI " != " MD5_PRI "; ", + i, MD5_PRI_ARG(md5), MD5_PRI_ARG(s->sei.picture_hash.md5[i])); + err = AVERROR_INVALIDDATA; + } + } + + av_log(s->avctx, err < 0 ? AV_LOG_ERROR : AV_LOG_DEBUG, + "Verifying checksum for frame with POC %d: %s\n", + s->poc, msg_buf); + + return err; + } + static int hevc_frame_end(HEVCContext *s) { HEVCFrame *out = s->cur_frame; @@ -3006,13 +3162,76 @@ static int hevc_frame_end(HEVCContext *s) av_assert1(ret >= 0); } + if (s->avctx->hwaccel) { + ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); + if (ret < 0) { + av_log(s->avctx, AV_LOG_ERROR, + "hardware accelerator failed to decode picture\n"); + return ret; + } + } else { + if (s->avctx->err_recognition & AV_EF_CRCCHECK && + s->sei.picture_hash.is_md5) { + ret = verify_md5(s, s->cur_frame->f); + if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE) + return ret; + } + } + s->sei.picture_hash.is_md5 = 0; + + av_log(s->avctx, AV_LOG_DEBUG, "Decoded frame with POC %d.\n", s->poc); + + return 0; +} + +static int decode_slice(HEVCContext *s, const H2645NAL *nal, GetBitContext *gb) +{ + int ret; + + ret = hls_slice_header(&s->sh, s, gb); + if (ret < 0) + return ret; + + if ((s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type == HEVC_SLICE_B) || + (s->avctx->skip_frame >= AVDISCARD_NONINTRA && s->sh.slice_type != HEVC_SLICE_I) || + (s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IRAP(s)) || + ((s->nal_unit_type == HEVC_NAL_RASL_R || s->nal_unit_type == HEVC_NAL_RASL_N) && + s->no_rasl_output_flag)) { + return 0; + } + + if (s->sh.first_slice_in_pic_flag) { + if (s->cur_frame) { + av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n"); + return AVERROR_INVALIDDATA; + } + + ret = hevc_frame_start(s); + if (ret < 0) + return ret; + } else if (!s->cur_frame) { + av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n"); + return AVERROR_INVALIDDATA; + } + + if (s->nal_unit_type != s->first_nal_type) { + av_log(s->avctx, AV_LOG_ERROR, + "Non-matching NAL types of the VCL NALUs: %d %d\n", + s->first_nal_type, s->nal_unit_type); + return AVERROR_INVALIDDATA; + } + + ret = decode_slice_data(s, nal, gb); + if (ret < 0) + return ret; + return 0; } static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) { GetBitContext gb = nal->gb; - int ctb_addr_ts, ret; + int ret; s->nal_unit_type = nal->type; s->temporal_id = nal->temporal_id; @@ -3068,106 +3287,13 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) case HEVC_NAL_RADL_R: case HEVC_NAL_RASL_N: case HEVC_NAL_RASL_R: - ret = hls_slice_header(s, &gb); + ret = decode_slice(s, nal, &gb); if (ret < 0) - return ret; - if (ret == 1) { - ret = AVERROR_INVALIDDATA; - goto fail; - } - - - if ( - (s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type == HEVC_SLICE_B) || - (s->avctx->skip_frame >= AVDISCARD_NONINTRA && s->sh.slice_type != HEVC_SLICE_I) || - (s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IRAP(s))) { - break; - } - - if (s->sh.first_slice_in_pic_flag) { - if (s->max_ra == INT_MAX) { - if (s->nal_unit_type == HEVC_NAL_CRA_NUT || IS_BLA(s)) { - s->max_ra = s->poc; - } else { - if (IS_IDR(s)) - s->max_ra = INT_MIN; - } - } - - if ((s->nal_unit_type == HEVC_NAL_RASL_R || s->nal_unit_type == HEVC_NAL_RASL_N) && - s->poc <= s->max_ra) { - s->is_decoded = 0; - break; - } else { - if (s->nal_unit_type == HEVC_NAL_RASL_R && s->poc > s->max_ra) - s->max_ra = INT_MIN; - } - - s->overlap ++; - ret = hevc_frame_start(s); - if (ret < 0) - return ret; - } else if (!s->cur_frame) { - av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n"); goto fail; - } - - if (s->nal_unit_type != s->first_nal_type) { - av_log(s->avctx, AV_LOG_ERROR, - "Non-matching NAL types of the VCL NALUs: %d %d\n", - s->first_nal_type, s->nal_unit_type); - return AVERROR_INVALIDDATA; - } - - if (!s->sh.dependent_slice_segment_flag && - s->sh.slice_type != HEVC_SLICE_I) { - ret = ff_hevc_slice_rpl(s); - if (ret < 0) { - av_log(s->avctx, AV_LOG_WARNING, - "Error constructing the reference lists for the current slice.\n"); - goto fail; - } - } - - if (s->sh.first_slice_in_pic_flag && s->avctx->hwaccel) { - ret = FF_HW_CALL(s->avctx, start_frame, NULL, 0); - if (ret < 0) - goto fail; - } - - if (s->avctx->hwaccel) { - ret = FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size); - if (ret < 0) - goto fail; - } else { - if (s->avctx->profile == AV_PROFILE_HEVC_SCC) { - av_log(s->avctx, AV_LOG_ERROR, - "SCC profile is not yet implemented in hevc native decoder.\n"); - ret = AVERROR_PATCHWELCOME; - goto fail; - } - - if (s->threads_number > 1 && s->sh.num_entry_point_offsets > 0) - ctb_addr_ts = hls_slice_data_wpp(s, nal); - else - ctb_addr_ts = hls_decode_entry(s, &gb); - if (ctb_addr_ts >= (s->ps.sps->ctb_width * s->ps.sps->ctb_height)) { - ret = hevc_frame_end(s); - if (ret < 0) - goto fail; - s->is_decoded = 1; - } - - if (ctb_addr_ts < 0) { - ret = ctb_addr_ts; - goto fail; - } - } break; case HEVC_NAL_EOS_NUT: case HEVC_NAL_EOB_NUT: s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; - s->max_ra = INT_MAX; break; case HEVC_NAL_AUD: case HEVC_NAL_FD_NUT: @@ -3180,9 +3306,13 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) return 0; fail: - if (s->avctx->err_recognition & AV_EF_EXPLODE) - return ret; - return 0; + if (ret == AVERROR_INVALIDDATA && + !(s->avctx->err_recognition & AV_EF_EXPLODE)) { + av_log(s->avctx, AV_LOG_WARNING, + "Skipping invalid undecodable NALU: %d\n", s->nal_unit_type); + return 0; + } + return ret; } static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) @@ -3193,7 +3323,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) s->cur_frame = s->collocated_ref = NULL; s->last_eos = s->eos; s->eos = 0; - s->overlap = 0; + s->slice_initialized = 0; /* split the input packet into NAL units, so we know the upper bound on the * number of slices in the frame */ @@ -3259,8 +3389,6 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) continue; ret = decode_nal_unit(s, nal); - if (ret >= 0 && s->overlap > 2) - ret = AVERROR_INVALIDDATA; if (ret < 0) { av_log(s->avctx, AV_LOG_WARNING, "Error parsing NAL unit #%d.\n", i); @@ -3269,79 +3397,15 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) } fail: - if (s->cur_frame && s->threads_type == FF_THREAD_FRAME) - ff_progress_frame_report(&s->cur_frame->tf, INT_MAX); - - return ret; -} - -static int verify_md5(HEVCContext *s, AVFrame *frame) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); - char msg_buf[4 * (50 + 2 * 2 * 16 /* MD5-size */)]; - int pixel_shift; - int err = 0; - int i, j; - - if (!desc) - return AVERROR(EINVAL); - - pixel_shift = desc->comp[0].depth > 8; - - /* the checksums are LE, so we have to byteswap for >8bpp formats - * on BE arches */ -#if HAVE_BIGENDIAN - if (pixel_shift && !s->checksum_buf) { - av_fast_malloc(&s->checksum_buf, &s->checksum_buf_size, - FFMAX3(frame->linesize[0], frame->linesize[1], - frame->linesize[2])); - if (!s->checksum_buf) - return AVERROR(ENOMEM); - } -#endif - - msg_buf[0] = '\0'; - for (i = 0; frame->data[i]; i++) { - int width = s->avctx->coded_width; - int height = s->avctx->coded_height; - int w = (i == 1 || i == 2) ? (width >> desc->log2_chroma_w) : width; - int h = (i == 1 || i == 2) ? (height >> desc->log2_chroma_h) : height; - uint8_t md5[16]; - - av_md5_init(s->md5_ctx); - for (j = 0; j < h; j++) { - const uint8_t *src = frame->data[i] + j * frame->linesize[i]; -#if HAVE_BIGENDIAN - if (pixel_shift) { - s->bdsp.bswap16_buf((uint16_t *) s->checksum_buf, - (const uint16_t *) src, w); - src = s->checksum_buf; - } -#endif - av_md5_update(s->md5_ctx, src, w << pixel_shift); - } - av_md5_final(s->md5_ctx, md5); - -#define MD5_PRI "%016" PRIx64 "%016" PRIx64 -#define MD5_PRI_ARG(buf) AV_RB64(buf), AV_RB64((const uint8_t*)(buf) + 8) + if (s->cur_frame) { + if (ret >= 0) + ret = hevc_frame_end(s); - if (!memcmp(md5, s->sei.picture_hash.md5[i], 16)) { - av_strlcatf(msg_buf, sizeof(msg_buf), - "plane %d - correct " MD5_PRI "; ", - i, MD5_PRI_ARG(md5)); - } else { - av_strlcatf(msg_buf, sizeof(msg_buf), - "mismatching checksum of plane %d - " MD5_PRI " != " MD5_PRI "; ", - i, MD5_PRI_ARG(md5), MD5_PRI_ARG(s->sei.picture_hash.md5[i])); - err = AVERROR_INVALIDDATA; - } + if (s->avctx->active_thread_type == FF_THREAD_FRAME) + ff_progress_frame_report(&s->cur_frame->tf, INT_MAX); } - av_log(s->avctx, err < 0 ? AV_LOG_ERROR : AV_LOG_DEBUG, - "Verifying checksum for frame with POC %d: %s\n", - s->poc, msg_buf); - - return err; + return ret; } static int hevc_decode_extradata(HEVCContext *s, uint8_t *buf, int length, int first) @@ -3405,36 +3469,10 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, old, s->dovi_ctx.cfg.dv_profile); } - s->cur_frame = s->collocated_ref = NULL; ret = decode_nal_units(s, avpkt->data, avpkt->size); if (ret < 0) return ret; - if (avctx->hwaccel) { - if (s->cur_frame && (ret = FF_HW_SIMPLE_CALL(avctx, end_frame)) < 0) { - av_log(avctx, AV_LOG_ERROR, - "hardware accelerator failed to decode picture\n"); - ff_hevc_unref_frame(s->cur_frame, ~0); - return ret; - } - } else { - /* verify the SEI checksum */ - if (avctx->err_recognition & AV_EF_CRCCHECK && s->cur_frame && s->is_decoded && - s->sei.picture_hash.is_md5) { - ret = verify_md5(s, s->cur_frame->f); - if (ret < 0 && avctx->err_recognition & AV_EF_EXPLODE) { - ff_hevc_unref_frame(s->cur_frame, ~0); - return ret; - } - } - } - s->sei.picture_hash.is_md5 = 0; - - if (s->is_decoded) { - av_log(avctx, AV_LOG_DEBUG, "Decoded frame with POC %d.\n", s->poc); - s->is_decoded = 0; - } - if (s->output_frame->buf[0]) { av_frame_move_ref(rframe, s->output_frame); *got_output = 1; @@ -3443,7 +3481,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, return avpkt->size; } -static int hevc_ref_frame(HEVCFrame *dst, HEVCFrame *src) +static int hevc_ref_frame(HEVCFrame *dst, const HEVCFrame *src) { int ret; @@ -3481,6 +3519,8 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) pic_arrays_free(s); + ff_refstruct_unref(&s->pps); + ff_dovi_ctx_unref(&s->dovi_ctx); av_buffer_unref(&s->rpu_buf); @@ -3538,8 +3578,6 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) return AVERROR(ENOMEM); } - s->max_ra = INT_MAX; - s->md5_ctx = av_md5_alloc(); if (!s->md5_ctx) return AVERROR(ENOMEM); @@ -3582,28 +3620,26 @@ static int hevc_update_thread_context(AVCodecContext *dst, for (int i = 0; i < FF_ARRAY_ELEMS(s->ps.pps_list); i++) ff_refstruct_replace(&s->ps.pps_list[i], s0->ps.pps_list[i]); + // PPS do not persist between frames + ff_refstruct_unref(&s->pps); + if (s->ps.sps != s0->ps.sps) if ((ret = set_sps(s, s0->ps.sps, src->pix_fmt)) < 0) return ret; s->seq_decode = s0->seq_decode; s->seq_output = s0->seq_output; - s->pocTid0 = s0->pocTid0; - s->max_ra = s0->max_ra; + s->poc_tid0 = s0->poc_tid0; s->eos = s0->eos; s->no_rasl_output_flag = s0->no_rasl_output_flag; s->is_nalff = s0->is_nalff; s->nal_length_size = s0->nal_length_size; - s->threads_number = s0->threads_number; - s->threads_type = s0->threads_type; - s->film_grain_warning_shown = s0->film_grain_warning_shown; if (s0->eos) { s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; - s->max_ra = INT_MAX; } ret = ff_h2645_sei_ctx_replace(&s->sei.common, &s0->sei.common); @@ -3647,23 +3683,15 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx) int ret; if (avctx->active_thread_type & FF_THREAD_SLICE) { - s->threads_number = avctx->thread_count; ret = ff_slice_thread_init_progress(avctx); if (ret < 0) return ret; - } else - s->threads_number = 1; - - if((avctx->active_thread_type & FF_THREAD_FRAME) && avctx->thread_count > 1) - s->threads_type = FF_THREAD_FRAME; - else - s->threads_type = FF_THREAD_SLICE; + } ret = hevc_init_context(avctx); if (ret < 0) return ret; - s->enable_parallel_tiles = 0; s->sei.picture_timing.picture_struct = 0; s->eos = 1; @@ -3698,7 +3726,6 @@ static void hevc_decode_flush(AVCodecContext *avctx) ff_hevc_reset_sei(&s->sei); ff_dovi_ctx_flush(&s->dovi_ctx); av_buffer_unref(&s->rpu_buf); - s->max_ra = INT_MAX; s->eos = 1; if (FF_HW_HAS_CB(avctx, flush)) diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.h b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.h index 33ad4ac0aa..da4d83e661 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.h +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.h @@ -209,6 +209,7 @@ typedef struct SliceHeader { enum HEVCSliceType slice_type; int pic_order_cnt_lsb; + int poc; uint8_t first_slice_in_pic_flag; uint8_t dependent_slice_segment_flag; @@ -453,9 +454,6 @@ typedef struct HEVCContext { HEVCLocalContext *local_ctx; unsigned nb_local_ctx; - uint8_t threads_type; - uint8_t threads_number; - /** 1 if the independent slice segment header was successfully parsed */ uint8_t slice_initialized; @@ -473,6 +471,7 @@ typedef struct HEVCContext { ///< candidate references for the current frame RefPicList rps[5]; + const HEVCPPS *pps; ///< RefStruct reference SliceHeader sh; SAOParams *sao; DBParams *deblock; @@ -482,16 +481,14 @@ typedef struct HEVCContext { HEVCFrame *collocated_ref; HEVCFrame DPB[32]; int poc; - int pocTid0; + int poc_tid0; int slice_idx; ///< number of the slice being currently decoded int eos; ///< current packet contains an EOS/EOB NAL int last_eos; ///< last packet contains an EOS/EOB NAL - int max_ra; int bs_width; int bs_height; - int overlap; - int is_decoded; + // NoRaslOutputFlag associated with the last IRAP frame int no_rasl_output_flag; HEVCPredContext hpc; @@ -531,7 +528,6 @@ typedef struct HEVCContext { /** The target for the common_cabac_state of the local contexts. */ HEVCCABACState cabac; - int enable_parallel_tiles; atomic_int wpp_err; const uint8_t *data; @@ -576,23 +572,25 @@ int ff_hevc_frame_rps(HEVCContext *s); */ int ff_hevc_slice_rpl(HEVCContext *s); -void ff_hevc_save_states(HEVCLocalContext *lc, int ctb_addr_ts); -int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts, - const uint8_t *data, size_t size); +void ff_hevc_save_states(HEVCLocalContext *lc, const HEVCPPS *pps, + int ctb_addr_ts); +int ff_hevc_cabac_init(HEVCLocalContext *lc, const HEVCPPS *pps, + int ctb_addr_ts, const uint8_t *data, size_t size, + int is_wpp); int ff_hevc_sao_merge_flag_decode(HEVCLocalContext *lc); int ff_hevc_sao_type_idx_decode(HEVCLocalContext *lc); int ff_hevc_sao_band_position_decode(HEVCLocalContext *lc); -int ff_hevc_sao_offset_abs_decode(HEVCLocalContext *lc); +int ff_hevc_sao_offset_abs_decode(HEVCLocalContext *lc, int bit_depth); int ff_hevc_sao_offset_sign_decode(HEVCLocalContext *lc); int ff_hevc_sao_eo_class_decode(HEVCLocalContext *lc); int ff_hevc_end_of_slice_flag_decode(HEVCLocalContext *lc); int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc); int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, int x0, int y0, - int x_cb, int y_cb); + int x_cb, int y_cb, int min_cb_width); int ff_hevc_pred_mode_decode(HEVCLocalContext *lc); -int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, int ct_depth, - int x0, int y0); -int ff_hevc_part_mode_decode(HEVCLocalContext *lc, int log2_cb_size); +int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *sps, + int ct_depth, int x0, int y0); +int ff_hevc_part_mode_decode(HEVCLocalContext *lc, const HEVCSPS *sps, int log2_cb_size); int ff_hevc_pcm_flag_decode(HEVCLocalContext *lc); int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCLocalContext *lc); int ff_hevc_mpm_idx_decode(HEVCLocalContext *lc); @@ -613,7 +611,7 @@ int ff_hevc_res_scale_sign_flag(HEVCLocalContext *lc, int idx); /** * Get the number of candidate references for the current frame. */ -int ff_hevc_frame_nb_refs(const HEVCContext *s); +int ff_hevc_frame_nb_refs(const SliceHeader *sh, const HEVCPPS *pps); int ff_hevc_set_new_ref(HEVCContext *s, int poc); @@ -645,25 +643,30 @@ void ff_hevc_bump_frame(HEVCContext *s); void ff_hevc_unref_frame(HEVCFrame *frame, int flags); void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0, - int nPbW, int nPbH); -void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, + int nPbW, int nPbH, int log2_ctb_size); +void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv); -void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, +void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv, int mvp_lx_flag, int LX); -void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size); -void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size); -void ff_hevc_set_qPy(HEVCLocalContext *lc, int xBase, int yBase, - int log2_cb_size); -void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, - int log2_trafo_size); +void ff_hevc_hls_filter(HEVCLocalContext *lc, const HEVCPPS *pps, + int x, int y, int ctb_size); +void ff_hevc_hls_filters(HEVCLocalContext *lc, const HEVCPPS *pps, + int x_ctb, int y_ctb, int ctb_size); +void ff_hevc_set_qPy(HEVCLocalContext *lc, const HEVCPPS *pps, + int xBase, int yBase, int log2_cb_size); +void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int log2_trafo_size); int ff_hevc_cu_qp_delta_sign_flag(HEVCLocalContext *lc); int ff_hevc_cu_qp_delta_abs(HEVCLocalContext *lc); int ff_hevc_cu_chroma_qp_offset_flag(HEVCLocalContext *lc); -int ff_hevc_cu_chroma_qp_offset_idx(HEVCLocalContext *lc); -void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, +int ff_hevc_cu_chroma_qp_offset_idx(HEVCLocalContext *lc, int chroma_qp_offset_list_len_minus1); +void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx); diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/mvs.c b/src/ExtLib/ffmpeg/libavcodec/hevc/mvs.c index b56f0bece5..96d8d58f39 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/mvs.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/mvs.c @@ -41,17 +41,16 @@ static const uint8_t l0_l1_cand_idx[12][2] = { }; void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0, - int nPbW, int nPbH) + int nPbW, int nPbH, int log2_ctb_size) { - const HEVCContext *const s = lc->parent; - int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size); - int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size); + int x0b = av_zero_extend(x0, log2_ctb_size); + int y0b = av_zero_extend(y0, log2_ctb_size); lc->na.cand_up = (lc->ctb_up_flag || y0b); lc->na.cand_left = (lc->ctb_left_flag || x0b); lc->na.cand_up_left = (x0b || y0b) ? lc->na.cand_left && lc->na.cand_up : lc->ctb_up_left_flag; lc->na.cand_up_right_sap = - (x0b + nPbW == 1 << s->ps.sps->log2_ctb_size) ? + (x0b + nPbW == 1 << log2_ctb_size) ? lc->ctb_up_right_flag && !y0b : lc->na.cand_up; lc->na.cand_up_right = lc->na.cand_up_right_sap @@ -62,31 +61,32 @@ void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0, /* * 6.4.1 Derivation process for z-scan order block availability */ -static av_always_inline int z_scan_block_avail(const HEVCContext *s, int xCurr, int yCurr, - int xN, int yN) +static av_always_inline int +z_scan_block_avail(const HEVCPPS *pps, const HEVCSPS *sps, + int xCurr, int yCurr, int xN, int yN) { #define MIN_TB_ADDR_ZS(x, y) \ - s->ps.pps->min_tb_addr_zs[(y) * (s->ps.sps->tb_mask+2) + (x)] + pps->min_tb_addr_zs[(y) * (sps->tb_mask+2) + (x)] - int xCurr_ctb = xCurr >> s->ps.sps->log2_ctb_size; - int yCurr_ctb = yCurr >> s->ps.sps->log2_ctb_size; - int xN_ctb = xN >> s->ps.sps->log2_ctb_size; - int yN_ctb = yN >> s->ps.sps->log2_ctb_size; + int xCurr_ctb = xCurr >> sps->log2_ctb_size; + int yCurr_ctb = yCurr >> sps->log2_ctb_size; + int xN_ctb = xN >> sps->log2_ctb_size; + int yN_ctb = yN >> sps->log2_ctb_size; if( yN_ctb < yCurr_ctb || xN_ctb < xCurr_ctb ) return 1; else { - int Curr = MIN_TB_ADDR_ZS((xCurr >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask, - (yCurr >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask); - int N = MIN_TB_ADDR_ZS((xN >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask, - (yN >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask); + int Curr = MIN_TB_ADDR_ZS((xCurr >> sps->log2_min_tb_size) & sps->tb_mask, + (yCurr >> sps->log2_min_tb_size) & sps->tb_mask); + int N = MIN_TB_ADDR_ZS((xN >> sps->log2_min_tb_size) & sps->tb_mask, + (yN >> sps->log2_min_tb_size) & sps->tb_mask); return N <= Curr; } } //check if the two luma locations belong to the same motion estimation region -static av_always_inline int is_diff_mer(const HEVCContext *s, int xN, int yN, int xP, int yP) +static av_always_inline int is_diff_mer(const HEVCPPS *pps, int xN, int yN, int xP, int yP) { - uint8_t plevel = s->ps.pps->log2_parallel_merge_level; + uint8_t plevel = pps->log2_parallel_merge_level; return xN >> plevel == xP >> plevel && yN >> plevel == yP >> plevel; @@ -205,8 +205,8 @@ static int derive_temporal_colocated_mvs(const HEVCContext *s, MvField temp_col, tab_mvf[(y) * min_pu_width + x] #define TAB_MVF_PU(v) \ - TAB_MVF(((x ## v) >> s->ps.sps->log2_min_pu_size), \ - ((y ## v) >> s->ps.sps->log2_min_pu_size)) + TAB_MVF(((x ## v) >> sps->log2_min_pu_size), \ + ((y ## v) >> sps->log2_min_pu_size)) #define DERIVE_TEMPORAL_COLOCATED_MVS \ derive_temporal_colocated_mvs(s, temp_col, \ @@ -216,14 +216,15 @@ static int derive_temporal_colocated_mvs(const HEVCContext *s, MvField temp_col, /* * 8.5.3.1.7 temporal luma motion vector prediction */ -static int temporal_luma_motion_vector(const HEVCContext *s, int x0, int y0, +static int temporal_luma_motion_vector(const HEVCContext *s, const HEVCSPS *sps, + int x0, int y0, int nPbW, int nPbH, int refIdxLx, Mv *mvLXCol, int X) { const MvField *tab_mvf; MvField temp_col; int x, y, x_pu, y_pu; - int min_pu_width = s->ps.sps->min_pu_width; + int min_pu_width = sps->min_pu_width; int availableFlagLXCol = 0; int colPic; @@ -242,15 +243,15 @@ static int temporal_luma_motion_vector(const HEVCContext *s, int x0, int y0, y = y0 + nPbH; if (tab_mvf && - (y0 >> s->ps.sps->log2_ctb_size) == (y >> s->ps.sps->log2_ctb_size) && - y < s->ps.sps->height && - x < s->ps.sps->width) { + (y0 >> sps->log2_ctb_size) == (y >> sps->log2_ctb_size) && + y < sps->height && + x < sps->width) { x &= ~15; y &= ~15; - if (s->threads_type == FF_THREAD_FRAME) + if (s->avctx->active_thread_type == FF_THREAD_FRAME) ff_progress_frame_await(&ref->tf, y); - x_pu = x >> s->ps.sps->log2_min_pu_size; - y_pu = y >> s->ps.sps->log2_min_pu_size; + x_pu = x >> sps->log2_min_pu_size; + y_pu = y >> sps->log2_min_pu_size; temp_col = TAB_MVF(x_pu, y_pu); availableFlagLXCol = DERIVE_TEMPORAL_COLOCATED_MVS; } @@ -261,10 +262,10 @@ static int temporal_luma_motion_vector(const HEVCContext *s, int x0, int y0, y = y0 + (nPbH >> 1); x &= ~15; y &= ~15; - if (s->threads_type == FF_THREAD_FRAME) + if (s->avctx->active_thread_type == FF_THREAD_FRAME) ff_progress_frame_await(&ref->tf, y); - x_pu = x >> s->ps.sps->log2_min_pu_size; - y_pu = y >> s->ps.sps->log2_min_pu_size; + x_pu = x >> sps->log2_min_pu_size; + y_pu = y >> sps->log2_min_pu_size; temp_col = TAB_MVF(x_pu, y_pu); availableFlagLXCol = DERIVE_TEMPORAL_COLOCATED_MVS; } @@ -275,7 +276,7 @@ static int temporal_luma_motion_vector(const HEVCContext *s, int x0, int y0, (cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA)) #define PRED_BLOCK_AVAILABLE(v) \ - z_scan_block_avail(s, x0, y0, x ## v, y ## v) + z_scan_block_avail(pps, sps, x0, y0, x ## v, y ## v) #define COMPARE_MV_REFIDX(a, b) \ compare_mv_ref_idx(TAB_MVF_PU(a), TAB_MVF_PU(b)) @@ -284,6 +285,7 @@ static int temporal_luma_motion_vector(const HEVCContext *s, int x0, int y0, * 8.5.3.1.2 Derivation process for spatial merging candidates */ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCContext *s, + const HEVCPPS *pps, const HEVCSPS *sps, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, @@ -294,7 +296,7 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont const RefPicList *refPicList = s->cur_frame->refPicList; const MvField *tab_mvf = s->cur_frame->tab_mvf; - const int min_pu_width = s->ps.sps->min_pu_width; + const int min_pu_width = sps->min_pu_width; const int cand_bottom_left = lc->na.cand_bottom_left; const int cand_left = lc->na.cand_left; @@ -336,7 +338,7 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont (lc->cu.part_mode == PART_Nx2N || lc->cu.part_mode == PART_nLx2N || lc->cu.part_mode == PART_nRx2N) || - is_diff_mer(s, xA1, yA1, x0, y0)) { + is_diff_mer(pps, xA1, yA1, x0, y0)) { is_available_a1 = 0; } else { is_available_a1 = AVAILABLE(cand_left, A1); @@ -352,7 +354,7 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont (lc->cu.part_mode == PART_2NxN || lc->cu.part_mode == PART_2NxnU || lc->cu.part_mode == PART_2NxnD) || - is_diff_mer(s, xB1, yB1, x0, y0)) { + is_diff_mer(pps, xB1, yB1, x0, y0)) { is_available_b1 = 0; } else { is_available_b1 = AVAILABLE(cand_up, B1); @@ -367,9 +369,9 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont // above right spatial merge candidate is_available_b0 = AVAILABLE(cand_up_right, B0) && - xB0 < s->ps.sps->width && + xB0 < sps->width && PRED_BLOCK_AVAILABLE(B0) && - !is_diff_mer(s, xB0, yB0, x0, y0); + !is_diff_mer(pps, xB0, yB0, x0, y0); if (is_available_b0 && !(is_available_b1 && COMPARE_MV_REFIDX(B0, B1))) { @@ -381,9 +383,9 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont // left bottom spatial merge candidate is_available_a0 = AVAILABLE(cand_bottom_left, A0) && - yA0 < s->ps.sps->height && + yA0 < sps->height && PRED_BLOCK_AVAILABLE(A0) && - !is_diff_mer(s, xA0, yA0, x0, y0); + !is_diff_mer(pps, xA0, yA0, x0, y0); if (is_available_a0 && !(is_available_a1 && COMPARE_MV_REFIDX(A0, A1))) { @@ -395,7 +397,7 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont // above left spatial merge candidate is_available_b2 = AVAILABLE(cand_up_left, B2) && - !is_diff_mer(s, xB2, yB2, x0, y0); + !is_diff_mer(pps, xB2, yB2, x0, y0); if (is_available_b2 && !(is_available_a1 && COMPARE_MV_REFIDX(B2, A1)) && @@ -411,10 +413,10 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont if (s->sh.slice_temporal_mvp_enabled_flag && nb_merge_cand < s->sh.max_num_merge_cand) { Mv mv_l0_col = { 0 }, mv_l1_col = { 0 }; - int available_l0 = temporal_luma_motion_vector(s, x0, y0, nPbW, nPbH, + int available_l0 = temporal_luma_motion_vector(s, sps, x0, y0, nPbW, nPbH, 0, &mv_l0_col, 0); int available_l1 = (s->sh.slice_type == HEVC_SLICE_B) ? - temporal_luma_motion_vector(s, x0, y0, nPbW, nPbH, + temporal_luma_motion_vector(s, sps, x0, y0, nPbW, nPbH, 0, &mv_l1_col, 1) : 0; if (available_l0 || available_l1) { @@ -477,10 +479,12 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont /* * 8.5.3.1.1 Derivation process of luma Mvs for merge mode */ -void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, +void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv) { + const HEVCSPS *const sps = pps->sps; const HEVCContext *const s = lc->parent; int singleMCLFlag = 0; int nCS = 1 << log2_cb_size; @@ -488,7 +492,7 @@ void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbW2 = nPbW; int nPbH2 = nPbH; - if (s->ps.pps->log2_parallel_merge_level > 2 && nCS == 8) { + if (pps->log2_parallel_merge_level > 2 && nCS == 8) { singleMCLFlag = 1; x0 = lc->cu.x; y0 = lc->cu.y; @@ -497,8 +501,8 @@ void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, part_idx = 0; } - ff_hevc_set_neighbour_available(lc, x0, y0, nPbW, nPbH); - derive_spatial_merge_candidates(lc, s, x0, y0, nPbW, nPbH, log2_cb_size, + ff_hevc_set_neighbour_available(lc, x0, y0, nPbW, nPbH, sps->log2_ctb_size); + derive_spatial_merge_candidates(lc, s, pps, sps, x0, y0, nPbW, nPbH, log2_cb_size, singleMCLFlag, part_idx, merge_idx, mergecand_list); @@ -527,11 +531,12 @@ static av_always_inline void dist_scale(const HEVCContext *s, Mv *mv, } } -static int mv_mp_mode_mx(const HEVCContext *s, int x, int y, int pred_flag_index, +static int mv_mp_mode_mx(const HEVCContext *s, const HEVCSPS *sps, + int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx) { const MvField *tab_mvf = s->cur_frame->tab_mvf; - int min_pu_width = s->ps.sps->min_pu_width; + int min_pu_width = sps->min_pu_width; const RefPicList *refPicList = s->cur_frame->refPicList; @@ -543,11 +548,12 @@ static int mv_mp_mode_mx(const HEVCContext *s, int x, int y, int pred_flag_index return 0; } -static int mv_mp_mode_mx_lt(const HEVCContext *s, int x, int y, int pred_flag_index, +static int mv_mp_mode_mx_lt(const HEVCContext *s, const HEVCSPS *sps, + int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx) { const MvField *tab_mvf = s->cur_frame->tab_mvf; - int min_pu_width = s->ps.sps->min_pu_width; + int min_pu_width = sps->min_pu_width; const RefPicList *refPicList = s->cur_frame->refPicList; @@ -569,29 +575,31 @@ static int mv_mp_mode_mx_lt(const HEVCContext *s, int x, int y, int pred_flag_in } #define MP_MX(v, pred, mx) \ - mv_mp_mode_mx(s, \ - (x ## v) >> s->ps.sps->log2_min_pu_size, \ - (y ## v) >> s->ps.sps->log2_min_pu_size, \ + mv_mp_mode_mx(s, sps, \ + (x ## v) >> sps->log2_min_pu_size, \ + (y ## v) >> sps->log2_min_pu_size, \ pred, &mx, ref_idx_curr, ref_idx) #define MP_MX_LT(v, pred, mx) \ - mv_mp_mode_mx_lt(s, \ - (x ## v) >> s->ps.sps->log2_min_pu_size, \ - (y ## v) >> s->ps.sps->log2_min_pu_size, \ + mv_mp_mode_mx_lt(s, sps, \ + (x ## v) >> sps->log2_min_pu_size, \ + (y ## v) >> sps->log2_min_pu_size, \ pred, &mx, ref_idx_curr, ref_idx) -void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, +void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, const HEVCPPS *pps, + int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv, int mvp_lx_flag, int LX) { + const HEVCSPS *const sps = pps->sps; const HEVCContext *const s = lc->parent; const MvField *const tab_mvf = s->cur_frame->tab_mvf; int isScaledFlag_L0 = 0; int availableFlagLXA0 = 1; int availableFlagLXB0 = 1; int numMVPCandLX = 0; - int min_pu_width = s->ps.sps->min_pu_width; + int min_pu_width = sps->min_pu_width; int xA0, yA0; int is_available_a0; @@ -627,7 +635,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, yA0 = y0 + nPbH; is_available_a0 = AVAILABLE(cand_bottom_left, A0) && - yA0 < s->ps.sps->height && + yA0 < sps->height && PRED_BLOCK_AVAILABLE(A0); //left spatial merge candidate @@ -682,7 +690,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, yB0 = y0 - 1; is_available_b0 = AVAILABLE(cand_up_right, B0) && - xB0 < s->ps.sps->width && + xB0 < sps->width && PRED_BLOCK_AVAILABLE(B0); // above spatial merge candidate @@ -764,7 +772,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, if (numMVPCandLX < 2 && s->sh.slice_temporal_mvp_enabled_flag && mvp_lx_flag == numMVPCandLX) { Mv mv_col; - int available_col = temporal_luma_motion_vector(s, x0, y0, nPbW, + int available_col = temporal_luma_motion_vector(s, sps, x0, y0, nPbW, nPbH, ref_idx, &mv_col, LX); if (available_col) diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/parser.c b/src/ExtLib/ffmpeg/libavcodec/hevc/parser.c index 7090270b95..bddccabac8 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/parser.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/parser.c @@ -58,6 +58,8 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal, HEVCParamSets *ps = &ctx->ps; HEVCSEI *sei = &ctx->sei; GetBitContext *gb = &nal->gb; + const HEVCPPS *pps; + const HEVCSPS *sps; const HEVCWindow *ow; int i, num = 0, den = 0; @@ -78,32 +80,25 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal, av_log(avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id); return AVERROR_INVALIDDATA; } - ps->pps = ps->pps_list[pps_id]; - - if (ps->pps->sps_id >= HEVC_MAX_SPS_COUNT || !ps->sps_list[ps->pps->sps_id]) { - av_log(avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", ps->pps->sps_id); - return AVERROR_INVALIDDATA; - } - if (ps->sps != ps->sps_list[ps->pps->sps_id]) { - ps->sps = ps->sps_list[ps->pps->sps_id]; - ps->vps = ps->vps_list[ps->sps->vps_id]; - } - ow = &ps->sps->output_window; - - s->coded_width = ps->sps->width; - s->coded_height = ps->sps->height; - s->width = ps->sps->width - ow->left_offset - ow->right_offset; - s->height = ps->sps->height - ow->top_offset - ow->bottom_offset; - s->format = ps->sps->pix_fmt; - avctx->profile = ps->sps->ptl.general_ptl.profile_idc; - avctx->level = ps->sps->ptl.general_ptl.level_idc; - - if (ps->vps->vps_timing_info_present_flag) { - num = ps->vps->vps_num_units_in_tick; - den = ps->vps->vps_time_scale; - } else if (ps->sps->vui.vui_timing_info_present_flag) { - num = ps->sps->vui.vui_num_units_in_tick; - den = ps->sps->vui.vui_time_scale; + pps = ps->pps_list[pps_id]; + sps = pps->sps; + + ow = &sps->output_window; + + s->coded_width = sps->width; + s->coded_height = sps->height; + s->width = sps->width - ow->left_offset - ow->right_offset; + s->height = sps->height - ow->top_offset - ow->bottom_offset; + s->format = sps->pix_fmt; + avctx->profile = sps->ptl.general_ptl.profile_idc; + avctx->level = sps->ptl.general_ptl.level_idc; + + if (sps->vps->vps_timing_info_present_flag) { + num = sps->vps->vps_num_units_in_tick; + den = sps->vps->vps_time_scale; + } else if (sps->vui.vui_timing_info_present_flag) { + num = sps->vui.vui_num_units_in_tick; + den = sps->vui.vui_time_scale; } if (num != 0 && den != 0) @@ -114,15 +109,15 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal, unsigned int slice_segment_addr; int slice_address_length; - if (ps->pps->dependent_slice_segments_enabled_flag) + if (pps->dependent_slice_segments_enabled_flag) dependent_slice_segment_flag = get_bits1(gb); else dependent_slice_segment_flag = 0; - slice_address_length = av_ceil_log2_c(ps->sps->ctb_width * - ps->sps->ctb_height); + slice_address_length = av_ceil_log2_c(sps->ctb_width * + sps->ctb_height); slice_segment_addr = get_bitsz(gb, slice_address_length); - if (slice_segment_addr >= ps->sps->ctb_width * ps->sps->ctb_height) { + if (slice_segment_addr >= sps->ctb_width * sps->ctb_height) { av_log(avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n", slice_segment_addr); return AVERROR_INVALIDDATA; @@ -133,7 +128,7 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal, if (dependent_slice_segment_flag) return 0; /* break; */ - for (i = 0; i < ps->pps->num_extra_slice_header_bits; i++) + for (i = 0; i < pps->num_extra_slice_header_bits; i++) skip_bits(gb, 1); // slice_reserved_undetermined_flag[] slice_type = get_ue_golomb_31(gb); @@ -147,16 +142,16 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal, slice_type == HEVC_SLICE_P ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; - if (ps->pps->output_flag_present_flag) + if (pps->output_flag_present_flag) skip_bits1(gb); // pic_output_flag - if (ps->sps->separate_colour_plane) + if (sps->separate_colour_plane) skip_bits(gb, 2); // colour_plane_id if (!IS_IDR_NAL(nal)) { - int pic_order_cnt_lsb = get_bits(gb, ps->sps->log2_max_poc_lsb); + int pic_order_cnt_lsb = get_bits(gb, sps->log2_max_poc_lsb); s->output_picture_number = ctx->poc = - ff_hevc_compute_poc(ps->sps, ctx->pocTid0, pic_order_cnt_lsb, nal->type); + ff_hevc_compute_poc(sps, ctx->pocTid0, pic_order_cnt_lsb, nal->type); } else s->output_picture_number = ctx->poc = 0; diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/pred.h b/src/ExtLib/ffmpeg/libavcodec/hevc/pred.h index 7828303805..3c7f7b2012 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/pred.h +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/pred.h @@ -27,9 +27,11 @@ #include struct HEVCLocalContext; +struct HEVCPPS; typedef struct HEVCPredContext { - void (*intra_pred[4])(struct HEVCLocalContext *lc, int x0, int y0, int c_idx); + void (*intra_pred[4])(struct HEVCLocalContext *lc, + const struct HEVCPPS *pps, int x0, int y0, int c_idx); void (*pred_planar[4])(uint8_t *src, const uint8_t *top, const uint8_t *left, ptrdiff_t stride); diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/pred_template.c b/src/ExtLib/ffmpeg/libavcodec/hevc/pred_template.c index f698164fe7..4a5b3f3f34 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/pred_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/pred_template.c @@ -27,11 +27,13 @@ #define POS(x, y) src[(x) + stride * (y)] -static av_always_inline void FUNC(intra_pred)(HEVCLocalContext *lc, int x0, int y0, +static av_always_inline void FUNC(intra_pred)(HEVCLocalContext *lc, + const HEVCPPS *pps, + int x0, int y0, int log2_size, int c_idx) { #define PU(x) \ - ((x) >> s->ps.sps->log2_min_pu_size) + ((x) >> sps->log2_min_pu_size) #define MVF(x, y) \ (s->cur_frame->tab_mvf[(x) + (y) * min_pu_width]) #define MVF_PU(x, y) \ @@ -39,7 +41,7 @@ static av_always_inline void FUNC(intra_pred)(HEVCLocalContext *lc, int x0, int #define IS_INTRA(x, y) \ (MVF_PU(x, y).pred_flag == PF_INTRA) #define MIN_TB_ADDR_ZS(x, y) \ - s->ps.pps->min_tb_addr_zs[(y) * (s->ps.sps->tb_mask+2) + (x)] + pps->min_tb_addr_zs[(y) * (sps->tb_mask+2) + (x)] #define EXTEND(ptr, val, len) \ do { \ pixel4 pix = PIXEL_SPLAT_X4(val); \ @@ -70,27 +72,28 @@ do { \ else \ a = PIXEL_SPLAT_X4(ptr[i + 3]) + const HEVCSPS *const sps = pps->sps; const HEVCContext *const s = lc->parent; int i; - int hshift = s->ps.sps->hshift[c_idx]; - int vshift = s->ps.sps->vshift[c_idx]; + int hshift = sps->hshift[c_idx]; + int vshift = sps->vshift[c_idx]; int size = (1 << log2_size); int size_in_luma_h = size << hshift; - int size_in_tbs_h = size_in_luma_h >> s->ps.sps->log2_min_tb_size; + int size_in_tbs_h = size_in_luma_h >> sps->log2_min_tb_size; int size_in_luma_v = size << vshift; - int size_in_tbs_v = size_in_luma_v >> s->ps.sps->log2_min_tb_size; + int size_in_tbs_v = size_in_luma_v >> sps->log2_min_tb_size; int x = x0 >> hshift; int y = y0 >> vshift; - int x_tb = (x0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask; - int y_tb = (y0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask; - int spin = c_idx && !size_in_tbs_v && ((2 * y0) & (1 << s->ps.sps->log2_min_tb_size)); + int x_tb = (x0 >> sps->log2_min_tb_size) & sps->tb_mask; + int y_tb = (y0 >> sps->log2_min_tb_size) & sps->tb_mask; + int spin = c_idx && !size_in_tbs_v && ((2 * y0) & (1 << sps->log2_min_tb_size)); int cur_tb_addr = MIN_TB_ADDR_ZS(x_tb, y_tb); ptrdiff_t stride = s->cur_frame->f->linesize[c_idx] / sizeof(pixel); pixel *src = (pixel*)s->cur_frame->f->data[c_idx] + x + y * stride; - int min_pu_width = s->ps.sps->min_pu_width; + int min_pu_width = sps->min_pu_width; enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c : lc->tu.intra_pred_mode; @@ -104,28 +107,28 @@ do { \ pixel *top = top_array + 1; pixel *filtered_left = filtered_left_array + 1; pixel *filtered_top = filtered_top_array + 1; - int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS( x_tb - 1, (y_tb + size_in_tbs_v + spin) & s->ps.sps->tb_mask); + int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS( x_tb - 1, (y_tb + size_in_tbs_v + spin) & sps->tb_mask); int cand_left = lc->na.cand_left; int cand_up_left = lc->na.cand_up_left; int cand_up = lc->na.cand_up; - int cand_up_right = lc->na.cand_up_right && !spin && cur_tb_addr > MIN_TB_ADDR_ZS((x_tb + size_in_tbs_h) & s->ps.sps->tb_mask, y_tb - 1); + int cand_up_right = lc->na.cand_up_right && !spin && cur_tb_addr > MIN_TB_ADDR_ZS((x_tb + size_in_tbs_h) & sps->tb_mask, y_tb - 1); - int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma_v, s->ps.sps->height) - + int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma_v, sps->height) - (y0 + size_in_luma_v)) >> vshift; - int top_right_size = (FFMIN(x0 + 2 * size_in_luma_h, s->ps.sps->width) - + int top_right_size = (FFMIN(x0 + 2 * size_in_luma_h, sps->width) - (x0 + size_in_luma_h)) >> hshift; - if (s->ps.pps->constrained_intra_pred_flag == 1) { + if (pps->constrained_intra_pred_flag == 1) { int size_in_luma_pu_v = PU(size_in_luma_v); int size_in_luma_pu_h = PU(size_in_luma_h); - int on_pu_edge_x = !av_mod_uintp2(x0, s->ps.sps->log2_min_pu_size); - int on_pu_edge_y = !av_mod_uintp2(y0, s->ps.sps->log2_min_pu_size); + int on_pu_edge_x = !av_zero_extend(x0, sps->log2_min_pu_size); + int on_pu_edge_y = !av_zero_extend(y0, sps->log2_min_pu_size); if (!size_in_luma_pu_h) size_in_luma_pu_h++; if (cand_bottom_left == 1 && on_pu_edge_x) { int x_left_pu = PU(x0 - 1); int y_bottom_pu = PU(y0 + size_in_luma_v); - int max = FFMIN(size_in_luma_pu_v, s->ps.sps->min_pu_height - y_bottom_pu); + int max = FFMIN(size_in_luma_pu_v, sps->min_pu_height - y_bottom_pu); cand_bottom_left = 0; for (i = 0; i < max; i += 2) cand_bottom_left |= (MVF(x_left_pu, y_bottom_pu + i).pred_flag == PF_INTRA); @@ -133,7 +136,7 @@ do { \ if (cand_left == 1 && on_pu_edge_x) { int x_left_pu = PU(x0 - 1); int y_left_pu = PU(y0); - int max = FFMIN(size_in_luma_pu_v, s->ps.sps->min_pu_height - y_left_pu); + int max = FFMIN(size_in_luma_pu_v, sps->min_pu_height - y_left_pu); cand_left = 0; for (i = 0; i < max; i += 2) cand_left |= (MVF(x_left_pu, y_left_pu + i).pred_flag == PF_INTRA); @@ -146,7 +149,7 @@ do { \ if (cand_up == 1 && on_pu_edge_y) { int x_top_pu = PU(x0); int y_top_pu = PU(y0 - 1); - int max = FFMIN(size_in_luma_pu_h, s->ps.sps->min_pu_width - x_top_pu); + int max = FFMIN(size_in_luma_pu_h, sps->min_pu_width - x_top_pu); cand_up = 0; for (i = 0; i < max; i += 2) cand_up |= (MVF(x_top_pu + i, y_top_pu).pred_flag == PF_INTRA); @@ -154,7 +157,7 @@ do { \ if (cand_up_right == 1 && on_pu_edge_y) { int y_top_pu = PU(y0 - 1); int x_right_pu = PU(x0 + size_in_luma_h); - int max = FFMIN(size_in_luma_pu_h, s->ps.sps->min_pu_width - x_right_pu); + int max = FFMIN(size_in_luma_pu_h, sps->min_pu_width - x_right_pu); cand_up_right = 0; for (i = 0; i < max; i += 2) cand_up_right |= (MVF(x_right_pu + i, y_top_pu).pred_flag == PF_INTRA); @@ -184,20 +187,20 @@ do { \ size - bottom_left_size); } - if (s->ps.pps->constrained_intra_pred_flag == 1) { + if (pps->constrained_intra_pred_flag == 1) { if (cand_bottom_left || cand_left || cand_up_left || cand_up || cand_up_right) { - int size_max_x = x0 + ((2 * size) << hshift) < s->ps.sps->width ? - 2 * size : (s->ps.sps->width - x0) >> hshift; - int size_max_y = y0 + ((2 * size) << vshift) < s->ps.sps->height ? - 2 * size : (s->ps.sps->height - y0) >> vshift; + int size_max_x = x0 + ((2 * size) << hshift) < sps->width ? + 2 * size : (sps->width - x0) >> hshift; + int size_max_y = y0 + ((2 * size) << vshift) < sps->height ? + 2 * size : (sps->height - y0) >> vshift; int j = size + (cand_bottom_left? bottom_left_size: 0) -1; if (!cand_up_right) { - size_max_x = x0 + ((size) << hshift) < s->ps.sps->width ? - size : (s->ps.sps->width - x0) >> hshift; + size_max_x = x0 + ((size) << hshift) < sps->width ? + size : (sps->width - x0) >> hshift; } if (!cand_bottom_left) { - size_max_y = y0 + (( size) << vshift) < s->ps.sps->height ? - size : (s->ps.sps->height - y0) >> vshift; + size_max_y = y0 + (( size) << vshift) < sps->height ? + size : (sps->height - y0) >> vshift; } if (cand_bottom_left || cand_left || cand_up_left) { while (j > -1 && !IS_INTRA(-1, j)) @@ -285,14 +288,14 @@ do { \ top[-1] = left[-1]; // Filtering process - if (!s->ps.sps->intra_smoothing_disabled && (c_idx == 0 || s->ps.sps->chroma_format_idc == 3)) { + if (!sps->intra_smoothing_disabled && (c_idx == 0 || sps->chroma_format_idc == 3)) { if (mode != INTRA_DC && size != 4){ int intra_hor_ver_dist_thresh[] = { 7, 1, 0 }; int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)), FFABS((int)(mode - 10U))); if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) { int threshold = 1 << (BIT_DEPTH - 5); - if (s->ps.sps->strong_intra_smoothing_enabled && c_idx == 0 && + if (sps->strong_intra_smoothing_enabled && c_idx == 0 && log2_size == 5 && FFABS(top[-1] + top[63] - 2 * top[31]) < threshold && FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) { @@ -343,9 +346,10 @@ do { \ } #define INTRA_PRED(size) \ -static void FUNC(intra_pred_ ## size)(HEVCLocalContext *lc, int x0, int y0, int c_idx) \ +static void FUNC(intra_pred_ ## size)(HEVCLocalContext *lc, const HEVCPPS *pps, \ + int x0, int y0, int c_idx) \ { \ - FUNC(intra_pred)(lc, x0, y0, size, c_idx); \ + FUNC(intra_pred)(lc, pps, x0, y0, size, c_idx); \ } INTRA_PRED(2) diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/ps.c b/src/ExtLib/ffmpeg/libavcodec/hevc/ps.c index a3c2bde4c4..303cb192a4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/ps.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/ps.c @@ -61,13 +61,6 @@ static const uint8_t hevc_sub_height_c[] = { 1, 2, 1, 1 }; -static void remove_pps(HEVCParamSets *s, int id) -{ - if (s->pps == s->pps_list[id]) - s->pps = NULL; - ff_refstruct_unref(&s->pps_list[id]); -} - static void remove_sps(HEVCParamSets *s, int id) { int i; @@ -78,7 +71,7 @@ static void remove_sps(HEVCParamSets *s, int id) /* drop all PPS that depend on this SPS */ for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++) if (s->pps_list[i] && s->pps_list[i]->sps_id == id) - remove_pps(s, i); + ff_refstruct_unref(&s->pps_list[i]); av_assert0(!(s->sps_list[id] && s->sps == s->sps_list[id])); ff_refstruct_unref(&s->sps_list[id]); @@ -889,10 +882,13 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, sps->vps_id = get_bits(gb, 4); - if (vps_list && !vps_list[sps->vps_id]) { - av_log(avctx, AV_LOG_ERROR, "VPS %d does not exist\n", - sps->vps_id); - return AVERROR_INVALIDDATA; + if (vps_list) { + if (!vps_list[sps->vps_id]) { + av_log(avctx, AV_LOG_ERROR, "VPS %d does not exist\n", + sps->vps_id); + return AVERROR_INVALIDDATA; + } + sps->vps = ff_refstruct_ref_c(vps_list[sps->vps_id]); } sps->max_sub_layers = get_bits(gb, 3) + 1; @@ -1262,8 +1258,8 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, sps->qp_bd_offset = 6 * (sps->bit_depth - 8); - if (av_mod_uintp2(sps->width, sps->log2_min_cb_size) || - av_mod_uintp2(sps->height, sps->log2_min_cb_size)) { + if (av_zero_extend(sps->width, sps->log2_min_cb_size) || + av_zero_extend(sps->height, sps->log2_min_cb_size)) { av_log(avctx, AV_LOG_ERROR, "Invalid coded frame dimensions.\n"); return AVERROR_INVALIDDATA; } @@ -1300,6 +1296,8 @@ static void hevc_sps_free(FFRefStructOpaque opaque, void *obj) { HEVCSPS *sps = obj; + ff_refstruct_unref(&sps->vps); + av_freep(&sps->data); } @@ -1365,6 +1363,8 @@ static void hevc_pps_free(FFRefStructOpaque unused, void *obj) { HEVCPPS *pps = obj; + ff_refstruct_unref(&pps->sps); + av_freep(&pps->column_width); av_freep(&pps->row_height); av_freep(&pps->col_bd); @@ -1830,6 +1830,8 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, sps = ps->sps_list[pps->sps_id]; vps = ps->vps_list[sps->vps_id]; + pps->sps = ff_refstruct_ref_c(sps); + pps->dependent_slice_segments_enabled_flag = get_bits1(gb); pps->output_flag_present_flag = get_bits1(gb); pps->num_extra_slice_header_bits = get_bits(gb, 3); @@ -2028,7 +2030,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, "Overread PPS by %d bits\n", -get_bits_left(gb)); } - remove_pps(ps, pps_id); + ff_refstruct_unref(&ps->pps_list[pps_id]); ps->pps_list[pps_id] = pps; return 0; @@ -2050,7 +2052,6 @@ void ff_hevc_ps_uninit(HEVCParamSets *ps) ff_refstruct_unref(&ps->pps_list[i]); ps->sps = NULL; - ps->pps = NULL; ps->vps = NULL; } diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/ps.h b/src/ExtLib/ffmpeg/libavcodec/hevc/ps.h index d299885df0..aa33ac438b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/ps.h +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/ps.h @@ -302,6 +302,8 @@ typedef struct HEVCSPS { uint8_t *data; int data_size; + + const HEVCVPS *vps; ///< RefStruct reference } HEVCSPS; typedef struct HEVCPPS { @@ -437,6 +439,8 @@ typedef struct HEVCPPS { uint8_t *data; int data_size; + + const HEVCSPS *sps; ///< RefStruct reference } HEVCPPS; typedef struct HEVCParamSets { @@ -447,7 +451,6 @@ typedef struct HEVCParamSets { /* currently active parameter sets */ const HEVCVPS *vps; const HEVCSPS *sps; - const HEVCPPS *pps; } HEVCParamSets; /** diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/refs.c b/src/ExtLib/ffmpeg/libavcodec/hevc/refs.c index 39ce70ca39..48fc4d27da 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/refs.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/refs.c @@ -54,7 +54,7 @@ const RefPicList *ff_hevc_get_ref_list(const HEVCContext *s, int x_cb = x0 >> s->ps.sps->log2_ctb_size; int y_cb = y0 >> s->ps.sps->log2_ctb_size; int pic_width_cb = s->ps.sps->ctb_width; - int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb]; + int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb]; return &ref->rpl_tab[ctb_addr_ts]->refPicList[0]; } @@ -283,7 +283,7 @@ static int init_slice_rpl(HEVCContext *s) { HEVCFrame *frame = s->cur_frame; int ctb_count = frame->ctb_count; - int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr]; + int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr]; int i; if (s->slice_idx >= frame->nb_rpl_elems) @@ -310,7 +310,7 @@ int ff_hevc_slice_rpl(HEVCContext *s) return ret; if (!(s->rps[ST_CURR_BEF].nb_refs + s->rps[ST_CURR_AFT].nb_refs + - s->rps[LT_CURR].nb_refs) && !s->ps.pps->pps_curr_pic_ref_enabled_flag) { + s->rps[LT_CURR].nb_refs) && !s->pps->pps_curr_pic_ref_enabled_flag) { av_log(s->avctx, AV_LOG_ERROR, "Zero refs in the frame RPS.\n"); return AVERROR_INVALIDDATA; } @@ -338,7 +338,7 @@ int ff_hevc_slice_rpl(HEVCContext *s) } } // Construct RefPicList0, RefPicList1 (8-8, 8-10) - if (s->ps.pps->pps_curr_pic_ref_enabled_flag && rpl_tmp.nb_refs < HEVC_MAX_REFS) { + if (s->pps->pps_curr_pic_ref_enabled_flag && rpl_tmp.nb_refs < HEVC_MAX_REFS) { rpl_tmp.list[rpl_tmp.nb_refs] = s->cur_frame->poc; rpl_tmp.ref[rpl_tmp.nb_refs] = s->cur_frame; rpl_tmp.isLongTerm[rpl_tmp.nb_refs] = 1; @@ -367,7 +367,7 @@ int ff_hevc_slice_rpl(HEVCContext *s) } // 8-9 - if (s->ps.pps->pps_curr_pic_ref_enabled_flag && + if (s->pps->pps_curr_pic_ref_enabled_flag && !sh->rpl_modification_flag[list_idx] && rpl_tmp.nb_refs > sh->nb_refs[L0]) { rpl->list[sh->nb_refs[L0] - 1] = s->cur_frame->poc; @@ -435,7 +435,7 @@ static HEVCFrame *generate_missing_ref(HEVCContext *s, int poc) frame->sequence = HEVC_SEQUENCE_COUNTER_INVALID; frame->flags = 0; - if (s->threads_type == FF_THREAD_FRAME) + if (s->avctx->active_thread_type == FF_THREAD_FRAME) ff_progress_frame_report(&frame->tf, INT_MAX); return frame; @@ -526,12 +526,12 @@ int ff_hevc_frame_rps(HEVCContext *s) return ret; } -int ff_hevc_frame_nb_refs(const HEVCContext *s) +int ff_hevc_frame_nb_refs(const SliceHeader *sh, const HEVCPPS *pps) { int ret = 0; int i; - const ShortTermRPS *rps = s->sh.short_term_rps; - const LongTermRPS *long_rps = &s->sh.long_term_rps; + const ShortTermRPS *rps = sh->short_term_rps; + const LongTermRPS *long_rps = &sh->long_term_rps; if (rps) { for (i = 0; i < rps->num_negative_pics; i++) @@ -545,7 +545,7 @@ int ff_hevc_frame_nb_refs(const HEVCContext *s) ret += !!long_rps->used[i]; } - if (s->ps.pps->pps_curr_pic_ref_enabled_flag) + if (pps->pps_curr_pic_ref_enabled_flag) ret++; return ret; diff --git a/src/ExtLib/ffmpeg/libavcodec/hpeldsp.c b/src/ExtLib/ffmpeg/libavcodec/hpeldsp.c index cd62f53475..27269969fd 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hpeldsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/hpeldsp.c @@ -357,8 +357,6 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags) #if ARCH_AARCH64 ff_hpeldsp_init_aarch64(c, flags); -#elif ARCH_ALPHA - ff_hpeldsp_init_alpha(c, flags); #elif ARCH_ARM ff_hpeldsp_init_arm(c, flags); #elif ARCH_PPC diff --git a/src/ExtLib/ffmpeg/libavcodec/idctdsp.c b/src/ExtLib/ffmpeg/libavcodec/idctdsp.c index 0a6bcfb8d1..e48382b740 100644 --- a/src/ExtLib/ffmpeg/libavcodec/idctdsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/idctdsp.c @@ -294,8 +294,6 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx) #if ARCH_AARCH64 ff_idctdsp_init_aarch64(c, avctx, high_bit_depth); -#elif ARCH_ALPHA - ff_idctdsp_init_alpha(c, avctx, high_bit_depth); #elif ARCH_ARM ff_idctdsp_init_arm(c, avctx, high_bit_depth); #elif ARCH_PPC diff --git a/src/ExtLib/ffmpeg/libavcodec/intelh263dec.c b/src/ExtLib/ffmpeg/libavcodec/intelh263dec.c index 5d34892ef7..4efae7938c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/intelh263dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/intelh263dec.c @@ -132,8 +132,9 @@ const FFCodec ff_h263i_decoder = { .p.id = AV_CODEC_ID_H263I, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, }; diff --git a/src/ExtLib/ffmpeg/libavcodec/intrax8.c b/src/ExtLib/ffmpeg/libavcodec/intrax8.c index 40085c69ce..f1dce86a50 100644 --- a/src/ExtLib/ffmpeg/libavcodec/intrax8.c +++ b/src/ExtLib/ffmpeg/libavcodec/intrax8.c @@ -730,7 +730,7 @@ av_cold void ff_intrax8_common_end(IntraX8Context *w) av_freep(&w->prediction_table); } -int ff_intrax8_decode_picture(IntraX8Context *w, Picture *pict, +int ff_intrax8_decode_picture(IntraX8Context *w, MPVPicture *pict, GetBitContext *gb, int *mb_x, int *mb_y, int dquant, int quant_offset, int loopfilter, int lowdelay) diff --git a/src/ExtLib/ffmpeg/libavcodec/intrax8.h b/src/ExtLib/ffmpeg/libavcodec/intrax8.h index 8e22361f1f..b9f8c4250b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/intrax8.h +++ b/src/ExtLib/ffmpeg/libavcodec/intrax8.h @@ -106,7 +106,7 @@ void ff_intrax8_common_end(IntraX8Context *w); * @param quant_offset offset away from zero * @param loopfilter enable filter after decoding a block */ -int ff_intrax8_decode_picture(IntraX8Context *w, Picture *pict, +int ff_intrax8_decode_picture(IntraX8Context *w, MPVPicture *pict, GetBitContext *gb, int *mb_x, int *mb_y, int quant, int halfpq, int loopfilter, int lowdelay); diff --git a/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c b/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c index aeeda1cc42..0809048362 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c @@ -357,20 +357,20 @@ static void preview_obmc(MpegEncContext *s){ do{ if (get_bits1(&s->gb)) { /* skip mb */ - mot_val = s->current_picture.motion_val[0][s->block_index[0]]; + mot_val = s->cur_pic.motion_val[0][s->block_index[0]]; mot_val[0 ]= mot_val[2 ]= mot_val[0+stride]= mot_val[2+stride]= 0; mot_val[1 ]= mot_val[3 ]= mot_val[1+stride]= mot_val[3+stride]= 0; - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; goto end; } cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2); }while(cbpc == 20); if(cbpc & 4){ - s->current_picture.mb_type[xy] = MB_TYPE_INTRA; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; }else{ get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1); if (cbpc & 8) { @@ -382,7 +382,7 @@ static void preview_obmc(MpegEncContext *s){ } if ((cbpc & 16) == 0) { - s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; /* 16x16 motion prediction */ mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); if (s->umvplus) @@ -400,7 +400,7 @@ static void preview_obmc(MpegEncContext *s){ mot_val[1 ]= mot_val[3 ]= mot_val[1+stride]= mot_val[3+stride]= my; } else { - s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; for(i=0;i<4;i++) { mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); if (s->umvplus) @@ -534,7 +534,7 @@ static int h263_decode_block(MpegEncContext * s, int16_t * block, int n, int coded) { int level, i, j, run; - RLTable *rl = &ff_h263_rl_inter; + const RLTable *rl = &ff_h263_rl_inter; const uint8_t *scan_table; GetBitContext gb= s->gb; @@ -719,7 +719,7 @@ static int h263_get_modb(GetBitContext *gb, int pb_frame, int *cbpb) #define tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0])) #define tab_bias (tab_size / 2) -static inline void set_one_direct_mv(MpegEncContext *s, Picture *p, int i) +static inline void set_one_direct_mv(MpegEncContext *s, const MPVPicture *p, int i) { int xy = s->block_index[i]; uint16_t time_pp = s->pp_time; @@ -750,12 +750,12 @@ static inline void set_one_direct_mv(MpegEncContext *s, Picture *p, int i) static int set_direct_mv(MpegEncContext *s) { const int mb_index = s->mb_x + s->mb_y * s->mb_stride; - Picture *p = &s->next_picture; + const MPVPicture *p = s->next_pic.ptr; int colocated_mb_type = p->mb_type[mb_index]; int i; if (s->codec_tag == AV_RL32("U263") && p->f->pict_type == AV_PICTURE_TYPE_I) { - p = &s->last_picture; + p = s->last_pic.ptr; colocated_mb_type = p->mb_type[mb_index]; } @@ -803,7 +803,7 @@ int ff_h263_decode_mb(MpegEncContext *s, s->block_last_index[i] = -1; s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; s->mb_skipped = !(s->obmc | s->loop_filter); @@ -841,7 +841,7 @@ int ff_h263_decode_mb(MpegEncContext *s, s->mv_dir = MV_DIR_FORWARD; if ((cbpc & 16) == 0) { - s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; /* 16x16 motion prediction */ s->mv_type = MV_TYPE_16X16; ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); @@ -866,7 +866,7 @@ int ff_h263_decode_mb(MpegEncContext *s, if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ } else { - s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; s->mv_type = MV_TYPE_8X8; for(i=0;i<4;i++) { mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); @@ -894,8 +894,8 @@ int ff_h263_decode_mb(MpegEncContext *s, } else if(s->pict_type==AV_PICTURE_TYPE_B) { int mb_type; const int stride= s->b8_stride; - int16_t *mot_val0 = s->current_picture.motion_val[0][2 * (s->mb_x + s->mb_y * stride)]; - int16_t *mot_val1 = s->current_picture.motion_val[1][2 * (s->mb_x + s->mb_y * stride)]; + int16_t *mot_val0 = s->cur_pic.motion_val[0][2 * (s->mb_x + s->mb_y * stride)]; + int16_t *mot_val1 = s->cur_pic.motion_val[1][2 * (s->mb_x + s->mb_y * stride)]; // const int mv_xy= s->mb_x + 1 + s->mb_y * s->mb_stride; //FIXME ugly @@ -1007,7 +1007,7 @@ int ff_h263_decode_mb(MpegEncContext *s, } } - s->current_picture.mb_type[xy] = mb_type; + s->cur_pic.mb_type[xy] = mb_type; } else { /* I-Frame */ do{ cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 2); @@ -1022,11 +1022,11 @@ int ff_h263_decode_mb(MpegEncContext *s, dquant = cbpc & 4; s->mb_intra = 1; intra: - s->current_picture.mb_type[xy] = MB_TYPE_INTRA; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; if (s->h263_aic) { s->ac_pred = get_bits1(&s->gb); if(s->ac_pred){ - s->current_picture.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; s->h263_aic_dir = get_bits1(&s->gb); } diff --git a/src/ExtLib/ffmpeg/libavcodec/me_cmp.c b/src/ExtLib/ffmpeg/libavcodec/me_cmp.c index db3fb1260c..fe39009093 100644 --- a/src/ExtLib/ffmpeg/libavcodec/me_cmp.c +++ b/src/ExtLib/ffmpeg/libavcodec/me_cmp.c @@ -751,7 +751,7 @@ static int quant_psnr8x8_c(MpegEncContext *s, const uint8_t *src1, memcpy(bak, temp, 64 * sizeof(int16_t)); s->block_last_index[0 /* FIXME */] = - s->fast_dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i); + s->dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i); s->dct_unquantize_inter(s, temp, 0, s->qscale); ff_simple_idct_int16_8bit(temp); // FIXME @@ -779,7 +779,7 @@ static int rd8x8_c(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, s->block_last_index[0 /* FIXME */] = last = - s->fast_dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i); + s->dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i); bits = 0; @@ -849,7 +849,7 @@ static int bit8x8_c(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, s->block_last_index[0 /* FIXME */] = last = - s->fast_dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i); + s->dct_quantize(s, temp, 0 /* FIXME */, s->qscale, &i); bits = 0; @@ -1058,8 +1058,6 @@ av_cold void ff_me_cmp_init(MECmpContext *c, AVCodecContext *avctx) #if ARCH_AARCH64 ff_me_cmp_init_aarch64(c, avctx); -#elif ARCH_ALPHA - ff_me_cmp_init_alpha(c, avctx); #elif ARCH_ARM ff_me_cmp_init_arm(c, avctx); #elif ARCH_PPC diff --git a/src/ExtLib/ffmpeg/libavcodec/motion_est.c b/src/ExtLib/ffmpeg/libavcodec/motion_est.c index fb569ede8a..162472d693 100644 --- a/src/ExtLib/ffmpeg/libavcodec/motion_est.c +++ b/src/ExtLib/ffmpeg/libavcodec/motion_est.c @@ -510,16 +510,16 @@ static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my, int mv4) if(mv4){ int mot_xy= s->block_index[0]; - s->current_picture.motion_val[0][mot_xy ][0] = mx; - s->current_picture.motion_val[0][mot_xy ][1] = my; - s->current_picture.motion_val[0][mot_xy + 1][0] = mx; - s->current_picture.motion_val[0][mot_xy + 1][1] = my; + s->cur_pic.motion_val[0][mot_xy ][0] = mx; + s->cur_pic.motion_val[0][mot_xy ][1] = my; + s->cur_pic.motion_val[0][mot_xy + 1][0] = mx; + s->cur_pic.motion_val[0][mot_xy + 1][1] = my; mot_xy += s->b8_stride; - s->current_picture.motion_val[0][mot_xy ][0] = mx; - s->current_picture.motion_val[0][mot_xy ][1] = my; - s->current_picture.motion_val[0][mot_xy + 1][0] = mx; - s->current_picture.motion_val[0][mot_xy + 1][1] = my; + s->cur_pic.motion_val[0][mot_xy ][0] = mx; + s->cur_pic.motion_val[0][mot_xy ][1] = my; + s->cur_pic.motion_val[0][mot_xy + 1][0] = mx; + s->cur_pic.motion_val[0][mot_xy + 1][1] = my; } } @@ -601,8 +601,8 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) c->ymax = - 16*s->mb_y + s->height - 8*(block>>1); } - P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0]; - P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1]; + P_LEFT[0] = s->cur_pic.motion_val[0][mot_xy - 1][0]; + P_LEFT[1] = s->cur_pic.motion_val[0][mot_xy - 1][1]; if (P_LEFT[0] > c->xmax * (1 << shift)) P_LEFT[0] = c->xmax * (1 << shift); @@ -611,10 +611,10 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) c->pred_x= pred_x4= P_LEFT[0]; c->pred_y= pred_y4= P_LEFT[1]; } else { - P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0]; - P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1]; - P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][0]; - P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][1]; + P_TOP[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][0]; + P_TOP[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][1]; + P_TOPRIGHT[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride + off[block]][0]; + P_TOPRIGHT[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride + off[block]][1]; if (P_TOP[1] > c->ymax * (1 << shift)) P_TOP[1] = c->ymax * (1 << shift); if (P_TOPRIGHT[0] < c->xmin * (1 << shift)) P_TOPRIGHT[0] = c->xmin * (1 << shift); if (P_TOPRIGHT[0] > c->xmax * (1 << shift)) P_TOPRIGHT[0] = c->xmax * (1 << shift); @@ -675,8 +675,8 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) my4_sum+= my4; } - s->current_picture.motion_val[0][s->block_index[block]][0] = mx4; - s->current_picture.motion_val[0][s->block_index[block]][1] = my4; + s->cur_pic.motion_val[0][s->block_index[block]][0] = mx4; + s->cur_pic.motion_val[0][s->block_index[block]][1] = my4; if(mx4 != mx || my4 != my) same=0; } @@ -686,7 +686,7 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) if (s->mecc.me_sub_cmp[0] != s->mecc.mb_cmp[0]) { dmin_sum += s->mecc.mb_cmp[0](s, - s->new_picture->data[0] + + s->new_pic->data[0] + s->mb_x * 16 + s->mb_y * 16 * stride, c->scratchpad, stride, 16); } @@ -703,15 +703,15 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) offset= (s->mb_x*8 + (mx>>1)) + (s->mb_y*8 + (my>>1))*s->uvlinesize; if(s->no_rounding){ - s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.f->data[1] + offset, s->uvlinesize, 8); - s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_picture.f->data[2] + offset, s->uvlinesize, 8); + s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_pic.data[1] + offset, s->uvlinesize, 8); + s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_pic.data[2] + offset, s->uvlinesize, 8); }else{ - s->hdsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_picture.f->data[1] + offset, s->uvlinesize, 8); - s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_picture.f->data[2] + offset, s->uvlinesize, 8); + s->hdsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_pic.data[1] + offset, s->uvlinesize, 8); + s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_pic.data[2] + offset, s->uvlinesize, 8); } - dmin_sum += s->mecc.mb_cmp[1](s, s->new_picture->data[1] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad, s->uvlinesize, 8); - dmin_sum += s->mecc.mb_cmp[1](s, s->new_picture->data[2] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad + 8, s->uvlinesize, 8); + dmin_sum += s->mecc.mb_cmp[1](s, s->new_pic->data[1] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad, s->uvlinesize, 8); + dmin_sum += s->mecc.mb_cmp[1](s, s->new_pic->data[2] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad + 8, s->uvlinesize, 8); } c->pred_x= mx; @@ -899,7 +899,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, const int shift= 1+s->quarter_sample; int mb_type=0; - init_ref(c, s->new_picture->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0); + init_ref(c, s->new_pic->data, s->last_pic.data, NULL, 16*mb_x, 16*mb_y, 0); av_assert0(s->quarter_sample==0 || s->quarter_sample==1); av_assert0(s->linesize == c->stride); @@ -927,17 +927,17 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, const int mot_stride = s->b8_stride; const int mot_xy = s->block_index[0]; - P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0]; - P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1]; + P_LEFT[0] = s->cur_pic.motion_val[0][mot_xy - 1][0]; + P_LEFT[1] = s->cur_pic.motion_val[0][mot_xy - 1][1]; if (P_LEFT[0] > (c->xmax << shift)) P_LEFT[0] = c->xmax << shift; if (!s->first_slice_line) { - P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0]; - P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1]; - P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][0]; - P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1]; + P_TOP[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][0]; + P_TOP[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][1]; + P_TOPRIGHT[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride + 2][0]; + P_TOPRIGHT[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride + 2][1]; if (P_TOP[1] > (c->ymax << shift)) P_TOP[1] = c->ymax << shift; if (P_TOPRIGHT[0] < (c->xmin * (1 << shift))) @@ -1048,9 +1048,9 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, if(intra_score < dmin){ mb_type= CANDIDATE_MB_TYPE_INTRA; - s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = CANDIDATE_MB_TYPE_INTRA; //FIXME cleanup + s->cur_pic.mb_type[mb_y*s->mb_stride + mb_x] = CANDIDATE_MB_TYPE_INTRA; //FIXME cleanup }else - s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = 0; + s->cur_pic.mb_type[mb_y*s->mb_stride + mb_x] = 0; { int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100); @@ -1070,7 +1070,7 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int P[10][2]; const int shift= 1+s->quarter_sample; const int xy= mb_x + mb_y*s->mb_stride; - init_ref(c, s->new_picture->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0); + init_ref(c, s->new_pic->data, s->last_pic.data, NULL, 16*mb_x, 16*mb_y, 0); av_assert0(s->quarter_sample==0 || s->quarter_sample==1); @@ -1403,7 +1403,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) ymin= xmin=(-32)>>shift; ymax= xmax= 31>>shift; - if (IS_8X8(s->next_picture.mb_type[mot_xy])) { + if (IS_8X8(s->next_pic.mb_type[mot_xy])) { s->mv_type= MV_TYPE_8X8; }else{ s->mv_type= MV_TYPE_16X16; @@ -1413,8 +1413,8 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) int index= s->block_index[i]; int min, max; - c->co_located_mv[i][0] = s->next_picture.motion_val[0][index][0]; - c->co_located_mv[i][1] = s->next_picture.motion_val[0][index][1]; + c->co_located_mv[i][0] = s->next_pic.motion_val[0][index][0]; + c->co_located_mv[i][1] = s->next_pic.motion_val[0][index][1]; c->direct_basis_mv[i][0]= c->co_located_mv[i][0]*time_pb/time_pp + ((i& 1)<<(shift+3)); c->direct_basis_mv[i][1]= c->co_located_mv[i][1]*time_pb/time_pp + ((i>>1)<<(shift+3)); // c->direct_basis_mv[1][i][0]= c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(shift+3); @@ -1495,14 +1495,14 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, int fmin, bmin, dmin, fbmin, bimin, fimin; int type=0; const int xy = mb_y*s->mb_stride + mb_x; - init_ref(c, s->new_picture->data, s->last_picture.f->data, - s->next_picture.f->data, 16 * mb_x, 16 * mb_y, 2); + init_ref(c, s->new_pic->data, s->last_pic.data, + s->next_pic.data, 16 * mb_x, 16 * mb_y, 2); get_limits(s, 16*mb_x, 16*mb_y); c->skip=0; - if (s->codec_id == AV_CODEC_ID_MPEG4 && s->next_picture.mbskip_table[xy]) { + if (s->codec_id == AV_CODEC_ID_MPEG4 && s->next_pic.mbskip_table[xy]) { int score= direct_search(s, mb_x, mb_y); //FIXME just check 0,0 score= ((unsigned)(score*score + 128*256))>>16; @@ -1609,7 +1609,7 @@ int ff_get_best_fcode(MpegEncContext * s, const int16_t (*mv_table)[2], int type int best_fcode=-1; int best_score=-10000000; - if(s->msmpeg4_version) + if (s->msmpeg4_version != MSMP4_UNUSED) range= FFMIN(range, 16); else if(s->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) range= FFMIN(range, 256); @@ -1660,9 +1660,9 @@ void ff_fix_long_p_mvs(MpegEncContext * s, int type) int y, range; av_assert0(s->pict_type==AV_PICTURE_TYPE_P); - range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code); + range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version != MSMP4_UNUSED) ? 8 : 16) << f_code); - av_assert0(range <= 16 || !s->msmpeg4_version); + av_assert0(range <= 16 || s->msmpeg4_version == MSMP4_UNUSED); av_assert0(range <=256 || !(s->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL)); if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range; @@ -1681,14 +1681,14 @@ void ff_fix_long_p_mvs(MpegEncContext * s, int type) int block; for(block=0; block<4; block++){ int off= (block& 1) + (block>>1)*wrap; - int mx = s->current_picture.motion_val[0][ xy + off ][0]; - int my = s->current_picture.motion_val[0][ xy + off ][1]; + int mx = s->cur_pic.motion_val[0][ xy + off ][0]; + int my = s->cur_pic.motion_val[0][ xy + off ][1]; if( mx >=range || mx <-range || my >=range || my <-range){ s->mb_type[i] &= ~CANDIDATE_MB_TYPE_INTER4V; s->mb_type[i] |= type; - s->current_picture.mb_type[i] = type; + s->cur_pic.mb_type[i] = type; } } } @@ -1709,7 +1709,7 @@ void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_ int y, h_range, v_range; // RAL: 8 in MPEG-1, 16 in MPEG-4 - int range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code); + int range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version != MSMP4_UNUSED) ? 8 : 16) << f_code); if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c index e869f6b0eb..28f95dd853 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c @@ -165,7 +165,7 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; - uint8_t *const scantable = s->intra_scantable.permutated; + const uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix = s->inter_matrix; const int qscale = s->qscale; @@ -249,7 +249,7 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; - uint8_t *const scantable = s->intra_scantable.permutated; + const uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; int mismatch; @@ -336,7 +336,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, int level, dc, diff, i, j, run; int component; const RL_VLC_ELEM *rl_vlc; - uint8_t *const scantable = s->intra_scantable.permutated; + const uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; int mismatch; @@ -442,21 +442,21 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) if (s->mb_skip_run-- != 0) { if (s->pict_type == AV_PICTURE_TYPE_P) { s->mb_skipped = 1; - s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = + s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride] = MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16; } else { int mb_type; if (s->mb_x) - mb_type = s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride - 1]; + mb_type = s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride - 1]; else // FIXME not sure if this is allowed in MPEG at all - mb_type = s->current_picture.mb_type[s->mb_width + (s->mb_y - 1) * s->mb_stride - 1]; + mb_type = s->cur_pic.mb_type[s->mb_width + (s->mb_y - 1) * s->mb_stride - 1]; if (IS_INTRA(mb_type)) { av_log(s->avctx, AV_LOG_ERROR, "skip with previntra\n"); return AVERROR_INVALIDDATA; } - s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = + s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride] = mb_type | MB_TYPE_SKIP; if ((s->mv[0][0][0] | s->mv[0][0][1] | s->mv[1][0][0] | s->mv[1][0][1]) == 0) @@ -540,14 +540,14 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) { for (i = 0; i < mb_block_count; i++) - if ((ret = mpeg2_decode_block_intra(s, *s->pblocks[i], i)) < 0) + if ((ret = mpeg2_decode_block_intra(s, s->block[i], i)) < 0) return ret; } else { for (i = 0; i < 6; i++) { ret = ff_mpeg1_decode_block_intra(&s->gb, s->intra_matrix, s->intra_scantable.permutated, - s->last_dc, *s->pblocks[i], + s->last_dc, s->block[i], i, s->qscale); if (ret < 0) { av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", @@ -765,7 +765,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) for (i = 0; i < mb_block_count; i++) { if (cbp & (1 << 11)) { - if ((ret = mpeg2_decode_block_non_intra(s, *s->pblocks[i], i)) < 0) + if ((ret = mpeg2_decode_block_non_intra(s, s->block[i], i)) < 0) return ret; } else { s->block_last_index[i] = -1; @@ -775,7 +775,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) } else { for (i = 0; i < 6; i++) { if (cbp & 32) { - if ((ret = mpeg1_decode_block_inter(s, *s->pblocks[i], i)) < 0) + if ((ret = mpeg1_decode_block_inter(s, s->block[i], i)) < 0) return ret; } else { s->block_last_index[i] = -1; @@ -789,7 +789,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) } } - s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = mb_type; + s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride] = mb_type; return 0; } @@ -798,6 +798,9 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx) { Mpeg1Context *s = avctx->priv_data; MpegEncContext *s2 = &s->mpeg_enc_ctx; + int ret; + + s2->out_format = FMT_MPEG1; // ==> Start patch MPC /* @@ -806,7 +809,9 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx) avctx->coded_width = avctx->coded_height = 0; // do not trust dimensions from input */ // ==> End patch MPC - ff_mpv_decode_init(s2, avctx); + ret = ff_mpv_decode_init(s2, avctx); + if (ret < 0) + return ret; ff_mpeg12_init_vlcs(); @@ -1281,13 +1286,10 @@ static int mpeg_decode_picture_coding_extension(Mpeg1Context *s1) s->chroma_420_type = get_bits1(&s->gb); s->progressive_frame = get_bits1(&s->gb); - if (s->alternate_scan) { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); - } else { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - } + // We only initialize intra_scantable, as both scantables always coincide + // and all code therefore only uses the intra one. + ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, + s->alternate_scan ? ff_alternate_vertical_scan : ff_zigzag_direct); /* composite display not parsed */ ff_dlog(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision); @@ -1303,10 +1305,11 @@ static int mpeg_decode_picture_coding_extension(Mpeg1Context *s1) return 0; } -static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) +static int mpeg_field_start(Mpeg1Context *s1, const uint8_t *buf, int buf_size) { + MpegEncContext *s = &s1->mpeg_enc_ctx; AVCodecContext *avctx = s->avctx; - Mpeg1Context *s1 = (Mpeg1Context *) s; + int second_field = 0; int ret; if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) { @@ -1322,36 +1325,36 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) return ret; if (s->picture_structure != PICT_FRAME) { - s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * - (s->picture_structure == PICT_TOP_FIELD); + s->cur_pic.ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * + (s->picture_structure == PICT_TOP_FIELD); for (int i = 0; i < 3; i++) { if (s->picture_structure == PICT_BOTTOM_FIELD) { - s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i], - s->current_picture.f->linesize[i]); + s->cur_pic.data[i] = FF_PTR_ADD(s->cur_pic.data[i], + s->cur_pic.linesize[i]); } - s->current_picture.f->linesize[i] *= 2; - s->last_picture.f->linesize[i] *= 2; - s->next_picture.f->linesize[i] *= 2; + s->cur_pic.linesize[i] *= 2; + s->last_pic.linesize[i] *= 2; + s->next_pic.linesize[i] *= 2; } } ff_mpeg_er_frame_start(s); /* first check if we must repeat the frame */ - s->current_picture_ptr->f->repeat_pict = 0; + s->cur_pic.ptr->f->repeat_pict = 0; if (s->repeat_first_field) { if (s->progressive_sequence) { if (s->top_field_first) - s->current_picture_ptr->f->repeat_pict = 4; + s->cur_pic.ptr->f->repeat_pict = 4; else - s->current_picture_ptr->f->repeat_pict = 2; + s->cur_pic.ptr->f->repeat_pict = 2; } else if (s->progressive_frame) { - s->current_picture_ptr->f->repeat_pict = 1; + s->cur_pic.ptr->f->repeat_pict = 1; } } - ret = ff_frame_new_side_data(s->avctx, s->current_picture_ptr->f, + ret = ff_frame_new_side_data(s->avctx, s->cur_pic.ptr->f, AV_FRAME_DATA_PANSCAN, sizeof(s1->pan_scan), &pan_scan); if (ret < 0) @@ -1361,14 +1364,14 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) if (s1->a53_buf_ref) { ret = ff_frame_new_side_data_from_buf( - s->avctx, s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC, + s->avctx, s->cur_pic.ptr->f, AV_FRAME_DATA_A53_CC, &s1->a53_buf_ref, NULL); if (ret < 0) return ret; } if (s1->has_stereo3d) { - AVStereo3D *stereo = av_stereo3d_create_side_data(s->current_picture_ptr->f); + AVStereo3D *stereo = av_stereo3d_create_side_data(s->cur_pic.ptr->f); if (!stereo) return AVERROR(ENOMEM); @@ -1378,7 +1381,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) if (s1->has_afd) { AVFrameSideData *sd; - ret = ff_frame_new_side_data(s->avctx, s->current_picture_ptr->f, + ret = ff_frame_new_side_data(s->avctx, s->cur_pic.ptr->f, AV_FRAME_DATA_AFD, 1, &sd); if (ret < 0) return ret; @@ -1390,7 +1393,8 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME)) ff_thread_finish_setup(avctx); } else { // second field - if (!s->current_picture_ptr) { + second_field = 1; + if (!s->cur_pic.ptr) { av_log(s->avctx, AV_LOG_ERROR, "first field missing\n"); return AVERROR_INVALIDDATA; } @@ -1402,18 +1406,31 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) return ret; } } + ret = ff_mpv_alloc_dummy_frames(s); + if (ret < 0) + return ret; for (int i = 0; i < 3; i++) { - s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i]; + s->cur_pic.data[i] = s->cur_pic.ptr->f->data[i]; if (s->picture_structure == PICT_BOTTOM_FIELD) - s->current_picture.f->data[i] += - s->current_picture_ptr->f->linesize[i]; + s->cur_pic.data[i] += + s->cur_pic.ptr->f->linesize[i]; } } if (avctx->hwaccel) { if ((ret = FF_HW_CALL(avctx, start_frame, buf, buf_size)) < 0) return ret; + } else if (s->codec_tag == MKTAG('V', 'C', 'R', '2')) { + // Exchange UV + FFSWAP(uint8_t*, s->cur_pic.data[1], s->cur_pic.data[2]); + FFSWAP(ptrdiff_t, s->cur_pic.linesize[1], s->cur_pic.linesize[2]); + if (!second_field) { + FFSWAP(uint8_t*, s->next_pic.data[1], s->next_pic.data[2]); + FFSWAP(ptrdiff_t, s->next_pic.linesize[1], s->next_pic.linesize[2]); + FFSWAP(uint8_t*, s->last_pic.data[1], s->last_pic.data[2]); + FFSWAP(ptrdiff_t, s->last_pic.linesize[1], s->last_pic.linesize[2]); + } } return 0; @@ -1534,7 +1551,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, return ret; // Note motion_val is normally NULL unless we want to extract the MVs. - if (s->current_picture.motion_val[0]) { + if (s->cur_pic.motion_val[0]) { const int wrap = s->b8_stride; int xy = s->mb_x * 2 + s->mb_y * 2 * wrap; int b8_xy = 4 * (s->mb_x + s->mb_y * s->mb_stride); @@ -1554,12 +1571,12 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, motion_y = s->mv[dir][i][1]; } - s->current_picture.motion_val[dir][xy][0] = motion_x; - s->current_picture.motion_val[dir][xy][1] = motion_y; - s->current_picture.motion_val[dir][xy + 1][0] = motion_x; - s->current_picture.motion_val[dir][xy + 1][1] = motion_y; - s->current_picture.ref_index [dir][b8_xy] = - s->current_picture.ref_index [dir][b8_xy + 1] = s->field_select[dir][i]; + s->cur_pic.motion_val[dir][xy][0] = motion_x; + s->cur_pic.motion_val[dir][xy][1] = motion_y; + s->cur_pic.motion_val[dir][xy + 1][0] = motion_x; + s->cur_pic.motion_val[dir][xy + 1][1] = motion_y; + s->cur_pic.ref_index [dir][b8_xy] = + s->cur_pic.ref_index [dir][b8_xy + 1] = s->field_select[dir][i]; av_assert2(s->field_select[dir][i] == 0 || s->field_select[dir][i] == 1); } @@ -1757,12 +1774,12 @@ static int slice_decode_thread(AVCodecContext *c, void *arg) * Handle slice ends. * @return 1 if it seems to be the last slice */ -static int slice_end(AVCodecContext *avctx, AVFrame *pict) +static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output) { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; - if (!s->context_initialized || !s->current_picture_ptr) + if (!s->context_initialized || !s->cur_pic.ptr) return 0; if (s->avctx->hwaccel) { @@ -1783,19 +1800,21 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) ff_mpv_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { - int ret = av_frame_ref(pict, s->current_picture_ptr->f); + int ret = av_frame_ref(pict, s->cur_pic.ptr->f); if (ret < 0) return ret; - ff_print_debug_info(s, s->current_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG2); + ff_print_debug_info(s, s->cur_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict, s->cur_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG2); + *got_output = 1; } else { /* latency of 1 frame for I- and P-frames */ - if (s->last_picture_ptr) { - int ret = av_frame_ref(pict, s->last_picture_ptr->f); + if (s->last_pic.ptr && !s->last_pic.ptr->dummy) { + int ret = av_frame_ref(pict, s->last_pic.ptr->f); if (ret < 0) return ret; - ff_print_debug_info(s, s->last_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG2); + ff_print_debug_info(s, s->last_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict, s->last_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG2); + *got_output = 1; } } @@ -1884,7 +1903,6 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, s->chroma_format = 1; s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO; - s->out_format = FMT_MPEG1; if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) s->low_delay = 1; @@ -1902,7 +1920,6 @@ static int vcr2_init_sequence(AVCodecContext *avctx) int i, v, ret; /* start new MPEG-1 context decoding */ - s->out_format = FMT_MPEG1; if (s->context_initialized) ff_mpv_common_end(s); @@ -2236,14 +2253,9 @@ static int mpeg_decode_gop(AVCodecContext *avctx, s2->er.error_count += s2->thread_context[i]->er.error_count; } - ret = slice_end(avctx, picture); + ret = slice_end(avctx, picture, got_output); if (ret < 0) return ret; - else if (ret) { - // FIXME: merge with the stuff in mpeg_decode_slice - if (s2->last_picture_ptr || s2->low_delay || s2->pict_type == AV_PICTURE_TYPE_B) - *got_output = 1; - } } s2->pict_type = 0; @@ -2437,7 +2449,7 @@ static int mpeg_decode_gop(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - if (!s2->last_picture_ptr) { + if (!s2->last_pic.ptr) { /* Skip B-frames if we do not have reference frames and * GOP is not closed. */ if (s2->pict_type == AV_PICTURE_TYPE_B) { @@ -2451,7 +2463,7 @@ static int mpeg_decode_gop(AVCodecContext *avctx, } if (s2->pict_type == AV_PICTURE_TYPE_I || (s2->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL)) s->sync = 1; - if (!s2->next_picture_ptr) { + if (!s2->next_pic.ptr) { /* Skip P-frames if we do not have a reference frame or * we have an invalid header. */ if (s2->pict_type == AV_PICTURE_TYPE_P && !s->sync) { @@ -2489,10 +2501,10 @@ static int mpeg_decode_gop(AVCodecContext *avctx, if (s->first_slice) { skip_frame = 0; s->first_slice = 0; - if ((ret = mpeg_field_start(s2, buf, buf_size)) < 0) + if ((ret = mpeg_field_start(s, buf, buf_size)) < 0) return ret; } - if (!s2->current_picture_ptr) { + if (!s2->cur_pic.ptr) { av_log(avctx, AV_LOG_ERROR, "current_picture not initialized\n"); return AVERROR_INVALIDDATA; @@ -2556,12 +2568,12 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) { /* special case for last picture */ - if (s2->low_delay == 0 && s2->next_picture_ptr) { - int ret = av_frame_ref(picture, s2->next_picture_ptr->f); + if (s2->low_delay == 0 && s2->next_pic.ptr) { + int ret = av_frame_ref(picture, s2->next_pic.ptr->f); if (ret < 0) return ret; - s2->next_picture_ptr = NULL; + ff_mpv_unref_picture(&s2->next_pic); *got_output = 1; } @@ -2584,14 +2596,14 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, } s->extradata_decoded = 1; if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) { - s2->current_picture_ptr = NULL; + ff_mpv_unref_picture(&s2->cur_pic); return ret; } } ret = decode_chunks(avctx, picture, got_output, buf, buf_size); if (ret<0 || *got_output) { - s2->current_picture_ptr = NULL; + ff_mpv_unref_picture(&s2->cur_pic); if (s->timecode_frame_start != -1 && *got_output) { char tcbuf[AV_TIMECODE_STR_SIZE]; @@ -2627,9 +2639,8 @@ static av_cold int mpeg_decode_end(AVCodecContext *avctx) { Mpeg1Context *s = avctx->priv_data; - ff_mpv_common_end(&s->mpeg_enc_ctx); av_buffer_unref(&s->a53_buf_ref); - return 0; + return ff_mpv_decode_close(avctx); } const FFCodec ff_mpeg1video_decoder = { @@ -2783,13 +2794,8 @@ static int ipu_decode_frame(AVCodecContext *avctx, AVFrame *frame, m->intra_vlc_format = !!(s->flags & 0x20); m->alternate_scan = !!(s->flags & 0x10); - if (s->flags & 0x10) { - ff_init_scantable(m->idsp.idct_permutation, &m->inter_scantable, ff_alternate_vertical_scan); - ff_init_scantable(m->idsp.idct_permutation, &m->intra_scantable, ff_alternate_vertical_scan); - } else { - ff_init_scantable(m->idsp.idct_permutation, &m->inter_scantable, ff_zigzag_direct); - ff_init_scantable(m->idsp.idct_permutation, &m->intra_scantable, ff_zigzag_direct); - } + ff_init_scantable(m->idsp.idct_permutation, &m->intra_scantable, + s->flags & 0x10 ? ff_alternate_vertical_scan : ff_zigzag_direct); m->last_dc[0] = m->last_dc[1] = m->last_dc[2] = 1 << (7 + (s->flags & 3)); m->qscale = 1; @@ -2825,8 +2831,6 @@ static int ipu_decode_frame(AVCodecContext *avctx, AVFrame *frame, m->intra_scantable.permutated, m->last_dc, s->block[n], n, m->qscale); - if (ret >= 0) - m->block_last_index[n] = ret; } else { ret = mpeg2_decode_block_intra(m, s->block[n], n); } @@ -2865,8 +2869,9 @@ static av_cold int ipu_decode_init(AVCodecContext *avctx) MpegEncContext *m = &s->m; avctx->pix_fmt = AV_PIX_FMT_YUV420P; + m->avctx = avctx; - ff_mpv_decode_init(m, avctx); + ff_idctdsp_init(&m->idsp, avctx); ff_mpeg12_init_vlcs(); for (int i = 0; i < 64; i++) { @@ -2876,13 +2881,6 @@ static av_cold int ipu_decode_init(AVCodecContext *avctx) m->chroma_intra_matrix[j] = v; } - for (int i = 0; i < 64; i++) { - int j = m->idsp.idct_permutation[i]; - int v = ff_mpeg1_default_non_intra_matrix[i]; - m->inter_matrix[j] = v; - m->chroma_inter_matrix[j] = v; - } - return 0; } diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c b/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c index ffeaf822b2..7bbd412aa8 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c @@ -98,7 +98,7 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, uint16_t time_pb = s->pb_time; int p_mx, p_my; - p_mx = s->next_picture.motion_val[0][xy][0]; + p_mx = s->next_pic.motion_val[0][xy][0]; if ((unsigned)(p_mx + tab_bias) < tab_size) { s->mv[0][i][0] = s->direct_scale_mv[0][p_mx + tab_bias] + mx; s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx @@ -108,7 +108,7 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx : p_mx * (time_pb - time_pp) / time_pp; } - p_my = s->next_picture.motion_val[0][xy][1]; + p_my = s->next_pic.motion_val[0][xy][1]; if ((unsigned)(p_my + tab_bias) < tab_size) { s->mv[0][i][1] = s->direct_scale_mv[0][p_my + tab_bias] + my; s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my @@ -129,7 +129,7 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my) { const int mb_index = s->mb_x + s->mb_y * s->mb_stride; - const int colocated_mb_type = s->next_picture.mb_type[mb_index]; + const int colocated_mb_type = s->next_pic.mb_type[mb_index]; uint16_t time_pp; uint16_t time_pb; int i; @@ -145,7 +145,7 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my) } else if (IS_INTERLACED(colocated_mb_type)) { s->mv_type = MV_TYPE_FIELD; for (i = 0; i < 2; i++) { - int field_select = s->next_picture.ref_index[0][4 * mb_index + 2 * i]; + int field_select = s->next_pic.ref_index[0][4 * mb_index + 2 * i]; s->field_select[0][i] = field_select; s->field_select[1][i] = i; if (s->top_field_first) { diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c b/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c index df1e22207d..81f05bbb28 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c @@ -45,7 +45,7 @@ #include "internal.h" #include "profiles.h" #include "qpeldsp.h" -#include "threadframe.h" +#include "threadprogress.h" #include "xvididct.h" #include "unary.h" @@ -316,7 +316,7 @@ void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, int dir) { int i; int16_t *ac_val, *ac_val1; - int8_t *const qscale_table = s->current_picture.qscale_table; + int8_t *const qscale_table = s->cur_pic.qscale_table; /* find prediction */ ac_val = &s->ac_val[0][0][0] + s->block_index[n] * 16; @@ -970,13 +970,13 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) } while (cbpc == 8); s->cbp_table[xy] = cbpc & 3; - s->current_picture.mb_type[xy] = MB_TYPE_INTRA; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; s->mb_intra = 1; if (cbpc & 4) ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); - s->current_picture.qscale_table[xy] = s->qscale; + s->cur_pic.qscale_table[xy] = s->qscale; s->mbintra_table[xy] = 1; for (i = 0; i < 6; i++) { @@ -994,7 +994,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) s->pred_dir_table[xy] = dir; } else { /* P/S_TYPE */ int mx, my, pred_x, pred_y, bits; - int16_t *const mot_val = s->current_picture.motion_val[0][s->block_index[0]]; + int16_t *const mot_val = s->cur_pic.motion_val[0][s->block_index[0]]; const int stride = s->b8_stride * 2; try_again: @@ -1007,14 +1007,14 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) /* skip mb */ if (s->pict_type == AV_PICTURE_TYPE_S && ctx->vol_sprite_usage == GMC_SPRITE) { - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0; mx = get_amv(ctx, 0); my = get_amv(ctx, 1); } else { - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; mx = my = 0; @@ -1047,7 +1047,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) s->mb_intra = ((cbpc & 4) != 0); if (s->mb_intra) { - s->current_picture.mb_type[xy] = MB_TYPE_INTRA; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; s->mbintra_table[xy] = 1; mot_val[0] = mot_val[2] = @@ -1080,12 +1080,12 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) my = ff_h263_decode_motion(s, pred_y, s->f_code); if (my >= 0xffff) return AVERROR_INVALIDDATA; - s->current_picture.mb_type[xy] = MB_TYPE_16x16 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; } else { mx = get_amv(ctx, 0); my = get_amv(ctx, 1); - s->current_picture.mb_type[xy] = MB_TYPE_16x16 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0; } @@ -1100,7 +1100,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) mot_val[3 + stride] = my; } else { int i; - s->current_picture.mb_type[xy] = MB_TYPE_8x8 | + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; for (i = 0; i < 4; i++) { int16_t *mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); @@ -1156,9 +1156,9 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) } s->cbp_table[xy] |= cbpy << 2; - s->current_picture.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; + s->cur_pic.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; } else { /* P || S_TYPE */ - if (IS_INTRA(s->current_picture.mb_type[xy])) { + if (IS_INTRA(s->cur_pic.mb_type[xy])) { int i; int dir = 0; int ac_pred = get_bits1(&s->gb); @@ -1172,7 +1172,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) if (s->cbp_table[xy] & 8) ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); - s->current_picture.qscale_table[xy] = s->qscale; + s->cur_pic.qscale_table[xy] = s->qscale; for (i = 0; i < 6; i++) { int dc_pred_dir; @@ -1188,10 +1188,10 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) } s->cbp_table[xy] &= 3; // remove dquant s->cbp_table[xy] |= cbpy << 2; - s->current_picture.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; + s->cur_pic.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; s->pred_dir_table[xy] = dir; - } else if (IS_SKIP(s->current_picture.mb_type[xy])) { - s->current_picture.qscale_table[xy] = s->qscale; + } else if (IS_SKIP(s->cur_pic.mb_type[xy])) { + s->cur_pic.qscale_table[xy] = s->qscale; s->cbp_table[xy] = 0; } else { int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1); @@ -1204,7 +1204,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) if (s->cbp_table[xy] & 8) ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); - s->current_picture.qscale_table[xy] = s->qscale; + s->cur_pic.qscale_table[xy] = s->qscale; s->cbp_table[xy] &= 3; // remove dquant s->cbp_table[xy] |= (cbpy ^ 0xf) << 2; @@ -1294,8 +1294,8 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block, MpegEncContext *s = &ctx->m; int level, i, last, run, qmul, qadd; int av_uninit(dc_pred_dir); - RLTable *rl; - RL_VLC_ELEM *rl_vlc; + const RLTable *rl; + const RL_VLC_ELEM *rl_vlc; const uint8_t *scan_table; // Note intra & rvlc should be optimized away if this is inlined @@ -1567,20 +1567,20 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) av_assert2(s == (void*)ctx); - mb_type = s->current_picture.mb_type[xy]; + mb_type = s->cur_pic.mb_type[xy]; cbp = s->cbp_table[xy]; use_intra_dc_vlc = s->qscale < ctx->intra_dc_threshold; - if (s->current_picture.qscale_table[xy] != s->qscale) - ff_set_qscale(s, s->current_picture.qscale_table[xy]); + if (s->cur_pic.qscale_table[xy] != s->qscale) + ff_set_qscale(s, s->cur_pic.qscale_table[xy]); if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_S) { int i; for (i = 0; i < 4; i++) { - s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0]; - s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1]; + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0]; + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1]; } s->mb_intra = IS_INTRA(mb_type); @@ -1594,12 +1594,14 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) && ctx->vol_sprite_usage == GMC_SPRITE) { s->mcsel = 1; s->mb_skipped = 0; + s->cur_pic.mbskip_table[xy] = 0; } else { s->mcsel = 0; s->mb_skipped = 1; + s->cur_pic.mbskip_table[xy] = 1; } } else if (s->mb_intra) { - s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); + s->ac_pred = IS_ACPRED(s->cur_pic.mb_type[xy]); } else if (!s->mb_intra) { // s->mcsel = 0; // FIXME do we need to init that? @@ -1612,7 +1614,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) } } else { /* I-Frame */ s->mb_intra = 1; - s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); + s->ac_pred = IS_ACPRED(s->cur_pic.mb_type[xy]); } if (!IS_SKIP(mb_type)) { @@ -1651,7 +1653,6 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; - int16_t *mot_val; static const int8_t quant_tab[4] = { -1, -2, 1, 2 }; const int xy = s->mb_x + s->mb_y * s->mb_stride; int next; @@ -1671,21 +1672,23 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv_type = MV_TYPE_16X16; if (s->pict_type == AV_PICTURE_TYPE_S && ctx->vol_sprite_usage == GMC_SPRITE) { - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0; s->mcsel = 1; s->mv[0][0][0] = get_amv(ctx, 0); s->mv[0][0][1] = get_amv(ctx, 1); + s->cur_pic.mbskip_table[xy] = 0; s->mb_skipped = 0; } else { - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; s->mcsel = 0; s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; + s->cur_pic.mbskip_table[xy] = 1; s->mb_skipped = 1; } goto end; @@ -1726,7 +1729,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv_dir = MV_DIR_FORWARD; if ((cbpc & 16) == 0) { if (s->mcsel) { - s->current_picture.mb_type[xy] = MB_TYPE_GMC | + s->cur_pic.mb_type[xy] = MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0; /* 16x16 global motion prediction */ @@ -1736,7 +1739,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][0] = mx; s->mv[0][0][1] = my; } else if ((!s->progressive_sequence) && get_bits1(&s->gb)) { - s->current_picture.mb_type[xy] = MB_TYPE_16x8 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x8 | MB_TYPE_L0 | MB_TYPE_INTERLACED; /* 16x8 field motion prediction */ @@ -1760,7 +1763,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][i][1] = my; } } else { - s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; /* 16x16 motion prediction */ s->mv_type = MV_TYPE_16X16; ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); @@ -1777,10 +1780,10 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][1] = my; } } else { - s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; s->mv_type = MV_TYPE_8X8; for (i = 0; i < 4; i++) { - mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); + int16_t *mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); mx = ff_h263_decode_motion(s, pred_x, s->f_code); if (mx >= 0xffff) return AVERROR_INVALIDDATA; @@ -1810,11 +1813,11 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->last_mv[i][1][1] = 0; } - ff_thread_await_progress(&s->next_picture_ptr->tf, s->mb_y, 0); + ff_thread_progress_await(&s->next_pic.ptr->progress, s->mb_y); } /* if we skipped it in the future P-frame than skip it now too */ - s->mb_skipped = s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC + s->mb_skipped = s->next_pic.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC if (s->mb_skipped) { /* skip mb */ @@ -1827,7 +1830,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][1] = s->mv[1][0][0] = s->mv[1][0][1] = 0; - s->current_picture.mb_type[xy] = MB_TYPE_SKIP | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; goto end; @@ -1947,7 +1950,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; mb_type |= ff_mpeg4_set_direct_mv(s, mx, my); } - s->current_picture.mb_type[xy] = mb_type; + s->cur_pic.mb_type[xy] = mb_type; } else { /* I-Frame */ int use_intra_dc_vlc; @@ -1966,9 +1969,9 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) intra: s->ac_pred = get_bits1(&s->gb); if (s->ac_pred) - s->current_picture.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; else - s->current_picture.mb_type[xy] = MB_TYPE_INTRA; + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1); if (cbpy < 0) { @@ -2015,11 +2018,11 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) if (s->pict_type == AV_PICTURE_TYPE_B) { const int delta = s->mb_x + 1 == s->mb_width ? 2 : 1; - ff_thread_await_progress(&s->next_picture_ptr->tf, + ff_thread_progress_await(&s->next_pic.ptr->progress, (s->mb_x + delta >= s->mb_width) ? FFMIN(s->mb_y + 1, s->mb_height - 1) - : s->mb_y, 0); - if (s->next_picture.mbskip_table[xy + delta]) + : s->mb_y); + if (s->next_pic.mbskip_table[xy + delta]) return SLICE_OK; } @@ -2073,7 +2076,7 @@ static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; const VLCElem *cur_vlc = studio_intra_tab[0]; - uint8_t *const scantable = s->intra_scantable.permutated; + const uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; uint32_t flc; const int min = -1 * (1 << (s->avctx->bits_per_raw_sample + 6)); @@ -3859,11 +3862,12 @@ const FFCodec ff_mpeg4_decoder = { .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(Mpeg4DecContext), .init = decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, .p.max_lowres = 3, .p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c b/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c index 71dda802e2..583ea9de6f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c @@ -71,7 +71,7 @@ static uint8_t uni_mpeg4_inter_rl_len[64 * 64 * 2 * 2]; * @param[in] block_last_index last index in scantable order that refers to a non zero element in block. */ static inline int get_block_rate(MpegEncContext *s, int16_t block[64], - int block_last_index, uint8_t scantable[64]) + int block_last_index, const uint8_t scantable[64]) { int last = 0; int j; @@ -106,7 +106,7 @@ static inline int get_block_rate(MpegEncContext *s, int16_t block[64], * @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order */ static inline void restore_ac_coeffs(MpegEncContext *s, int16_t block[6][64], - const int dir[6], uint8_t *st[6], + const int dir[6], const uint8_t *st[6], const int zigzag_last_index[6]) { int i, n; @@ -137,12 +137,12 @@ static inline void restore_ac_coeffs(MpegEncContext *s, int16_t block[6][64], * @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order */ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64], - const int dir[6], uint8_t *st[6], + const int dir[6], const uint8_t *st[6], int zigzag_last_index[6]) { int score = 0; int i, n; - int8_t *const qscale_table = s->current_picture.qscale_table; + const int8_t *const qscale_table = s->cur_pic.qscale_table; memcpy(zigzag_last_index, s->block_last_index, sizeof(int) * 6); @@ -222,7 +222,7 @@ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64], void ff_clean_mpeg4_qscales(MpegEncContext *s) { int i; - int8_t *const qscale_table = s->current_picture.qscale_table; + int8_t *const qscale_table = s->cur_pic.qscale_table; ff_clean_h263_qscales(s); @@ -288,14 +288,14 @@ static inline int mpeg4_get_dc_length(int level, int n) * Encode an 8x8 block. * @param n block index (0-3 are luma, 4-5 are chroma) */ -static inline void mpeg4_encode_block(MpegEncContext *s, - int16_t *block, int n, int intra_dc, - uint8_t *scan_table, PutBitContext *dc_pb, +static inline void mpeg4_encode_block(const MpegEncContext *s, + const int16_t *block, int n, int intra_dc, + const uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb) { int i, last_non_zero; - uint32_t *bits_tab; - uint8_t *len_tab; + const uint32_t *bits_tab; + const uint8_t *len_tab; const int last_index = s->block_last_index[n]; if (s->mb_intra) { // Note gcc (3.2.1 at least) will optimize this away @@ -350,11 +350,11 @@ static inline void mpeg4_encode_block(MpegEncContext *s, } static int mpeg4_get_block_length(MpegEncContext *s, - int16_t *block, int n, - int intra_dc, uint8_t *scan_table) + const int16_t *block, int n, + int intra_dc, const uint8_t *scan_table) { int i, last_non_zero; - uint8_t *len_tab; + const uint8_t *len_tab; const int last_index = s->block_last_index[n]; int len = 0; @@ -403,8 +403,10 @@ static int mpeg4_get_block_length(MpegEncContext *s, return len; } -static inline void mpeg4_encode_blocks(MpegEncContext *s, int16_t block[6][64], - int intra_dc[6], uint8_t **scan_table, +static inline void mpeg4_encode_blocks(MpegEncContext *s, + const int16_t block[6][64], + const int intra_dc[6], + const uint8_t * const *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb) { @@ -511,8 +513,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], av_assert2(mb_type >= 0); /* nothing to do if this MB was skipped in the next P-frame */ - if (s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]) { // FIXME avoid DCT & ... - s->skip_count++; + if (s->next_pic.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]) { // FIXME avoid DCT & ... s->mv[0][0][0] = s->mv[0][0][1] = s->mv[1][0][0] = @@ -536,7 +537,6 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], s->misc_bits++; s->last_bits++; } - s->skip_count++; return; } @@ -646,13 +646,13 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], y = s->mb_y * 16; offset = x + y * s->linesize; - p_pic = s->new_picture->data[0] + offset; + p_pic = s->new_pic->data[0] + offset; s->mb_skipped = 1; for (i = 0; i < s->max_b_frames; i++) { const uint8_t *b_pic; int diff; - Picture *pic = s->reordered_input_picture[i + 1]; + const MPVPicture *pic = s->reordered_input_picture[i + 1]; if (!pic || pic->f->pict_type != AV_PICTURE_TYPE_B) break; @@ -691,7 +691,6 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], s->misc_bits++; s->last_bits++; } - s->skip_count++; return; } @@ -780,8 +779,8 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); ff_h263_encode_motion_vector(s, - s->current_picture.motion_val[0][s->block_index[i]][0] - pred_x, - s->current_picture.motion_val[0][s->block_index[i]][1] - pred_y, + s->cur_pic.motion_val[0][s->block_index[i]][0] - pred_x, + s->cur_pic.motion_val[0][s->block_index[i]][1] - pred_y, s->f_code); } } @@ -799,7 +798,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], int dc_diff[6]; // dc values with the dc prediction subtracted int dir[6]; // prediction direction int zigzag_last_index[6]; - uint8_t *scan_table[6]; + const uint8_t *scan_table[6]; int i; for (i = 0; i < 6; i++) @@ -863,11 +862,9 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], */ void ff_mpeg4_stuffing(PutBitContext *pbc) { - int length; - put_bits(pbc, 1, 0); - length = (-put_bits_count(pbc)) & 7; - if (length) - put_bits(pbc, length, (1 << length) - 1); + int length = 8 - (put_bits_count(pbc) & 7); + + put_bits(pbc, length, (1 << (length - 1)) - 1); } /* must be called before writing the header */ @@ -886,10 +883,9 @@ static void mpeg4_encode_gop_header(MpegEncContext *s) int64_t hours, minutes, seconds; int64_t time; - put_bits(&s->pb, 16, 0); - put_bits(&s->pb, 16, GOP_STARTCODE); + put_bits32(&s->pb, GOP_STARTCODE); - time = s->current_picture_ptr->f->pts; + time = s->cur_pic.ptr->f->pts; if (s->reordered_input_picture[1]) time = FFMIN(time, s->reordered_input_picture[1]->f->pts); time = time * s->avctx->time_base.num; @@ -936,13 +932,11 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s) // FIXME levels - put_bits(&s->pb, 16, 0); - put_bits(&s->pb, 16, VOS_STARTCODE); + put_bits32(&s->pb, VOS_STARTCODE); put_bits(&s->pb, 8, profile_and_level_indication); - put_bits(&s->pb, 16, 0); - put_bits(&s->pb, 16, VISUAL_OBJ_STARTCODE); + put_bits32(&s->pb, VISUAL_OBJ_STARTCODE); put_bits(&s->pb, 1, 1); put_bits(&s->pb, 4, vo_ver_id); @@ -969,10 +963,8 @@ static void mpeg4_encode_vol_header(MpegEncContext *s, vo_type = SIMPLE_VO_TYPE; } - put_bits(&s->pb, 16, 0); - put_bits(&s->pb, 16, 0x100 + vo_number); /* video obj */ - put_bits(&s->pb, 16, 0); - put_bits(&s->pb, 16, 0x120 + vol_number); /* video obj layer */ + put_bits32(&s->pb, 0x100 + vo_number); /* video obj */ + put_bits32(&s->pb, 0x120 + vol_number); /* video obj layer */ put_bits(&s->pb, 1, 0); /* random access vol */ put_bits(&s->pb, 8, vo_type); /* video obj type indication */ @@ -1049,8 +1041,7 @@ static void mpeg4_encode_vol_header(MpegEncContext *s, /* user data */ if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT)) { - put_bits(&s->pb, 16, 0); - put_bits(&s->pb, 16, 0x1B2); /* user_data */ + put_bits32(&s->pb, USER_DATA_STARTCODE); ff_put_string(&s->pb, LIBAVCODEC_IDENT, 0); } } @@ -1074,8 +1065,7 @@ int ff_mpeg4_encode_picture_header(MpegEncContext *s) s->partitioned_frame = s->data_partitioning && s->pict_type != AV_PICTURE_TYPE_B; - put_bits(&s->pb, 16, 0); /* vop header */ - put_bits(&s->pb, 16, VOP_STARTCODE); /* vop header */ + put_bits32(&s->pb, VOP_STARTCODE); /* vop header */ put_bits(&s->pb, 2, s->pict_type - 1); /* pict type: I = 0 , P = 1 */ time_div = FFUDIV(s->time, s->avctx->time_base.den); @@ -1101,7 +1091,7 @@ int ff_mpeg4_encode_picture_header(MpegEncContext *s) } put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */ if (!s->progressive_sequence) { - put_bits(&s->pb, 1, !!(s->current_picture_ptr->f->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)); + put_bits(&s->pb, 1, !!(s->cur_pic.ptr->f->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)); put_bits(&s->pb, 1, s->alternate_scan); } // FIXME sprite stuff diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c b/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c index d429b0a839..e7b3197bb1 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c @@ -22,7 +22,7 @@ #include "mpegvideodec.h" #include "mpeg_er.h" -static void set_erpic(ERPicture *dst, Picture *src) +static void set_erpic(ERPicture *dst, const MPVPicture *src) { int i; @@ -34,7 +34,7 @@ static void set_erpic(ERPicture *dst, Picture *src) } dst->f = src->f; - dst->tf = &src->tf; + dst->progress = &src->progress; for (i = 0; i < 2; i++) { dst->motion_val[i] = src->motion_val[i]; @@ -49,9 +49,9 @@ void ff_mpeg_er_frame_start(MpegEncContext *s) { ERContext *er = &s->er; - set_erpic(&er->cur_pic, s->current_picture_ptr); - set_erpic(&er->next_pic, s->next_picture_ptr); - set_erpic(&er->last_pic, s->last_picture_ptr); + set_erpic(&er->cur_pic, s->cur_pic.ptr); + set_erpic(&er->next_pic, s->next_pic.ptr); + set_erpic(&er->last_pic, s->last_pic.ptr); er->pp_time = s->pp_time; er->pb_time = s->pb_time; @@ -84,13 +84,13 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, if (!s->chroma_y_shift) s->bdsp.clear_blocks(s->block[6]); - s->dest[0] = s->current_picture.f->data[0] + + s->dest[0] = s->cur_pic.data[0] + s->mb_y * 16 * s->linesize + s->mb_x * 16; - s->dest[1] = s->current_picture.f->data[1] + + s->dest[1] = s->cur_pic.data[1] + s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize + s->mb_x * (16 >> s->chroma_x_shift); - s->dest[2] = s->current_picture.f->data[2] + + s->dest[2] = s->cur_pic.data[2] + s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize + s->mb_x * (16 >> s->chroma_x_shift); diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegpicture.c b/src/ExtLib/ffmpeg/libavcodec/mpegpicture.c index 06b6daa01a..cde060aa1f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegpicture.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpegpicture.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/mem.h" @@ -27,74 +25,130 @@ #include "libavutil/imgutils.h" #include "avcodec.h" -#include "motion_est.h" #include "mpegpicture.h" -#include "mpegvideo.h" #include "refstruct.h" -#include "threadframe.h" -static void av_noinline free_picture_tables(Picture *pic) +static void mpv_pic_reset(FFRefStructOpaque unused, void *obj) { - pic->alloc_mb_width = - pic->alloc_mb_height = 0; + MPVPicture *pic = obj; + + av_frame_unref(pic->f); + ff_thread_progress_reset(&pic->progress); + + ff_refstruct_unref(&pic->hwaccel_picture_private); - av_buffer_unref(&pic->mbskip_table_buf); - av_buffer_unref(&pic->qscale_table_buf); - av_buffer_unref(&pic->mb_type_buf); + ff_refstruct_unref(&pic->mbskip_table); + ff_refstruct_unref(&pic->qscale_table_base); + ff_refstruct_unref(&pic->mb_type_base); for (int i = 0; i < 2; i++) { - av_buffer_unref(&pic->motion_val_buf[i]); - av_buffer_unref(&pic->ref_index_buf[i]); + ff_refstruct_unref(&pic->motion_val_base[i]); + ff_refstruct_unref(&pic->ref_index[i]); + + pic->motion_val[i] = NULL; } + + pic->mb_type = NULL; + pic->qscale_table = NULL; + + pic->mb_stride = + pic->mb_width = + pic->mb_height = 0; + + pic->dummy = 0; + pic->field_picture = 0; + pic->b_frame_score = 0; + pic->reference = 0; + pic->shared = 0; + pic->display_picture_number = 0; + pic->coded_picture_number = 0; } -static int make_table_writable(AVBufferRef **ref) +static int av_cold mpv_pic_init(FFRefStructOpaque opaque, void *obj) { - AVBufferRef *old = *ref, *new; + MPVPicture *pic = obj; + int ret, init_progress = (uintptr_t)opaque.nc; - if (av_buffer_is_writable(old)) - return 0; - new = av_buffer_allocz(old->size); - if (!new) + ret = ff_thread_progress_init(&pic->progress, init_progress); + if (ret < 0) + return ret; + + pic->f = av_frame_alloc(); + if (!pic->f) return AVERROR(ENOMEM); - av_buffer_unref(ref); - *ref = new; return 0; } -static int make_tables_writable(Picture *pic) +static void av_cold mpv_pic_free(FFRefStructOpaque unused, void *obj) { -#define MAKE_WRITABLE(table) \ -do {\ - int ret = make_table_writable(&pic->table); \ - if (ret < 0) \ - return ret; \ -} while (0) + MPVPicture *pic = obj; - MAKE_WRITABLE(mbskip_table_buf); - MAKE_WRITABLE(qscale_table_buf); - MAKE_WRITABLE(mb_type_buf); + ff_thread_progress_destroy(&pic->progress); + av_frame_free(&pic->f); +} - if (pic->motion_val_buf[0]) { - for (int i = 0; i < 2; i++) { - MAKE_WRITABLE(motion_val_buf[i]); - MAKE_WRITABLE(ref_index_buf[i]); - } +av_cold FFRefStructPool *ff_mpv_alloc_pic_pool(int init_progress) +{ + return ff_refstruct_pool_alloc_ext(sizeof(MPVPicture), + FF_REFSTRUCT_POOL_FLAG_FREE_ON_INIT_ERROR, + (void*)(uintptr_t)init_progress, + mpv_pic_init, mpv_pic_reset, mpv_pic_free, NULL); +} + +void ff_mpv_unref_picture(MPVWorkPicture *pic) +{ + ff_refstruct_unref(&pic->ptr); + memset(pic, 0, sizeof(*pic)); +} + +static void set_workpic_from_pic(MPVWorkPicture *wpic, const MPVPicture *pic) +{ + for (int i = 0; i < MPV_MAX_PLANES; i++) { + wpic->data[i] = pic->f->data[i]; + wpic->linesize[i] = pic->f->linesize[i]; } + wpic->qscale_table = pic->qscale_table; + wpic->mb_type = pic->mb_type; + wpic->mbskip_table = pic->mbskip_table; - return 0; + for (int i = 0; i < 2; i++) { + wpic->motion_val[i] = pic->motion_val[i]; + wpic->ref_index[i] = pic->ref_index[i]; + } + wpic->reference = pic->reference; } -int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me, - ScratchpadContext *sc, int linesize) +void ff_mpv_replace_picture(MPVWorkPicture *dst, const MPVWorkPicture *src) +{ + av_assert1(dst != src); + ff_refstruct_replace(&dst->ptr, src->ptr); + memcpy(dst, src, sizeof(*dst)); +} + +void ff_mpv_workpic_from_pic(MPVWorkPicture *wpic, MPVPicture *pic) +{ + ff_refstruct_replace(&wpic->ptr, pic); + if (!pic) { + memset(wpic, 0, sizeof(*wpic)); + return; + } + set_workpic_from_pic(wpic, pic); +} + +int ff_mpv_framesize_alloc(AVCodecContext *avctx, + ScratchpadContext *sc, int linesize) { # define EMU_EDGE_HEIGHT (4 * 70) - int alloc_size = FFALIGN(FFABS(linesize) + 64, 32); + int linesizeabs = FFABS(linesize); + int alloc_size = FFALIGN(linesizeabs + 64, 32); + + if (linesizeabs <= sc->linesize) + return 0; if (avctx->hwaccel) return 0; - if (linesize < 24) { + if (linesizeabs < 24) { av_log(avctx, AV_LOG_ERROR, "Image too small, temporary buffers cannot function\n"); return AVERROR_PATCHWELCOME; } @@ -102,6 +156,9 @@ int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me, if (av_image_check_size2(alloc_size, EMU_EDGE_HEIGHT, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0) return AVERROR(ENOMEM); + av_freep(&sc->edge_emu_buffer); + av_freep(&sc->scratchpad_buf); + // edge emu needs blocksize + filter length - 1 // (= 17x17 for halfpel / 21x21 for H.264) // VC-1 computes luma and chroma simultaneously and needs 19X19 + 9x9 @@ -109,290 +166,93 @@ int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me, // linesize * interlaced * MBsize // we also use this buffer for encoding in encode_mb_internal() needig an additional 32 lines if (!FF_ALLOCZ_TYPED_ARRAY(sc->edge_emu_buffer, alloc_size * EMU_EDGE_HEIGHT) || - !FF_ALLOCZ_TYPED_ARRAY(me->scratchpad, alloc_size * 4 * 16 * 2)) { + !FF_ALLOCZ_TYPED_ARRAY(sc->scratchpad_buf, alloc_size * 4 * 16 * 2)) { + sc->linesize = 0; av_freep(&sc->edge_emu_buffer); return AVERROR(ENOMEM); } + sc->linesize = linesizeabs; - me->temp = me->scratchpad; - sc->rd_scratchpad = me->scratchpad; - sc->b_scratchpad = me->scratchpad; - sc->obmc_scratchpad = me->scratchpad + 16; + sc->obmc_scratchpad = sc->scratchpad_buf + 16; return 0; } -/** - * Check the pic's linesize and allocate linesize dependent scratch buffers - */ -static int handle_pic_linesizes(AVCodecContext *avctx, Picture *pic, - MotionEstContext *me, ScratchpadContext *sc, - int linesize, int uvlinesize) +int ff_mpv_pic_check_linesize(void *logctx, const AVFrame *f, + ptrdiff_t *linesizep, ptrdiff_t *uvlinesizep) { - int ret; - - if ((linesize && linesize != pic->f->linesize[0]) || - (uvlinesize && uvlinesize != pic->f->linesize[1])) { - av_log(avctx, AV_LOG_ERROR, - "get_buffer() failed (stride changed: linesize=%d/%d uvlinesize=%d/%d)\n", - linesize, pic->f->linesize[0], - uvlinesize, pic->f->linesize[1]); - ff_mpeg_unref_picture(pic); - return -1; - } - - if (av_pix_fmt_count_planes(pic->f->format) > 2 && - pic->f->linesize[1] != pic->f->linesize[2]) { - av_log(avctx, AV_LOG_ERROR, - "get_buffer() failed (uv stride mismatch)\n"); - ff_mpeg_unref_picture(pic); - return -1; + ptrdiff_t linesize = *linesizep, uvlinesize = *uvlinesizep; + + if ((linesize && linesize != f->linesize[0]) || + (uvlinesize && uvlinesize != f->linesize[1])) { + av_log(logctx, AV_LOG_ERROR, "Stride change unsupported: " + "linesize=%"PTRDIFF_SPECIFIER"/%d uvlinesize=%"PTRDIFF_SPECIFIER"/%d)\n", + linesize, f->linesize[0], + uvlinesize, f->linesize[1]); + return AVERROR_PATCHWELCOME; } - if (!sc->edge_emu_buffer && - (ret = ff_mpeg_framesize_alloc(avctx, me, sc, - pic->f->linesize[0])) < 0) { - av_log(avctx, AV_LOG_ERROR, - "get_buffer() failed to allocate context scratch buffers.\n"); - ff_mpeg_unref_picture(pic); - return ret; + if (av_pix_fmt_count_planes(f->format) > 2 && + f->linesize[1] != f->linesize[2]) { + av_log(logctx, AV_LOG_ERROR, "uv stride mismatch unsupported\n"); + return AVERROR_PATCHWELCOME; } + *linesizep = f->linesize[0]; + *uvlinesizep = f->linesize[1]; return 0; } -static int alloc_picture_tables(AVCodecContext *avctx, Picture *pic, int encoding, int out_format, - int mb_stride, int mb_width, int mb_height, int b8_stride) +static int alloc_picture_tables(BufferPoolContext *pools, MPVPicture *pic, + int mb_height) { - const int big_mb_num = mb_stride * (mb_height + 1) + 1; - const int mb_array_size = mb_stride * mb_height; - const int b8_array_size = b8_stride * mb_height * 2; - int i; - - - pic->mbskip_table_buf = av_buffer_allocz(mb_array_size + 2); - pic->qscale_table_buf = av_buffer_allocz(big_mb_num + mb_stride); - pic->mb_type_buf = av_buffer_allocz((big_mb_num + mb_stride) * - sizeof(uint32_t)); - if (!pic->mbskip_table_buf || !pic->qscale_table_buf || !pic->mb_type_buf) - return AVERROR(ENOMEM); - - if (out_format == FMT_H263 || encoding || - (avctx->export_side_data & AV_CODEC_EXPORT_DATA_MVS)) { - int mv_size = 2 * (b8_array_size + 4) * sizeof(int16_t); - int ref_index_size = 4 * mb_array_size; - - for (i = 0; mv_size && i < 2; i++) { - pic->motion_val_buf[i] = av_buffer_allocz(mv_size); - pic->ref_index_buf[i] = av_buffer_allocz(ref_index_size); - if (!pic->motion_val_buf[i] || !pic->ref_index_buf[i]) - return AVERROR(ENOMEM); - } - } - - pic->alloc_mb_width = mb_width; - pic->alloc_mb_height = mb_height; - pic->alloc_mb_stride = mb_stride; - - return 0; -} - -/** - * Allocate a Picture. - * The pixels are allocated/set by calling get_buffer() if shared = 0 - */ -int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, - ScratchpadContext *sc, int encoding, int out_format, - int mb_stride, int mb_width, int mb_height, int b8_stride, - ptrdiff_t *linesize, ptrdiff_t *uvlinesize) -{ - int i, ret; - - if (pic->qscale_table_buf) - if ( pic->alloc_mb_width != mb_width - || pic->alloc_mb_height != mb_height) - free_picture_tables(pic); - - if (handle_pic_linesizes(avctx, pic, me, sc, - *linesize, *uvlinesize) < 0) - return -1; - - *linesize = pic->f->linesize[0]; - *uvlinesize = pic->f->linesize[1]; - - if (!pic->qscale_table_buf) - ret = alloc_picture_tables(avctx, pic, encoding, out_format, - mb_stride, mb_width, mb_height, b8_stride); - else - ret = make_tables_writable(pic); - if (ret < 0) - goto fail; - - pic->mbskip_table = pic->mbskip_table_buf->data; - pic->qscale_table = pic->qscale_table_buf->data + 2 * mb_stride + 1; - pic->mb_type = (uint32_t*)pic->mb_type_buf->data + 2 * mb_stride + 1; - - if (pic->motion_val_buf[0]) { - for (i = 0; i < 2; i++) { - pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4; - pic->ref_index[i] = pic->ref_index_buf[i]->data; +#define GET_BUFFER(name, buf_suffix, idx_suffix) do { \ + pic->name ## buf_suffix idx_suffix = ff_refstruct_pool_get(pools->name ## _pool); \ + if (!pic->name ## buf_suffix idx_suffix) \ + return AVERROR(ENOMEM); \ +} while (0) + GET_BUFFER(qscale_table, _base,); + GET_BUFFER(mb_type, _base,); + if (pools->motion_val_pool) { + if (pools->mbskip_table_pool) + GET_BUFFER(mbskip_table,,); + for (int i = 0; i < 2; i++) { + GET_BUFFER(ref_index,, [i]); + GET_BUFFER(motion_val, _base, [i]); + pic->motion_val[i] = pic->motion_val_base[i] + 4; } } +#undef GET_BUFFER - return 0; -fail: - av_log(avctx, AV_LOG_ERROR, "Error allocating a picture.\n"); - ff_mpeg_unref_picture(pic); - free_picture_tables(pic); - return AVERROR(ENOMEM); -} - -/** - * Deallocate a picture; frees the picture tables in case they - * need to be reallocated anyway. - */ -void ff_mpeg_unref_picture(Picture *pic) -{ - pic->tf.f = pic->f; - ff_thread_release_ext_buffer(&pic->tf); - - ff_refstruct_unref(&pic->hwaccel_picture_private); - - if (pic->needs_realloc) - free_picture_tables(pic); - - pic->field_picture = 0; - pic->b_frame_score = 0; - pic->needs_realloc = 0; - pic->reference = 0; - pic->shared = 0; - pic->display_picture_number = 0; - pic->coded_picture_number = 0; -} - -int ff_update_picture_tables(Picture *dst, const Picture *src) -{ - int i, ret; - - ret = av_buffer_replace(&dst->mbskip_table_buf, src->mbskip_table_buf); - ret |= av_buffer_replace(&dst->qscale_table_buf, src->qscale_table_buf); - ret |= av_buffer_replace(&dst->mb_type_buf, src->mb_type_buf); - for (i = 0; i < 2; i++) { - ret |= av_buffer_replace(&dst->motion_val_buf[i], src->motion_val_buf[i]); - ret |= av_buffer_replace(&dst->ref_index_buf[i], src->ref_index_buf[i]); - } - - if (ret < 0) { - free_picture_tables(dst); - return ret; - } - - dst->mbskip_table = src->mbskip_table; - dst->qscale_table = src->qscale_table; - dst->mb_type = src->mb_type; - for (i = 0; i < 2; i++) { - dst->motion_val[i] = src->motion_val[i]; - dst->ref_index[i] = src->ref_index[i]; - } + pic->mb_width = pools->alloc_mb_width; + pic->mb_height = mb_height; + pic->mb_stride = pools->alloc_mb_stride; - dst->alloc_mb_width = src->alloc_mb_width; - dst->alloc_mb_height = src->alloc_mb_height; - dst->alloc_mb_stride = src->alloc_mb_stride; + pic->qscale_table = pic->qscale_table_base + 2 * pic->mb_stride + 1; + pic->mb_type = pic->mb_type_base + 2 * pic->mb_stride + 1; return 0; } -int ff_mpeg_ref_picture(Picture *dst, Picture *src) +int ff_mpv_alloc_pic_accessories(AVCodecContext *avctx, MPVWorkPicture *wpic, + ScratchpadContext *sc, + BufferPoolContext *pools, int mb_height) { + MPVPicture *pic = wpic->ptr; int ret; - av_assert0(!dst->f->buf[0]); - av_assert0(src->f->buf[0]); - - src->tf.f = src->f; - dst->tf.f = dst->f; - ret = ff_thread_ref_frame(&dst->tf, &src->tf); + ret = ff_mpv_framesize_alloc(avctx, sc, pic->f->linesize[0]); if (ret < 0) goto fail; - ret = ff_update_picture_tables(dst, src); + ret = alloc_picture_tables(pools, pic, mb_height); if (ret < 0) goto fail; - ff_refstruct_replace(&dst->hwaccel_picture_private, - src->hwaccel_picture_private); - - dst->field_picture = src->field_picture; - dst->b_frame_score = src->b_frame_score; - dst->needs_realloc = src->needs_realloc; - dst->reference = src->reference; - dst->shared = src->shared; - dst->display_picture_number = src->display_picture_number; - dst->coded_picture_number = src->coded_picture_number; + set_workpic_from_pic(wpic, pic); return 0; fail: - ff_mpeg_unref_picture(dst); + av_log(avctx, AV_LOG_ERROR, "Error allocating picture accessories.\n"); return ret; } - -static inline int pic_is_unused(Picture *pic) -{ - if (!pic->f->buf[0]) - return 1; - if (pic->needs_realloc) - return 1; - return 0; -} - -static int find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared) -{ - int i; - - if (shared) { - for (i = 0; i < MAX_PICTURE_COUNT; i++) { - if (!picture[i].f->buf[0]) - return i; - } - } else { - for (i = 0; i < MAX_PICTURE_COUNT; i++) { - if (pic_is_unused(&picture[i])) - return i; - } - } - - av_log(avctx, AV_LOG_FATAL, - "Internal error, picture buffer overflow\n"); - /* We could return -1, but the codec would crash trying to draw into a - * non-existing frame anyway. This is safer than waiting for a random crash. - * Also the return of this is never useful, an encoder must only allocate - * as much as allowed in the specification. This has no relationship to how - * much libavcodec could allocate (and MAX_PICTURE_COUNT is always large - * enough for such valid streams). - * Plus, a decoder has to check stream validity and remove frames if too - * many reference frames are around. Waiting for "OOM" is not correct at - * all. Similarly, missing reference frames have to be replaced by - * interpolated/MC frames, anything else is a bug in the codec ... - */ - abort(); - return -1; -} - -int ff_find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared) -{ - int ret = find_unused_picture(avctx, picture, shared); - - if (ret >= 0 && ret < MAX_PICTURE_COUNT) { - if (picture[ret].needs_realloc) { - ff_mpeg_unref_picture(&picture[ret]); - } - } - return ret; -} - -void av_cold ff_mpv_picture_free(Picture *pic) -{ - free_picture_tables(pic); - ff_mpeg_unref_picture(pic); - av_frame_free(&pic->f); -} diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h b/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h index a457586be5..86504fe8ca 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h @@ -21,83 +21,123 @@ #ifndef AVCODEC_MPEGPICTURE_H #define AVCODEC_MPEGPICTURE_H +#include #include -#include "libavutil/frame.h" - #include "avcodec.h" -#include "motion_est.h" -#include "threadframe.h" +#include "threadprogress.h" -#define MPEGVIDEO_MAX_PLANES 4 -#define MAX_PICTURE_COUNT 36 +#define MPV_MAX_PLANES 3 #define EDGE_WIDTH 16 typedef struct ScratchpadContext { uint8_t *edge_emu_buffer; ///< temporary buffer for if MVs point to out-of-frame data - uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision uint8_t *obmc_scratchpad; - uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers + union { + uint8_t *scratchpad_buf; ///< the other *_scratchpad point into this buffer + uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers + uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision + }; + int linesize; ///< linesize that the buffers in this context have been allocated for } ScratchpadContext; +typedef struct BufferPoolContext { + struct FFRefStructPool *mbskip_table_pool; + struct FFRefStructPool *qscale_table_pool; + struct FFRefStructPool *mb_type_pool; + struct FFRefStructPool *motion_val_pool; + struct FFRefStructPool *ref_index_pool; + int alloc_mb_width; ///< mb_width used to allocate tables + int alloc_mb_height; ///< mb_height used to allocate tables + int alloc_mb_stride; ///< mb_stride used to allocate tables +} BufferPoolContext; + /** - * Picture. + * MPVPicture. */ -typedef struct Picture { +typedef struct MPVPicture { struct AVFrame *f; - ThreadFrame tf; - AVBufferRef *qscale_table_buf; + int8_t *qscale_table_base; int8_t *qscale_table; - AVBufferRef *motion_val_buf[2]; + int16_t (*motion_val_base[2])[2]; int16_t (*motion_val[2])[2]; - AVBufferRef *mb_type_buf; + uint32_t *mb_type_base; uint32_t *mb_type; ///< types and macros are defined in mpegutils.h - AVBufferRef *mbskip_table_buf; uint8_t *mbskip_table; - AVBufferRef *ref_index_buf[2]; int8_t *ref_index[2]; - int alloc_mb_width; ///< mb_width used to allocate tables - int alloc_mb_height; ///< mb_height used to allocate tables - int alloc_mb_stride; ///< mb_stride used to allocate tables - /// RefStruct reference for hardware accelerator private data void *hwaccel_picture_private; + int mb_width; ///< mb_width of the tables + int mb_height; ///< mb_height of the tables + int mb_stride; ///< mb_stride of the tables + + int dummy; ///< Picture is a dummy and should not be output int field_picture; ///< whether or not the picture was encoded in separate fields int b_frame_score; - int needs_realloc; ///< Picture needs to be reallocated (eg due to a frame size change) int reference; int shared; int display_picture_number; int coded_picture_number; -} Picture; + + ThreadProgress progress; +} MPVPicture; + +typedef struct MPVWorkPicture { + uint8_t *data[MPV_MAX_PLANES]; + ptrdiff_t linesize[MPV_MAX_PLANES]; + + MPVPicture *ptr; ///< RefStruct reference + + int8_t *qscale_table; + + int16_t (*motion_val[2])[2]; + + uint32_t *mb_type; ///< types and macros are defined in mpegutils.h + + uint8_t *mbskip_table; + + int8_t *ref_index[2]; + + int reference; +} MPVWorkPicture; /** - * Allocate a Picture's accessories, but not the AVFrame's buffer itself. + * Allocate a pool of MPVPictures. */ -int ff_alloc_picture(AVCodecContext *avctx, Picture *pic, MotionEstContext *me, - ScratchpadContext *sc, int encoding, int out_format, - int mb_stride, int mb_width, int mb_height, int b8_stride, - ptrdiff_t *linesize, ptrdiff_t *uvlinesize); +struct FFRefStructPool *ff_mpv_alloc_pic_pool(int init_progress); -int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me, - ScratchpadContext *sc, int linesize); +/** + * Allocate an MPVPicture's accessories (but not the AVFrame's buffer itself) + * and set the MPVWorkPicture's fields. + */ +int ff_mpv_alloc_pic_accessories(AVCodecContext *avctx, MPVWorkPicture *pic, + ScratchpadContext *sc, + BufferPoolContext *pools, int mb_height); -int ff_mpeg_ref_picture(Picture *dst, Picture *src); -void ff_mpeg_unref_picture(Picture *picture); +/** + * Check that the linesizes of an AVFrame are consistent with the requirements + * of mpegvideo. + * FIXME: There should be no need for this function. mpegvideo should be made + * to work with changing linesizes. + */ +int ff_mpv_pic_check_linesize(void *logctx, const struct AVFrame *f, + ptrdiff_t *linesizep, ptrdiff_t *uvlinesizep); -void ff_mpv_picture_free(Picture *pic); -int ff_update_picture_tables(Picture *dst, const Picture *src); +int ff_mpv_framesize_alloc(AVCodecContext *avctx, + ScratchpadContext *sc, int linesize); -int ff_find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared); +void ff_mpv_unref_picture(MPVWorkPicture *pic); +void ff_mpv_workpic_from_pic(MPVWorkPicture *wpic, MPVPicture *pic); +void ff_mpv_replace_picture(MPVWorkPicture *dst, const MPVWorkPicture *src); #endif /* AVCODEC_MPEGPICTURE_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c index 7af823b8bd..6692a44ebb 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c @@ -41,6 +41,7 @@ #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodata.h" +#include "refstruct.h" static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, int16_t *block, int n, int qscale) @@ -304,9 +305,7 @@ static av_cold int dct_init(MpegEncContext *s) ff_mpv_common_init_neon(s); #endif -#if ARCH_ALPHA - ff_mpv_common_init_axp(s); -#elif ARCH_ARM +#if ARCH_ARM ff_mpv_common_init_arm(s); #elif ARCH_PPC ff_mpv_common_init_ppc(s); @@ -364,14 +363,6 @@ av_cold void ff_mpv_idct_init(MpegEncContext *s) static int init_duplicate_context(MpegEncContext *s) { - int y_size = s->b8_stride * (2 * s->mb_height + 1); - int c_size = s->mb_stride * (s->mb_height + 1); - int yc_size = y_size + 2 * c_size; - int i; - - if (s->mb_height & 1) - yc_size += 2*s->b8_stride + 2*s->mb_stride; - if (s->encoding) { s->me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->me.map)); if (!s->me.map) @@ -387,16 +378,12 @@ static int init_duplicate_context(MpegEncContext *s) return AVERROR(ENOMEM); s->block = s->blocks[0]; - for (i = 0; i < 12; i++) { - s->pblocks[i] = &s->block[i]; - } - - if (s->avctx->codec_tag == AV_RL32("VCR2")) { - // exchange uv - FFSWAP(void *, s->pblocks[4], s->pblocks[5]); - } - if (s->out_format == FMT_H263) { + int mb_height = s->msmpeg4_version == MSMP4_VC1 ? + FFALIGN(s->mb_height, 2) : s->mb_height; + int y_size = s->b8_stride * (2 * mb_height + 1); + int c_size = s->mb_stride * (mb_height + 1); + int yc_size = y_size + 2 * c_size; /* ac values */ if (!FF_ALLOCZ_TYPED_ARRAY(s->ac_val_base, yc_size)) return AVERROR(ENOMEM); @@ -438,11 +425,10 @@ static void free_duplicate_context(MpegEncContext *s) return; av_freep(&s->sc.edge_emu_buffer); - av_freep(&s->me.scratchpad); - s->me.temp = - s->sc.rd_scratchpad = - s->sc.b_scratchpad = + av_freep(&s->sc.scratchpad_buf); + s->me.temp = s->me.scratchpad = s->sc.obmc_scratchpad = NULL; + s->sc.linesize = 0; av_freep(&s->dct_error_sum); av_freep(&s->me.map); @@ -464,12 +450,7 @@ static void free_duplicate_contexts(MpegEncContext *s) static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src) { #define COPY(a) bak->a = src->a - COPY(sc.edge_emu_buffer); - COPY(me.scratchpad); - COPY(me.temp); - COPY(sc.rd_scratchpad); - COPY(sc.b_scratchpad); - COPY(sc.obmc_scratchpad); + COPY(sc); COPY(me.map); COPY(me.score_map); COPY(blocks); @@ -477,7 +458,6 @@ static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src) COPY(start_mb_y); COPY(end_mb_y); COPY(me.map_generation); - COPY(pb); COPY(dct_error_sum); COPY(dct_count[0]); COPY(dct_count[1]); @@ -491,21 +471,14 @@ static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src) int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src) { MpegEncContext bak; - int i, ret; + int ret; // FIXME copy only needed parts backup_duplicate_context(&bak, dst); memcpy(dst, src, sizeof(MpegEncContext)); backup_duplicate_context(dst, &bak); - for (i = 0; i < 12; i++) { - dst->pblocks[i] = &dst->block[i]; - } - if (dst->avctx->codec_tag == AV_RL32("VCR2")) { - // exchange uv - FFSWAP(void *, dst->pblocks[4], dst->pblocks[5]); - } - if (!dst->sc.edge_emu_buffer && - (ret = ff_mpeg_framesize_alloc(dst->avctx, &dst->me, - &dst->sc, dst->linesize)) < 0) { + + ret = ff_mpv_framesize_alloc(dst->avctx, &dst->sc, dst->linesize); + if (ret < 0) { av_log(dst->avctx, AV_LOG_ERROR, "failed to allocate context " "scratch buffers.\n"); return ret; @@ -528,7 +501,6 @@ void ff_mpv_common_defaults(MpegEncContext *s) s->progressive_sequence = 1; s->picture_structure = PICT_FRAME; - s->coded_picture_number = 0; s->picture_number = 0; s->f_code = 1; @@ -537,20 +509,38 @@ void ff_mpv_common_defaults(MpegEncContext *s) s->slice_context_count = 1; } +static void free_buffer_pools(BufferPoolContext *pools) +{ + ff_refstruct_pool_uninit(&pools->mbskip_table_pool); + ff_refstruct_pool_uninit(&pools->qscale_table_pool); + ff_refstruct_pool_uninit(&pools->mb_type_pool); + ff_refstruct_pool_uninit(&pools->motion_val_pool); + ff_refstruct_pool_uninit(&pools->ref_index_pool); + pools->alloc_mb_height = pools->alloc_mb_width = pools->alloc_mb_stride = 0; +} + int ff_mpv_init_context_frame(MpegEncContext *s) { + BufferPoolContext *const pools = &s->buffer_pools; int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y; + int mb_height; if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && !s->progressive_sequence) s->mb_height = (s->height + 31) / 32 * 2; else s->mb_height = (s->height + 15) / 16; + /* VC-1 can change from being progressive to interlaced on a per-frame + * basis. We therefore allocate certain buffers so big that they work + * in both instances. */ + mb_height = s->msmpeg4_version == MSMP4_VC1 ? + FFALIGN(s->mb_height, 2) : s->mb_height; + s->mb_width = (s->width + 15) / 16; s->mb_stride = s->mb_width + 1; s->b8_stride = s->mb_width * 2 + 1; - mb_array_size = s->mb_height * s->mb_stride; - mv_table_size = (s->mb_height + 2) * s->mb_stride + 1; + mb_array_size = mb_height * s->mb_stride; + mv_table_size = (mb_height + 2) * s->mb_stride + 1; /* set default edge pos, will be overridden * in decode_header if needed */ @@ -566,13 +556,10 @@ int ff_mpv_init_context_frame(MpegEncContext *s) s->block_wrap[4] = s->block_wrap[5] = s->mb_stride; - y_size = s->b8_stride * (2 * s->mb_height + 1); - c_size = s->mb_stride * (s->mb_height + 1); + y_size = s->b8_stride * (2 * mb_height + 1); + c_size = s->mb_stride * (mb_height + 1); yc_size = y_size + 2 * c_size; - if (s->mb_height & 1) - yc_size += 2*s->b8_stride + 2*s->mb_stride; - if (!FF_ALLOCZ_TYPED_ARRAY(s->mb_index2xy, s->mb_num + 1)) return AVERROR(ENOMEM); for (y = 0; y < s->mb_height; y++) @@ -581,6 +568,12 @@ int ff_mpv_init_context_frame(MpegEncContext *s) s->mb_index2xy[s->mb_height * s->mb_width] = (s->mb_height - 1) * s->mb_stride + s->mb_width; // FIXME really needed? +#define ALLOC_POOL(name, size, flags) do { \ + pools->name ##_pool = ff_refstruct_pool_alloc((size), (flags)); \ + if (!pools->name ##_pool) \ + return AVERROR(ENOMEM); \ +} while (0) + if (s->codec_id == AV_CODEC_ID_MPEG4 || (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) { /* interlaced direct mode decoding tables */ @@ -595,13 +588,21 @@ int ff_mpv_init_context_frame(MpegEncContext *s) tmp += mv_table_size; } } + if (s->codec_id == AV_CODEC_ID_MPEG4) { + ALLOC_POOL(mbskip_table, mb_array_size + 2, + !s->encoding ? FF_REFSTRUCT_POOL_FLAG_ZERO_EVERY_TIME : 0); + if (!s->encoding) { + /* cbp, pred_dir */ + if (!(s->cbp_table = av_mallocz(mb_array_size)) || + !(s->pred_dir_table = av_mallocz(mb_array_size))) + return AVERROR(ENOMEM); + } + } } - if (s->out_format == FMT_H263) { - /* cbp values, cbp, ac_pred, pred_dir */ - if (!(s->coded_block_base = av_mallocz(y_size + (s->mb_height&1)*2*s->b8_stride)) || - !(s->cbp_table = av_mallocz(mb_array_size)) || - !(s->pred_dir_table = av_mallocz(mb_array_size))) + if (s->msmpeg4_version >= MSMP4_V3) { + s->coded_block_base = av_mallocz(y_size); + if (!s->coded_block_base) return AVERROR(ENOMEM); s->coded_block = s->coded_block_base + s->b8_stride + 1; } @@ -625,14 +626,35 @@ int ff_mpv_init_context_frame(MpegEncContext *s) return AVERROR(ENOMEM); memset(s->mbintra_table, 1, mb_array_size); + ALLOC_POOL(qscale_table, mv_table_size, 0); + ALLOC_POOL(mb_type, mv_table_size * sizeof(uint32_t), 0); + + if (s->out_format == FMT_H263 || s->encoding || + (s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_MVS)) { + const int b8_array_size = s->b8_stride * mb_height * 2; + int mv_size = 2 * (b8_array_size + 4) * sizeof(int16_t); + int ref_index_size = 4 * mb_array_size; + + /* FIXME: The output of H.263 with OBMC depends upon + * the earlier content of the buffer; therefore we set + * the flags to always reset returned buffers here. */ + ALLOC_POOL(motion_val, mv_size, FF_REFSTRUCT_POOL_FLAG_ZERO_EVERY_TIME); + ALLOC_POOL(ref_index, ref_index_size, 0); + } +#undef ALLOC_POOL + pools->alloc_mb_width = s->mb_width; + pools->alloc_mb_height = mb_height; + pools->alloc_mb_stride = s->mb_stride; + return !CONFIG_MPEGVIDEODEC || s->encoding ? 0 : ff_mpeg_er_init(s); } static void clear_context(MpegEncContext *s) { - memset(&s->next_picture, 0, sizeof(s->next_picture)); - memset(&s->last_picture, 0, sizeof(s->last_picture)); - memset(&s->current_picture, 0, sizeof(s->current_picture)); + memset(&s->buffer_pools, 0, sizeof(s->buffer_pools)); + memset(&s->next_pic, 0, sizeof(s->next_pic)); + memset(&s->last_pic, 0, sizeof(s->last_pic)); + memset(&s->cur_pic, 0, sizeof(s->cur_pic)); memset(s->thread_context, 0, sizeof(s->thread_context)); @@ -641,22 +663,17 @@ static void clear_context(MpegEncContext *s) s->dct_error_sum = NULL; s->block = NULL; s->blocks = NULL; - memset(s->pblocks, 0, sizeof(s->pblocks)); s->ac_val_base = NULL; s->ac_val[0] = s->ac_val[1] = s->ac_val[2] =NULL; - s->sc.edge_emu_buffer = NULL; s->me.scratchpad = NULL; - s->me.temp = - s->sc.rd_scratchpad = - s->sc.b_scratchpad = - s->sc.obmc_scratchpad = NULL; + s->me.temp = NULL; + memset(&s->sc, 0, sizeof(s->sc)); s->bitstream_buffer = NULL; s->allocated_bitstream_buffer_size = 0; - s->picture = NULL; s->p_field_mv_table_base = NULL; for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) @@ -681,10 +698,10 @@ static void clear_context(MpegEncContext *s) */ av_cold int ff_mpv_common_init(MpegEncContext *s) { - int i, ret; int nb_slices = (HAVE_THREADS && s->avctx->active_thread_type & FF_THREAD_SLICE) ? s->avctx->thread_count : 1; + int ret; clear_context(s); @@ -710,19 +727,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) if (ret) return ret; - if (!FF_ALLOCZ_TYPED_ARRAY(s->picture, MAX_PICTURE_COUNT)) - return AVERROR(ENOMEM); - for (i = 0; i < MAX_PICTURE_COUNT; i++) { - s->picture[i].f = av_frame_alloc(); - if (!s->picture[i].f) - goto fail_nomem; - } - - if (!(s->next_picture.f = av_frame_alloc()) || - !(s->last_picture.f = av_frame_alloc()) || - !(s->current_picture.f = av_frame_alloc())) - goto fail_nomem; - if ((ret = ff_mpv_init_context_frame(s))) goto fail; @@ -749,8 +753,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) // } return 0; - fail_nomem: - ret = AVERROR(ENOMEM); fail: ff_mpv_common_end(s); return ret; @@ -760,6 +762,7 @@ void ff_mpv_free_context_frame(MpegEncContext *s) { free_duplicate_contexts(s); + free_buffer_pools(&s->buffer_pools); av_freep(&s->p_field_mv_table_base); for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) @@ -789,26 +792,18 @@ void ff_mpv_common_end(MpegEncContext *s) av_freep(&s->bitstream_buffer); s->allocated_bitstream_buffer_size = 0; - if (s->picture) { - for (int i = 0; i < MAX_PICTURE_COUNT; i++) - ff_mpv_picture_free(&s->picture[i]); - } - av_freep(&s->picture); - ff_mpv_picture_free(&s->last_picture); - ff_mpv_picture_free(&s->current_picture); - ff_mpv_picture_free(&s->next_picture); + ff_mpv_unref_picture(&s->last_pic); + ff_mpv_unref_picture(&s->cur_pic); + ff_mpv_unref_picture(&s->next_pic); s->context_initialized = 0; s->context_reinit = 0; - s->last_picture_ptr = - s->next_picture_ptr = - s->current_picture_ptr = NULL; s->linesize = s->uvlinesize = 0; } /** - * Clean dc, ac, coded_block for the current non-intra MB. + * Clean dc, ac for the current non-intra MB. */ void ff_clean_intra_table_entries(MpegEncContext *s) { @@ -822,12 +817,6 @@ void ff_clean_intra_table_entries(MpegEncContext *s) /* ac pred */ memset(s->ac_val[0][xy ], 0, 32 * sizeof(int16_t)); memset(s->ac_val[0][xy + wrap], 0, 32 * sizeof(int16_t)); - if (s->msmpeg4_version>=3) { - s->coded_block[xy ] = - s->coded_block[xy + 1 ] = - s->coded_block[xy + wrap] = - s->coded_block[xy + 1 + wrap] = 0; - } /* chroma */ wrap = s->mb_stride; xy = s->mb_x + s->mb_y * wrap; @@ -841,8 +830,8 @@ void ff_clean_intra_table_entries(MpegEncContext *s) } void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename - const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics - const int uvlinesize = s->current_picture.f->linesize[1]; + const int linesize = s->cur_pic.linesize[0]; //not s->linesize as this would be wrong for field pics + const int uvlinesize = s->cur_pic.linesize[1]; const int width_of_mb = (4 + (s->avctx->bits_per_raw_sample > 8)) - s->avctx->lowres; const int height_of_mb = 4 - s->avctx->lowres; @@ -854,9 +843,9 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x - 1; //block_index is not used by mpeg2, so it is not affected by chroma_format - s->dest[0] = s->current_picture.f->data[0] + (int)((s->mb_x - 1U) << width_of_mb); - s->dest[1] = s->current_picture.f->data[1] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); - s->dest[2] = s->current_picture.f->data[2] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); + s->dest[0] = s->cur_pic.data[0] + (int)((s->mb_x - 1U) << width_of_mb); + s->dest[1] = s->cur_pic.data[1] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); + s->dest[2] = s->cur_pic.data[2] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); if (s->picture_structure == PICT_FRAME) { s->dest[0] += s->mb_y * linesize << height_of_mb; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h index 215df0fd5b..60dcf65288 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h @@ -128,9 +128,11 @@ typedef struct MpegEncContext { int mb_num; ///< number of MBs of a picture ptrdiff_t linesize; ///< line size, in bytes, may be different from width ptrdiff_t uvlinesize; ///< line size, for chroma in bytes, may be different from width - Picture *picture; ///< main picture buffer - Picture **input_picture; ///< next pictures on display order for encoding - Picture **reordered_input_picture; ///< pointer to the next pictures in coded order for encoding + struct FFRefStructPool *picture_pool; ///< Pool for MPVPictures + MPVPicture **input_picture;///< next pictures on display order for encoding + MPVPicture **reordered_input_picture; ///< pointer to the next pictures in coded order for encoding + + BufferPoolContext buffer_pools; int64_t user_specified_pts; ///< last non-zero pts from AVFrame which was passed into avcodec_send_frame() /** @@ -154,29 +156,26 @@ typedef struct MpegEncContext { * copy of the previous picture structure. * note, linesize & data, might not match the previous picture (for field pictures) */ - Picture last_picture; + MPVWorkPicture last_pic; /** * copy of the next picture structure. * note, linesize & data, might not match the next picture (for field pictures) */ - Picture next_picture; + MPVWorkPicture next_pic; /** * Reference to the source picture for encoding. * note, linesize & data, might not match the source picture (for field pictures) */ - AVFrame *new_picture; + AVFrame *new_pic; /** * copy of the current picture structure. * note, linesize & data, might not match the current picture (for field pictures) */ - Picture current_picture; ///< buffer to store the decompressed current picture + MPVWorkPicture cur_pic; - Picture *last_picture_ptr; ///< pointer to the previous picture. - Picture *next_picture_ptr; ///< pointer to the next picture (for bidir pred) - Picture *current_picture_ptr; ///< pointer to the current picture int skipped_last_frame; int last_dc[3]; ///< last DC values for MPEG-1 int16_t *dc_val_base; @@ -254,7 +253,7 @@ typedef struct MpegEncContext { uint8_t *mb_mean; ///< Table for MB luminance int64_t mb_var_sum; ///< sum of MB variance for current frame int64_t mc_mb_var_sum; ///< motion compensated MB variance for current frame - uint64_t encoding_error[MPEGVIDEO_MAX_PLANES]; + uint64_t encoding_error[MPV_MAX_PLANES]; int motion_est; ///< ME algorithm int me_penalty_compensation; @@ -345,7 +344,6 @@ typedef struct MpegEncContext { int i_tex_bits; int p_tex_bits; int i_count; - int skip_count; int misc_bits; ///< cbp, mb_type int last_bits; ///< temp var used for calculating the above vars @@ -420,7 +418,15 @@ typedef struct MpegEncContext { int slice_height; ///< in macroblocks int first_slice_line; ///< used in MPEG-4 too to handle resync markers int flipflop_rounding; - int msmpeg4_version; ///< 0=not msmpeg4, 1=mp41, 2=mp42, 3=mp43/divx3 4=wmv1/7 5=wmv2/8 + enum { + MSMP4_UNUSED, + MSMP4_V1, + MSMP4_V2, + MSMP4_V3, + MSMP4_WMV1, + MSMP4_WMV2, + MSMP4_VC1, ///< for VC1 (image), WMV3 (image) and MSS2. + } msmpeg4_version; int per_mb_rl_table; int esc3_level_length; int esc3_run_length; @@ -468,7 +474,6 @@ typedef struct MpegEncContext { int rtp_payload_size; uint8_t *ptr_lastgob; - int16_t (*pblocks[12])[64]; int16_t (*block)[64]; ///< points to one of the following blocks int16_t (*blocks)[12][64]; // for HQ mode we need to keep the best block @@ -496,7 +501,6 @@ typedef struct MpegEncContext { void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (MPEG-4 can use both) int16_t *block/*align 16*/, int n, int qscale); int (*dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow); - int (*fast_dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow); void (*denoise_dct)(struct MpegEncContext *s, int16_t *block); int mpv_flags; ///< flags set by private options @@ -594,8 +598,8 @@ void ff_mpv_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4], - qpel_mc_func (*qpix_op)[16]); + const op_pixels_func (*pix_op)[4], + const qpel_mc_func (*qpix_op)[16]); static inline void ff_update_block_index(MpegEncContext *s, int bits_per_raw_sample, int lowres, int chroma_x_shift) diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c b/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c index 4353f1fd68..0a50cfac5b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c @@ -38,12 +38,15 @@ #include "mpegvideo.h" #include "mpegvideodec.h" #include "mpeg4videodec.h" +#include "refstruct.h" #include "thread.h" -#include "threadframe.h" +#include "threadprogress.h" #include "wmv2dec.h" -void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) +int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) { + enum ThreadingStatus thread_status; + ff_mpv_common_defaults(s); s->avctx = avctx; @@ -57,6 +60,17 @@ void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) ff_mpv_idct_init(s); ff_h264chroma_init(&s->h264chroma, 8); //for lowres + + if (s->picture_pool) // VC-1 can call this multiple times + return 0; + + thread_status = ff_thread_sync_ref(avctx, offsetof(MpegEncContext, picture_pool)); + if (thread_status != FF_THREAD_IS_COPY) { + s->picture_pool = ff_mpv_alloc_pic_pool(thread_status != FF_THREAD_NO_FRAME_THREADING); + if (!s->picture_pool) + return AVERROR(ENOMEM); + } + return 0; } int ff_mpeg_update_thread_context(AVCodecContext *dst, @@ -100,41 +114,14 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, s->quarter_sample = s1->quarter_sample; - s->coded_picture_number = s1->coded_picture_number; s->picture_number = s1->picture_number; - av_assert0(!s->picture || s->picture != s1->picture); - if (s->picture) - for (int i = 0; i < MAX_PICTURE_COUNT; i++) { - ff_mpeg_unref_picture(&s->picture[i]); - if (s1->picture && s1->picture[i].f->buf[0] && - (ret = ff_mpeg_ref_picture(&s->picture[i], &s1->picture[i])) < 0) - return ret; - } + ff_mpv_replace_picture(&s->cur_pic, &s1->cur_pic); + ff_mpv_replace_picture(&s->last_pic, &s1->last_pic); + ff_mpv_replace_picture(&s->next_pic, &s1->next_pic); -#define UPDATE_PICTURE(pic)\ -do {\ - ff_mpeg_unref_picture(&s->pic);\ - if (s1->pic.f && s1->pic.f->buf[0])\ - ret = ff_mpeg_ref_picture(&s->pic, &s1->pic);\ - else\ - ret = ff_update_picture_tables(&s->pic, &s1->pic);\ - if (ret < 0)\ - return ret;\ -} while (0) - - UPDATE_PICTURE(current_picture); - UPDATE_PICTURE(last_picture); - UPDATE_PICTURE(next_picture); - -#define REBASE_PICTURE(pic, new_ctx, old_ctx) \ - ((pic && pic >= old_ctx->picture && \ - pic < old_ctx->picture + MAX_PICTURE_COUNT) ? \ - &new_ctx->picture[pic - old_ctx->picture] : NULL) - - s->last_picture_ptr = REBASE_PICTURE(s1->last_picture_ptr, s, s1); - s->current_picture_ptr = REBASE_PICTURE(s1->current_picture_ptr, s, s1); - s->next_picture_ptr = REBASE_PICTURE(s1->next_picture_ptr, s, s1); + s->linesize = s1->linesize; + s->uvlinesize = s1->uvlinesize; // Error/bug resilience s->workaround_bugs = s1->workaround_bugs; @@ -167,18 +154,12 @@ do {\ } // linesize-dependent scratch buffer allocation - if (!s->sc.edge_emu_buffer) - if (s1->linesize) { - if (ff_mpeg_framesize_alloc(s->avctx, &s->me, - &s->sc, s1->linesize) < 0) { - av_log(s->avctx, AV_LOG_ERROR, "Failed to allocate context " - "scratch buffers.\n"); - return AVERROR(ENOMEM); - } - } else { - av_log(s->avctx, AV_LOG_ERROR, "Context scratch buffers could not " - "be allocated due to unknown size.\n"); - } + ret = ff_mpv_framesize_alloc(s->avctx, &s->sc, s1->linesize); + if (ret < 0) { + av_log(s->avctx, AV_LOG_ERROR, "Failed to allocate context " + "scratch buffers.\n"); + return ret; + } // MPEG-2/interlacing info memcpy(&s->progressive_sequence, &s1->progressive_sequence, @@ -187,6 +168,15 @@ do {\ return 0; } +int ff_mpv_decode_close(AVCodecContext *avctx) +{ + MpegEncContext *s = avctx->priv_data; + + ff_refstruct_pool_uninit(&s->picture_pool); + ff_mpv_common_end(s); + return 0; +} + int ff_mpv_common_frame_size_change(MpegEncContext *s) { int err = 0; @@ -196,13 +186,9 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s) ff_mpv_free_context_frame(s); - if (s->picture) - for (int i = 0; i < MAX_PICTURE_COUNT; i++) - s->picture[i].needs_realloc = 1; - - s->last_picture_ptr = - s->next_picture_ptr = - s->current_picture_ptr = NULL; + ff_mpv_unref_picture(&s->last_pic); + ff_mpv_unref_picture(&s->next_pic); + ff_mpv_unref_picture(&s->cur_pic); if ((s->width || s->height) && (err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0) @@ -235,19 +221,17 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s) return err; } -static int alloc_picture(MpegEncContext *s, Picture **picp, int reference) +static int alloc_picture(MpegEncContext *s, MPVWorkPicture *dst, int reference) { AVCodecContext *avctx = s->avctx; - int idx = ff_find_unused_picture(s->avctx, s->picture, 0); - Picture *pic; + MPVPicture *pic = ff_refstruct_pool_get(s->picture_pool); int ret; - if (idx < 0) - return idx; + if (!pic) + return AVERROR(ENOMEM); - pic = &s->picture[idx]; + dst->ptr = pic; - pic->tf.f = pic->f; pic->reference = reference; /* WM Image / Screen codecs allocate internal buffers with different @@ -255,8 +239,8 @@ static int alloc_picture(MpegEncContext *s, Picture **picp, int reference) if (avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && avctx->codec_id != AV_CODEC_ID_VC1IMAGE && avctx->codec_id != AV_CODEC_ID_MSS2) { - ret = ff_thread_get_ext_buffer(avctx, &pic->tf, - reference ? AV_GET_BUFFER_FLAG_REF : 0); + ret = ff_thread_get_buffer(avctx, pic->f, + reference ? AV_GET_BUFFER_FLAG_REF : 0); } else { pic->f->width = avctx->width; pic->f->height = avctx->height; @@ -266,34 +250,40 @@ static int alloc_picture(MpegEncContext *s, Picture **picp, int reference) if (ret < 0) goto fail; + ret = ff_mpv_pic_check_linesize(avctx, pic->f, &s->linesize, &s->uvlinesize); + if (ret < 0) + goto fail; + ret = ff_hwaccel_frame_priv_alloc(avctx, &pic->hwaccel_picture_private); if (ret < 0) goto fail; - ret = ff_alloc_picture(s->avctx, pic, &s->me, &s->sc, 0, s->out_format, - s->mb_stride, s->mb_width, s->mb_height, s->b8_stride, - &s->linesize, &s->uvlinesize); + av_assert1(s->mb_width == s->buffer_pools.alloc_mb_width); + av_assert1(s->mb_height == s->buffer_pools.alloc_mb_height || + FFALIGN(s->mb_height, 2) == s->buffer_pools.alloc_mb_height); + av_assert1(s->mb_stride == s->buffer_pools.alloc_mb_stride); + ret = ff_mpv_alloc_pic_accessories(s->avctx, dst, &s->sc, + &s->buffer_pools, s->mb_height); if (ret < 0) goto fail; - *picp = pic; return 0; fail: - ff_mpeg_unref_picture(pic); + ff_mpv_unref_picture(dst); return ret; } -static int av_cold alloc_dummy_frame(MpegEncContext *s, Picture **picp) +static int av_cold alloc_dummy_frame(MpegEncContext *s, MPVWorkPicture *dst) { - Picture *pic; - int ret = alloc_picture(s, picp, 1); + MPVPicture *pic; + int ret = alloc_picture(s, dst, 1); if (ret < 0) return ret; - pic = *picp; + pic = dst->ptr; + pic->dummy = 1; - ff_thread_report_progress(&pic->tf, INT_MAX, 0); - ff_thread_report_progress(&pic->tf, INT_MAX, 1); + ff_thread_progress_report(&pic->progress, INT_MAX); return 0; } @@ -316,6 +306,45 @@ static void color_frame(AVFrame *frame, int luma) } } +int ff_mpv_alloc_dummy_frames(MpegEncContext *s) +{ + AVCodecContext *avctx = s->avctx; + int ret; + + av_assert1(!s->last_pic.ptr || s->last_pic.ptr->f->buf[0]); + av_assert1(!s->next_pic.ptr || s->next_pic.ptr->f->buf[0]); + if (!s->last_pic.ptr && s->pict_type != AV_PICTURE_TYPE_I) { + if (s->pict_type == AV_PICTURE_TYPE_B && s->next_pic.ptr) + av_log(avctx, AV_LOG_DEBUG, + "allocating dummy last picture for B frame\n"); + else if (s->codec_id != AV_CODEC_ID_H261 /* H.261 has no keyframes */ && + (s->picture_structure == PICT_FRAME || s->first_field)) + av_log(avctx, AV_LOG_ERROR, + "warning: first frame is no keyframe\n"); + + /* Allocate a dummy frame */ + ret = alloc_dummy_frame(s, &s->last_pic); + if (ret < 0) + return ret; + + if (!avctx->hwaccel) { + int luma_val = s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263 ? 16 : 0x80; + color_frame(s->last_pic.ptr->f, luma_val); + } + } + if (!s->next_pic.ptr && s->pict_type == AV_PICTURE_TYPE_B) { + /* Allocate a dummy frame */ + ret = alloc_dummy_frame(s, &s->next_pic); + if (ret < 0) + return ret; + } + + av_assert0(s->pict_type == AV_PICTURE_TYPE_I || (s->last_pic.ptr && + s->last_pic.ptr->f->buf[0])); + + return 0; +} + /** * generic function called after decoding * the header and before a frame is decoded. @@ -331,102 +360,38 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) return AVERROR_BUG; } - /* mark & release old frames */ - if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && - s->last_picture_ptr != s->next_picture_ptr && - s->last_picture_ptr->f->buf[0]) { - ff_mpeg_unref_picture(s->last_picture_ptr); - } - - /* release non reference/forgotten frames */ - for (int i = 0; i < MAX_PICTURE_COUNT; i++) { - if (!s->picture[i].reference || - (&s->picture[i] != s->last_picture_ptr && - &s->picture[i] != s->next_picture_ptr && - !s->picture[i].needs_realloc)) { - ff_mpeg_unref_picture(&s->picture[i]); - } - } - - ff_mpeg_unref_picture(&s->current_picture); - ff_mpeg_unref_picture(&s->last_picture); - ff_mpeg_unref_picture(&s->next_picture); - - ret = alloc_picture(s, &s->current_picture_ptr, + ff_mpv_unref_picture(&s->cur_pic); + ret = alloc_picture(s, &s->cur_pic, s->pict_type != AV_PICTURE_TYPE_B && !s->droppable); if (ret < 0) return ret; - s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!s->top_field_first; - s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * (!s->progressive_frame && - !s->progressive_sequence); - s->current_picture_ptr->field_picture = s->picture_structure != PICT_FRAME; + s->cur_pic.ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!s->top_field_first; + s->cur_pic.ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * + (!s->progressive_frame && !s->progressive_sequence); + s->cur_pic.ptr->field_picture = s->picture_structure != PICT_FRAME; - s->current_picture_ptr->f->pict_type = s->pict_type; + s->cur_pic.ptr->f->pict_type = s->pict_type; if (s->pict_type == AV_PICTURE_TYPE_I) - s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_KEY; + s->cur_pic.ptr->f->flags |= AV_FRAME_FLAG_KEY; else - s->current_picture_ptr->f->flags &= ~AV_FRAME_FLAG_KEY; - - if ((ret = ff_mpeg_ref_picture(&s->current_picture, - s->current_picture_ptr)) < 0) - return ret; + s->cur_pic.ptr->f->flags &= ~AV_FRAME_FLAG_KEY; if (s->pict_type != AV_PICTURE_TYPE_B) { - s->last_picture_ptr = s->next_picture_ptr; + ff_mpv_workpic_from_pic(&s->last_pic, s->next_pic.ptr); if (!s->droppable) - s->next_picture_ptr = s->current_picture_ptr; + ff_mpv_workpic_from_pic(&s->next_pic, s->cur_pic.ptr); } ff_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n", - s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr, - s->last_picture_ptr ? s->last_picture_ptr->f->data[0] : NULL, - s->next_picture_ptr ? s->next_picture_ptr->f->data[0] : NULL, - s->current_picture_ptr ? s->current_picture_ptr->f->data[0] : NULL, + (void*)s->last_pic.ptr, (void*)s->next_pic.ptr, (void*)s->cur_pic.ptr, + s->last_pic.ptr ? s->last_pic.ptr->f->data[0] : NULL, + s->next_pic.ptr ? s->next_pic.ptr->f->data[0] : NULL, + s->cur_pic.ptr ? s->cur_pic.ptr->f->data[0] : NULL, s->pict_type, s->droppable); - if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && - (s->pict_type != AV_PICTURE_TYPE_I)) { - if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f->buf[0]) - av_log(avctx, AV_LOG_DEBUG, - "allocating dummy last picture for B frame\n"); - else if (s->codec_id != AV_CODEC_ID_H261) - av_log(avctx, AV_LOG_ERROR, - "warning: first frame is no keyframe\n"); - - /* Allocate a dummy frame */ - ret = alloc_dummy_frame(s, &s->last_picture_ptr); - if (ret < 0) - return ret; - - if (!avctx->hwaccel) { - int luma_val = s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263 ? 16 : 0x80; - color_frame(s->last_picture_ptr->f, luma_val); - } - - } - if ((!s->next_picture_ptr || !s->next_picture_ptr->f->buf[0]) && - s->pict_type == AV_PICTURE_TYPE_B) { - /* Allocate a dummy frame */ - ret = alloc_dummy_frame(s, &s->next_picture_ptr); - if (ret < 0) - return ret; - } - - if (s->last_picture_ptr) { - if (s->last_picture_ptr->f->buf[0] && - (ret = ff_mpeg_ref_picture(&s->last_picture, - s->last_picture_ptr)) < 0) - return ret; - } - if (s->next_picture_ptr) { - if (s->next_picture_ptr->f->buf[0] && - (ret = ff_mpeg_ref_picture(&s->next_picture, - s->next_picture_ptr)) < 0) - return ret; - } - - av_assert0(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr && - s->last_picture_ptr->f->buf[0])); + ret = ff_mpv_alloc_dummy_frames(s); + if (ret < 0) + return ret; /* set dequantizer, we can't do it during init as * it might change for MPEG-4 and we can't do it in the header @@ -443,7 +408,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) } if (s->avctx->debug & FF_DEBUG_NOMC) - color_frame(s->current_picture_ptr->f, 0x80); + color_frame(s->cur_pic.ptr->f, 0x80); return 0; } @@ -453,22 +418,23 @@ void ff_mpv_frame_end(MpegEncContext *s) { emms_c(); - if (s->current_picture.reference) - ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); + if (s->cur_pic.reference) + ff_thread_progress_report(&s->cur_pic.ptr->progress, INT_MAX); } -void ff_print_debug_info(const MpegEncContext *s, const Picture *p, AVFrame *pict) +void ff_print_debug_info(const MpegEncContext *s, const MPVPicture *p, AVFrame *pict) { ff_print_debug_info2(s->avctx, pict, s->mbskip_table, p->mb_type, p->qscale_table, p->motion_val, s->mb_width, s->mb_height, s->mb_stride, s->quarter_sample); } -int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p, int qp_type) +int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, + const MPVPicture *p, int qp_type) { AVVideoEncParams *par; int mult = (qp_type == FF_MPV_QSCALE_TYPE_MPEG1) ? 2 : 1; - unsigned int nb_mb = p->alloc_mb_height * p->alloc_mb_width; + unsigned int nb_mb = p->mb_height * p->mb_width; if (!(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS)) return 0; @@ -477,10 +443,10 @@ int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p if (!par) return AVERROR(ENOMEM); - for (unsigned y = 0; y < p->alloc_mb_height; y++) - for (unsigned x = 0; x < p->alloc_mb_width; x++) { - const unsigned int block_idx = y * p->alloc_mb_width + x; - const unsigned int mb_xy = y * p->alloc_mb_stride + x; + for (unsigned y = 0; y < p->mb_height; y++) + for (unsigned x = 0; x < p->mb_width; x++) { + const unsigned int block_idx = y * p->mb_width + x; + const unsigned int mb_xy = y * p->mb_stride + x; AVVideoBlockParams *const b = av_video_enc_params_block(par, block_idx); b->src_x = x * 16; @@ -496,8 +462,8 @@ int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h) { - ff_draw_horiz_band(s->avctx, s->current_picture_ptr->f, - s->last_picture_ptr ? s->last_picture_ptr->f : NULL, + ff_draw_horiz_band(s->avctx, s->cur_pic.ptr->f, + s->last_pic.ptr ? s->last_pic.ptr->f : NULL, y, h, s->picture_structure, s->first_field, s->low_delay); } @@ -506,16 +472,9 @@ void ff_mpeg_flush(AVCodecContext *avctx) { MpegEncContext *const s = avctx->priv_data; - if (!s->picture) - return; - - for (int i = 0; i < MAX_PICTURE_COUNT; i++) - ff_mpeg_unref_picture(&s->picture[i]); - s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL; - - ff_mpeg_unref_picture(&s->current_picture); - ff_mpeg_unref_picture(&s->last_picture); - ff_mpeg_unref_picture(&s->next_picture); + ff_mpv_unref_picture(&s->cur_pic); + ff_mpv_unref_picture(&s->last_pic); + ff_mpv_unref_picture(&s->next_pic); s->mb_x = s->mb_y = 0; @@ -526,7 +485,7 @@ void ff_mpeg_flush(AVCodecContext *avctx) void ff_mpv_report_decode_progress(MpegEncContext *s) { if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred) - ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0); + ff_thread_progress_report(&s->cur_pic.ptr->progress, s->mb_y); } @@ -599,8 +558,8 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, const int h_edge_pos = s->h_edge_pos >> lowres; const int v_edge_pos = s->v_edge_pos >> lowres; int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h; - linesize = s->current_picture.f->linesize[0] << field_based; - uvlinesize = s->current_picture.f->linesize[1] << field_based; + linesize = s->cur_pic.linesize[0] << field_based; + uvlinesize = s->cur_pic.linesize[1] << field_based; // FIXME obviously not perfect but qpel will not work in lowres anyway if (s->quarter_sample) { @@ -843,9 +802,9 @@ static inline void MPV_motion_lowres(MpegEncContext *s, s->mv[dir][1][0], s->mv[dir][1][1], block_s, mb_y); } else { - if ( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field - || !ref_picture[0]) { - ref_picture = s->current_picture_ptr->f->data; + if (s->picture_structure != s->field_select[dir][0] + 1 && + s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { + ref_picture = s->cur_pic.ptr->f->data; } mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, 0, s->field_select[dir][0], @@ -858,12 +817,11 @@ static inline void MPV_motion_lowres(MpegEncContext *s, for (int i = 0; i < 2; i++) { uint8_t *const *ref2picture; - if ((s->picture_structure == s->field_select[dir][i] + 1 || - s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && - ref_picture[0]) { + if (s->picture_structure == s->field_select[dir][i] + 1 || + s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { ref2picture = ref_picture; } else { - ref2picture = s->current_picture_ptr->f->data; + ref2picture = s->cur_pic.ptr->f->data; } mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, @@ -891,9 +849,6 @@ static inline void MPV_motion_lowres(MpegEncContext *s, pix_op = s->h264chroma.avg_h264_chroma_pixels_tab; } } else { - if (!ref_picture[0]) { - ref_picture = s->current_picture_ptr->f->data; - } for (int i = 0; i < 2; i++) { mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, 0, s->picture_structure != i + 1, @@ -907,7 +862,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, // opposite parity is always in the same // frame if this is second field if (!s->first_field) { - ref_picture = s->current_picture_ptr->f->data; + ref_picture = s->cur_pic.ptr->f->data; } } } diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideo_motion.c b/src/ExtLib/ffmpeg/libavcodec/mpegvideo_motion.c index 8922f5b1a5..6e9368dd9c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideo_motion.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideo_motion.c @@ -38,7 +38,7 @@ static inline int hpel_motion(MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, - op_pixels_func *pix_op, + const op_pixels_func *pix_op, int motion_x, int motion_y) { int dxy = 0; @@ -79,7 +79,7 @@ void mpeg_motion_internal(MpegEncContext *s, int bottom_field, int field_select, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4], + const op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h, @@ -93,8 +93,8 @@ void mpeg_motion_internal(MpegEncContext *s, ptrdiff_t uvlinesize, linesize; v_edge_pos = s->v_edge_pos >> field_based; - linesize = s->current_picture.f->linesize[0] << field_based; - uvlinesize = s->current_picture.f->linesize[1] << field_based; + linesize = s->cur_pic.linesize[0] << field_based; + uvlinesize = s->cur_pic.linesize[1] << field_based; block_y_half = (field_based | is_16x8); dxy = ((motion_y & 1) << 1) | (motion_x & 1); @@ -114,13 +114,16 @@ void mpeg_motion_internal(MpegEncContext *s, uvsrc_y = src_y >> 1; } // Even chroma mv's are full pel in H261 - } else if (!is_mpeg12 && s->out_format == FMT_H261) { + } else if (!CONFIG_SMALL && !is_mpeg12 || + CONFIG_SMALL && s->out_format == FMT_H261) { + av_assert2(s->out_format == FMT_H261); mx = motion_x / 4; my = motion_y / 4; uvdxy = 0; uvsrc_x = s->mb_x * 8 + mx; uvsrc_y = mb_y * 8 + my; } else { + av_assert2(s->out_format == FMT_MPEG1); if (s->chroma_y_shift) { mx = motion_x / 2; my = motion_y / 2; @@ -216,7 +219,7 @@ void mpeg_motion_internal(MpegEncContext *s, static void mpeg_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_select, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4], + const op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h, int is_16x8, int mb_y) { #if !CONFIG_SMALL @@ -235,23 +238,23 @@ static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int bottom_field, int field_select, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4], - int motion_x, int motion_y, int h, int mb_y) + const op_pixels_func (*pix_op)[4], + int motion_x, int motion_y, int mb_y) { #if !CONFIG_SMALL if (s->out_format == FMT_MPEG1) mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 1, bottom_field, field_select, ref_picture, pix_op, - motion_x, motion_y, h, 1, 0, mb_y); + motion_x, motion_y, 8, 1, 0, mb_y); else #endif mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 1, bottom_field, field_select, ref_picture, pix_op, - motion_x, motion_y, h, 0, 0, mb_y); + motion_x, motion_y, 8, 0, 0, mb_y); } // FIXME: SIMDify, avg variant, 16x16 version -static inline void put_obmc(uint8_t *dst, uint8_t *src[5], int stride) +static inline void put_obmc(uint8_t *dst, uint8_t *const src[5], int stride) { int x; uint8_t *const top = src[1]; @@ -307,7 +310,7 @@ static inline void put_obmc(uint8_t *dst, uint8_t *src[5], int stride) static inline void obmc_motion(MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, - op_pixels_func *pix_op, + const op_pixels_func *pix_op, int16_t mv[5][2] /* mid top left right bottom */) #define MID 0 { @@ -336,8 +339,8 @@ static inline void qpel_motion(MpegEncContext *s, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4], - qpel_mc_func (*qpix_op)[16], + const op_pixels_func (*pix_op)[4], + const qpel_mc_func (*qpix_op)[16], int motion_x, int motion_y, int h) { const uint8_t *ptr_y, *ptr_cb, *ptr_cr; @@ -440,7 +443,7 @@ static inline void qpel_motion(MpegEncContext *s, static void chroma_4mv_motion(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture, - op_pixels_func *pix_op, + const op_pixels_func *pix_op, int mx, int my) { const uint8_t *ptr; @@ -508,10 +511,10 @@ static inline void apply_obmc(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4]) + const op_pixels_func (*pix_op)[4]) { LOCAL_ALIGNED_8(int16_t, mv_cache, [4], [4][2]); - const Picture *cur_frame = &s->current_picture; + const MPVWorkPicture *cur_frame = &s->cur_pic; int mb_x = s->mb_x; int mb_y = s->mb_y; const int xy = mb_x + mb_y * s->mb_stride; @@ -596,8 +599,8 @@ static inline void apply_8x8(MpegEncContext *s, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, - qpel_mc_func (*qpix_op)[16], - op_pixels_func (*pix_op)[4]) + const qpel_mc_func (*qpix_op)[16], + const op_pixels_func (*pix_op)[4]) { int dxy, mx, my, src_x, src_y; int i; @@ -681,8 +684,8 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4], - qpel_mc_func (*qpix_op)[16], + const op_pixels_func (*pix_op)[4], + const qpel_mc_func (*qpix_op)[16], int is_mpeg12) { int i; @@ -719,7 +722,11 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, dir, ref_picture, qpix_op, pix_op); break; case MV_TYPE_FIELD: - if (s->picture_structure == PICT_FRAME) { + // Only MPEG-1/2 can have a picture_structure != PICT_FRAME here. + if (!CONFIG_SMALL) + av_assert2(is_mpeg12 || s->picture_structure == PICT_FRAME); + if ((!CONFIG_SMALL && !is_mpeg12) || + s->picture_structure == PICT_FRAME) { if (!is_mpeg12 && s->quarter_sample) { for (i = 0; i < 2; i++) qpel_motion(s, dest_y, dest_cb, dest_cr, @@ -731,17 +738,18 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, mpeg_motion_field(s, dest_y, dest_cb, dest_cr, 0, s->field_select[dir][0], ref_picture, pix_op, - s->mv[dir][0][0], s->mv[dir][0][1], 8, mb_y); + s->mv[dir][0][0], s->mv[dir][0][1], mb_y); /* bottom field */ mpeg_motion_field(s, dest_y, dest_cb, dest_cr, 1, s->field_select[dir][1], ref_picture, pix_op, - s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y); + s->mv[dir][1][0], s->mv[dir][1][1], mb_y); } } else { - if ( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field - || !ref_picture[0]) { - ref_picture = s->current_picture_ptr->f->data; + av_assert2(s->out_format == FMT_MPEG1); + if (s->picture_structure != s->field_select[dir][0] + 1 && + s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { + ref_picture = s->cur_pic.ptr->f->data; } mpeg_motion(s, dest_y, dest_cb, dest_cr, @@ -755,12 +763,11 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, for (i = 0; i < 2; i++) { uint8_t *const *ref2picture; - if ((s->picture_structure == s->field_select[dir][i] + 1 || - s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && - ref_picture[0]) { + if (s->picture_structure == s->field_select[dir][i] + 1 || + s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { ref2picture = ref_picture; } else { - ref2picture = s->current_picture_ptr->f->data; + ref2picture = s->cur_pic.ptr->f->data; } mpeg_motion(s, dest_y, dest_cb, dest_cr, @@ -783,13 +790,10 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, mpeg_motion_field(s, dest_y, dest_cb, dest_cr, j, j ^ i, ref_picture, pix_op, s->mv[dir][2 * i + j][0], - s->mv[dir][2 * i + j][1], 8, mb_y); + s->mv[dir][2 * i + j][1], mb_y); pix_op = s->hdsp.avg_pixels_tab; } } else { - if (!ref_picture[0]) { - ref_picture = s->current_picture_ptr->f->data; - } for (i = 0; i < 2; i++) { mpeg_motion(s, dest_y, dest_cb, dest_cr, s->picture_structure != i + 1, @@ -803,7 +807,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, /* opposite parity is always in the same frame if this is * second field */ if (!s->first_field) - ref_picture = s->current_picture_ptr->f->data; + ref_picture = s->cur_pic.ptr->f->data; } } break; @@ -816,9 +820,12 @@ void ff_mpv_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, - op_pixels_func (*pix_op)[4], - qpel_mc_func (*qpix_op)[16]) + const op_pixels_func (*pix_op)[4], + const qpel_mc_func (*qpix_op)[16]) { + av_assert2(s->out_format == FMT_MPEG1 || + s->out_format == FMT_H263 || + s->out_format == FMT_H261); prefetch_motion(s, ref_picture, dir); #if !CONFIG_SMALL diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideodec.h b/src/ExtLib/ffmpeg/libavcodec/mpegvideodec.h index 0b841bc1a1..6100364715 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideodec.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideodec.h @@ -44,22 +44,30 @@ * Initialize the given MpegEncContext for decoding. * the changed fields will not depend upon * the prior state of the MpegEncContext. + * + * Also initialize the picture pool. */ -void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx); +int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx); int ff_mpv_common_frame_size_change(MpegEncContext *s); int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx); +/** + * Ensure that the dummy frames are allocated according to pict_type if necessary. + */ +int ff_mpv_alloc_dummy_frames(MpegEncContext *s); void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]); void ff_mpv_report_decode_progress(MpegEncContext *s); void ff_mpv_frame_end(MpegEncContext *s); -int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p, int qp_type); +int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, + const MPVPicture *p, int qp_type); int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h); void ff_mpeg_flush(AVCodecContext *avctx); +int ff_mpv_decode_close(AVCodecContext *avctx); -void ff_print_debug_info(const MpegEncContext *s, const Picture *p, AVFrame *pict); +void ff_print_debug_info(const MpegEncContext *s, const MPVPicture *p, AVFrame *pict); static inline int mpeg_get_qscale(MpegEncContext *s) { diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideoenc.h b/src/ExtLib/ffmpeg/libavcodec/mpegvideoenc.h index c20ea500eb..f5044a0309 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideoenc.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideoenc.h @@ -145,14 +145,14 @@ int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t s void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix); -int ff_dct_encode_init(MpegEncContext *s); +void ff_dct_encode_init(MpegEncContext *s); +void ff_mpvenc_dct_init_mips(MpegEncContext *s); void ff_dct_encode_init_x86(MpegEncContext *s); -int ff_dct_quantize_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow); void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16)[2][64], const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra); -void ff_block_permute(int16_t *block, uint8_t *permutation, +void ff_block_permute(int16_t *block, const uint8_t *permutation, const uint8_t *scantable, int last); static inline int get_bits_diff(MpegEncContext *s) diff --git a/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c b/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c index 6f7a5fb1b4..6ad353ddfd 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c @@ -59,7 +59,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], #define IS_MPEG12(s) (is_mpeg12 == MAY_BE_MPEG12 ? ((s)->out_format == FMT_MPEG1) : is_mpeg12) const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; - s->current_picture.qscale_table[mb_xy] = s->qscale; + s->cur_pic.qscale_table[mb_xy] = s->qscale; /* update DC predictors for P macroblocks */ if (!s->mb_intra) { @@ -82,8 +82,8 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], { uint8_t *dest_y, *dest_cb, *dest_cr; int dct_linesize, dct_offset; - const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics - const int uvlinesize = s->current_picture.f->linesize[1]; + const int linesize = s->cur_pic.linesize[0]; //not s->linesize as this would be wrong for field pics + const int uvlinesize = s->cur_pic.linesize[1]; const int readable = IS_ENCODER || lowres_flag || s->pict_type != AV_PICTURE_TYPE_B; const int block_size = lowres_flag ? 8 >> s->avctx->lowres : 8; @@ -96,7 +96,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], s->mb_skipped = 0; av_assert2(s->pict_type!=AV_PICTURE_TYPE_I); *mbskip_ptr = 1; - } else if(!s->current_picture.reference) { + } else if (!s->cur_pic.reference) { *mbskip_ptr = 1; } else{ *mbskip_ptr = 0; /* not skipped */ @@ -124,12 +124,12 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], if (HAVE_THREADS && is_mpeg12 != DEFINITELY_MPEG12 && s->avctx->active_thread_type & FF_THREAD_FRAME) { if (s->mv_dir & MV_DIR_FORWARD) { - ff_thread_await_progress(&s->last_picture_ptr->tf, - lowest_referenced_row(s, 0), 0); + ff_thread_progress_await(&s->last_pic.ptr->progress, + lowest_referenced_row(s, 0)); } if (s->mv_dir & MV_DIR_BACKWARD) { - ff_thread_await_progress(&s->next_picture_ptr->tf, - lowest_referenced_row(s, 1), 0); + ff_thread_progress_await(&s->next_pic.ptr->progress, + lowest_referenced_row(s, 1)); } } @@ -137,15 +137,15 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], const h264_chroma_mc_func *op_pix = s->h264chroma.put_h264_chroma_pixels_tab; if (s->mv_dir & MV_DIR_FORWARD) { - MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix); + MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_pic.data, op_pix); op_pix = s->h264chroma.avg_h264_chroma_pixels_tab; } if (s->mv_dir & MV_DIR_BACKWARD) { - MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix); + MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_pic.data, op_pix); } } else { - op_pixels_func (*op_pix)[4]; - qpel_mc_func (*op_qpix)[16]; + const op_pixels_func (*op_pix)[4]; + const qpel_mc_func (*op_qpix)[16]; if ((is_mpeg12 == DEFINITELY_MPEG12 || !s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { op_pix = s->hdsp.put_pixels_tab; @@ -155,12 +155,12 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], op_qpix = s->qdsp.put_no_rnd_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_FORWARD) { - ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix); + ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_pic.data, op_pix, op_qpix); op_pix = s->hdsp.avg_pixels_tab; op_qpix = s->qdsp.avg_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_BACKWARD) { - ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix); + ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_pic.data, op_pix, op_qpix); } } @@ -173,7 +173,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], } /* add dct residue */ - if (!(IS_MPEG12(s) || s->msmpeg4_version || + if (!(IS_MPEG12(s) || s->msmpeg4_version != MSMP4_UNUSED || (s->codec_id == AV_CODEC_ID_MPEG4 && !s->mpeg_quant))) #endif /* !IS_ENCODER */ { diff --git a/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c b/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c index e327bf36a7..50fd581a83 100644 --- a/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c +++ b/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c @@ -120,12 +120,12 @@ av_cold void ff_msmpeg4_common_init(MpegEncContext *s) static AVOnce init_static_once = AV_ONCE_INIT; switch(s->msmpeg4_version){ - case 1: - case 2: + case MSMP4_V1: + case MSMP4_V2: s->y_dc_scale_table= s->c_dc_scale_table= ff_mpeg1_dc_scale_table; break; - case 3: + case MSMP4_V3: if(s->workaround_bugs){ s->y_dc_scale_table= ff_old_ff_y_dc_scale_table; s->c_dc_scale_table= ff_wmv1_c_dc_scale_table; @@ -134,14 +134,14 @@ av_cold void ff_msmpeg4_common_init(MpegEncContext *s) s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table; } break; - case 4: - case 5: + case MSMP4_WMV1: + case MSMP4_WMV2: s->y_dc_scale_table= ff_wmv1_y_dc_scale_table; s->c_dc_scale_table= ff_wmv1_c_dc_scale_table; break; } - if(s->msmpeg4_version>=4){ + if (s->msmpeg4_version >= MSMP4_WMV1) { ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_wmv1_scantable[1]); ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_wmv1_scantable[0]); ff_permute_scantable(s->permutated_intra_h_scantable, ff_wmv1_scantable[2], @@ -218,9 +218,8 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, b = dc_val[ - 1 - wrap]; c = dc_val[ - wrap]; - if(s->first_slice_line && (n&2)==0 && s->msmpeg4_version<4){ + if (s->first_slice_line && !(n & 2) && s->msmpeg4_version < MSMP4_WMV1) b=c=1024; - } /* XXX: the following solution consumes divisions, but it does not necessitate to modify mpegvideo.c. The problem comes from the @@ -259,7 +258,7 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, #endif /* XXX: WARNING: they did not choose the same test as MPEG-4. This is very important ! */ - if(s->msmpeg4_version>3){ + if (s->msmpeg4_version > MSMP4_V3) { if(s->inter_intra_pred){ uint8_t *dest; int wrap; @@ -282,10 +281,10 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, int bs = 8 >> s->avctx->lowres; if(n<4){ wrap= s->linesize; - dest= s->current_picture.f->data[0] + (((n >> 1) + 2*s->mb_y) * bs* wrap ) + ((n & 1) + 2*s->mb_x) * bs; + dest = s->cur_pic.data[0] + (((n >> 1) + 2*s->mb_y) * bs* wrap ) + ((n & 1) + 2*s->mb_x) * bs; }else{ wrap= s->uvlinesize; - dest= s->current_picture.f->data[n - 3] + (s->mb_y * bs * wrap) + s->mb_x * bs; + dest = s->cur_pic.data[n - 3] + (s->mb_y * bs * wrap) + s->mb_x * bs; } if(s->mb_x==0) a= (1024 + (scale>>1))/scale; else a= get_dc(dest-bs, wrap, scale*8>>(2*s->avctx->lowres), bs); diff --git a/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c b/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c index bf1e4877bd..209e1fe1b2 100644 --- a/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c @@ -28,6 +28,7 @@ #include "codec_internal.h" #include "mpegutils.h" #include "mpegvideo.h" +#include "mpegvideodec.h" #include "msmpeg4.h" #include "msmpeg4dec.h" #include "libavutil/imgutils.h" @@ -105,7 +106,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code) static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) { int cbp, code, i; - uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride]; + uint32_t * const mb_type_ptr = &s->cur_pic.mb_type[s->mb_x + s->mb_y*s->mb_stride]; if (s->pict_type == AV_PICTURE_TYPE_P) { if (s->use_skip_mb_code) { @@ -124,7 +125,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) } } - if(s->msmpeg4_version==2) + if (s->msmpeg4_version == MSMP4_V2) code = get_vlc2(&s->gb, v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 1); else code = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2); @@ -138,7 +139,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) cbp = code & 0x3; } else { s->mb_intra = 1; - if(s->msmpeg4_version==2) + if (s->msmpeg4_version == MSMP4_V2) cbp = get_vlc2(&s->gb, v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 1); else cbp = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 2); @@ -158,7 +159,8 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) } cbp|= cbpy<<2; - if(s->msmpeg4_version==1 || (cbp&3) != 3) cbp^= 0x3C; + if (s->msmpeg4_version == MSMP4_V1 || (cbp&3) != 3) + cbp ^= 0x3C; ff_h263_pred_motion(s, 0, 0, &mx, &my); mx= msmpeg4v2_decode_motion(s, mx, 1); @@ -171,7 +173,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) *mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16; } else { int v; - if(s->msmpeg4_version==2){ + if (s->msmpeg4_version == MSMP4_V2) { s->ac_pred = get_bits1(&s->gb); v = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1); if (v < 0) { @@ -207,7 +209,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64]) { int cbp, code, i; uint8_t *coded_val; - uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride]; + uint32_t * const mb_type_ptr = &s->cur_pic.mb_type[s->mb_x + s->mb_y*s->mb_stride]; if (get_bits_left(&s->gb) <= 0) return AVERROR_INVALIDDATA; @@ -365,16 +367,16 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx) ff_msmpeg4_common_init(s); - switch(s->msmpeg4_version){ - case 1: - case 2: + switch (s->msmpeg4_version) { + case MSMP4_V1: + case MSMP4_V2: s->decode_mb= msmpeg4v12_decode_mb; break; - case 3: - case 4: + case MSMP4_V3: + case MSMP4_WMV1: s->decode_mb= msmpeg4v34_decode_mb; break; - case 5: + case MSMP4_WMV2: break; } @@ -397,7 +399,7 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s) if (get_bits_left(&s->gb) * 8LL < (s->width+15)/16 * ((s->height+15)/16)) return AVERROR_INVALIDDATA; - if(s->msmpeg4_version==1){ + if (s->msmpeg4_version == MSMP4_V1) { int start_code = get_bits_long(&s->gb, 32); if(start_code!=0x00000100){ av_log(s->avctx, AV_LOG_ERROR, "invalid startcode\n"); @@ -421,7 +423,7 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s) if (s->pict_type == AV_PICTURE_TYPE_I) { code = get_bits(&s->gb, 5); - if(s->msmpeg4_version==1){ + if (s->msmpeg4_version == MSMP4_V1) { if(code==0 || code>s->mb_height){ av_log(s->avctx, AV_LOG_ERROR, "invalid slice height %d\n", code); return -1; @@ -439,20 +441,20 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s) } switch(s->msmpeg4_version){ - case 1: - case 2: + case MSMP4_V1: + case MSMP4_V2: s->rl_chroma_table_index = 2; s->rl_table_index = 2; s->dc_table_index = 0; //not used break; - case 3: + case MSMP4_V3: s->rl_chroma_table_index = decode012(&s->gb); s->rl_table_index = decode012(&s->gb); s->dc_table_index = get_bits1(&s->gb); break; - case 4: + case MSMP4_WMV1: ff_msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8); if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb); @@ -478,9 +480,9 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s) s->slice_height); } else { switch(s->msmpeg4_version){ - case 1: - case 2: - if(s->msmpeg4_version==1) + case MSMP4_V1: + case MSMP4_V2: + if (s->msmpeg4_version == MSMP4_V1) s->use_skip_mb_code = 1; else s->use_skip_mb_code = get_bits1(&s->gb); @@ -489,7 +491,7 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s) s->dc_table_index = 0; //not used s->mv_table_index = 0; break; - case 3: + case MSMP4_V3: s->use_skip_mb_code = get_bits1(&s->gb); s->rl_table_index = decode012(&s->gb); s->rl_chroma_table_index = s->rl_table_index; @@ -498,7 +500,7 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s) s->mv_table_index = get_bits1(&s->gb); break; - case 4: + case MSMP4_WMV1: s->use_skip_mb_code = get_bits1(&s->gb); if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb); @@ -544,13 +546,13 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s) int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) { int left= buf_size*8 - get_bits_count(&s->gb); - int length= s->msmpeg4_version>=3 ? 17 : 16; + int length = s->msmpeg4_version >= MSMP4_V3 ? 17 : 16; /* the alt_bitstream reader could read over the end so we need to check it */ if(left>=length && leftgb, 5); /* fps */ s->bit_rate= get_bits(&s->gb, 11)*1024; - if(s->msmpeg4_version>=3) + if (s->msmpeg4_version >= MSMP4_V3) s->flipflop_rounding= get_bits1(&s->gb); else s->flipflop_rounding= 0; @@ -558,7 +560,7 @@ int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) else if(leftflipflop_rounding= 0; - if(s->msmpeg4_version != 2) + if (s->msmpeg4_version != MSMP4_V2) av_log(s->avctx, AV_LOG_ERROR, "ext header missing, %d left\n", left); } else @@ -573,7 +575,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) { int level, pred; - if(s->msmpeg4_version<=2){ + if (s->msmpeg4_version <= MSMP4_V2) { if (n < 4) { level = get_vlc2(&s->gb, v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 3); } else { @@ -599,7 +601,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) } } - if(s->msmpeg4_version==1){ + if (s->msmpeg4_version == MSMP4_V1) { int32_t *dc_val; pred = msmpeg4v1_pred_dc(s, n, &dc_val); level += pred; @@ -627,8 +629,8 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, { int level, i, last, run, run_diff; int av_uninit(dc_pred_dir); - RLTable *rl; - RL_VLC_ELEM *rl_vlc; + const RLTable *rl; + const RL_VLC_ELEM *rl_vlc; int qmul, qadd; if (s->mb_intra) { @@ -657,7 +659,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, } block[0] = level; - run_diff = s->msmpeg4_version >= 4; + run_diff = s->msmpeg4_version >= MSMP4_WMV1; i = 0; if (!coded) { goto not_coded; @@ -677,7 +679,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, i = -1; rl = &ff_rl_table[3 + s->rl_table_index]; - if(s->msmpeg4_version==2) + if (s->msmpeg4_version == MSMP4_V2) run_diff = 0; else run_diff = 1; @@ -699,12 +701,13 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, int cache; cache= GET_CACHE(re, &s->gb); /* escape */ - if (s->msmpeg4_version==1 || (cache&0x80000000)==0) { - if (s->msmpeg4_version==1 || (cache&0x40000000)==0) { + if (s->msmpeg4_version == MSMP4_V1 || (cache&0x80000000)==0) { + if (s->msmpeg4_version == MSMP4_V1 || (cache&0x40000000)==0) { /* third escape */ - if(s->msmpeg4_version!=1) LAST_SKIP_BITS(re, &s->gb, 2); + if (s->msmpeg4_version != MSMP4_V1) + LAST_SKIP_BITS(re, &s->gb, 2); UPDATE_CACHE(re, &s->gb); - if(s->msmpeg4_version<=3){ + if (s->msmpeg4_version <= MSMP4_V3) { last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); run= SHOW_UBITS(re, &s->gb, 6); SKIP_CACHE(re, &s->gb, 6); level= SHOW_SBITS(re, &s->gb, 8); @@ -803,7 +806,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, i = 63; /* XXX: not optimal */ } } - if(s->msmpeg4_version>=4 && i>0) i=63; //FIXME/XXX optimize + if (s->msmpeg4_version >= MSMP4_WMV1 && i > 0) i=63; //FIXME/XXX optimize s->block_last_index[n] = i; return 0; @@ -811,7 +814,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, void ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr) { - MVTable *mv; + const MVTable *mv; int code, mx, my; mv = &ff_mv_tables[s->mv_table_index]; @@ -848,10 +851,11 @@ const FFCodec ff_msmpeg4v1_decoder = { .p.id = AV_CODEC_ID_MSMPEG4V1, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, }; @@ -862,10 +866,11 @@ const FFCodec ff_msmpeg4v2_decoder = { .p.id = AV_CODEC_ID_MSMPEG4V2, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, }; @@ -876,10 +881,11 @@ const FFCodec ff_msmpeg4v3_decoder = { .p.id = AV_CODEC_ID_MSMPEG4V3, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, }; @@ -890,9 +896,10 @@ const FFCodec ff_wmv1_decoder = { .p.id = AV_CODEC_ID_WMV1, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, - .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, }; diff --git a/src/ExtLib/ffmpeg/libavcodec/mss2.c b/src/ExtLib/ffmpeg/libavcodec/mss2.c index dd0d403338..1888053eb2 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mss2.c +++ b/src/ExtLib/ffmpeg/libavcodec/mss2.c @@ -382,7 +382,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, MSS12Context *c = &ctx->c; VC1Context *v = avctx->priv_data; MpegEncContext *s = &v->s; - AVFrame *f; + MPVWorkPicture *f; int ret; ff_mpeg_flush(avctx); @@ -431,7 +431,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, ff_mpv_frame_end(s); - f = s->current_picture.f; + f = &s->cur_pic; if (v->respic == 3) { ctx->dsp.upsample_plane(f->data[0], f->linesize[0], w, h); diff --git a/src/ExtLib/ffmpeg/libavcodec/nvdec_hevc.c b/src/ExtLib/ffmpeg/libavcodec/nvdec_hevc.c index 1d23f2ab56..ce66ddcfb7 100644 --- a/src/ExtLib/ffmpeg/libavcodec/nvdec_hevc.c +++ b/src/ExtLib/ffmpeg/libavcodec/nvdec_hevc.c @@ -44,8 +44,8 @@ static void dpb_add(CUVIDHEVCPICPARAMS *pp, int idx, const HEVCFrame *src) static void fill_scaling_lists(CUVIDHEVCPICPARAMS *ppc, const HEVCContext *s) { - const ScalingList *sl = s->ps.pps->scaling_list_data_present_flag ? - &s->ps.pps->scaling_list : &s->ps.sps->scaling_list; + const ScalingList *sl = s->pps->scaling_list_data_present_flag ? + &s->pps->scaling_list : &s->pps->sps->scaling_list; int i, j, pos; for (i = 0; i < 6; i++) { @@ -73,8 +73,8 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { const HEVCContext *s = avctx->priv_data; - const HEVCPPS *pps = s->ps.pps; - const HEVCSPS *sps = s->ps.sps; + const HEVCPPS *pps = s->pps; + const HEVCSPS *sps = pps->sps; NVDECContext *ctx = avctx->internal->hwaccel_priv_data; CUVIDPICPARAMS *pp = &ctx->pic_params; @@ -187,7 +187,7 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, .NumBitsForShortTermRPSInSlice = s->sh.short_term_rps ? s->sh.short_term_ref_pic_set_size : 0, .NumDeltaPocsOfRefRpsIdx = s->sh.short_term_rps ? s->sh.short_term_rps->rps_idx_num_delta_pocs : 0, - .NumPocTotalCurr = ff_hevc_frame_nb_refs(s), + .NumPocTotalCurr = ff_hevc_frame_nb_refs(&s->sh, pps), .NumPocStCurrBefore = s->rps[ST_CURR_BEF].nb_refs, .NumPocStCurrAfter = s->rps[ST_CURR_AFT].nb_refs, .NumPocLtCurr = s->rps[LT_CURR].nb_refs, @@ -300,7 +300,7 @@ static int nvdec_hevc_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) { const HEVCContext *s = avctx->priv_data; - const HEVCSPS *sps = s->ps.sps; + const HEVCSPS *sps = s->pps->sps; return ff_nvdec_frame_params(avctx, hw_frames_ctx, sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering + 1, 1); } diff --git a/src/ExtLib/ffmpeg/libavcodec/nvdec_mpeg12.c b/src/ExtLib/ffmpeg/libavcodec/nvdec_mpeg12.c index 7e79c422fc..53f7d4f2e8 100644 --- a/src/ExtLib/ffmpeg/libavcodec/nvdec_mpeg12.c +++ b/src/ExtLib/ffmpeg/libavcodec/nvdec_mpeg12.c @@ -39,7 +39,7 @@ static int nvdec_mpeg12_start_frame(AVCodecContext *avctx, const uint8_t *buffer CUVIDMPEG2PICPARAMS *ppc = &pp->CodecSpecific.mpeg2; FrameDecodeData *fdd; NVDECFrame *cf; - AVFrame *cur_frame = s->current_picture.f; + AVFrame *cur_frame = s->cur_pic.ptr->f; int ret, i; @@ -64,8 +64,8 @@ static int nvdec_mpeg12_start_frame(AVCodecContext *avctx, const uint8_t *buffer s->pict_type == AV_PICTURE_TYPE_P, .CodecSpecific.mpeg2 = { - .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_picture.f), - .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_picture.f), + .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_pic.ptr ? s->last_pic.ptr->f : NULL), + .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_pic.ptr ? s->next_pic.ptr->f : NULL), .picture_coding_type = s->pict_type, .full_pel_forward_vector = s->full_pel[0], diff --git a/src/ExtLib/ffmpeg/libavcodec/nvdec_vc1.c b/src/ExtLib/ffmpeg/libavcodec/nvdec_vc1.c index 33a929ccfc..ab48819b81 100644 --- a/src/ExtLib/ffmpeg/libavcodec/nvdec_vc1.c +++ b/src/ExtLib/ffmpeg/libavcodec/nvdec_vc1.c @@ -38,7 +38,7 @@ static int nvdec_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, u CUVIDPICPARAMS *pp = &ctx->pic_params; FrameDecodeData *fdd; NVDECFrame *cf; - AVFrame *cur_frame = s->current_picture.f; + AVFrame *cur_frame = s->cur_pic.ptr->f; int ret; @@ -63,8 +63,8 @@ static int nvdec_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, u s->pict_type == AV_PICTURE_TYPE_P, .CodecSpecific.vc1 = { - .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_picture.f), - .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_picture.f), + .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_pic.ptr ? s->last_pic.ptr->f : NULL), + .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_pic.ptr ? s->next_pic.ptr->f : NULL), .FrameWidth = cur_frame->width, .FrameHeight = cur_frame->height, diff --git a/src/ExtLib/ffmpeg/libavcodec/opus_pvq.c b/src/ExtLib/ffmpeg/libavcodec/opus_pvq.c index 554a72609f..b16916fbfb 100644 --- a/src/ExtLib/ffmpeg/libavcodec/opus_pvq.c +++ b/src/ExtLib/ffmpeg/libavcodec/opus_pvq.c @@ -663,7 +663,7 @@ static av_always_inline uint32_t quant_band_template(CeltPVQ *pvq, CeltFrame *f, if (itheta == 0) { imid = 32767; iside = 0; - fill = av_mod_uintp2(fill, blocks); + fill = av_zero_extend(fill, blocks); delta = -16384; } else if (itheta == 16384) { imid = 0; @@ -878,7 +878,7 @@ static av_always_inline uint32_t quant_band_template(CeltPVQ *pvq, CeltFrame *f, for (i = 0; i < N0; i++) lowband_out[i] = n * X[i]; } - cm = av_mod_uintp2(cm, blocks); + cm = av_zero_extend(cm, blocks); } return cm; diff --git a/src/ExtLib/ffmpeg/libavcodec/opus_rc.c b/src/ExtLib/ffmpeg/libavcodec/opus_rc.c index 031332c9ce..0687e9e779 100644 --- a/src/ExtLib/ffmpeg/libavcodec/opus_rc.c +++ b/src/ExtLib/ffmpeg/libavcodec/opus_rc.c @@ -147,7 +147,7 @@ uint32_t ff_opus_rc_get_raw(OpusRangeCoder *rc, uint32_t count) rc->rb.bytes--; } - value = av_mod_uintp2(rc->rb.cacheval, count); + value = av_zero_extend(rc->rb.cacheval, count); rc->rb.cacheval >>= count; rc->rb.cachelen -= count; rc->total_bits += count; @@ -163,7 +163,7 @@ void ff_opus_rc_put_raw(OpusRangeCoder *rc, uint32_t val, uint32_t count) const int to_write = FFMIN(32 - rc->rb.cachelen, count); rc->total_bits += count; - rc->rb.cacheval |= av_mod_uintp2(val, to_write) << rc->rb.cachelen; + rc->rb.cacheval |= av_zero_extend(val, to_write) << rc->rb.cachelen; rc->rb.cachelen = (rc->rb.cachelen + to_write) % 32; if (!rc->rb.cachelen && count) { @@ -171,7 +171,7 @@ void ff_opus_rc_put_raw(OpusRangeCoder *rc, uint32_t val, uint32_t count) rc->rb.bytes += 4; rc->rb.position -= 4; rc->rb.cachelen = count - to_write; - rc->rb.cacheval = av_mod_uintp2(val >> to_write, rc->rb.cachelen); + rc->rb.cacheval = av_zero_extend(val >> to_write, rc->rb.cachelen); av_assert0(rc->rng_cur < rc->rb.position); } } diff --git a/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c b/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c index 3f2fce19ca..2c7feb512e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c @@ -103,8 +103,6 @@ av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx) #if ARCH_AARCH64 ff_pixblockdsp_init_aarch64(c, avctx, high_bit_depth); -#elif ARCH_ALPHA - ff_pixblockdsp_init_alpha(c, avctx, high_bit_depth); #elif ARCH_ARM ff_pixblockdsp_init_arm(c, avctx, high_bit_depth); #elif ARCH_PPC diff --git a/src/ExtLib/ffmpeg/libavcodec/pngdec.c b/src/ExtLib/ffmpeg/libavcodec/pngdec.c index 8934a95a7f..1c910e6a5b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/pngdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/pngdec.c @@ -1018,7 +1018,7 @@ static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s, for (i = 0; i < length / 2; i++) { /* only use the least significant bits */ - v = av_mod_uintp2(bytestream2_get_be16(gb), s->bit_depth); + v = av_zero_extend(bytestream2_get_be16(gb), s->bit_depth); if (s->bit_depth > 8) AV_WB16(&s->transparent_color_be[2 * i], v); diff --git a/src/ExtLib/ffmpeg/libavcodec/pthread_frame.c b/src/ExtLib/ffmpeg/libavcodec/pthread_frame.c index 982e4a64c5..85a3dce929 100644 --- a/src/ExtLib/ffmpeg/libavcodec/pthread_frame.c +++ b/src/ExtLib/ffmpeg/libavcodec/pthread_frame.c @@ -996,11 +996,6 @@ int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags) int ret; f->owner[0] = f->owner[1] = avctx; - /* Hint: It is possible for this function to be called with codecs - * that don't support frame threading at all, namely in case - * a frame-threaded decoder shares code with codecs that are not. - * This currently affects non-MPEG-4 mpegvideo codecs. - * The following check will always be true for them. */ if (!(avctx->active_thread_type & FF_THREAD_FRAME)) return ff_get_buffer(avctx, f->f, flags); diff --git a/src/ExtLib/ffmpeg/libavcodec/put_bits.h b/src/ExtLib/ffmpeg/libavcodec/put_bits.h index 4561dc131a..0caaa6b338 100644 --- a/src/ExtLib/ffmpeg/libavcodec/put_bits.h +++ b/src/ExtLib/ffmpeg/libavcodec/put_bits.h @@ -282,7 +282,7 @@ static inline void put_sbits(PutBitContext *pb, int n, int32_t value) { av_assert2(n >= 0 && n <= 31); - put_bits(pb, n, av_mod_uintp2(value, n)); + put_bits(pb, n, av_zero_extend(value, n)); } /** diff --git a/src/ExtLib/ffmpeg/libavcodec/ratecontrol.h b/src/ExtLib/ffmpeg/libavcodec/ratecontrol.h index 1f44b44341..4d71a181b5 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ratecontrol.h +++ b/src/ExtLib/ffmpeg/libavcodec/ratecontrol.h @@ -39,6 +39,9 @@ typedef struct Predictor{ typedef struct RateControlEntry{ int pict_type; float qscale; + int i_count; + int f_code; + int b_code; int mv_bits; int i_tex_bits; int p_tex_bits; @@ -49,10 +52,6 @@ typedef struct RateControlEntry{ float new_qscale; int64_t mc_mb_var_sum; int64_t mb_var_sum; - int i_count; - int skip_count; - int f_code; - int b_code; }RateControlEntry; /** @@ -87,8 +86,8 @@ struct MpegEncContext; int ff_rate_control_init(struct MpegEncContext *s); float ff_rate_estimate_qscale(struct MpegEncContext *s, int dry_run); void ff_write_pass1_stats(struct MpegEncContext *s); -void ff_rate_control_uninit(struct MpegEncContext *s); int ff_vbv_update(struct MpegEncContext *s, int frame_size); void ff_get_2pass_fcode(struct MpegEncContext *s); +void ff_rate_control_uninit(RateControlContext *rcc); #endif /* AVCODEC_RATECONTROL_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/rv10.c b/src/ExtLib/ffmpeg/libavcodec/rv10.c index df487b24a9..3dcee0a065 100644 --- a/src/ExtLib/ffmpeg/libavcodec/rv10.c +++ b/src/ExtLib/ffmpeg/libavcodec/rv10.c @@ -170,7 +170,7 @@ static int rv20_decode_picture_header(RVDecContext *rv, int whole_size) av_log(s->avctx, AV_LOG_ERROR, "low delay B\n"); return -1; } - if (!s->last_picture_ptr && s->pict_type == AV_PICTURE_TYPE_B) { + if (!s->last_pic.ptr && s->pict_type == AV_PICTURE_TYPE_B) { av_log(s->avctx, AV_LOG_ERROR, "early B-frame\n"); return AVERROR_INVALIDDATA; } @@ -364,7 +364,9 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) avctx->coded_height, 0, avctx)) < 0) return ret; - ff_mpv_decode_init(s, avctx); + ret = ff_mpv_decode_init(s, avctx); + if (ret < 0) + return ret; s->out_format = FMT_H263; @@ -416,14 +418,6 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) return 0; } -static av_cold int rv10_decode_end(AVCodecContext *avctx) -{ - MpegEncContext *s = avctx->priv_data; - - ff_mpv_common_end(s); - return 0; -} - static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, int buf_size, int buf_size2, int whole_size) { @@ -458,9 +452,9 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, if (whole_size < s->mb_width * s->mb_height / 8) return AVERROR_INVALIDDATA; - if ((s->mb_x == 0 && s->mb_y == 0) || !s->current_picture_ptr) { + if ((s->mb_x == 0 && s->mb_y == 0) || !s->cur_pic.ptr) { // FIXME write parser so we always have complete frames? - if (s->current_picture_ptr) { + if (s->cur_pic.ptr) { ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0; @@ -469,7 +463,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, return ret; ff_mpeg_er_frame_start(s); } else { - if (s->current_picture_ptr->f->pict_type != s->pict_type) { + if (s->cur_pic.ptr->f->pict_type != s->pict_type) { av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n"); return AVERROR_INVALIDDATA; } @@ -632,28 +626,28 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, i++; } - if (s->current_picture_ptr && s->mb_y >= s->mb_height) { + if (s->cur_pic.ptr && s->mb_y >= s->mb_height) { ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { - if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) + if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0) return ret; - ff_print_debug_info(s, s->current_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); - } else if (s->last_picture_ptr) { - if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) + ff_print_debug_info(s, s->cur_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict, s->cur_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG1); + } else if (s->last_pic.ptr) { + if ((ret = av_frame_ref(pict, s->last_pic.ptr->f)) < 0) return ret; - ff_print_debug_info(s, s->last_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict,s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); + ff_print_debug_info(s, s->last_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict,s->last_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG1); } - if (s->last_picture_ptr || s->low_delay) { + if (s->last_pic.ptr || s->low_delay) { *got_frame = 1; } // so we can detect if frame_end was not called (find some nicer solution...) - s->current_picture_ptr = NULL; + ff_mpv_unref_picture(&s->cur_pic); } return avpkt->size; @@ -666,10 +660,11 @@ const FFCodec ff_rv10_decoder = { .p.id = AV_CODEC_ID_RV10, .priv_data_size = sizeof(RVDecContext), .init = rv10_decode_init, - .close = rv10_decode_end, FF_CODEC_DECODE_CB(rv10_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_rv20_decoder = { @@ -679,9 +674,10 @@ const FFCodec ff_rv20_decoder = { .p.id = AV_CODEC_ID_RV20, .priv_data_size = sizeof(RVDecContext), .init = rv10_decode_init, - .close = rv10_decode_end, FF_CODEC_DECODE_CB(rv10_decode_frame), + .close = ff_mpv_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .flush = ff_mpeg_flush, .p.max_lowres = 3, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/src/ExtLib/ffmpeg/libavcodec/rv30.c b/src/ExtLib/ffmpeg/libavcodec/rv30.c index 316962fbbb..5e1dd01aa1 100644 --- a/src/ExtLib/ffmpeg/libavcodec/rv30.c +++ b/src/ExtLib/ffmpeg/libavcodec/rv30.c @@ -160,7 +160,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ - int mbtype = s->current_picture_ptr->mb_type[mb_pos]; + int mbtype = s->cur_pic.mb_type[mb_pos]; if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype)) r->deblock_coefs[mb_pos] = 0xFFFF; if(IS_INTRA(mbtype)) @@ -172,11 +172,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row) */ mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ - cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]]; + cur_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos]]; if(mb_x) - left_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - 1]]; + left_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos - 1]]; for(j = 0; j < 16; j += 4){ - Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x; + Y = s->cur_pic.data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x; for(i = !mb_x; i < 4; i++, Y += 4){ int ij = i + j; loc_lim = 0; @@ -196,7 +196,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) if(mb_x) left_cbp = (r->cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF; for(j = 0; j < 8; j += 4){ - C = s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x; + C = s->cur_pic.data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x; for(i = !mb_x; i < 2; i++, C += 4){ int ij = i + (j >> 1); loc_lim = 0; @@ -214,11 +214,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row) } mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ - cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]]; + cur_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos]]; if(row) - top_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - s->mb_stride]]; + top_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos - s->mb_stride]]; for(j = 4*!row; j < 16; j += 4){ - Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize; + Y = s->cur_pic.data[0] + mb_x*16 + (row*16 + j) * s->linesize; for(i = 0; i < 4; i++, Y += 4){ int ij = i + j; loc_lim = 0; @@ -238,7 +238,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) if(row) top_cbp = (r->cbp_chroma[mb_pos - s->mb_stride] >> (k*4)) & 0xF; for(j = 4*!row; j < 8; j += 4){ - C = s->current_picture_ptr->f->data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize; + C = s->cur_pic.data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize; for(i = 0; i < 2; i++, C += 4){ int ij = i + (j >> 1); loc_lim = 0; @@ -302,6 +302,7 @@ const FFCodec ff_rv30_decoder = { FF_CODEC_DECODE_CB(ff_rv34_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .flush = ff_mpeg_flush, UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context), }; diff --git a/src/ExtLib/ffmpeg/libavcodec/rv34.c b/src/ExtLib/ffmpeg/libavcodec/rv34.c index cfd4cd259a..728e117df4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/rv34.c +++ b/src/ExtLib/ffmpeg/libavcodec/rv34.c @@ -43,7 +43,7 @@ #include "qpeldsp.h" #include "rectangle.h" #include "thread.h" -#include "threadframe.h" +#include "threadprogress.h" #include "rv34vlc.h" #include "rv34data.h" @@ -369,7 +369,7 @@ static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types) r->is16 = get_bits1(gb); if(r->is16){ - s->current_picture_ptr->mb_type[mb_pos] = MB_TYPE_INTRA16x16; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA16x16; r->block_type = RV34_MB_TYPE_INTRA16x16; t = get_bits(gb, 2); fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); @@ -379,7 +379,7 @@ static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types) if(!get_bits1(gb)) av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n"); } - s->current_picture_ptr->mb_type[mb_pos] = MB_TYPE_INTRA; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; r->block_type = RV34_MB_TYPE_INTRA; if(r->decode_intra_types(r, gb, intra_types) < 0) return -1; @@ -405,7 +405,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) r->block_type = r->decode_mb_info(r); if(r->block_type == -1) return -1; - s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; + s->cur_pic.mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; r->mb_type[mb_pos] = r->block_type; if(r->block_type == RV34_MB_SKIP){ if(s->pict_type == AV_PICTURE_TYPE_P) @@ -413,7 +413,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) if(s->pict_type == AV_PICTURE_TYPE_B) r->mb_type[mb_pos] = RV34_MB_B_DIRECT; } - r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]); + r->is16 = !!IS_INTRA16x16(s->cur_pic.mb_type[mb_pos]); if (rv34_decode_mv(r, r->block_type) < 0) return -1; if(r->block_type == RV34_MB_SKIP){ @@ -423,7 +423,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) r->chroma_vlc = 1; r->luma_vlc = 0; - if(IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){ + if (IS_INTRA(s->cur_pic.mb_type[mb_pos])) { if(r->is16){ t = get_bits(gb, 2); fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); @@ -482,33 +482,34 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int int mx, my; int* avail = r->avail_cache + avail_indexes[subblock_no]; int c_off = part_sizes_w[block_type]; + int16_t (*motion_val)[2] = s->cur_pic.motion_val[0]; mv_pos += (subblock_no & 1) + (subblock_no >> 1)*s->b8_stride; if(subblock_no == 3) c_off = -1; if(avail[-1]){ - A[0] = s->current_picture_ptr->motion_val[0][mv_pos-1][0]; - A[1] = s->current_picture_ptr->motion_val[0][mv_pos-1][1]; + A[0] = motion_val[mv_pos-1][0]; + A[1] = motion_val[mv_pos-1][1]; } if(avail[-4]){ - B[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][0]; - B[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][1]; + B[0] = motion_val[mv_pos-s->b8_stride][0]; + B[1] = motion_val[mv_pos-s->b8_stride][1]; }else{ B[0] = A[0]; B[1] = A[1]; } if(!avail[c_off-4]){ if(avail[-4] && (avail[-1] || r->rv30)){ - C[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride-1][0]; - C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride-1][1]; + C[0] = motion_val[mv_pos-s->b8_stride-1][0]; + C[1] = motion_val[mv_pos-s->b8_stride-1][1]; }else{ C[0] = A[0]; C[1] = A[1]; } }else{ - C[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][0]; - C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][1]; + C[0] = motion_val[mv_pos-s->b8_stride+c_off][0]; + C[1] = motion_val[mv_pos-s->b8_stride+c_off][1]; } mx = mid_pred(A[0], B[0], C[0]); my = mid_pred(A[1], B[1], C[1]); @@ -516,8 +517,8 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int my += r->dmv[dmv_no][1]; for(j = 0; j < part_sizes_h[block_type]; j++){ for(i = 0; i < part_sizes_w[block_type]; i++){ - s->current_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][0] = mx; - s->current_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][1] = my; + motion_val[mv_pos + i + j*s->b8_stride][0] = mx; + motion_val[mv_pos + i + j*s->b8_stride][1] = my; } } } @@ -566,7 +567,7 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir) int has_A = 0, has_B = 0, has_C = 0; int mx, my; int i, j; - Picture *cur_pic = s->current_picture_ptr; + MPVWorkPicture *cur_pic = &s->cur_pic; const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0; int type = cur_pic->mb_type[mb_pos]; @@ -619,27 +620,27 @@ static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir) int* avail = r->avail_cache + avail_indexes[0]; if(avail[-1]){ - A[0] = s->current_picture_ptr->motion_val[0][mv_pos - 1][0]; - A[1] = s->current_picture_ptr->motion_val[0][mv_pos - 1][1]; + A[0] = s->cur_pic.motion_val[0][mv_pos - 1][0]; + A[1] = s->cur_pic.motion_val[0][mv_pos - 1][1]; } if(avail[-4]){ - B[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride][0]; - B[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride][1]; + B[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride][0]; + B[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride][1]; }else{ B[0] = A[0]; B[1] = A[1]; } if(!avail[-4 + 2]){ if(avail[-4] && (avail[-1])){ - C[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride - 1][0]; - C[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride - 1][1]; + C[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride - 1][0]; + C[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride - 1][1]; }else{ C[0] = A[0]; C[1] = A[1]; } }else{ - C[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride + 2][0]; - C[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride + 2][1]; + C[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride + 2][0]; + C[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride + 2][1]; } mx = mid_pred(A[0], B[0], C[0]); my = mid_pred(A[1], B[1], C[1]); @@ -648,8 +649,8 @@ static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir) for(j = 0; j < 2; j++){ for(i = 0; i < 2; i++){ for(k = 0; k < 2; k++){ - s->current_picture_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx; - s->current_picture_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][1] = my; + s->cur_pic.motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx; + s->cur_pic.motion_val[k][mv_pos + i + j*s->b8_stride][1] = my; } } } @@ -680,32 +681,34 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, h264_chroma_mc_func (*chroma_mc)) { MpegEncContext *s = &r->s; - uint8_t *Y, *U, *V, *srcY, *srcU, *srcV; + uint8_t *Y, *U, *V; + const uint8_t *srcY, *srcU, *srcV; int dxy, mx, my, umx, umy, lx, ly, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride + mv_off; int is16x16 = 1; int emu = 0; + int16_t *motion_val = s->cur_pic.motion_val[dir][mv_pos]; if(thirdpel){ int chroma_mx, chroma_my; - mx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24); - my = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24); - lx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3; - ly = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3; - chroma_mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] / 2; - chroma_my = s->current_picture_ptr->motion_val[dir][mv_pos][1] / 2; + mx = (motion_val[0] + (3 << 24)) / 3 - (1 << 24); + my = (motion_val[1] + (3 << 24)) / 3 - (1 << 24); + lx = (motion_val[0] + (3 << 24)) % 3; + ly = (motion_val[1] + (3 << 24)) % 3; + chroma_mx = motion_val[0] / 2; + chroma_my = motion_val[1] / 2; umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24); umy = (chroma_my + (3 << 24)) / 3 - (1 << 24); uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3]; uvmy = chroma_coeffs[(chroma_my + (3 << 24)) % 3]; }else{ int cx, cy; - mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] >> 2; - my = s->current_picture_ptr->motion_val[dir][mv_pos][1] >> 2; - lx = s->current_picture_ptr->motion_val[dir][mv_pos][0] & 3; - ly = s->current_picture_ptr->motion_val[dir][mv_pos][1] & 3; - cx = s->current_picture_ptr->motion_val[dir][mv_pos][0] / 2; - cy = s->current_picture_ptr->motion_val[dir][mv_pos][1] / 2; + mx = motion_val[0] >> 2; + my = motion_val[1] >> 2; + lx = motion_val[0] & 3; + ly = motion_val[1] & 3; + cx = motion_val[0] / 2; + cy = motion_val[1] / 2; umx = cx >> 2; umy = cy >> 2; uvmx = (cx & 3) << 1; @@ -718,14 +721,14 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) { /* wait for the referenced mb row to be finished */ int mb_row = s->mb_y + ((yoff + my + 5 + 8 * height) >> 4); - const ThreadFrame *f = dir ? &s->next_picture_ptr->tf : &s->last_picture_ptr->tf; - ff_thread_await_progress(f, mb_row, 0); + const ThreadProgress *p = dir ? &s->next_pic.ptr->progress : &s->last_pic.ptr->progress; + ff_thread_progress_await(p, mb_row); } dxy = ly*4 + lx; - srcY = dir ? s->next_picture_ptr->f->data[0] : s->last_picture_ptr->f->data[0]; - srcU = dir ? s->next_picture_ptr->f->data[1] : s->last_picture_ptr->f->data[1]; - srcV = dir ? s->next_picture_ptr->f->data[2] : s->last_picture_ptr->f->data[2]; + srcY = dir ? s->next_pic.data[0] : s->last_pic.data[0]; + srcU = dir ? s->next_pic.data[1] : s->last_pic.data[1]; + srcV = dir ? s->next_pic.data[2] : s->last_pic.data[2]; src_x = s->mb_x * 16 + xoff + mx; src_y = s->mb_y * 16 + yoff + my; uvsrc_x = s->mb_x * 8 + (xoff >> 1) + umx; @@ -886,11 +889,11 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) switch(block_type){ case RV34_MB_TYPE_INTRA: case RV34_MB_TYPE_INTRA16x16: - ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); + ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); return 0; case RV34_MB_SKIP: if(s->pict_type == AV_PICTURE_TYPE_P){ - ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); + ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0); break; } @@ -898,23 +901,23 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) //surprisingly, it uses motion scheme from next reference frame /* wait for the current mb row to be finished */ if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) - ff_thread_await_progress(&s->next_picture_ptr->tf, FFMAX(0, s->mb_y-1), 0); + ff_thread_progress_await(&s->next_pic.ptr->progress, FFMAX(0, s->mb_y-1)); - next_bt = s->next_picture_ptr->mb_type[s->mb_x + s->mb_y * s->mb_stride]; + next_bt = s->next_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride]; if(IS_INTRA(next_bt) || IS_SKIP(next_bt)){ - ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); - ZERO8x2(s->current_picture_ptr->motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); + ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); + ZERO8x2(s->cur_pic.motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); }else for(j = 0; j < 2; j++) for(i = 0; i < 2; i++) for(k = 0; k < 2; k++) for(l = 0; l < 2; l++) - s->current_picture_ptr->motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][k]); + s->cur_pic.motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_pic.motion_val[0][mv_pos + i + j*s->b8_stride][k]); if(!(IS_16X8(next_bt) || IS_8X16(next_bt) || IS_8X8(next_bt))) //we can use whole macroblock MC rv34_mc_2mv(r, block_type); else rv34_mc_2mv_skip(r); - ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); + ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); break; case RV34_MB_P_16x16: case RV34_MB_P_MIX16x16: @@ -1182,7 +1185,7 @@ static int rv34_set_deblock_coef(RV34DecContext *r) MpegEncContext *s = &r->s; int hmvmask = 0, vmvmask = 0, i, j; int midx = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride; - int16_t (*motion_val)[2] = &s->current_picture_ptr->motion_val[0][midx]; + int16_t (*motion_val)[2] = &s->cur_pic.motion_val[0][midx]; for(j = 0; j < 16; j += 8){ for(i = 0; i < 2; i++){ if(is_mv_diff_gt_3(motion_val + i, 1)) @@ -1225,26 +1228,26 @@ static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types) dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; if(s->mb_x && dist) r->avail_cache[5] = - r->avail_cache[9] = s->current_picture_ptr->mb_type[mb_pos - 1]; + r->avail_cache[9] = s->cur_pic.mb_type[mb_pos - 1]; if(dist >= s->mb_width) r->avail_cache[2] = - r->avail_cache[3] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride]; + r->avail_cache[3] = s->cur_pic.mb_type[mb_pos - s->mb_stride]; if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) - r->avail_cache[4] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride + 1]; + r->avail_cache[4] = s->cur_pic.mb_type[mb_pos - s->mb_stride + 1]; if(s->mb_x && dist > s->mb_width) - r->avail_cache[1] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1]; + r->avail_cache[1] = s->cur_pic.mb_type[mb_pos - s->mb_stride - 1]; s->qscale = r->si.quant; cbp = cbp2 = rv34_decode_inter_mb_header(r, intra_types); r->cbp_luma [mb_pos] = cbp; r->cbp_chroma[mb_pos] = cbp >> 16; r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos]; - s->current_picture_ptr->qscale_table[mb_pos] = s->qscale; + s->cur_pic.qscale_table[mb_pos] = s->qscale; if(cbp == -1) return -1; - if (IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){ + if (IS_INTRA(s->cur_pic.mb_type[mb_pos])) { if(r->is16) rv34_output_i16x16(r, intra_types, cbp); else rv34_output_intra(r, intra_types, cbp); return 0; @@ -1327,21 +1330,21 @@ static int rv34_decode_intra_macroblock(RV34DecContext *r, int8_t *intra_types) dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; if(s->mb_x && dist) r->avail_cache[5] = - r->avail_cache[9] = s->current_picture_ptr->mb_type[mb_pos - 1]; + r->avail_cache[9] = s->cur_pic.mb_type[mb_pos - 1]; if(dist >= s->mb_width) r->avail_cache[2] = - r->avail_cache[3] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride]; + r->avail_cache[3] = s->cur_pic.mb_type[mb_pos - s->mb_stride]; if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) - r->avail_cache[4] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride + 1]; + r->avail_cache[4] = s->cur_pic.mb_type[mb_pos - s->mb_stride + 1]; if(s->mb_x && dist > s->mb_width) - r->avail_cache[1] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1]; + r->avail_cache[1] = s->cur_pic.mb_type[mb_pos - s->mb_stride - 1]; s->qscale = r->si.quant; cbp = rv34_decode_intra_mb_header(r, intra_types); r->cbp_luma [mb_pos] = cbp; r->cbp_chroma[mb_pos] = cbp >> 16; r->deblock_coefs[mb_pos] = 0xFFFF; - s->current_picture_ptr->qscale_table[mb_pos] = s->qscale; + s->cur_pic.qscale_table[mb_pos] = s->qscale; if(cbp == -1) return -1; @@ -1482,8 +1485,8 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int r->loop_filter(r, s->mb_y - 2); if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) - ff_thread_report_progress(&s->current_picture_ptr->tf, - s->mb_y - 2, 0); + ff_thread_progress_report(&s->cur_pic.ptr->progress, + s->mb_y - 2); } if(s->mb_x == s->resync_mb_x) @@ -1507,7 +1510,9 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) MpegEncContext *s = &r->s; int ret; - ff_mpv_decode_init(s, avctx); + ret = ff_mpv_decode_init(s, avctx); + if (ret < 0) + return ret; s->out_format = FMT_H263; avctx->pix_fmt = AV_PIX_FMT_YUV420P; @@ -1519,10 +1524,9 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) ff_h264_pred_init(&r->h, AV_CODEC_ID_RV40, 8, 1); - if ((ret = rv34_decoder_alloc(r)) < 0) { - ff_mpv_common_end(&r->s); + ret = rv34_decoder_alloc(r); + if (ret < 0) return ret; - } ff_thread_once(&init_static_once, rv34_init_tables); @@ -1580,19 +1584,19 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict) s->mb_num_left = 0; if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) - ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); + ff_thread_progress_report(&s->cur_pic.ptr->progress, INT_MAX); if (s->pict_type == AV_PICTURE_TYPE_B) { - if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) + if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0) return ret; - ff_print_debug_info(s, s->current_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); + ff_print_debug_info(s, s->cur_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict, s->cur_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG1); got_picture = 1; - } else if (s->last_picture_ptr) { - if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) + } else if (s->last_pic.ptr) { + if ((ret = av_frame_ref(pict, s->last_pic.ptr->f)) < 0) return ret; - ff_print_debug_info(s, s->last_picture_ptr, pict); - ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); + ff_print_debug_info(s, s->last_pic.ptr, pict); + ff_mpv_export_qp_table(s, pict, s->last_pic.ptr, FF_MPV_QSCALE_TYPE_MPEG1); got_picture = 1; } @@ -1627,10 +1631,10 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, /* no supplementary picture */ if (buf_size == 0) { /* special case for last picture */ - if (s->next_picture_ptr) { - if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) + if (s->next_pic.ptr) { + if ((ret = av_frame_ref(pict, s->next_pic.ptr->f)) < 0) return ret; - s->next_picture_ptr = NULL; + ff_mpv_unref_picture(&s->next_pic); *got_picture_ptr = 1; } @@ -1653,8 +1657,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n"); return AVERROR_INVALIDDATA; } - if ((!s->last_picture_ptr || !s->last_picture_ptr->f->data[0]) && - si.type == AV_PICTURE_TYPE_B) { + if (!s->last_pic.ptr && si.type == AV_PICTURE_TYPE_B) { av_log(avctx, AV_LOG_ERROR, "Invalid decoder state: B-frame without " "reference data.\n"); faulty_b = 1; @@ -1666,7 +1669,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, /* first slice */ if (si.start == 0) { - if (s->mb_num_left > 0 && s->current_picture_ptr) { + if (s->mb_num_left > 0 && s->cur_pic.ptr) { av_log(avctx, AV_LOG_ERROR, "New frame but still %d MB left.\n", s->mb_num_left); if (!s->context_reinit) @@ -1791,7 +1794,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, break; } - if (s->current_picture_ptr) { + if (s->cur_pic.ptr) { if (last) { if(r->loop_filter) r->loop_filter(r, s->mb_height - 1); @@ -1808,7 +1811,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_num_left = 0; - ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); + ff_thread_progress_report(&s->cur_pic.ptr->progress, INT_MAX); return AVERROR_INVALIDDATA; } } @@ -1820,8 +1823,7 @@ av_cold int ff_rv34_decode_end(AVCodecContext *avctx) { RV34DecContext *r = avctx->priv_data; - ff_mpv_common_end(&r->s); rv34_decoder_free(r); - return 0; + return ff_mpv_decode_close(avctx); } diff --git a/src/ExtLib/ffmpeg/libavcodec/rv40.c b/src/ExtLib/ffmpeg/libavcodec/rv40.c index 19d4e742df..0a5136d129 100644 --- a/src/ExtLib/ffmpeg/libavcodec/rv40.c +++ b/src/ExtLib/ffmpeg/libavcodec/rv40.c @@ -371,7 +371,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ - int mbtype = s->current_picture_ptr->mb_type[mb_pos]; + int mbtype = s->cur_pic.mb_type[mb_pos]; if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype)) r->cbp_luma [mb_pos] = r->deblock_coefs[mb_pos] = 0xFFFF; if(IS_INTRA(mbtype)) @@ -386,7 +386,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) unsigned y_to_deblock; int c_to_deblock[2]; - q = s->current_picture_ptr->qscale_table[mb_pos]; + q = s->cur_pic.qscale_table[mb_pos]; alpha = rv40_alpha_tab[q]; beta = rv40_beta_tab [q]; betaY = betaC = beta * 3; @@ -401,7 +401,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) if(avail[i]){ int pos = mb_pos + neighbour_offs_x[i] + neighbour_offs_y[i]*s->mb_stride; mvmasks[i] = r->deblock_coefs[pos]; - mbtype [i] = s->current_picture_ptr->mb_type[pos]; + mbtype [i] = s->cur_pic.mb_type[pos]; cbp [i] = r->cbp_luma[pos]; uvcbp[i][0] = r->cbp_chroma[pos] & 0xF; uvcbp[i][1] = r->cbp_chroma[pos] >> 4; @@ -460,7 +460,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) } for(j = 0; j < 16; j += 4){ - Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize; + Y = s->cur_pic.data[0] + mb_x*16 + (row*16 + j) * s->linesize; for(i = 0; i < 4; i++, Y += 4){ int ij = i + j; int clip_cur = y_to_deblock & (MASK_CUR << ij) ? clip[POS_CUR] : 0; @@ -505,7 +505,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) } for(k = 0; k < 2; k++){ for(j = 0; j < 2; j++){ - C = s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize; + C = s->cur_pic.data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize; for(i = 0; i < 2; i++, C += 4){ int ij = i + j*2; int clip_cur = c_to_deblock[k] & (MASK_CUR << ij) ? clip[POS_CUR] : 0; @@ -580,6 +580,7 @@ const FFCodec ff_rv40_decoder = { FF_CODEC_DECODE_CB(ff_rv34_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .flush = ff_mpeg_flush, UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context), }; diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1.c b/src/ExtLib/ffmpeg/libavcodec/vc1.c index e234192fdd..987e77fcc7 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1.c @@ -856,7 +856,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B; else v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; - v->s.current_picture_ptr->f->pict_type = v->s.pict_type; + v->s.cur_pic.ptr->f->pict_type = v->s.pict_type; if (!v->pic_header_flag) goto parse_common_info; } diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1.h b/src/ExtLib/ffmpeg/libavcodec/vc1.h index 776467e062..557a917c2e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1.h +++ b/src/ExtLib/ffmpeg/libavcodec/vc1.h @@ -293,6 +293,7 @@ typedef struct VC1Context{ uint8_t next_luty[2][256], next_lutuv[2][256]; ///< lookup tables used for intensity compensation uint8_t (*curr_luty)[256] ,(*curr_lutuv)[256]; int last_use_ic, *curr_use_ic, next_use_ic, aux_use_ic; + int last_interlaced, next_interlaced; ///< whether last_pic, next_pic is interlaced int rnd; ///< rounding control int cbptab; diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1_block.c b/src/ExtLib/ffmpeg/libavcodec/vc1_block.c index 322acebfe5..640f7329ca 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1_block.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1_block.c @@ -59,9 +59,9 @@ static inline void init_block_index(VC1Context *v) MpegEncContext *s = &v->s; ff_init_block_index(s); if (v->field_mode && !(v->second_field ^ v->tff)) { - s->dest[0] += s->current_picture_ptr->f->linesize[0]; - s->dest[1] += s->current_picture_ptr->f->linesize[1]; - s->dest[2] += s->current_picture_ptr->f->linesize[2]; + s->dest[0] += s->cur_pic.ptr->f->linesize[0]; + s->dest[1] += s->cur_pic.ptr->f->linesize[1]; + s->dest[2] += s->cur_pic.ptr->f->linesize[2]; } } @@ -417,7 +417,7 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, int dqscale_index; /* scale predictors if needed */ - q1 = FFABS(s->current_picture.qscale_table[mb_pos]); + q1 = FFABS(s->cur_pic.qscale_table[mb_pos]); dqscale_index = s->y_dc_scale_table[q1] - 1; if (dqscale_index < 0) return 0; @@ -433,12 +433,12 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, a = dc_val[ - wrap]; if (c_avail && (n != 1 && n != 3)) { - q2 = FFABS(s->current_picture.qscale_table[mb_pos - 1]); + q2 = FFABS(s->cur_pic.qscale_table[mb_pos - 1]); if (q2 && q2 != q1) c = (int)((unsigned)c * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18; } if (a_avail && (n != 2 && n != 3)) { - q2 = FFABS(s->current_picture.qscale_table[mb_pos - s->mb_stride]); + q2 = FFABS(s->cur_pic.qscale_table[mb_pos - s->mb_stride]); if (q2 && q2 != q1) a = (int)((unsigned)a * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18; } @@ -448,7 +448,7 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, off--; if (n != 2) off -= s->mb_stride; - q2 = FFABS(s->current_picture.qscale_table[off]); + q2 = FFABS(s->cur_pic.qscale_table[off]); if (q2 && q2 != q1) b = (int)((unsigned)b * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18; } @@ -771,19 +771,19 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, else // top ac_val -= 16 * s->block_wrap[n]; - q1 = s->current_picture.qscale_table[mb_pos]; + q1 = s->cur_pic.qscale_table[mb_pos]; if (n == 3) q2 = q1; else if (dc_pred_dir) { if (n == 1) q2 = q1; else if (c_avail && mb_pos) - q2 = s->current_picture.qscale_table[mb_pos - 1]; + q2 = s->cur_pic.qscale_table[mb_pos - 1]; } else { if (n == 2) q2 = q1; else if (a_avail && mb_pos >= s->mb_stride) - q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride]; + q2 = s->cur_pic.qscale_table[mb_pos - s->mb_stride]; } //AC Decoding @@ -973,11 +973,11 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, else //top ac_val -= 16 * s->block_wrap[n]; - q1 = s->current_picture.qscale_table[mb_pos]; + q1 = s->cur_pic.qscale_table[mb_pos]; if (dc_pred_dir && c_avail && mb_pos) - q2 = s->current_picture.qscale_table[mb_pos - 1]; + q2 = s->cur_pic.qscale_table[mb_pos - 1]; if (!dc_pred_dir && a_avail && mb_pos >= s->mb_stride) - q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride]; + q2 = s->cur_pic.qscale_table[mb_pos - s->mb_stride]; if (dc_pred_dir && n == 1) q2 = q1; if (!dc_pred_dir && n == 2) @@ -1314,10 +1314,10 @@ static int vc1_decode_p_mb(VC1Context *v) GET_MVDATA(dmv_x, dmv_y); if (s->mb_intra) { - s->current_picture.motion_val[1][s->block_index[0]][0] = 0; - s->current_picture.motion_val[1][s->block_index[0]][1] = 0; + s->cur_pic.motion_val[1][s->block_index[0]][0] = 0; + s->cur_pic.motion_val[1][s->block_index[0]][1] = 0; } - s->current_picture.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16; + s->cur_pic.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16; ff_vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0); /* FIXME Set DC val for inter block ? */ @@ -1334,7 +1334,7 @@ static int vc1_decode_p_mb(VC1Context *v) mquant = v->pq; cbp = 0; } - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], @@ -1383,8 +1383,8 @@ static int vc1_decode_p_mb(VC1Context *v) v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } - s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; - s->current_picture.qscale_table[mb_pos] = 0; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_SKIP; + s->cur_pic.qscale_table[mb_pos] = 0; ff_vc1_pred_mv(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0); ff_vc1_mc_1mv(v, 0); } @@ -1427,7 +1427,7 @@ static int vc1_decode_p_mb(VC1Context *v) if (!intra_count && !coded_inter) goto end; GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; /* test if block is intra and has pred */ { int intrapred = 0; @@ -1484,7 +1484,7 @@ static int vc1_decode_p_mb(VC1Context *v) } } else { // skipped MB s->mb_intra = 0; - s->current_picture.qscale_table[mb_pos] = 0; + s->cur_pic.qscale_table[mb_pos] = 0; for (i = 0; i < 6; i++) { v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; @@ -1494,7 +1494,7 @@ static int vc1_decode_p_mb(VC1Context *v) ff_vc1_mc_4mv_luma(v, i, 0, 0); } ff_vc1_mc_4mv_chroma(v, 0); - s->current_picture.qscale_table[mb_pos] = 0; + s->cur_pic.qscale_table[mb_pos] = 0; } } end: @@ -1574,19 +1574,19 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) } if (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB for (i = 0; i < 4; i++) { - s->current_picture.motion_val[1][s->block_index[i]][0] = 0; - s->current_picture.motion_val[1][s->block_index[i]][1] = 0; + s->cur_pic.motion_val[1][s->block_index[i]][0] = 0; + s->cur_pic.motion_val[1][s->block_index[i]][1] = 0; } v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. s->mb_intra = 1; - s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; /* Set DC scale - y and c use the same (not sure if necessary here) */ s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; @@ -1666,7 +1666,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) } if (cbp) GET_MQUANT(); // p. 227 - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; if (!v->ttmbf && cbp) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); for (i = 0; i < 6; i++) { @@ -1697,8 +1697,8 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } - s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; - s->current_picture.qscale_table[mb_pos] = 0; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_SKIP; + s->cur_pic.qscale_table[mb_pos] = 0; v->blk_mv_type[s->block_index[0]] = 0; v->blk_mv_type[s->block_index[1]] = 0; v->blk_mv_type[s->block_index[2]] = 0; @@ -1742,11 +1742,11 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) if (idx_mbmode <= 1) { // intra MB v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. s->mb_intra = 1; - s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; - s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; - s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; /* Set DC scale - y and c use the same (not sure if necessary here) */ s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; @@ -1775,7 +1775,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) } } else { s->mb_intra = v->is_intra[s->mb_x] = 0; - s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; for (i = 0; i < 6; i++) v->mb_type[0][s->block_index[i]] = 0; if (idx_mbmode <= 5) { // 1-MV @@ -1803,7 +1803,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) if (cbp) { GET_MQUANT(); } - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; if (!v->ttmbf && cbp) { ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); } @@ -1875,7 +1875,7 @@ static int vc1_decode_b_mb(VC1Context *v) v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } - s->current_picture.qscale_table[mb_pos] = 0; + s->cur_pic.qscale_table[mb_pos] = 0; if (!direct) { if (!skipped) { @@ -1912,7 +1912,7 @@ static int vc1_decode_b_mb(VC1Context *v) cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); GET_MQUANT(); s->mb_intra = 0; - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; if (!v->ttmbf) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); dmv_x[0] = dmv_y[0] = dmv_x[1] = dmv_y[1] = 0; @@ -1927,7 +1927,7 @@ static int vc1_decode_b_mb(VC1Context *v) } if (s->mb_intra && !mb_has_coeffs) { GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; s->ac_pred = get_bits1(gb); cbp = 0; ff_vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype); @@ -1949,7 +1949,7 @@ static int vc1_decode_b_mb(VC1Context *v) s->ac_pred = get_bits1(gb); cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); } @@ -2024,11 +2024,11 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) if (idx_mbmode <= 1) { // intra MB v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. s->mb_intra = 1; - s->current_picture.motion_val[1][s->block_index[0]][0] = 0; - s->current_picture.motion_val[1][s->block_index[0]][1] = 0; - s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; + s->cur_pic.motion_val[1][s->block_index[0]][0] = 0; + s->cur_pic.motion_val[1][s->block_index[0]][1] = 0; + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; /* Set DC scale - y and c use the same (not sure if necessary here) */ s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; @@ -2064,7 +2064,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) } } else { s->mb_intra = v->is_intra[s->mb_x] = 0; - s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; for (i = 0; i < 6; i++) v->mb_type[0][s->block_index[i]] = 0; if (v->fmb_is_raw) @@ -2101,7 +2101,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) if (bmvtype == BMV_TYPE_DIRECT) { dmv_x[0] = dmv_y[0] = pred_flag[0] = 0; dmv_x[1] = dmv_y[1] = pred_flag[0] = 0; - if (!s->next_picture_ptr->field_picture) { + if (!s->next_pic.ptr->field_picture) { av_log(s->avctx, AV_LOG_ERROR, "Mixed field/frame direct mode not supported\n"); return AVERROR_INVALIDDATA; } @@ -2133,7 +2133,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) if (cbp) { GET_MQUANT(); } - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; if (!v->ttmbf && cbp) { ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); } @@ -2212,21 +2212,21 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) if (ff_vc1_mbmode_intfrp[0][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB for (i = 0; i < 4; i++) { - s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = 0; - s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = 0; - s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = 0; - s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = 0; + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0] = 0; + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1] = 0; + s->mv[1][i][0] = s->cur_pic.motion_val[1][s->block_index[i]][0] = 0; + s->mv[1][i][1] = s->cur_pic.motion_val[1][s->block_index[i]][1] = 0; } v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. s->mb_intra = 1; - s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; /* Set DC scale - y and c use the same (not sure if necessary here) */ s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; @@ -2267,31 +2267,31 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) direct = v->direct_mb_plane[mb_pos]; if (direct) { - if (s->next_picture_ptr->field_picture) + if (s->next_pic.ptr->field_picture) av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n"); - s->mv[0][0][0] = s->current_picture.motion_val[0][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 0, s->quarter_sample); - s->mv[0][0][1] = s->current_picture.motion_val[0][s->block_index[0]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][1], v->bfraction, 0, s->quarter_sample); - s->mv[1][0][0] = s->current_picture.motion_val[1][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 1, s->quarter_sample); - s->mv[1][0][1] = s->current_picture.motion_val[1][s->block_index[0]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][1], v->bfraction, 1, s->quarter_sample); + s->mv[0][0][0] = s->cur_pic.motion_val[0][s->block_index[0]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][0], v->bfraction, 0, s->quarter_sample); + s->mv[0][0][1] = s->cur_pic.motion_val[0][s->block_index[0]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][1], v->bfraction, 0, s->quarter_sample); + s->mv[1][0][0] = s->cur_pic.motion_val[1][s->block_index[0]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][0], v->bfraction, 1, s->quarter_sample); + s->mv[1][0][1] = s->cur_pic.motion_val[1][s->block_index[0]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][1], v->bfraction, 1, s->quarter_sample); if (twomv) { - s->mv[0][2][0] = s->current_picture.motion_val[0][s->block_index[2]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][0], v->bfraction, 0, s->quarter_sample); - s->mv[0][2][1] = s->current_picture.motion_val[0][s->block_index[2]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][1], v->bfraction, 0, s->quarter_sample); - s->mv[1][2][0] = s->current_picture.motion_val[1][s->block_index[2]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][0], v->bfraction, 1, s->quarter_sample); - s->mv[1][2][1] = s->current_picture.motion_val[1][s->block_index[2]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][1], v->bfraction, 1, s->quarter_sample); + s->mv[0][2][0] = s->cur_pic.motion_val[0][s->block_index[2]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][0], v->bfraction, 0, s->quarter_sample); + s->mv[0][2][1] = s->cur_pic.motion_val[0][s->block_index[2]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][1], v->bfraction, 0, s->quarter_sample); + s->mv[1][2][0] = s->cur_pic.motion_val[1][s->block_index[2]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][0], v->bfraction, 1, s->quarter_sample); + s->mv[1][2][1] = s->cur_pic.motion_val[1][s->block_index[2]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][1], v->bfraction, 1, s->quarter_sample); for (i = 1; i < 4; i += 2) { - s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = s->mv[0][i-1][0]; - s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = s->mv[0][i-1][1]; - s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = s->mv[1][i-1][0]; - s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = s->mv[1][i-1][1]; + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0] = s->mv[0][i-1][0]; + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1] = s->mv[0][i-1][1]; + s->mv[1][i][0] = s->cur_pic.motion_val[1][s->block_index[i]][0] = s->mv[1][i-1][0]; + s->mv[1][i][1] = s->cur_pic.motion_val[1][s->block_index[i]][1] = s->mv[1][i-1][1]; } } else { for (i = 1; i < 4; i++) { - s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = s->mv[0][0][0]; - s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = s->mv[0][0][1]; - s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = s->mv[1][0][0]; - s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = s->mv[1][0][1]; + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0] = s->mv[0][0][0]; + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1] = s->mv[0][0][1]; + s->mv[1][i][0] = s->cur_pic.motion_val[1][s->block_index[i]][0] = s->mv[1][0][0]; + s->mv[1][i][1] = s->cur_pic.motion_val[1][s->block_index[i]][1] = s->mv[1][0][1]; } } } @@ -2393,10 +2393,10 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) if (mvsw) { for (i = 0; i < 2; i++) { - s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->current_picture.motion_val[dir][s->block_index[i+2]][0] = s->current_picture.motion_val[dir][s->block_index[i]][0]; - s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->current_picture.motion_val[dir][s->block_index[i+2]][1] = s->current_picture.motion_val[dir][s->block_index[i]][1]; - s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->current_picture.motion_val[dir2][s->block_index[i]][0] = s->current_picture.motion_val[dir2][s->block_index[i+2]][0]; - s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->current_picture.motion_val[dir2][s->block_index[i]][1] = s->current_picture.motion_val[dir2][s->block_index[i+2]][1]; + s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->cur_pic.motion_val[dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[dir][s->block_index[i]][0]; + s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->cur_pic.motion_val[dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[dir][s->block_index[i]][1]; + s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->cur_pic.motion_val[dir2][s->block_index[i]][0] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][0]; + s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->cur_pic.motion_val[dir2][s->block_index[i]][1] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][1]; } } else { ff_vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, !dir); @@ -2423,15 +2423,15 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) v->blk_mv_type[s->block_index[3]] = 1; ff_vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, !dir); for (i = 0; i < 2; i++) { - s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->current_picture.motion_val[!dir][s->block_index[i+2]][0] = s->current_picture.motion_val[!dir][s->block_index[i]][0]; - s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->current_picture.motion_val[!dir][s->block_index[i+2]][1] = s->current_picture.motion_val[!dir][s->block_index[i]][1]; + s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[!dir][s->block_index[i]][0]; + s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[!dir][s->block_index[i]][1]; } ff_vc1_mc_1mv(v, dir); } if (cbp) GET_MQUANT(); // p. 227 - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; if (!v->ttmbf && cbp) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); for (i = 0; i < 6; i++) { @@ -2462,8 +2462,8 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } - s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; - s->current_picture.qscale_table[mb_pos] = 0; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_SKIP; + s->cur_pic.qscale_table[mb_pos] = 0; v->blk_mv_type[s->block_index[0]] = 0; v->blk_mv_type[s->block_index[1]] = 0; v->blk_mv_type[s->block_index[2]] = 0; @@ -2481,10 +2481,10 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) if (mvsw) dir2 = !dir; for (i = 0; i < 2; i++) { - s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->current_picture.motion_val[dir][s->block_index[i+2]][0] = s->current_picture.motion_val[dir][s->block_index[i]][0]; - s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->current_picture.motion_val[dir][s->block_index[i+2]][1] = s->current_picture.motion_val[dir][s->block_index[i]][1]; - s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->current_picture.motion_val[dir2][s->block_index[i]][0] = s->current_picture.motion_val[dir2][s->block_index[i+2]][0]; - s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->current_picture.motion_val[dir2][s->block_index[i]][1] = s->current_picture.motion_val[dir2][s->block_index[i+2]][1]; + s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->cur_pic.motion_val[dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[dir][s->block_index[i]][0]; + s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->cur_pic.motion_val[dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[dir][s->block_index[i]][1]; + s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->cur_pic.motion_val[dir2][s->block_index[i]][0] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][0]; + s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->cur_pic.motion_val[dir2][s->block_index[i]][1] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][1]; } } else { v->blk_mv_type[s->block_index[0]] = 1; @@ -2493,8 +2493,8 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) v->blk_mv_type[s->block_index[3]] = 1; ff_vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, !dir); for (i = 0; i < 2; i++) { - s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->current_picture.motion_val[!dir][s->block_index[i+2]][0] = s->current_picture.motion_val[!dir][s->block_index[i]][0]; - s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->current_picture.motion_val[!dir][s->block_index[i+2]][1] = s->current_picture.motion_val[!dir][s->block_index[i]][1]; + s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[!dir][s->block_index[i]][0]; + s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[!dir][s->block_index[i]][1]; } } } @@ -2563,11 +2563,11 @@ static void vc1_decode_i_blocks(VC1Context *v) update_block_index(s); s->bdsp.clear_blocks(v->block[v->cur_blk_idx][0]); mb_pos = s->mb_x + s->mb_y * s->mb_width; - s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; - s->current_picture.qscale_table[mb_pos] = v->pq; + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; + s->cur_pic.qscale_table[mb_pos] = v->pq; for (int i = 0; i < 4; i++) { - s->current_picture.motion_val[1][s->block_index[i]][0] = 0; - s->current_picture.motion_val[1][s->block_index[i]][1] = 0; + s->cur_pic.motion_val[1][s->block_index[i]][0] = 0; + s->cur_pic.motion_val[1][s->block_index[i]][1] = 0; } // do actual MB decoding and displaying @@ -2693,10 +2693,10 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) update_block_index(s); s->bdsp.clear_blocks(v->block[v->cur_blk_idx][0]); mb_pos = s->mb_x + s->mb_y * s->mb_stride; - s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; for (int i = 0; i < 4; i++) { - s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][0] = 0; - s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][1] = 0; + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][0] = 0; + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][1] = 0; } // do actual MB decoding and displaying @@ -2719,7 +2719,7 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) GET_MQUANT(); - s->current_picture.qscale_table[mb_pos] = mquant; + s->cur_pic.qscale_table[mb_pos] = mquant; /* Set DC scale - y and c use the same */ s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; @@ -2943,7 +2943,7 @@ static void vc1_decode_skip_blocks(VC1Context *v) { MpegEncContext *s = &v->s; - if (!v->s.last_picture.f->data[0]) + if (!v->s.last_pic.data[0]) return; ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, ER_MB_END); @@ -2952,9 +2952,9 @@ static void vc1_decode_skip_blocks(VC1Context *v) s->mb_x = 0; init_block_index(v); update_block_index(s); - memcpy(s->dest[0], s->last_picture.f->data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16); - memcpy(s->dest[1], s->last_picture.f->data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); - memcpy(s->dest[2], s->last_picture.f->data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); + memcpy(s->dest[0], s->last_pic.data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16); + memcpy(s->dest[1], s->last_pic.data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); + memcpy(s->dest[2], s->last_pic.data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); s->first_slice_line = 0; } } @@ -2964,7 +2964,7 @@ void ff_vc1_decode_blocks(VC1Context *v) v->s.esc3_level_length = 0; if (v->x8_type) { - ff_intrax8_decode_picture(&v->x8, &v->s.current_picture, + ff_intrax8_decode_picture(&v->x8, v->s.cur_pic.ptr, &v->s.gb, &v->s.mb_x, &v->s.mb_y, 2 * v->pq + v->halfpq, v->pq * !v->pquantizer, v->s.loop_filter, v->s.low_delay); diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c b/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c index ff4dd6d02b..2053197dc1 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c @@ -413,9 +413,10 @@ static av_always_inline void vc1_p_h_loop_filter(VC1Context *v, uint8_t *dest, u } } -static av_always_inline void vc1_p_v_loop_filter(VC1Context *v, uint8_t *dest, uint32_t *cbp, - uint8_t *is_intra, int16_t (*mv)[2], uint8_t *mv_f, - int *ttblk, uint32_t flags, int block_num) +static av_always_inline +void vc1_p_v_loop_filter(VC1Context *v, uint8_t *dest, const uint32_t *cbp, + const uint8_t *is_intra, int16_t (*mv)[2], const uint8_t *mv_f, + const int *ttblk, uint32_t flags, int block_num) { MpegEncContext *s = &v->s; int pq = v->pq; @@ -500,7 +501,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride - 1 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], ttblk, @@ -520,7 +521,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride + v->mb_off] : &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], ttblk, @@ -543,7 +544,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride - 1 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], ttblk, @@ -562,7 +563,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 2 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 2 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 1 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 2 + v->blocks_off], ttblk, @@ -583,7 +584,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride + v->mb_off] : &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], ttblk, @@ -602,7 +603,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] + v->mb_off] : &v->mv_f[0][s->block_index[i] + v->blocks_off], ttblk, @@ -625,7 +626,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 4 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 4 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride - 2 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride - 4 + v->blocks_off], ttblk, @@ -646,7 +647,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride - 1 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], ttblk, @@ -665,7 +666,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride + v->mb_off] : &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], ttblk, @@ -688,7 +689,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 4 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 4 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride - 2 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride - 4 + v->blocks_off], ttblk, @@ -709,7 +710,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride - 1 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], ttblk, @@ -728,7 +729,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride + v->mb_off] : &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], ttblk, @@ -749,7 +750,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 4 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 4 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 2 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 4 + v->blocks_off], ttblk, @@ -770,7 +771,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] - 2 + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] - 2 + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] - 1 + v->mb_off] : &v->mv_f[0][s->block_index[i] - 2 + v->blocks_off], ttblk, @@ -789,7 +790,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) cbp, is_intra, i > 3 ? uvmv : - &s->current_picture.motion_val[0][s->block_index[i] + v->blocks_off], + &s->cur_pic.motion_val[0][s->block_index[i] + v->blocks_off], i > 3 ? &v->mv_f[0][s->block_index[i] + v->mb_off] : &v->mv_f[0][s->block_index[i] + v->blocks_off], ttblk, @@ -799,7 +800,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) } } -static av_always_inline void vc1_p_h_intfr_loop_filter(VC1Context *v, uint8_t *dest, int *ttblk, +static av_always_inline void vc1_p_h_intfr_loop_filter(VC1Context *v, uint8_t *dest, const int *ttblk, uint32_t flags, uint8_t fieldtx, int block_num) { MpegEncContext *s = &v->s; @@ -849,8 +850,9 @@ static av_always_inline void vc1_p_h_intfr_loop_filter(VC1Context *v, uint8_t *d } } -static av_always_inline void vc1_p_v_intfr_loop_filter(VC1Context *v, uint8_t *dest, int *ttblk, - uint32_t flags, uint8_t fieldtx, int block_num) +static av_always_inline +void vc1_p_v_intfr_loop_filter(VC1Context *v, uint8_t *dest, const int *ttblk, + uint32_t flags, uint8_t fieldtx, int block_num) { MpegEncContext *s = &v->s; int pq = v->pq; @@ -1109,8 +1111,9 @@ void ff_vc1_p_intfr_loop_filter(VC1Context *v) } } -static av_always_inline void vc1_b_h_intfi_loop_filter(VC1Context *v, uint8_t *dest, uint32_t *cbp, - int *ttblk, uint32_t flags, int block_num) +static av_always_inline +void vc1_b_h_intfi_loop_filter(VC1Context *v, uint8_t *dest, const uint32_t *cbp, + const int *ttblk, uint32_t flags, int block_num) { MpegEncContext *s = &v->s; int pq = v->pq; @@ -1141,8 +1144,9 @@ static av_always_inline void vc1_b_h_intfi_loop_filter(VC1Context *v, uint8_t *d } } -static av_always_inline void vc1_b_v_intfi_loop_filter(VC1Context *v, uint8_t *dest, uint32_t *cbp, - int *ttblk, uint32_t flags, int block_num) +static av_always_inline +void vc1_b_v_intfi_loop_filter(VC1Context *v, uint8_t *dest, const uint32_t *cbp, + const int *ttblk, uint32_t flags, int block_num) { MpegEncContext *s = &v->s; int pq = v->pq; @@ -1174,7 +1178,7 @@ void ff_vc1_b_intfi_loop_filter(VC1Context *v) MpegEncContext *s = &v->s; int block_count = CONFIG_GRAY && (s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 4 : 6; uint8_t *dest; - uint32_t *cbp; + const uint32_t *cbp; int *ttblk; uint32_t flags = 0; int i; diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1_mc.c b/src/ExtLib/ffmpeg/libavcodec/vc1_mc.c index ec6bbcc8a1..91c4674a53 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1_mc.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1_mc.c @@ -58,7 +58,7 @@ static av_always_inline void vc1_scale_chroma(uint8_t *srcU, uint8_t *srcV, } static av_always_inline void vc1_lut_scale_luma(uint8_t *srcY, - uint8_t *lut1, uint8_t *lut2, + const uint8_t *lut1, const uint8_t *lut2, int k, int linesize) { int i, j; @@ -78,7 +78,7 @@ static av_always_inline void vc1_lut_scale_luma(uint8_t *srcY, } static av_always_inline void vc1_lut_scale_chroma(uint8_t *srcU, uint8_t *srcV, - uint8_t *lut1, uint8_t *lut2, + const uint8_t *lut1, const uint8_t *lut2, int k, int uvlinesize) { int i, j; @@ -177,18 +177,18 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir) int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; int v_edge_pos = s->v_edge_pos >> v->field_mode; int i; - uint8_t (*luty)[256], (*lutuv)[256]; + const uint8_t (*luty)[256], (*lutuv)[256]; int use_ic; int interlace; int linesize, uvlinesize; if ((!v->field_mode || (v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) && - !v->s.last_picture.f->data[0]) + !v->s.last_pic.data[0]) return; - linesize = s->current_picture_ptr->f->linesize[0]; - uvlinesize = s->current_picture_ptr->f->linesize[1]; + linesize = s->cur_pic.ptr->f->linesize[0]; + uvlinesize = s->cur_pic.ptr->f->linesize[1]; mx = s->mv[dir][0][0]; my = s->mv[dir][0][1]; @@ -196,8 +196,8 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir) // store motion vectors for further use in B-frames if (s->pict_type == AV_PICTURE_TYPE_P) { for (i = 0; i < 4; i++) { - s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][0] = mx; - s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][1] = my; + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][0] = mx; + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][1] = my; } } @@ -219,30 +219,30 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir) } if (!dir) { if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) { - srcY = s->current_picture.f->data[0]; - srcU = s->current_picture.f->data[1]; - srcV = s->current_picture.f->data[2]; + srcY = s->cur_pic.data[0]; + srcU = s->cur_pic.data[1]; + srcV = s->cur_pic.data[2]; luty = v->curr_luty; lutuv = v->curr_lutuv; use_ic = *v->curr_use_ic; interlace = 1; } else { - srcY = s->last_picture.f->data[0]; - srcU = s->last_picture.f->data[1]; - srcV = s->last_picture.f->data[2]; + srcY = s->last_pic.data[0]; + srcU = s->last_pic.data[1]; + srcV = s->last_pic.data[2]; luty = v->last_luty; lutuv = v->last_lutuv; use_ic = v->last_use_ic; - interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->last_interlaced; } } else { - srcY = s->next_picture.f->data[0]; - srcU = s->next_picture.f->data[1]; - srcV = s->next_picture.f->data[2]; + srcY = s->next_pic.data[0]; + srcU = s->next_pic.data[1]; + srcV = s->next_pic.data[2]; luty = v->next_luty; lutuv = v->next_lutuv; use_ic = v->next_use_ic; - interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->next_interlaced; } if (!srcY || !srcU) { @@ -457,38 +457,38 @@ void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg) int off; int fieldmv = (v->fcm == ILACE_FRAME) ? v->blk_mv_type[s->block_index[n]] : 0; int v_edge_pos = s->v_edge_pos >> v->field_mode; - uint8_t (*luty)[256]; + const uint8_t (*luty)[256]; int use_ic; int interlace; int linesize; if ((!v->field_mode || (v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) && - !v->s.last_picture.f->data[0]) + !v->s.last_pic.data[0]) return; - linesize = s->current_picture_ptr->f->linesize[0]; + linesize = s->cur_pic.ptr->f->linesize[0]; mx = s->mv[dir][n][0]; my = s->mv[dir][n][1]; if (!dir) { if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) { - srcY = s->current_picture.f->data[0]; + srcY = s->cur_pic.data[0]; luty = v->curr_luty; use_ic = *v->curr_use_ic; interlace = 1; } else { - srcY = s->last_picture.f->data[0]; + srcY = s->last_pic.data[0]; luty = v->last_luty; use_ic = v->last_use_ic; - interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->last_interlaced; } } else { - srcY = s->next_picture.f->data[0]; + srcY = s->next_pic.data[0]; luty = v->next_luty; use_ic = v->next_use_ic; - interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->next_interlaced; } if (!srcY) { @@ -503,8 +503,8 @@ void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg) if (s->pict_type == AV_PICTURE_TYPE_P && n == 3 && v->field_mode) { int opp_count = get_luma_mv(v, 0, - &s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0], - &s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1]); + &s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0], + &s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1]); int k, f = opp_count > 2; for (k = 0; k < 4; k++) v->mv_f[1][s->block_index[k] + v->blocks_off] = f; @@ -515,8 +515,8 @@ void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg) int width = s->avctx->coded_width; int height = s->avctx->coded_height >> 1; if (s->pict_type == AV_PICTURE_TYPE_P) { - s->current_picture.motion_val[1][s->block_index[n] + v->blocks_off][0] = mx; - s->current_picture.motion_val[1][s->block_index[n] + v->blocks_off][1] = my; + s->cur_pic.motion_val[1][s->block_index[n] + v->blocks_off][0] = mx; + s->cur_pic.motion_val[1][s->block_index[n] + v->blocks_off][1] = my; } qx = (s->mb_x * 16) + (mx >> 2); qy = (s->mb_y * 8) + (my >> 3); @@ -640,12 +640,12 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) int16_t tx, ty; int chroma_ref_type; int v_edge_pos = s->v_edge_pos >> v->field_mode; - uint8_t (*lutuv)[256]; + const uint8_t (*lutuv)[256]; int use_ic; int interlace; int uvlinesize; - if (!v->field_mode && !v->s.last_picture.f->data[0]) + if (!v->field_mode && !v->s.last_pic.data[0]) return; if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) return; @@ -654,8 +654,8 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) if (!v->field_mode || !v->numref) { int valid_count = get_chroma_mv(v, dir, &tx, &ty); if (!valid_count) { - s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; - s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0; return; //no need to do MC for intra blocks } @@ -664,12 +664,12 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) int opp_count = get_luma_mv(v, dir, &tx, &ty); chroma_ref_type = v->cur_field_type ^ (opp_count > 2); } - if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f->data[0]) + if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_pic.data[0]) return; - s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx; - s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty; + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx; + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty; - uvlinesize = s->current_picture_ptr->f->linesize[1]; + uvlinesize = s->cur_pic.ptr->f->linesize[1]; uvmx = (tx + ((tx & 3) == 3)) >> 1; uvmy = (ty + ((ty & 3) == 3)) >> 1; @@ -698,24 +698,24 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) if (!dir) { if (v->field_mode && (v->cur_field_type != chroma_ref_type) && v->second_field) { - srcU = s->current_picture.f->data[1]; - srcV = s->current_picture.f->data[2]; + srcU = s->cur_pic.data[1]; + srcV = s->cur_pic.data[2]; lutuv = v->curr_lutuv; use_ic = *v->curr_use_ic; interlace = 1; } else { - srcU = s->last_picture.f->data[1]; - srcV = s->last_picture.f->data[2]; + srcU = s->last_pic.data[1]; + srcV = s->last_pic.data[2]; lutuv = v->last_lutuv; use_ic = v->last_use_ic; - interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->last_interlaced; } } else { - srcU = s->next_picture.f->data[1]; - srcV = s->next_picture.f->data[2]; + srcU = s->next_pic.data[1]; + srcV = s->next_pic.data[2]; lutuv = v->next_lutuv; use_ic = v->next_use_ic; - interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->next_interlaced; } if (!srcU) { @@ -851,12 +851,12 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg) int use_ic; int interlace; int uvlinesize; - uint8_t (*lutuv)[256]; + const uint8_t (*lutuv)[256]; if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) return; - uvlinesize = s->current_picture_ptr->f->linesize[1]; + uvlinesize = s->cur_pic.ptr->f->linesize[1]; for (i = 0; i < 4; i++) { int d = i < 2 ? dir: dir2; @@ -880,17 +880,17 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg) else uvsrc_y = av_clip(uvsrc_y, -8, s->avctx->coded_height >> 1); if (i < 2 ? dir : dir2) { - srcU = s->next_picture.f->data[1]; - srcV = s->next_picture.f->data[2]; + srcU = s->next_pic.data[1]; + srcV = s->next_pic.data[2]; lutuv = v->next_lutuv; use_ic = v->next_use_ic; - interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->next_interlaced; } else { - srcU = s->last_picture.f->data[1]; - srcV = s->last_picture.f->data[2]; + srcU = s->last_pic.data[1]; + srcV = s->last_pic.data[2]; lutuv = v->last_lutuv; use_ic = v->last_use_ic; - interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + interlace = v->last_interlaced; } if (!srcU) return; @@ -1009,14 +1009,14 @@ void ff_vc1_interp_mc(VC1Context *v) int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; int v_edge_pos = s->v_edge_pos >> v->field_mode; int use_ic = v->next_use_ic; - int interlace; + int interlace = v->next_interlaced; int linesize, uvlinesize; - if (!v->field_mode && !v->s.next_picture.f->data[0]) + if (!v->field_mode && !v->s.next_pic.data[0]) return; - linesize = s->current_picture_ptr->f->linesize[0]; - uvlinesize = s->current_picture_ptr->f->linesize[1]; + linesize = s->cur_pic.ptr->f->linesize[0]; + uvlinesize = s->cur_pic.ptr->f->linesize[1]; mx = s->mv[1][0][0]; my = s->mv[1][0][1]; @@ -1030,11 +1030,9 @@ void ff_vc1_interp_mc(VC1Context *v) uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1)); uvmy = uvmy + ((uvmy < 0) ? -(uvmy & 1) : (uvmy & 1)); } - srcY = s->next_picture.f->data[0]; - srcU = s->next_picture.f->data[1]; - srcV = s->next_picture.f->data[2]; - - interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); + srcY = s->next_pic.data[0]; + srcU = s->next_pic.data[1]; + srcV = s->next_pic.data[2]; src_x = s->mb_x * 16 + (mx >> 2); src_y = s->mb_y * 16 + (my >> 2); @@ -1191,8 +1189,8 @@ void ff_vc1_interp_mc(VC1Context *v) } if (use_ic) { - uint8_t (*luty )[256] = v->next_luty; - uint8_t (*lutuv)[256] = v->next_lutuv; + const uint8_t (*luty )[256] = v->next_luty; + const uint8_t (*lutuv)[256] = v->next_lutuv; vc1_lut_scale_luma(srcY, luty[v->field_mode ? v->ref_field_type[1] : ((0+src_y - s->mspel) & 1)], luty[v->field_mode ? v->ref_field_type[1] : ((1+src_y - s->mspel) & 1)], diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1_pred.c b/src/ExtLib/ffmpeg/libavcodec/vc1_pred.c index 0514dd9f3f..d909ffce3a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1_pred.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1_pred.c @@ -33,7 +33,7 @@ #include "vc1_pred.h" #include "vc1data.h" -static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int dir) +static av_always_inline int scaleforsame_x(const VC1Context *v, int n /* MV */, int dir) { int scaledvalue, refdist; int scalesame1, scalesame2; @@ -66,7 +66,7 @@ static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int di return av_clip(scaledvalue, -v->range_x, v->range_x - 1); } -static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */, int dir) +static av_always_inline int scaleforsame_y(const VC1Context *v, int n /* MV */, int dir) { int scaledvalue, refdist; int scalesame1, scalesame2; @@ -103,7 +103,7 @@ static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */, return av_clip(scaledvalue, -v->range_y / 2, v->range_y / 2 - 1); } -static av_always_inline int scaleforopp_x(VC1Context *v, int n /* MV */) +static av_always_inline int scaleforopp_x(const VC1Context *v, int n /* MV */) { int scalezone1_x, zone1offset_x; int scaleopp1, scaleopp2, brfd; @@ -130,7 +130,7 @@ static av_always_inline int scaleforopp_x(VC1Context *v, int n /* MV */) return av_clip(scaledvalue, -v->range_x, v->range_x - 1); } -static av_always_inline int scaleforopp_y(VC1Context *v, int n /* MV */, int dir) +static av_always_inline int scaleforopp_y(const VC1Context *v, int n /* MV */, int dir) { int scalezone1_y, zone1offset_y; int scaleopp1, scaleopp2, brfd; @@ -161,7 +161,7 @@ static av_always_inline int scaleforopp_y(VC1Context *v, int n /* MV */, int dir } } -static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */, +static av_always_inline int scaleforsame(const VC1Context *v, int n /* MV */, int dim, int dir) { int brfd, scalesame; @@ -170,7 +170,7 @@ static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */, n >>= hpel; if (v->s.pict_type != AV_PICTURE_TYPE_B || v->second_field || !dir) { if (dim) - n = scaleforsame_y(v, i, n, dir) * (1 << hpel); + n = scaleforsame_y(v, n, dir) * (1 << hpel); else n = scaleforsame_x(v, n, dir) * (1 << hpel); return n; @@ -182,7 +182,7 @@ static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */, return n; } -static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */, +static av_always_inline int scaleforopp(const VC1Context *v, int n /* MV */, int dim, int dir) { int refdist, scaleopp; @@ -215,7 +215,6 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, { MpegEncContext *s = &v->s; int xy, wrap, off = 0; - int16_t *A, *B, *C; int px, py; int sum; int mixedmv_pic, num_samefield = 0, num_oppfield = 0; @@ -241,24 +240,24 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, xy = s->block_index[n]; if (s->mb_intra) { - s->mv[0][n][0] = s->current_picture.motion_val[0][xy + v->blocks_off][0] = 0; - s->mv[0][n][1] = s->current_picture.motion_val[0][xy + v->blocks_off][1] = 0; - s->current_picture.motion_val[1][xy + v->blocks_off][0] = 0; - s->current_picture.motion_val[1][xy + v->blocks_off][1] = 0; + s->mv[0][n][0] = s->cur_pic.motion_val[0][xy + v->blocks_off][0] = 0; + s->mv[0][n][1] = s->cur_pic.motion_val[0][xy + v->blocks_off][1] = 0; + s->cur_pic.motion_val[1][xy + v->blocks_off][0] = 0; + s->cur_pic.motion_val[1][xy + v->blocks_off][1] = 0; if (mv1) { /* duplicate motion data for 1-MV block */ - s->current_picture.motion_val[0][xy + 1 + v->blocks_off][0] = 0; - s->current_picture.motion_val[0][xy + 1 + v->blocks_off][1] = 0; - s->current_picture.motion_val[0][xy + wrap + v->blocks_off][0] = 0; - s->current_picture.motion_val[0][xy + wrap + v->blocks_off][1] = 0; - s->current_picture.motion_val[0][xy + wrap + 1 + v->blocks_off][0] = 0; - s->current_picture.motion_val[0][xy + wrap + 1 + v->blocks_off][1] = 0; + s->cur_pic.motion_val[0][xy + 1 + v->blocks_off][0] = 0; + s->cur_pic.motion_val[0][xy + 1 + v->blocks_off][1] = 0; + s->cur_pic.motion_val[0][xy + wrap + v->blocks_off][0] = 0; + s->cur_pic.motion_val[0][xy + wrap + v->blocks_off][1] = 0; + s->cur_pic.motion_val[0][xy + wrap + 1 + v->blocks_off][0] = 0; + s->cur_pic.motion_val[0][xy + wrap + 1 + v->blocks_off][1] = 0; v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0; - s->current_picture.motion_val[1][xy + 1 + v->blocks_off][0] = 0; - s->current_picture.motion_val[1][xy + 1 + v->blocks_off][1] = 0; - s->current_picture.motion_val[1][xy + wrap + v->blocks_off][0] = 0; - s->current_picture.motion_val[1][xy + wrap + v->blocks_off][1] = 0; - s->current_picture.motion_val[1][xy + wrap + 1 + v->blocks_off][0] = 0; - s->current_picture.motion_val[1][xy + wrap + 1 + v->blocks_off][1] = 0; + s->cur_pic.motion_val[1][xy + 1 + v->blocks_off][0] = 0; + s->cur_pic.motion_val[1][xy + 1 + v->blocks_off][1] = 0; + s->cur_pic.motion_val[1][xy + wrap + v->blocks_off][0] = 0; + s->cur_pic.motion_val[1][xy + wrap + v->blocks_off][1] = 0; + s->cur_pic.motion_val[1][xy + wrap + 1 + v->blocks_off][0] = 0; + s->cur_pic.motion_val[1][xy + wrap + 1 + v->blocks_off][1] = 0; } return; } @@ -301,7 +300,7 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, } if (a_valid) { - A = s->current_picture.motion_val[dir][xy - wrap + v->blocks_off]; + const int16_t *A = s->cur_pic.motion_val[dir][xy - wrap + v->blocks_off]; a_f = v->mv_f[dir][xy - wrap + v->blocks_off]; num_oppfield += a_f; num_samefield += 1 - a_f; @@ -312,7 +311,7 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, a_f = 0; } if (b_valid) { - B = s->current_picture.motion_val[dir][xy - wrap + off + v->blocks_off]; + const int16_t *B = s->cur_pic.motion_val[dir][xy - wrap + off + v->blocks_off]; b_f = v->mv_f[dir][xy - wrap + off + v->blocks_off]; num_oppfield += b_f; num_samefield += 1 - b_f; @@ -323,7 +322,7 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, b_f = 0; } if (c_valid) { - C = s->current_picture.motion_val[dir][xy - 1 + v->blocks_off]; + const int16_t *C = s->cur_pic.motion_val[dir][xy - 1 + v->blocks_off]; c_f = v->mv_f[dir][xy - 1 + v->blocks_off]; num_oppfield += c_f; num_samefield += 1 - c_f; @@ -366,16 +365,16 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, v->mv_f[dir][xy + v->blocks_off] = 0; v->ref_field_type[dir] = v->cur_field_type; if (a_valid && a_f) { - field_predA[0] = scaleforsame(v, n, field_predA[0], 0, dir); - field_predA[1] = scaleforsame(v, n, field_predA[1], 1, dir); + field_predA[0] = scaleforsame(v, field_predA[0], 0, dir); + field_predA[1] = scaleforsame(v, field_predA[1], 1, dir); } if (b_valid && b_f) { - field_predB[0] = scaleforsame(v, n, field_predB[0], 0, dir); - field_predB[1] = scaleforsame(v, n, field_predB[1], 1, dir); + field_predB[0] = scaleforsame(v, field_predB[0], 0, dir); + field_predB[1] = scaleforsame(v, field_predB[1], 1, dir); } if (c_valid && c_f) { - field_predC[0] = scaleforsame(v, n, field_predC[0], 0, dir); - field_predC[1] = scaleforsame(v, n, field_predC[1], 1, dir); + field_predC[0] = scaleforsame(v, field_predC[0], 0, dir); + field_predC[1] = scaleforsame(v, field_predC[1], 1, dir); } } @@ -451,15 +450,15 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, if (v->field_mode && v->cur_field_type && v->ref_field_type[dir] == 0) y_bias = 1; /* store MV using signed modulus of MV range defined in 4.11 */ - s->mv[dir][n][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; - s->mv[dir][n][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1] = ((py + dmv_y + r_y - y_bias) & ((r_y << 1) - 1)) - r_y + y_bias; + s->mv[dir][n][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; + s->mv[dir][n][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1] = ((py + dmv_y + r_y - y_bias) & ((r_y << 1) - 1)) - r_y + y_bias; if (mv1) { /* duplicate motion data for 1-MV block */ - s->current_picture.motion_val[dir][xy + 1 + v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0]; - s->current_picture.motion_val[dir][xy + 1 + v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1]; - s->current_picture.motion_val[dir][xy + wrap + v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0]; - s->current_picture.motion_val[dir][xy + wrap + v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1]; - s->current_picture.motion_val[dir][xy + wrap + 1 + v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0]; - s->current_picture.motion_val[dir][xy + wrap + 1 + v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1]; + s->cur_pic.motion_val[dir][xy + 1 + v->blocks_off][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0]; + s->cur_pic.motion_val[dir][xy + 1 + v->blocks_off][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1]; + s->cur_pic.motion_val[dir][xy + wrap + v->blocks_off][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0]; + s->cur_pic.motion_val[dir][xy + wrap + v->blocks_off][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1]; + s->cur_pic.motion_val[dir][xy + wrap + 1 + v->blocks_off][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0]; + s->cur_pic.motion_val[dir][xy + wrap + 1 + v->blocks_off][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1]; v->mv_f[dir][xy + 1 + v->blocks_off] = v->mv_f[dir][xy + v->blocks_off]; v->mv_f[dir][xy + wrap + v->blocks_off] = v->mv_f[dir][xy + wrap + 1 + v->blocks_off] = v->mv_f[dir][xy + v->blocks_off]; } @@ -483,24 +482,24 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, xy = s->block_index[n]; if (s->mb_intra) { - s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = 0; - s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = 0; - s->current_picture.motion_val[1][xy][0] = 0; - s->current_picture.motion_val[1][xy][1] = 0; + s->mv[0][n][0] = s->cur_pic.motion_val[0][xy][0] = 0; + s->mv[0][n][1] = s->cur_pic.motion_val[0][xy][1] = 0; + s->cur_pic.motion_val[1][xy][0] = 0; + s->cur_pic.motion_val[1][xy][1] = 0; if (mvn == 1) { /* duplicate motion data for 1-MV block */ - s->current_picture.motion_val[0][xy + 1][0] = 0; - s->current_picture.motion_val[0][xy + 1][1] = 0; - s->current_picture.motion_val[0][xy + wrap][0] = 0; - s->current_picture.motion_val[0][xy + wrap][1] = 0; - s->current_picture.motion_val[0][xy + wrap + 1][0] = 0; - s->current_picture.motion_val[0][xy + wrap + 1][1] = 0; + s->cur_pic.motion_val[0][xy + 1][0] = 0; + s->cur_pic.motion_val[0][xy + 1][1] = 0; + s->cur_pic.motion_val[0][xy + wrap][0] = 0; + s->cur_pic.motion_val[0][xy + wrap][1] = 0; + s->cur_pic.motion_val[0][xy + wrap + 1][0] = 0; + s->cur_pic.motion_val[0][xy + wrap + 1][1] = 0; v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0; - s->current_picture.motion_val[1][xy + 1][0] = 0; - s->current_picture.motion_val[1][xy + 1][1] = 0; - s->current_picture.motion_val[1][xy + wrap][0] = 0; - s->current_picture.motion_val[1][xy + wrap][1] = 0; - s->current_picture.motion_val[1][xy + wrap + 1][0] = 0; - s->current_picture.motion_val[1][xy + wrap + 1][1] = 0; + s->cur_pic.motion_val[1][xy + 1][0] = 0; + s->cur_pic.motion_val[1][xy + 1][1] = 0; + s->cur_pic.motion_val[1][xy + wrap][0] = 0; + s->cur_pic.motion_val[1][xy + wrap][1] = 0; + s->cur_pic.motion_val[1][xy + wrap + 1][0] = 0; + s->cur_pic.motion_val[1][xy + wrap + 1][1] = 0; } return; } @@ -510,14 +509,14 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, if (s->mb_x || (n == 1) || (n == 3)) { if ((v->blk_mv_type[xy]) // current block (MB) has a field MV || (!v->blk_mv_type[xy] && !v->blk_mv_type[xy - 1])) { // or both have frame MV - A[0] = s->current_picture.motion_val[dir][xy - 1][0]; - A[1] = s->current_picture.motion_val[dir][xy - 1][1]; + A[0] = s->cur_pic.motion_val[dir][xy - 1][0]; + A[1] = s->cur_pic.motion_val[dir][xy - 1][1]; a_valid = 1; } else { // current block has frame mv and cand. has field MV (so average) - A[0] = (s->current_picture.motion_val[dir][xy - 1][0] - + s->current_picture.motion_val[dir][xy - 1 + off * wrap][0] + 1) >> 1; - A[1] = (s->current_picture.motion_val[dir][xy - 1][1] - + s->current_picture.motion_val[dir][xy - 1 + off * wrap][1] + 1) >> 1; + A[0] = (s->cur_pic.motion_val[dir][xy - 1][0] + + s->cur_pic.motion_val[dir][xy - 1 + off * wrap][0] + 1) >> 1; + A[1] = (s->cur_pic.motion_val[dir][xy - 1][1] + + s->cur_pic.motion_val[dir][xy - 1 + off * wrap][1] + 1) >> 1; a_valid = 1; } if (!(n & 1) && v->is_intra[s->mb_x - 1]) { @@ -537,11 +536,11 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, if (v->blk_mv_type[pos_b] && v->blk_mv_type[xy]) { n_adj = (n & 2) | (n & 1); } - B[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap][0]; - B[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap][1]; + B[0] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap][0]; + B[1] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap][1]; if (v->blk_mv_type[pos_b] && !v->blk_mv_type[xy]) { - B[0] = (B[0] + s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][0] + 1) >> 1; - B[1] = (B[1] + s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][1] + 1) >> 1; + B[0] = (B[0] + s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][0] + 1) >> 1; + B[1] = (B[1] + s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][1] + 1) >> 1; } } if (s->mb_width > 1) { @@ -552,11 +551,11 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) { n_adj = n & 2; } - C[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][0]; - C[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][1]; + C[0] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][0]; + C[1] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][1]; if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) { - C[0] = (1 + C[0] + (s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][0])) >> 1; - C[1] = (1 + C[1] + (s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][1])) >> 1; + C[0] = (1 + C[0] + (s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][0])) >> 1; + C[1] = (1 + C[1] + (s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][1])) >> 1; } if (s->mb_x == s->mb_width - 1) { if (!v->is_intra[s->mb_x - s->mb_stride - 1]) { @@ -566,11 +565,11 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) { n_adj = n | 1; } - C[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][0]; - C[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][1]; + C[0] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][0]; + C[1] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][1]; if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) { - C[0] = (1 + C[0] + s->current_picture.motion_val[dir][s->block_index[1] - 2 * wrap - 2][0]) >> 1; - C[1] = (1 + C[1] + s->current_picture.motion_val[dir][s->block_index[1] - 2 * wrap - 2][1]) >> 1; + C[0] = (1 + C[0] + s->cur_pic.motion_val[dir][s->block_index[1] - 2 * wrap - 2][0]) >> 1; + C[1] = (1 + C[1] + s->cur_pic.motion_val[dir][s->block_index[1] - 2 * wrap - 2][1]) >> 1; } } else c_valid = 0; @@ -581,12 +580,12 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, } else { pos_b = s->block_index[1]; b_valid = 1; - B[0] = s->current_picture.motion_val[dir][pos_b][0]; - B[1] = s->current_picture.motion_val[dir][pos_b][1]; + B[0] = s->cur_pic.motion_val[dir][pos_b][0]; + B[1] = s->cur_pic.motion_val[dir][pos_b][1]; pos_c = s->block_index[0]; c_valid = 1; - C[0] = s->current_picture.motion_val[dir][pos_c][0]; - C[1] = s->current_picture.motion_val[dir][pos_c][1]; + C[0] = s->cur_pic.motion_val[dir][pos_c][0]; + C[1] = s->cur_pic.motion_val[dir][pos_c][1]; } total_valid = a_valid + b_valid + c_valid; @@ -671,18 +670,18 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, } /* store MV using signed modulus of MV range defined in 4.11 */ - s->mv[dir][n][0] = s->current_picture.motion_val[dir][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; - s->mv[dir][n][1] = s->current_picture.motion_val[dir][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y; + s->mv[dir][n][0] = s->cur_pic.motion_val[dir][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; + s->mv[dir][n][1] = s->cur_pic.motion_val[dir][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y; if (mvn == 1) { /* duplicate motion data for 1-MV block */ - s->current_picture.motion_val[dir][xy + 1 ][0] = s->current_picture.motion_val[dir][xy][0]; - s->current_picture.motion_val[dir][xy + 1 ][1] = s->current_picture.motion_val[dir][xy][1]; - s->current_picture.motion_val[dir][xy + wrap ][0] = s->current_picture.motion_val[dir][xy][0]; - s->current_picture.motion_val[dir][xy + wrap ][1] = s->current_picture.motion_val[dir][xy][1]; - s->current_picture.motion_val[dir][xy + wrap + 1][0] = s->current_picture.motion_val[dir][xy][0]; - s->current_picture.motion_val[dir][xy + wrap + 1][1] = s->current_picture.motion_val[dir][xy][1]; + s->cur_pic.motion_val[dir][xy + 1 ][0] = s->cur_pic.motion_val[dir][xy][0]; + s->cur_pic.motion_val[dir][xy + 1 ][1] = s->cur_pic.motion_val[dir][xy][1]; + s->cur_pic.motion_val[dir][xy + wrap ][0] = s->cur_pic.motion_val[dir][xy][0]; + s->cur_pic.motion_val[dir][xy + wrap ][1] = s->cur_pic.motion_val[dir][xy][1]; + s->cur_pic.motion_val[dir][xy + wrap + 1][0] = s->cur_pic.motion_val[dir][xy][0]; + s->cur_pic.motion_val[dir][xy + wrap + 1][1] = s->cur_pic.motion_val[dir][xy][1]; } else if (mvn == 2) { /* duplicate motion data for 2-Field MV block */ - s->current_picture.motion_val[dir][xy + 1][0] = s->current_picture.motion_val[dir][xy][0]; - s->current_picture.motion_val[dir][xy + 1][1] = s->current_picture.motion_val[dir][xy][1]; + s->cur_pic.motion_val[dir][xy + 1][0] = s->cur_pic.motion_val[dir][xy][0]; + s->cur_pic.motion_val[dir][xy + 1][1] = s->cur_pic.motion_val[dir][xy][1]; s->mv[dir][n + 1][0] = s->mv[dir][n][0]; s->mv[dir][n + 1][1] = s->mv[dir][n][1]; } @@ -692,8 +691,7 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], int direct, int mvtype) { MpegEncContext *s = &v->s; - int xy, wrap, off = 0; - int16_t *A, *B, *C; + int xy, wrap; int px, py; int sum; int r_x, r_y; @@ -715,38 +713,38 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], xy = s->block_index[0]; if (s->mb_intra) { - s->current_picture.motion_val[0][xy][0] = - s->current_picture.motion_val[0][xy][1] = - s->current_picture.motion_val[1][xy][0] = - s->current_picture.motion_val[1][xy][1] = 0; + s->cur_pic.motion_val[0][xy][0] = + s->cur_pic.motion_val[0][xy][1] = + s->cur_pic.motion_val[1][xy][0] = + s->cur_pic.motion_val[1][xy][1] = 0; return; } - if (direct && s->next_picture_ptr->field_picture) - av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n"); + if (direct && s->next_pic.ptr->field_picture) + av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n"); - s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample); - s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 0, s->quarter_sample); - s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 1, s->quarter_sample); - s->mv[1][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 1, s->quarter_sample); + s->mv[0][0][0] = scale_mv(s->next_pic.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample); + s->mv[0][0][1] = scale_mv(s->next_pic.motion_val[1][xy][1], v->bfraction, 0, s->quarter_sample); + s->mv[1][0][0] = scale_mv(s->next_pic.motion_val[1][xy][0], v->bfraction, 1, s->quarter_sample); + s->mv[1][0][1] = scale_mv(s->next_pic.motion_val[1][xy][1], v->bfraction, 1, s->quarter_sample); - /* Pullback predicted motion vectors as specified in 8.4.5.4 */ - s->mv[0][0][0] = av_clip(s->mv[0][0][0], -60 - (s->mb_x << 6), (s->mb_width << 6) - 4 - (s->mb_x << 6)); - s->mv[0][0][1] = av_clip(s->mv[0][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6)); - s->mv[1][0][0] = av_clip(s->mv[1][0][0], -60 - (s->mb_x << 6), (s->mb_width << 6) - 4 - (s->mb_x << 6)); - s->mv[1][0][1] = av_clip(s->mv[1][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6)); + /* Pullback predicted motion vectors as specified in 8.4.5.4 */ + s->mv[0][0][0] = av_clip(s->mv[0][0][0], -60 - (s->mb_x << 6), (s->mb_width << 6) - 4 - (s->mb_x << 6)); + s->mv[0][0][1] = av_clip(s->mv[0][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6)); + s->mv[1][0][0] = av_clip(s->mv[1][0][0], -60 - (s->mb_x << 6), (s->mb_width << 6) - 4 - (s->mb_x << 6)); + s->mv[1][0][1] = av_clip(s->mv[1][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6)); if (direct) { - s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0]; - s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1]; - s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0]; - s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1]; + s->cur_pic.motion_val[0][xy][0] = s->mv[0][0][0]; + s->cur_pic.motion_val[0][xy][1] = s->mv[0][0][1]; + s->cur_pic.motion_val[1][xy][0] = s->mv[1][0][0]; + s->cur_pic.motion_val[1][xy][1] = s->mv[1][0][1]; return; } if ((mvtype == BMV_TYPE_FORWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) { - C = s->current_picture.motion_val[0][xy - 2]; - A = s->current_picture.motion_val[0][xy - wrap * 2]; - off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2; - B = s->current_picture.motion_val[0][xy - wrap * 2 + off]; + int16_t *C = s->cur_pic.motion_val[0][xy - 2]; + const int16_t *A = s->cur_pic.motion_val[0][xy - wrap * 2]; + int off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2; + const int16_t *B = s->cur_pic.motion_val[0][xy - wrap * 2 + off]; if (!s->mb_x) C[0] = C[1] = 0; if (!s->first_slice_line) { // predictor A is not out of bounds @@ -812,10 +810,10 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], s->mv[0][0][1] = ((py + dmv_y[0] + r_y) & ((r_y << 1) - 1)) - r_y; } if ((mvtype == BMV_TYPE_BACKWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) { - C = s->current_picture.motion_val[1][xy - 2]; - A = s->current_picture.motion_val[1][xy - wrap * 2]; - off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2; - B = s->current_picture.motion_val[1][xy - wrap * 2 + off]; + int16_t *C = s->cur_pic.motion_val[1][xy - 2]; + const int16_t *A = s->cur_pic.motion_val[1][xy - wrap * 2]; + int off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2; + const int16_t *B = s->cur_pic.motion_val[1][xy - wrap * 2 + off]; if (!s->mb_x) C[0] = C[1] = 0; @@ -882,10 +880,10 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], s->mv[1][0][0] = ((px + dmv_x[1] + r_x) & ((r_x << 1) - 1)) - r_x; s->mv[1][0][1] = ((py + dmv_y[1] + r_y) & ((r_y << 1) - 1)) - r_y; } - s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0]; - s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1]; - s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0]; - s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1]; + s->cur_pic.motion_val[0][xy][0] = s->mv[0][0][0]; + s->cur_pic.motion_val[0][xy][1] = s->mv[0][0][1]; + s->cur_pic.motion_val[1][xy][0] = s->mv[1][0][0]; + s->cur_pic.motion_val[1][xy][1] = s->mv[1][0][1]; } void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, @@ -897,14 +895,14 @@ void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, if (v->bmvtype == BMV_TYPE_DIRECT) { int total_opp, k, f; - if (s->next_picture.mb_type[mb_pos + v->mb_off] != MB_TYPE_INTRA) { - s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][0], + if (s->next_pic.mb_type[mb_pos + v->mb_off] != MB_TYPE_INTRA) { + s->mv[0][0][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][0], v->bfraction, 0, s->quarter_sample); - s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][1], + s->mv[0][0][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][1], v->bfraction, 0, s->quarter_sample); - s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][0], + s->mv[1][0][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][0], v->bfraction, 1, s->quarter_sample); - s->mv[1][0][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][1], + s->mv[1][0][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][1], v->bfraction, 1, s->quarter_sample); total_opp = v->mv_f_next[0][s->block_index[0] + v->blocks_off] @@ -919,10 +917,10 @@ void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, } v->ref_field_type[0] = v->ref_field_type[1] = v->cur_field_type ^ f; for (k = 0; k < 4; k++) { - s->current_picture.motion_val[0][s->block_index[k] + v->blocks_off][0] = s->mv[0][0][0]; - s->current_picture.motion_val[0][s->block_index[k] + v->blocks_off][1] = s->mv[0][0][1]; - s->current_picture.motion_val[1][s->block_index[k] + v->blocks_off][0] = s->mv[1][0][0]; - s->current_picture.motion_val[1][s->block_index[k] + v->blocks_off][1] = s->mv[1][0][1]; + s->cur_pic.motion_val[0][s->block_index[k] + v->blocks_off][0] = s->mv[0][0][0]; + s->cur_pic.motion_val[0][s->block_index[k] + v->blocks_off][1] = s->mv[0][0][1]; + s->cur_pic.motion_val[1][s->block_index[k] + v->blocks_off][0] = s->mv[1][0][0]; + s->cur_pic.motion_val[1][s->block_index[k] + v->blocks_off][1] = s->mv[1][0][1]; v->mv_f[0][s->block_index[k] + v->blocks_off] = f; v->mv_f[1][s->block_index[k] + v->blocks_off] = f; } diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1dec.c b/src/ExtLib/ffmpeg/libavcodec/vc1dec.c index 96f6851de0..831fb2afdc 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1dec.c @@ -211,7 +211,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd) { int i, plane, row, sprite; int sr_cache[2][2] = { { -1, -1 }, { -1, -1 } }; - uint8_t* src_h[2][2]; + const uint8_t *src_h[2][2]; int xoff[2], xadv[2], yoff[2], yadv[2], alpha; int ysub[2]; MpegEncContext *s = &v->s; @@ -235,15 +235,15 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd) v->sprite_output_frame->linesize[plane] * row; for (sprite = 0; sprite <= v->two_sprites; sprite++) { - uint8_t *iplane = s->current_picture.f->data[plane]; - int iline = s->current_picture.f->linesize[plane]; + const uint8_t *iplane = s->cur_pic.data[plane]; + int iline = s->cur_pic.linesize[plane]; int ycoord = yoff[sprite] + yadv[sprite] * row; int yline = ycoord >> 16; int next_line; ysub[sprite] = ycoord & 0xFFFF; if (sprite) { - iplane = s->last_picture.f->data[plane]; - iline = s->last_picture.f->linesize[plane]; + iplane = s->last_pic.data[plane]; + iline = s->last_pic.linesize[plane]; } next_line = FFMIN(yline + 1, (v->sprite_height >> !!plane) - 1) * iline; if (!(xoff[sprite] & 0xFFFF) && xadv[sprite] == 1 << 16) { @@ -317,12 +317,12 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb) if (ret < 0) return ret; - if (!s->current_picture.f || !s->current_picture.f->data[0]) { + if (!s->cur_pic.data[0]) { av_log(avctx, AV_LOG_ERROR, "Got no sprites\n"); return AVERROR_UNKNOWN; } - if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f->data[0])) { + if (v->two_sprites && (!s->last_pic.ptr || !s->last_pic.data[0])) { av_log(avctx, AV_LOG_WARNING, "Need two sprites, only got one\n"); v->two_sprites = 0; } @@ -340,14 +340,14 @@ static void vc1_sprite_flush(AVCodecContext *avctx) { VC1Context *v = avctx->priv_data; MpegEncContext *s = &v->s; - AVFrame *f = s->current_picture.f; + MPVWorkPicture *f = &s->cur_pic; int plane, i; /* Windows Media Image codecs have a convergence interval of two keyframes. Since we can't enforce it, clear to black the missing sprite. This is wrong but it looks better than doing nothing. */ - if (f && f->data[0]) + if (f->data[0]) for (plane = 0; plane < (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY ? 1 : 3); plane++) for (i = 0; i < v->sprite_height>>!!plane; i++) memset(f->data[plane] + i * f->linesize[plane], @@ -449,6 +449,8 @@ static enum AVPixelFormat vc1_get_format(AVCodecContext *avctx) return ff_get_format(avctx, vc1_hwaccel_pixfmt_list_420); } +static void vc1_decode_reset(AVCodecContext *avctx); + av_cold int ff_vc1_decode_init(AVCodecContext *avctx) { VC1Context *const v = avctx->priv_data; @@ -459,7 +461,9 @@ av_cold int ff_vc1_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - ff_mpv_decode_init(s, avctx); + ret = ff_mpv_decode_init(s, avctx); + if (ret < 0) + return ret; avctx->pix_fmt = vc1_get_format(avctx); @@ -477,7 +481,7 @@ av_cold int ff_vc1_decode_init(AVCodecContext *avctx) ret = vc1_decode_init_alloc_tables(v); if (ret < 0) { - ff_vc1_decode_end(avctx); + vc1_decode_reset(avctx); return ret; } return 0; @@ -606,7 +610,7 @@ av_cold void ff_vc1_init_common(VC1Context *v) s->out_format = FMT_H263; s->h263_pred = 1; - s->msmpeg4_version = 6; + s->msmpeg4_version = MSMP4_VC1; ff_vc1dsp_init(&v->vc1dsp); @@ -667,7 +671,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) } } else { // VC1/WVC1/WVP2 const uint8_t *start = avctx->extradata; - uint8_t *end = avctx->extradata + avctx->extradata_size; + const uint8_t *end = avctx->extradata + avctx->extradata_size; const uint8_t *next; int size, buf2_size; uint8_t *buf2 = NULL; @@ -774,10 +778,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) return 0; } -/** Close a VC1/WMV3 decoder - * @warning Initial try at using MpegEncContext stuff - */ -av_cold int ff_vc1_decode_end(AVCodecContext *avctx) +static av_cold void vc1_decode_reset(AVCodecContext *avctx) { VC1Context *v = avctx->priv_data; int i; @@ -803,9 +804,16 @@ av_cold int ff_vc1_decode_end(AVCodecContext *avctx) av_freep(&v->is_intra_base); // FIXME use v->mb_type[] av_freep(&v->luma_mv_base); ff_intrax8_common_end(&v->x8); - return 0; } +/** + * Close a MSS2/VC1/WMV3 decoder + */ +av_cold int ff_vc1_decode_end(AVCodecContext *avctx) +{ + vc1_decode_reset(avctx); + return ff_mpv_decode_close(avctx); +} /** Decode a VC1/WMV3 frame * @todo TODO: Handle VC-1 IDUs (Transport level?) @@ -837,10 +845,10 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, /* no supplementary picture */ if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) { /* special case for last picture */ - if (s->low_delay == 0 && s->next_picture_ptr) { - if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) + if (s->low_delay == 0 && s->next_pic.ptr) { + if ((ret = av_frame_ref(pict, s->next_pic.ptr->f)) < 0) return ret; - s->next_picture_ptr = NULL; + ff_mpv_unref_picture(&s->next_pic); *got_frame = 1; } @@ -991,7 +999,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, if (s->context_initialized && (s->width != avctx->coded_width || s->height != avctx->coded_height)) { - ff_vc1_decode_end(avctx); + vc1_decode_reset(avctx); } if (!s->context_initialized) { @@ -1058,7 +1066,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, // ==> End patch MPC /* skip B-frames if we don't have reference frames */ - if (!s->last_picture_ptr && s->pict_type == AV_PICTURE_TYPE_B) { + if (!s->last_pic.ptr && s->pict_type == AV_PICTURE_TYPE_B) { av_log(v->s.avctx, AV_LOG_DEBUG, "Skipping B frame without reference frames\n"); goto end; } @@ -1072,19 +1080,21 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, goto err; } - v->s.current_picture_ptr->field_picture = v->field_mode; - v->s.current_picture_ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * (v->fcm != PROGRESSIVE); - v->s.current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!v->tff; + v->s.cur_pic.ptr->field_picture = v->field_mode; + v->s.cur_pic.ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * (v->fcm != PROGRESSIVE); + v->s.cur_pic.ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!v->tff; + v->last_interlaced = v->s.last_pic.ptr ? v->s.last_pic.ptr->f->flags & AV_FRAME_FLAG_INTERLACED : 0; + v->next_interlaced = v->s.next_pic.ptr ? v->s.next_pic.ptr->f->flags & AV_FRAME_FLAG_INTERLACED : 0; // process pulldown flags - s->current_picture_ptr->f->repeat_pict = 0; + s->cur_pic.ptr->f->repeat_pict = 0; // Pulldown flags are only valid when 'broadcast' has been set. if (v->rff) { // repeat field - s->current_picture_ptr->f->repeat_pict = 1; + s->cur_pic.ptr->f->repeat_pict = 1; } else if (v->rptfrm) { // repeat frames - s->current_picture_ptr->f->repeat_pict = v->rptfrm * 2; + s->cur_pic.ptr->f->repeat_pict = v->rptfrm * 2; } if (avctx->hwaccel) { @@ -1146,7 +1156,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, ret = AVERROR_INVALIDDATA; goto err; } - v->s.current_picture_ptr->f->pict_type = v->s.pict_type; + v->s.cur_pic.ptr->f->pict_type = v->s.pict_type; ret = hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field); @@ -1241,9 +1251,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, v->end_mb_x = s->mb_width; if (v->field_mode) { - s->current_picture.f->linesize[0] <<= 1; - s->current_picture.f->linesize[1] <<= 1; - s->current_picture.f->linesize[2] <<= 1; + s->cur_pic.linesize[0] <<= 1; + s->cur_pic.linesize[1] <<= 1; + s->cur_pic.linesize[2] <<= 1; s->linesize <<= 1; s->uvlinesize <<= 1; } @@ -1318,9 +1328,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } if (v->field_mode) { v->second_field = 0; - s->current_picture.f->linesize[0] >>= 1; - s->current_picture.f->linesize[1] >>= 1; - s->current_picture.f->linesize[2] >>= 1; + s->cur_pic.linesize[0] >>= 1; + s->cur_pic.linesize[1] >>= 1; + s->cur_pic.linesize[2] >>= 1; s->linesize >>= 1; s->uvlinesize >>= 1; if (v->s.pict_type != AV_PICTURE_TYPE_BI && v->s.pict_type != AV_PICTURE_TYPE_B) { @@ -1364,16 +1374,16 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, *got_frame = 1; } else { if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { - if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) + if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0) goto err; if (!v->field_mode) - ff_print_debug_info(s, s->current_picture_ptr, pict); + ff_print_debug_info(s, s->cur_pic.ptr, pict); *got_frame = 1; - } else if (s->last_picture_ptr) { - if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) + } else if (s->last_pic.ptr) { + if ((ret = av_frame_ref(pict, s->last_pic.ptr->f)) < 0) goto err; if (!v->field_mode) - ff_print_debug_info(s, s->last_picture_ptr, pict); + ff_print_debug_info(s, s->last_pic.ptr, pict); *got_frame = 1; } } diff --git a/src/ExtLib/ffmpeg/libavcodec/vorbisdec.c b/src/ExtLib/ffmpeg/libavcodec/vorbisdec.c index 700c6c8918..218e855f7a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vorbisdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/vorbisdec.c @@ -181,11 +181,11 @@ static const char idx_err_str[] = "Index value %d out of range (0 - %d) for %s a static float vorbisfloat2float(unsigned val) { - double mant = val & 0x1fffff; - long exp = (val & 0x7fe00000L) >> 21; + float mant = val & 0x1fffff; + int exp = (val & 0x7fe00000) >> 21; if (val & 0x80000000) mant = -mant; - return ldexp(mant, exp - 20 - 768); + return ldexpf(mant, exp - 20 - 768); } diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/cabac.c b/src/ExtLib/ffmpeg/libavcodec/vvc/cabac.c index a5ccccd1c0..0d45eec7511 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/cabac.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/cabac.c @@ -954,8 +954,8 @@ void get_left_top(const VVCLocalContext *lc, uint8_t *left, uint8_t *top, const VVCFrameContext *fc = lc->fc; const VVCSPS *sps = fc->ps.sps; const int min_cb_width = fc->ps.pps->min_cb_width; - const int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y); - const int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y); + const int x0b = av_zero_extend(x0, sps->ctb_log2_size_y); + const int y0b = av_zero_extend(y0, sps->ctb_log2_size_y); const int x_cb = x0 >> sps->min_cb_log2_size_y; const int y_cb = y0 >> sps->min_cb_log2_size_y; @@ -1132,8 +1132,8 @@ static int mtt_split_cu_vertical_flag_decode(VVCLocalContext *lc, const int x0, const VVCFrameContext *fc = lc->fc; const VVCSPS *sps = fc->ps.sps; const int min_cb_width = fc->ps.pps->min_cb_width; - const int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y); - const int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y); + const int x0b = av_zero_extend(x0, sps->ctb_log2_size_y); + const int y0b = av_zero_extend(y0, sps->ctb_log2_size_y); const int x_cb = x0 >> sps->min_cb_log2_size_y; const int y_cb = y0 >> sps->min_cb_log2_size_y; const int available_a = lc->ctb_up_flag || y0b; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c index 809510b93d..ce79f14288 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c @@ -713,8 +713,8 @@ static enum IntraPredMode luma_intra_pred_mode(VVCLocalContext* lc, const int in const int x_b = (x0 + cu->cb_width - 1) >> sps->min_cb_log2_size_y; const int y_b = (y0 - 1) >> sps->min_cb_log2_size_y; int min_cb_width = fc->ps.pps->min_cb_width; - int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y); - int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y); + int x0b = av_zero_extend(x0, sps->ctb_log2_size_y); + int y0b = av_zero_extend(y0, sps->ctb_log2_size_y); const int available_l = lc->ctb_left_flag || x0b; const int available_u = lc->ctb_up_flag || y0b; @@ -2508,8 +2508,8 @@ void ff_vvc_set_neighbour_available(VVCLocalContext *lc, const int x0, const int y0, const int w, const int h) { const int log2_ctb_size = lc->fc->ps.sps->ctb_log2_size_y; - const int x0b = av_mod_uintp2(x0, log2_ctb_size); - const int y0b = av_mod_uintp2(y0, log2_ctb_size); + const int x0b = av_zero_extend(x0, log2_ctb_size); + const int y0b = av_zero_extend(y0, log2_ctb_size); lc->na.cand_up = (lc->ctb_up_flag || y0b); lc->na.cand_left = (lc->ctb_left_flag || x0b); diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c b/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c index 98cb43322f..344a0a8c13 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c @@ -146,18 +146,21 @@ static void emulated_edge(const VVCLocalContext *lc, uint8_t *dst, subpic_get_rect(&subpic, src_frame, subpic_idx, is_chroma); if (!wrap_enabled || (dmvr_left >= 0 && dmvr_right <= pic_width)) { - return emulated_edge_no_wrap(lc, dst, src, src_stride, + emulated_edge_no_wrap(lc, dst, src, src_stride, x_off, y_off, block_w, block_h, extra_before, extra_after, &subpic, &sb, dmvr_clip); + return; } if (dmvr_right <= 0) { sb_wrap(&sb, wrap); - return emulated_edge_no_wrap(lc, dst, src, src_stride, + emulated_edge_no_wrap(lc, dst, src, src_stride, x_off + wrap, y_off, block_w, block_h, extra_before, extra_after, &subpic, &sb, dmvr_clip); + return; } if (dmvr_left >= pic_width) { sb_wrap(&sb, -wrap); - return emulated_edge_no_wrap(lc, dst, src, src_stride, + emulated_edge_no_wrap(lc, dst, src, src_stride, x_off - wrap, y_off, block_w, block_h, extra_before, extra_after, &subpic, &sb, dmvr_clip); + return; } block_w += extra; @@ -264,8 +267,8 @@ static void mc(VVCLocalContext *lc, int16_t *dst, const VVCFrame *ref, const Mv const int hs = fc->ps.sps->hshift[c_idx]; const int vs = fc->ps.sps->vshift[c_idx]; const int idx = av_log2(block_w) - 1; - const intptr_t mx = av_mod_uintp2(mv->x, 4 + hs) << (is_chroma - hs); - const intptr_t my = av_mod_uintp2(mv->y, 4 + vs) << (is_chroma - vs); + const intptr_t mx = av_zero_extend(mv->x, 4 + hs) << (is_chroma - hs); + const intptr_t my = av_zero_extend(mv->y, 4 + vs) << (is_chroma - vs); const int hpel_if_idx = (is_chroma || pu->merge_gpm_flag) ? 0 : pu->mi.hpel_if_idx; const int8_t *hf = INTER_FILTER(hpel_if_idx, mx); const int8_t *vf = INTER_FILTER(hpel_if_idx, my); @@ -292,8 +295,8 @@ static void mc_uni(VVCLocalContext *lc, uint8_t *dst, const ptrdiff_t dst_stride const int idx = av_log2(block_w) - 1; const Mv *mv = &mvf->mv[lx]; const int is_chroma = !!c_idx; - const intptr_t mx = av_mod_uintp2(mv->x, 4 + hs) << (is_chroma - hs); - const intptr_t my = av_mod_uintp2(mv->y, 4 + vs) << (is_chroma - vs); + const intptr_t mx = av_zero_extend(mv->x, 4 + hs) << (is_chroma - hs); + const intptr_t my = av_zero_extend(mv->y, 4 + vs) << (is_chroma - vs); const int hpel_if_idx = is_chroma ? 0 : pu->mi.hpel_if_idx; const int8_t *hf = INTER_FILTER(hpel_if_idx, mx); const int8_t *vf = INTER_FILTER(hpel_if_idx, my); @@ -332,8 +335,8 @@ static void mc_bi(VVCLocalContext *lc, uint8_t *dst, const ptrdiff_t dst_stride, for (int i = L0; i <= L1; i++) { const Mv *mv = mvf->mv + i; - const int mx = av_mod_uintp2(mv->x, 4 + hs) << (is_chroma - hs); - const int my = av_mod_uintp2(mv->y, 4 + vs) << (is_chroma - vs); + const int mx = av_zero_extend(mv->x, 4 + hs) << (is_chroma - hs); + const int my = av_zero_extend(mv->y, 4 + vs) << (is_chroma - vs); const int ox = x_off + (mv->x >> (4 + hs)); const int oy = y_off + (mv->y >> (4 + vs)); const VVCFrame *ref = refs[i]; @@ -669,8 +672,8 @@ static int ciip_derive_intra_weight(const VVCLocalContext *lc, const int x0, con { const VVCFrameContext *fc = lc->fc; const VVCSPS *sps = fc->ps.sps; - const int x0b = av_mod_uintp2(x0, sps->ctb_log2_size_y); - const int y0b = av_mod_uintp2(y0, sps->ctb_log2_size_y); + const int x0b = av_zero_extend(x0, sps->ctb_log2_size_y); + const int y0b = av_zero_extend(y0, sps->ctb_log2_size_y); const int available_l = lc->ctb_left_flag || x0b; const int available_u = lc->ctb_up_flag || y0b; const int min_pu_width = fc->ps.pps->min_pu_width; @@ -968,7 +971,7 @@ static void pred_affine_blk(VVCLocalContext *lc) luma_prof_bi(lc, dst0, dst_stride, refp[L0], refp[L1], mv, x, y, sbw, sbh); } if (fc->ps.sps->r->sps_chroma_format_idc) { - if (!av_mod_uintp2(sby, vs) && !av_mod_uintp2(sbx, hs)) { + if (!av_zero_extend(sby, vs) && !av_zero_extend(sbx, hs)) { MvField mvc; derive_affine_mvc(&mvc, fc, mv, x, y, sbw, sbh); diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/inter_template.c b/src/ExtLib/ffmpeg/libavcodec/vvc/inter_template.c index a8068f4ba8..89effffb8f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/inter_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/inter_template.c @@ -47,7 +47,7 @@ static void av_always_inline FUNC(put_scaled)(uint8_t *_dst, const ptrdiff_t _ds for (int i = 0; i < width; i++) { const int tx = _x + dx * i; const int x = SCALED_INT(tx) - x0; - const int mx = av_mod_uintp2(tx >> shift1, shift2); + const int mx = av_zero_extend(tx >> shift1, shift2); const int8_t *filter = hf + mx * taps; const pixel *src = (pixel*)_src - extra_before * src_stride; @@ -61,7 +61,7 @@ static void av_always_inline FUNC(put_scaled)(uint8_t *_dst, const ptrdiff_t _ds for (int i = 0; i < height; i++) { const int ty = _y + dy * i; const int x = SCALED_INT(ty) - y0; - const int mx = av_mod_uintp2(ty >> shift1, shift2); + const int mx = av_zero_extend(ty >> shift1, shift2); const int8_t *filter = vf + mx * taps; tmp = tmp_array + extra_before; @@ -136,7 +136,7 @@ static void av_always_inline FUNC(put_uni_w_scaled)(uint8_t *_dst, const ptrdiff for (int i = 0; i < width; i++) { const int tx = _x + dx * i; const int x = SCALED_INT(tx) - x0; - const int mx = av_mod_uintp2(tx >> shift1, shift2); + const int mx = av_zero_extend(tx >> shift1, shift2); const int8_t *filter = hf + mx * taps; const pixel *src = (pixel*)_src - extra_before * src_stride; @@ -150,7 +150,7 @@ static void av_always_inline FUNC(put_uni_w_scaled)(uint8_t *_dst, const ptrdiff for (int i = 0; i < height; i++) { const int ty = _y + dy * i; const int x = SCALED_INT(ty) - y0; - const int mx = av_mod_uintp2(ty >> shift1, shift2); + const int mx = av_zero_extend(ty >> shift1, shift2); const int8_t *filter = vf + mx * taps; tmp = tmp_array + extra_before; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/intra_template.c b/src/ExtLib/ffmpeg/libavcodec/vvc/intra_template.c index 1a4d5f6f93..62342c8142 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/intra_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/intra_template.c @@ -99,7 +99,7 @@ static av_always_inline void FUNC(cclm_select_luma)(const VVCFrameContext *fc, { const VVCSPS *sps = fc->ps.sps; - const int b_ctu_boundary = !av_mod_uintp2(y0, sps->ctb_log2_size_y); + const int b_ctu_boundary = !av_zero_extend(y0, sps->ctb_log2_size_y); const int hs = sps->hshift[1]; const int vs = sps->vshift[1]; const ptrdiff_t stride = fc->frame->linesize[0] / sizeof(pixel); diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/intra_utils.c b/src/ExtLib/ffmpeg/libavcodec/vvc/intra_utils.c index 040aacdffe..8c40eb1b16 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/intra_utils.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/intra_utils.c @@ -100,7 +100,7 @@ int ff_vvc_get_top_available(const VVCLocalContext *lc, const int x, const int y const int vs = sps->vshift[c_idx]; const int log2_ctb_size_v = sps->ctb_log2_size_y - vs; const int end_of_ctb_x = ((lc->cu->x0 >> sps->ctb_log2_size_y) + 1) << sps->ctb_log2_size_y; - const int y0b = av_mod_uintp2(y, log2_ctb_size_v); + const int y0b = av_zero_extend(y, log2_ctb_size_v); const int max_x = FFMIN(fc->ps.pps->width, end_of_ctb_x) >> hs; const ReconstructedArea *a; int px = x; @@ -130,7 +130,7 @@ int ff_vvc_get_left_available(const VVCLocalContext *lc, const int x, const int const int hs = sps->hshift[c_idx]; const int vs = sps->vshift[c_idx]; const int log2_ctb_size_h = sps->ctb_log2_size_y - hs; - const int x0b = av_mod_uintp2(x, log2_ctb_size_h); + const int x0b = av_zero_extend(x, log2_ctb_size_h); const int end_of_ctb_y = ((lc->cu->y0 >> sps->ctb_log2_size_y) + 1) << sps->ctb_log2_size_y; const int max_y = FFMIN(fc->ps.pps->height, end_of_ctb_y) >> vs; const ReconstructedArea *a; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c b/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c index b96e750272..42564b3e6f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c @@ -549,7 +549,7 @@ static int is_a0_available(const VVCLocalContext *lc, const CodingUnit *cu) { const VVCFrameContext *fc = lc->fc; const VVCSPS *sps = fc->ps.sps; - const int x0b = av_mod_uintp2(cu->x0, sps->ctb_log2_size_y); + const int x0b = av_zero_extend(cu->x0, sps->ctb_log2_size_y); int cand_bottom_left; if (!x0b && !lc->ctb_left_flag) { diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c b/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c index 1b23675c98..92368eafc2 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c @@ -101,9 +101,14 @@ static int sps_chroma_qp_table(VVCSPS *sps) qp_out[0] = qp_in[0] = r->sps_qp_table_start_minus26[i] + 26; for (int j = 0; j < num_points_in_qp_table; j++ ) { + const uint8_t delta_qp_out = (r->sps_delta_qp_in_val_minus1[i][j] ^ r->sps_delta_qp_diff_val[i][j]); delta_qp_in[j] = r->sps_delta_qp_in_val_minus1[i][j] + 1; + // Note: we cannot check qp_{in,out}[j+1] here as qp_*[j] + delta_qp_* + // may not fit in an 8-bit signed integer. + if (qp_in[j] + delta_qp_in[j] > 63 || qp_out[j] + delta_qp_out > 63) + return AVERROR(EINVAL); qp_in[j+1] = qp_in[j] + delta_qp_in[j]; - qp_out[j+1] = qp_out[j] + (r->sps_delta_qp_in_val_minus1[i][j] ^ r->sps_delta_qp_diff_val[i][j]); + qp_out[j+1] = qp_out[j] + delta_qp_out; } sps->chroma_qp_table[i][qp_in[0] + off] = qp_out[0]; for (int k = qp_in[0] - 1 + off; k >= 0; k--) @@ -186,8 +191,11 @@ static int sps_derive(VVCSPS *sps, void *log_ctx) sps_inter(sps); sps_partition_constraints(sps); sps_ladf(sps); - if (r->sps_chroma_format_idc != 0) - sps_chroma_qp_table(sps); + if (r->sps_chroma_format_idc != 0) { + ret = sps_chroma_qp_table(sps); + if (ret < 0) + return ret; + } return 0; } diff --git a/src/ExtLib/ffmpeg/libavcodec/wmv2.c b/src/ExtLib/ffmpeg/libavcodec/wmv2.c index e3d3288d33..c2bcb988c4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/wmv2.c +++ b/src/ExtLib/ffmpeg/libavcodec/wmv2.c @@ -49,7 +49,8 @@ av_cold void ff_wmv2_common_init(MpegEncContext *s) void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], + uint8_t *const *ref_picture, + const op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h) { WMV2Context *const w = s->private_ctx; diff --git a/src/ExtLib/ffmpeg/libavcodec/wmv2.h b/src/ExtLib/ffmpeg/libavcodec/wmv2.h index e49b81cdfb..6fc9704c3d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/wmv2.h +++ b/src/ExtLib/ffmpeg/libavcodec/wmv2.h @@ -39,7 +39,8 @@ void ff_wmv2_common_init(MpegEncContext *s); void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], + uint8_t *const *ref_picture, + const op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h); diff --git a/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c b/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c index ff27d1b4d0..5c91006169 100644 --- a/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c @@ -27,6 +27,7 @@ #include "mathops.h" #include "mpegutils.h" #include "mpegvideo.h" +#include "mpegvideodec.h" #include "msmpeg4.h" #include "msmpeg4_vc1_data.h" #include "msmpeg4dec.h" @@ -103,7 +104,7 @@ static int parse_mb_skip(WMV2DecContext *w) int mb_x, mb_y; int coded_mb_count = 0; MpegEncContext *const s = &w->s; - uint32_t *const mb_type = s->current_picture_ptr->mb_type; + uint32_t *const mb_type = s->cur_pic.mb_type; w->skip_type = get_bits(&s->gb, 2); switch (w->skip_type) { @@ -238,9 +239,8 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) if (s->pict_type == AV_PICTURE_TYPE_I) { /* Is filling with zeroes really the right thing to do? */ - memset(s->current_picture_ptr->mb_type, 0, - sizeof(*s->current_picture_ptr->mb_type) * - s->mb_height * s->mb_stride); + memset(s->cur_pic.mb_type, 0, + sizeof(*s->cur_pic.mb_type) * s->mb_height * s->mb_stride); if (w->j_type_bit) w->j_type = get_bits1(&s->gb); else @@ -331,7 +331,7 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) s->esc3_run_length = 0; if (w->j_type) { - ff_intrax8_decode_picture(&w->x8, &s->current_picture, + ff_intrax8_decode_picture(&w->x8, s->cur_pic.ptr, &s->gb, &s->mb_x, &s->mb_y, 2 * s->qscale, (s->qscale - 1) | 1, s->loop_filter, s->low_delay); @@ -366,11 +366,11 @@ static int16_t *wmv2_pred_motion(WMV2DecContext *w, int *px, int *py) wrap = s->b8_stride; xy = s->block_index[0]; - mot_val = s->current_picture.motion_val[0][xy]; + mot_val = s->cur_pic.motion_val[0][xy]; - A = s->current_picture.motion_val[0][xy - 1]; - B = s->current_picture.motion_val[0][xy - wrap]; - C = s->current_picture.motion_val[0][xy + 2 - wrap]; + A = s->cur_pic.motion_val[0][xy - 1]; + B = s->cur_pic.motion_val[0][xy - wrap]; + C = s->cur_pic.motion_val[0][xy + 2 - wrap]; if (s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag) diff = FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1])); @@ -452,7 +452,7 @@ static int wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) return 0; if (s->pict_type == AV_PICTURE_TYPE_P) { - if (IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])) { + if (IS_SKIP(s->cur_pic.mb_type[s->mb_y * s->mb_stride + s->mb_x])) { /* skip mb */ s->mb_intra = 0; for (i = 0; i < 6; i++) @@ -585,7 +585,7 @@ static av_cold int wmv2_decode_end(AVCodecContext *avctx) WMV2DecContext *const w = avctx->priv_data; ff_intrax8_common_end(&w->x8); - return ff_h263_decode_end(avctx); + return ff_mpv_decode_close(avctx); } const FFCodec ff_wmv2_decoder = { diff --git a/src/ExtLib/ffmpeg/libavutil/bswap.h b/src/ExtLib/ffmpeg/libavutil/bswap.h index 4840ab433f..f53e5768ad 100644 --- a/src/ExtLib/ffmpeg/libavutil/bswap.h +++ b/src/ExtLib/ffmpeg/libavutil/bswap.h @@ -34,16 +34,10 @@ #include "config.h" -#if ARCH_AARCH64 -# include "aarch64/bswap.h" -#elif ARCH_ARM +#if ARCH_ARM # include "arm/bswap.h" -#elif ARCH_AVR32 -# include "avr32/bswap.h" #elif ARCH_RISCV # include "riscv/bswap.h" -#elif ARCH_SH4 -# include "sh4/bswap.h" #elif ARCH_X86 # include "x86/bswap.h" #endif diff --git a/src/ExtLib/ffmpeg/libavutil/common.h b/src/ExtLib/ffmpeg/libavutil/common.h index 30ed76d13e..fd58d4ce9c 100644 --- a/src/ExtLib/ffmpeg/libavutil/common.h +++ b/src/ExtLib/ffmpeg/libavutil/common.h @@ -42,6 +42,7 @@ #include "attributes.h" #include "error.h" #include "macros.h" +#include "version.h" #ifdef HAVE_AV_CONFIG_H # include "config.h" @@ -122,9 +123,6 @@ #ifndef av_clip_uintp2 # define av_clip_uintp2 av_clip_uintp2_c #endif -#ifndef av_mod_uintp2 -# define av_mod_uintp2 av_mod_uintp2_c -#endif #ifndef av_sat_add32 # define av_sat_add32 av_sat_add32_c #endif @@ -149,6 +147,9 @@ #ifndef av_clipd # define av_clipd av_clipd_c #endif +#ifndef av_zero_extend +# define av_zero_extend av_zero_extend_c +#endif #ifndef av_popcount # define av_popcount av_popcount_c #endif @@ -252,8 +253,8 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a) */ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) { - if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF); - else return (int32_t)a; + if ((a+UINT64_C(0x80000000)) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF); + else return (int32_t)a; } /** @@ -264,7 +265,7 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) */ static av_always_inline av_const int av_clip_intp2_c(int a, int p) { - if (((unsigned)a + (1 << p)) & ~((2 << p) - 1)) + if (((unsigned)a + (1U << p)) & ~((2U << p) - 1)) return (a >> 31) ^ ((1 << p) - 1); else return a; @@ -278,21 +279,35 @@ static av_always_inline av_const int av_clip_intp2_c(int a, int p) */ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) { - if (a & ~((1<> 31 & ((1<> 31 & ((1U<= 2 + if (p > 31) abort(); +#endif return a & ((1U << p) - 1); } +#if FF_API_MOD_UINTP2 +#ifndef av_mod_uintp2 +# define av_mod_uintp2 av_mod_uintp2_c +#endif +attribute_deprecated +static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p) +{ + return av_zero_extend_c(a, p); +} +#endif + /** * Add two signed 32-bit values with saturation. * diff --git a/src/ExtLib/ffmpeg/libavutil/intmath.h b/src/ExtLib/ffmpeg/libavutil/intmath.h index e6a9b756bb..4c289c7c63 100644 --- a/src/ExtLib/ffmpeg/libavutil/intmath.h +++ b/src/ExtLib/ffmpeg/libavutil/intmath.h @@ -119,7 +119,7 @@ static av_always_inline av_const int ff_ctz_c(int v) 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; - return debruijn_ctz32[(uint32_t)((v & -v) * 0x077CB531U) >> 27]; + return debruijn_ctz32[(uint32_t)((v & -(uint32_t)v) * 0x077CB531U) >> 27]; } #endif @@ -135,7 +135,7 @@ static av_always_inline av_const int ff_ctzll_c(long long v) 63, 52, 6, 26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10, 51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12 }; - return debruijn_ctz64[(uint64_t)((v & -v) * 0x022FDD63CC95386DU) >> 58]; + return debruijn_ctz64[(uint64_t)((v & -(uint64_t)v) * 0x022FDD63CC95386DU) >> 58]; } #endif diff --git a/src/ExtLib/ffmpeg/libavutil/intreadwrite.h b/src/ExtLib/ffmpeg/libavutil/intreadwrite.h index 910423d1ac..f4c9d94857 100644 --- a/src/ExtLib/ffmpeg/libavutil/intreadwrite.h +++ b/src/ExtLib/ffmpeg/libavutil/intreadwrite.h @@ -64,9 +64,7 @@ typedef union { #include "config.h" -#if ARCH_ARM -# include "arm/intreadwrite.h" -#elif ARCH_AVR32 +#if ARCH_AVR32 # include "avr32/intreadwrite.h" #elif ARCH_MIPS # include "mips/intreadwrite.h" diff --git a/src/ExtLib/ffmpeg/libavutil/timer.h b/src/ExtLib/ffmpeg/libavutil/timer.h index 2cd299eca3..6bd6a0c645 100644 --- a/src/ExtLib/ffmpeg/libavutil/timer.h +++ b/src/ExtLib/ffmpeg/libavutil/timer.h @@ -46,6 +46,8 @@ #include "macos_kperf.h" #elif HAVE_MACH_ABSOLUTE_TIME #include +#elif HAVE_CLOCK_GETTIME +#include #endif #include "common.h" @@ -70,6 +72,14 @@ # define AV_READ_TIME gethrtime # elif HAVE_MACH_ABSOLUTE_TIME # define AV_READ_TIME mach_absolute_time +# elif HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) + static inline int64_t ff_read_time(void) + { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return ts.tv_sec * INT64_C(1000000000) + ts.tv_nsec; + } +# define AV_READ_TIME ff_read_time # endif #endif diff --git a/src/ExtLib/ffmpeg/libavutil/version.h b/src/ExtLib/ffmpeg/libavutil/version.h index 9d08d56884..2756f2aa03 100644 --- a/src/ExtLib/ffmpeg/libavutil/version.h +++ b/src/ExtLib/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 21 +#define LIBAVUTIL_VERSION_MINOR 22 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -112,6 +112,7 @@ #define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60) /** * @} diff --git a/src/ExtLib/ffmpeg/libavutil/x86/bswap.h b/src/ExtLib/ffmpeg/libavutil/x86/bswap.h index 3b86a45623..ec83ce8569 100644 --- a/src/ExtLib/ffmpeg/libavutil/x86/bswap.h +++ b/src/ExtLib/ffmpeg/libavutil/x86/bswap.h @@ -57,16 +57,7 @@ static inline uint64_t av_const av_bswap64(uint64_t x) #elif HAVE_INLINE_ASM -#if AV_GCC_VERSION_AT_MOST(4,0) -#define av_bswap16 av_bswap16 -static av_always_inline av_const unsigned av_bswap16(unsigned x) -{ - __asm__("rorw $8, %w0" : "+r"(x)); - return x; -} -#endif /* AV_GCC_VERSION_AT_MOST(4,0) */ - -#if AV_GCC_VERSION_AT_MOST(4,4) || defined(__INTEL_COMPILER) +#ifdef __INTEL_COMPILER #define av_bswap32 av_bswap32 static av_always_inline av_const uint32_t av_bswap32(uint32_t x) { @@ -82,7 +73,7 @@ static inline uint64_t av_const av_bswap64(uint64_t x) return x; } #endif -#endif /* AV_GCC_VERSION_AT_MOST(4,4) */ +#endif /* __INTEL_COMPILER */ #endif /* HAVE_INLINE_ASM */ #endif /* AVUTIL_X86_BSWAP_H */ diff --git a/src/ExtLib/ffmpeg/libavutil/x86/intmath.h b/src/ExtLib/ffmpeg/libavutil/x86/intmath.h index 9d05aaa0f6..0d98c40183 100644 --- a/src/ExtLib/ffmpeg/libavutil/x86/intmath.h +++ b/src/ExtLib/ffmpeg/libavutil/x86/intmath.h @@ -82,16 +82,28 @@ static av_always_inline av_const int ff_ctzll_x86(long long v) #if defined(__BMI2__) #if AV_GCC_VERSION_AT_LEAST(5,1) -#define av_mod_uintp2 __builtin_ia32_bzhi_si +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 +#define av_zero_extend av_zero_extend_bmi2 +static av_always_inline av_const unsigned av_zero_extend_bmi2(unsigned a, unsigned p) +{ + if (p > 31) abort(); + return __builtin_ia32_bzhi_si(a, p); +} +#else +#define av_zero_extend __builtin_ia32_bzhi_si +#endif #elif HAVE_INLINE_ASM /* GCC releases before 5.1.0 have a broken bzhi builtin, so for those we * implement it using inline assembly */ -#define av_mod_uintp2 av_mod_uintp2_bmi2 -static av_always_inline av_const unsigned av_mod_uintp2_bmi2(unsigned a, unsigned p) +#define av_zero_extend av_zero_extend_bmi2 +static av_always_inline av_const unsigned av_zero_extend_bmi2(unsigned a, unsigned p) { +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 + if (p > 31) abort(); +#endif if (av_builtin_constant_p(p)) - return a & ((1 << p) - 1); + return a & ((1U << p) - 1); else { unsigned x; __asm__ ("bzhi %2, %1, %0 \n\t" : "=r"(x) : "rm"(a), "r"(p)); diff --git a/src/ExtLib/ffmpeg/libswscale/swscale.c b/src/ExtLib/ffmpeg/libswscale/swscale.c index 2795429b6c..9736734881 100644 --- a/src/ExtLib/ffmpeg/libswscale/swscale.c +++ b/src/ExtLib/ffmpeg/libswscale/swscale.c @@ -602,6 +602,8 @@ void ff_sws_init_scale(SwsContext *c) ff_sws_init_swscale_arm(c); #elif ARCH_LOONGARCH64 ff_sws_init_swscale_loongarch(c); +#elif ARCH_RISCV + ff_sws_init_swscale_riscv(c); #endif } diff --git a/src/ExtLib/ffmpeg/libswscale/swscale_internal.h b/src/ExtLib/ffmpeg/libswscale/swscale_internal.h index d4b0c3cee2..5007dd422f 100644 --- a/src/ExtLib/ffmpeg/libswscale/swscale_internal.h +++ b/src/ExtLib/ffmpeg/libswscale/swscale_internal.h @@ -988,6 +988,7 @@ void ff_sws_init_swscale_x86(SwsContext *c); void ff_sws_init_swscale_aarch64(SwsContext *c); void ff_sws_init_swscale_arm(SwsContext *c); void ff_sws_init_swscale_loongarch(SwsContext *c); +void ff_sws_init_swscale_riscv(SwsContext *c); void ff_hyscale_fast_c(SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc); diff --git a/src/ExtLib/ffmpeg/libswscale/x86/input.asm b/src/ExtLib/ffmpeg/libswscale/x86/input.asm index a197183f1f..21cd8b37fd 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/input.asm +++ b/src/ExtLib/ffmpeg/libswscale/x86/input.asm @@ -23,7 +23,7 @@ %include "libavutil/x86/x86util.asm" -SECTION_RODATA +SECTION_RODATA 32 %define RY 0x20DE %define GY 0x4087 @@ -90,8 +90,12 @@ rgb_UVrnd: times 4 dd 0x400100 ; 128.5 << 15 ; rgba_Vcoeff_ag: times 4 dw 0, GV shuf_rgb_12x4: db 0, 0x80, 1, 0x80, 2, 0x80, 3, 0x80, \ + 6, 0x80, 7, 0x80, 8, 0x80, 9, 0x80, \ + 0, 0x80, 1, 0x80, 2, 0x80, 3, 0x80, \ 6, 0x80, 7, 0x80, 8, 0x80, 9, 0x80 shuf_rgb_3x56: db 2, 0x80, 3, 0x80, 4, 0x80, 5, 0x80, \ + 8, 0x80, 9, 0x80, 10, 0x80, 11, 0x80, \ + 2, 0x80, 3, 0x80, 4, 0x80, 5, 0x80, \ 8, 0x80, 9, 0x80, 10, 0x80, 11, 0x80 pd_65535f: times 8 dd 65535.0 pb_pack_shuffle16le: db 0, 1, 4, 5, \ @@ -134,8 +138,13 @@ SECTION .text %macro RGB24_TO_Y_FN 2-3 cglobal %2 %+ 24ToY, 6, 6, %1, dst, src, u1, u2, w, table %if ARCH_X86_64 +%if mmsize == 32 + vbroadcasti128 m8, [%2_Ycoeff_12x4] + vbroadcasti128 m9, [%2_Ycoeff_3x56] +%else mova m8, [%2_Ycoeff_12x4] mova m9, [%2_Ycoeff_3x56] +%endif %define coeff1 m8 %define coeff2 m9 %else ; x86-32 @@ -165,11 +174,19 @@ cglobal %2 %+ 24ToY, 6, 6, %1, dst, src, u1, u2, w, table %if notcpuflag(ssse3) pxor m7, m7 %endif ; !cpuflag(ssse3) +%if mmsize == 32 + vbroadcasti128 m4, [rgb_Yrnd] +%else mova m4, [rgb_Yrnd] +%endif .loop: %if cpuflag(ssse3) - movu m0, [srcq+0] ; (byte) { Bx, Gx, Rx }[0-3] - movu m2, [srcq+12] ; (byte) { Bx, Gx, Rx }[4-7] + movu xm0, [srcq+0] ; (byte) { Bx, Gx, Rx }[0-3] + movu xm2, [srcq+12] ; (byte) { Bx, Gx, Rx }[4-7] +%if mmsize == 32 + vinserti128 m0, m0, [srcq+24], 1 + vinserti128 m2, m2, [srcq+36], 1 +%endif pshufb m1, m0, shuf_rgb2 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 } pshufb m0, shuf_rgb1 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 } pshufb m3, m2, shuf_rgb2 ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 } @@ -212,27 +229,35 @@ cglobal %2 %+ 24ToY, 6, 6, %1, dst, src, u1, u2, w, table %endmacro ; %1 = nr. of XMM registers -; %2 = rgb or bgr -%macro RGB24_TO_UV_FN 2-3 -cglobal %2 %+ 24ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table +; %2 = aligned/unaligned output argument +; %3-4 = rgb or bgr +%macro RGB24_TO_UV_FN 3-4 +cglobal %3 %+ 24ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table %if ARCH_X86_64 - mova m8, [%2_Ucoeff_12x4] - mova m9, [%2_Ucoeff_3x56] - mova m10, [%2_Vcoeff_12x4] - mova m11, [%2_Vcoeff_3x56] +%if mmsize == 32 + vbroadcasti128 m8, [%3_Ucoeff_12x4] + vbroadcasti128 m9, [%3_Ucoeff_3x56] + vbroadcasti128 m10, [%3_Vcoeff_12x4] + vbroadcasti128 m11, [%3_Vcoeff_3x56] +%else + mova m8, [%3_Ucoeff_12x4] + mova m9, [%3_Ucoeff_3x56] + mova m10, [%3_Vcoeff_12x4] + mova m11, [%3_Vcoeff_3x56] +%endif %define coeffU1 m8 %define coeffU2 m9 %define coeffV1 m10 %define coeffV2 m11 %else ; x86-32 -%define coeffU1 [%2_Ucoeff_12x4] -%define coeffU2 [%2_Ucoeff_3x56] -%define coeffV1 [%2_Vcoeff_12x4] -%define coeffV2 [%2_Vcoeff_3x56] +%define coeffU1 [%3_Ucoeff_12x4] +%define coeffU2 [%3_Ucoeff_3x56] +%define coeffV1 [%3_Vcoeff_12x4] +%define coeffV2 [%3_Vcoeff_3x56] %endif ; x86-32/64 -%if ARCH_X86_64 && %0 == 3 - jmp mangle(private_prefix %+ _ %+ %3 %+ 24ToUV %+ SUFFIX).body -%else ; ARCH_X86_64 && %0 == 3 +%if ARCH_X86_64 && %0 == 4 + jmp mangle(private_prefix %+ _ %+ %4 %+ 24ToUV %+ SUFFIX).body +%else ; ARCH_X86_64 && %0 == 4 .body: %if cpuflag(ssse3) mova m7, [shuf_rgb_12x4] @@ -253,14 +278,22 @@ cglobal %2 %+ 24ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table add dstUq, wq add dstVq, wq neg wq +%if mmsize == 32 + vbroadcasti128 m6, [rgb_UVrnd] +%else mova m6, [rgb_UVrnd] +%endif %if notcpuflag(ssse3) pxor m7, m7 %endif .loop: %if cpuflag(ssse3) - movu m0, [srcq+0] ; (byte) { Bx, Gx, Rx }[0-3] - movu m4, [srcq+12] ; (byte) { Bx, Gx, Rx }[4-7] + movu xm0, [srcq+0] ; (byte) { Bx, Gx, Rx }[0-3] + movu xm4, [srcq+12] ; (byte) { Bx, Gx, Rx }[4-7] +%if mmsize == 32 + vinserti128 m0, m0, [srcq+24], 1 + vinserti128 m4, m4, [srcq+36], 1 +%endif pshufb m1, m0, shuf_rgb2 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 } pshufb m0, shuf_rgb1 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 } %else ; !cpuflag(ssse3) @@ -309,40 +342,53 @@ cglobal %2 %+ 24ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table psrad m4, 9 packssdw m0, m1 ; (word) { U[0-7] } packssdw m2, m4 ; (word) { V[0-7] } - mova [dstUq+wq], m0 - mova [dstVq+wq], m2 + mov%2 [dstUq+wq], m0 + mov%2 [dstVq+wq], m2 add wq, mmsize jl .loop RET -%endif ; ARCH_X86_64 && %0 == 3 +%endif ; ARCH_X86_64 && %0 == 4 %endmacro ; %1 = nr. of XMM registers for rgb-to-Y func ; %2 = nr. of XMM registers for rgb-to-UV func -%macro RGB24_FUNCS 2 +; %3 = aligned/unaligned output argument +%macro RGB24_FUNCS 3 RGB24_TO_Y_FN %1, rgb RGB24_TO_Y_FN %1, bgr, rgb -RGB24_TO_UV_FN %2, rgb -RGB24_TO_UV_FN %2, bgr, rgb +RGB24_TO_UV_FN %2, %3, rgb +RGB24_TO_UV_FN %2, %3, bgr, rgb %endmacro INIT_XMM sse2 -RGB24_FUNCS 10, 12 +RGB24_FUNCS 10, 12, a INIT_XMM ssse3 -RGB24_FUNCS 11, 13 +RGB24_FUNCS 11, 13, a %if HAVE_AVX_EXTERNAL INIT_XMM avx -RGB24_FUNCS 11, 13 +RGB24_FUNCS 11, 13, a +%endif + +%if ARCH_X86_64 +%if HAVE_AVX2_EXTERNAL +INIT_YMM avx2 +RGB24_FUNCS 11, 13, u +%endif %endif ; %1 = nr. of XMM registers ; %2-5 = rgba, bgra, argb or abgr (in individual characters) %macro RGB32_TO_Y_FN 5-6 cglobal %2%3%4%5 %+ ToY, 6, 6, %1, dst, src, u1, u2, w, table +%if mmsize == 32 + vbroadcasti128 m5, [rgba_Ycoeff_%2%4] + vbroadcasti128 m6, [rgba_Ycoeff_%3%5] +%else mova m5, [rgba_Ycoeff_%2%4] mova m6, [rgba_Ycoeff_%3%5] +%endif %if %0 == 6 jmp mangle(private_prefix %+ _ %+ %6 %+ ToY %+ SUFFIX).body %else ; %0 == 6 @@ -355,13 +401,21 @@ cglobal %2%3%4%5 %+ ToY, 6, 6, %1, dst, src, u1, u2, w, table lea srcq, [srcq+wq*2] add dstq, wq neg wq +%if mmsize == 32 + vbroadcasti128 m4, [rgb_Yrnd] +%else mova m4, [rgb_Yrnd] +%endif pcmpeqb m7, m7 psrlw m7, 8 ; (word) { 0x00ff } x4 .loop: ; FIXME check alignment and use mova - movu m0, [srcq+wq*2+0] ; (byte) { Bx, Gx, Rx, xx }[0-3] - movu m2, [srcq+wq*2+mmsize] ; (byte) { Bx, Gx, Rx, xx }[4-7] + movu xm0, [srcq+wq*2+0] ; (byte) { Bx, Gx, Rx, xx }[0-3] + movu xm2, [srcq+wq*2+16] ; (byte) { Bx, Gx, Rx, xx }[4-7] +%if mmsize == 32 + vinserti128 m0, m0, [srcq+wq*2+32], 1 + vinserti128 m2, m2, [srcq+wq*2+48], 1 +%endif DEINTB 1, 0, 3, 2, 7 ; (word) { Gx, xx (m0/m2) or Bx, Rx (m1/m3) }[0-3]/[4-7] pmaddwd m1, m5 ; (dword) { Bx*BY + Rx*RY }[0-3] pmaddwd m0, m6 ; (dword) { Gx*GY }[0-3] @@ -382,6 +436,7 @@ cglobal %2%3%4%5 %+ ToY, 6, 6, %1, dst, src, u1, u2, w, table add srcq, 2*mmsize - 2 add dstq, mmsize - 1 .loop2: +INIT_XMM cpuname movd m0, [srcq+wq*2+0] ; (byte) { Bx, Gx, Rx, xx }[0-3] DEINTB 1, 0, 3, 2, 7 ; (word) { Gx, xx (m0/m2) or Bx, Rx (m1/m3) }[0-3]/[4-7] pmaddwd m1, m5 ; (dword) { Bx*BY + Rx*RY }[0-3] @@ -394,32 +449,43 @@ cglobal %2%3%4%5 %+ ToY, 6, 6, %1, dst, src, u1, u2, w, table add wq, 2 jl .loop2 .end: +%if cpuflag(avx2) +INIT_YMM cpuname +%endif RET %endif ; %0 == 3 %endmacro ; %1 = nr. of XMM registers -; %2-5 = rgba, bgra, argb or abgr (in individual characters) -%macro RGB32_TO_UV_FN 5-6 -cglobal %2%3%4%5 %+ ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table +; %2 = aligned/unaligned output argument +; %3-6 = rgba, bgra, argb or abgr (in individual characters) +%macro RGB32_TO_UV_FN 6-7 +cglobal %3%4%5%6 %+ ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table %if ARCH_X86_64 - mova m8, [rgba_Ucoeff_%2%4] - mova m9, [rgba_Ucoeff_%3%5] - mova m10, [rgba_Vcoeff_%2%4] - mova m11, [rgba_Vcoeff_%3%5] +%if mmsize == 32 + vbroadcasti128 m8, [rgba_Ucoeff_%3%5] + vbroadcasti128 m9, [rgba_Ucoeff_%4%6] + vbroadcasti128 m10, [rgba_Vcoeff_%3%5] + vbroadcasti128 m11, [rgba_Vcoeff_%4%6] +%else + mova m8, [rgba_Ucoeff_%3%5] + mova m9, [rgba_Ucoeff_%4%6] + mova m10, [rgba_Vcoeff_%3%5] + mova m11, [rgba_Vcoeff_%4%6] +%endif %define coeffU1 m8 %define coeffU2 m9 %define coeffV1 m10 %define coeffV2 m11 %else ; x86-32 -%define coeffU1 [rgba_Ucoeff_%2%4] -%define coeffU2 [rgba_Ucoeff_%3%5] -%define coeffV1 [rgba_Vcoeff_%2%4] -%define coeffV2 [rgba_Vcoeff_%3%5] +%define coeffU1 [rgba_Ucoeff_%3%5] +%define coeffU2 [rgba_Ucoeff_%4%6] +%define coeffV1 [rgba_Vcoeff_%3%5] +%define coeffV2 [rgba_Vcoeff_%4%6] %endif ; x86-64/32 -%if ARCH_X86_64 && %0 == 6 - jmp mangle(private_prefix %+ _ %+ %6 %+ ToUV %+ SUFFIX).body -%else ; ARCH_X86_64 && %0 == 6 +%if ARCH_X86_64 && %0 == 7 + jmp mangle(private_prefix %+ _ %+ %7 %+ ToUV %+ SUFFIX).body +%else ; ARCH_X86_64 && %0 == 7 .body: %if ARCH_X86_64 movsxd wq, dword r5m @@ -434,11 +500,19 @@ cglobal %2%3%4%5 %+ ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table neg wq pcmpeqb m7, m7 psrlw m7, 8 ; (word) { 0x00ff } x4 +%if mmsize == 32 + vbroadcasti128 m6, [rgb_UVrnd] +%else mova m6, [rgb_UVrnd] +%endif .loop: ; FIXME check alignment and use mova - movu m0, [srcq+wq*2+0] ; (byte) { Bx, Gx, Rx, xx }[0-3] - movu m4, [srcq+wq*2+mmsize] ; (byte) { Bx, Gx, Rx, xx }[4-7] + movu xm0, [srcq+wq*2+0] ; (byte) { Bx, Gx, Rx, xx }[0-3] + movu xm4, [srcq+wq*2+16] ; (byte) { Bx, Gx, Rx, xx }[4-7] +%if mmsize == 32 + vinserti128 m0, m0, [srcq+wq*2+32], 1 + vinserti128 m4, m4, [srcq+wq*2+48], 1 +%endif DEINTB 1, 0, 5, 4, 7 ; (word) { Gx, xx (m0/m4) or Bx, Rx (m1/m5) }[0-3]/[4-7] pmaddwd m3, m1, coeffV1 ; (dword) { Bx*BV + Rx*RV }[0-3] pmaddwd m2, m0, coeffV2 ; (dword) { Gx*GV }[0-3] @@ -462,8 +536,9 @@ cglobal %2%3%4%5 %+ ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table psrad m1, 9 packssdw m0, m4 ; (word) { U[0-7] } packssdw m2, m1 ; (word) { V[0-7] } - mova [dstUq+wq], m0 - mova [dstVq+wq], m2 + ; FIXME check alignment and use mova + mov%2 [dstUq+wq], m0 + mov%2 [dstVq+wq], m2 add wq, mmsize jl .loop sub wq, mmsize - 1 @@ -472,6 +547,7 @@ cglobal %2%3%4%5 %+ ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table add dstUq, mmsize - 1 add dstVq, mmsize - 1 .loop2: +INIT_XMM cpuname movd m0, [srcq+wq*2] ; (byte) { Bx, Gx, Rx, xx }[0-3] DEINTB 1, 0, 5, 4, 7 ; (word) { Gx, xx (m0/m4) or Bx, Rx (m1/m5) }[0-3]/[4-7] pmaddwd m3, m1, coeffV1 ; (dword) { Bx*BV + Rx*RV }[0-3] @@ -491,30 +567,41 @@ cglobal %2%3%4%5 %+ ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, table add wq, 2 jl .loop2 .end: +%if cpuflag(avx2) +INIT_YMM cpuname +%endif RET -%endif ; ARCH_X86_64 && %0 == 3 +%endif ; ARCH_X86_64 && %0 == 7 %endmacro ; %1 = nr. of XMM registers for rgb-to-Y func ; %2 = nr. of XMM registers for rgb-to-UV func -%macro RGB32_FUNCS 2 +; %3 = aligned/unaligned output argument +%macro RGB32_FUNCS 3 RGB32_TO_Y_FN %1, r, g, b, a RGB32_TO_Y_FN %1, b, g, r, a, rgba RGB32_TO_Y_FN %1, a, r, g, b, rgba RGB32_TO_Y_FN %1, a, b, g, r, rgba -RGB32_TO_UV_FN %2, r, g, b, a -RGB32_TO_UV_FN %2, b, g, r, a, rgba -RGB32_TO_UV_FN %2, a, r, g, b, rgba -RGB32_TO_UV_FN %2, a, b, g, r, rgba +RGB32_TO_UV_FN %2, %3, r, g, b, a +RGB32_TO_UV_FN %2, %3, b, g, r, a, rgba +RGB32_TO_UV_FN %2, %3, a, r, g, b, rgba +RGB32_TO_UV_FN %2, %3, a, b, g, r, rgba %endmacro INIT_XMM sse2 -RGB32_FUNCS 8, 12 +RGB32_FUNCS 8, 12, a %if HAVE_AVX_EXTERNAL INIT_XMM avx -RGB32_FUNCS 8, 12 +RGB32_FUNCS 8, 12, a +%endif + +%if ARCH_X86_64 +%if HAVE_AVX2_EXTERNAL +INIT_YMM avx2 +RGB32_FUNCS 8, 12, u +%endif %endif ;----------------------------------------------------------------------------- diff --git a/src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb.c b/src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb.c index c771f14001..ff7e07780b 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb.c +++ b/src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb.c @@ -37,6 +37,7 @@ #include "libswscale/swscale_internal.h" #if HAVE_INLINE_ASM +#include "libavutil/x86/asm.h" DECLARE_ASM_CONST(8, uint64_t, mmx_ff) = 0x00000000000000FFULL; DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0x0000000000000000ULL; @@ -83,29 +84,2255 @@ DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2UVOffset); #define RV ((int)( 0.439*(1<>1)&0x7FE07FE0) | (x&0x001F001F); + s+=4; + d+=4; + } + if (s < end) { + register uint16_t x= *((const uint16_t*)s); + *((uint16_t *)d) = ((x>>1)&0x7FE0) | (x&0x001F); + } +} + +static inline void rgb32to16_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + mm_end = end - 15; + __asm__ volatile( + "movq %3, %%mm5 \n\t" + "movq %4, %%mm6 \n\t" + "movq %5, %%mm7 \n\t" + "jmp 2f \n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 4(%1), %%mm3 \n\t" + "punpckldq 8(%1), %%mm0 \n\t" + "punpckldq 12(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm3, %%mm4 \n\t" + "pand %%mm6, %%mm0 \n\t" + "pand %%mm6, %%mm3 \n\t" + "pmaddwd %%mm7, %%mm0 \n\t" + "pmaddwd %%mm7, %%mm3 \n\t" + "pand %%mm5, %%mm1 \n\t" + "pand %%mm5, %%mm4 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "psrld $5, %%mm0 \n\t" + "pslld $11, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + "add $16, %1 \n\t" + "add $8, %0 \n\t" + "2: \n\t" + "cmp %2, %1 \n\t" + " jb 1b \n\t" + : "+r" (d), "+r"(s) + : "r" (mm_end), "m" (mask3216g), "m" (mask3216br), "m" (mul3216) + ); + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register int rgb = *(const uint32_t*)s; s += 4; + *d++ = ((rgb&0xFF)>>3) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>8); + } +} + +static inline void rgb32tobgr16_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); + __asm__ volatile( + "movq %0, %%mm7 \n\t" + "movq %1, %%mm6 \n\t" + ::"m"(red_16mask),"m"(green_16mask)); + mm_end = end - 15; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 4(%1), %%mm3 \n\t" + "punpckldq 8(%1), %%mm0 \n\t" + "punpckldq 12(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm3, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "psllq $8, %%mm0 \n\t" + "psllq $8, %%mm3 \n\t" + "pand %%mm7, %%mm0 \n\t" + "pand %%mm7, %%mm3 \n\t" + "psrlq $5, %%mm1 \n\t" + "psrlq $5, %%mm4 \n\t" + "pand %%mm6, %%mm1 \n\t" + "pand %%mm6, %%mm4 \n\t" + "psrlq $19, %%mm2 \n\t" + "psrlq $19, %%mm5 \n\t" + "pand %2, %%mm2 \n\t" + "pand %2, %%mm5 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm2, %%mm0 \n\t" + "por %%mm5, %%mm3 \n\t" + "psllq $16, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + :: "r"(d),"r"(s),"m"(blue_16mask):"memory"); + d += 4; + s += 16; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register int rgb = *(const uint32_t*)s; s += 4; + *d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19); + } +} + +static inline void rgb32to15_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + mm_end = end - 15; + __asm__ volatile( + "movq %3, %%mm5 \n\t" + "movq %4, %%mm6 \n\t" + "movq %5, %%mm7 \n\t" + "jmp 2f \n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 4(%1), %%mm3 \n\t" + "punpckldq 8(%1), %%mm0 \n\t" + "punpckldq 12(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm3, %%mm4 \n\t" + "pand %%mm6, %%mm0 \n\t" + "pand %%mm6, %%mm3 \n\t" + "pmaddwd %%mm7, %%mm0 \n\t" + "pmaddwd %%mm7, %%mm3 \n\t" + "pand %%mm5, %%mm1 \n\t" + "pand %%mm5, %%mm4 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "psrld $6, %%mm0 \n\t" + "pslld $10, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + "add $16, %1 \n\t" + "add $8, %0 \n\t" + "2: \n\t" + "cmp %2, %1 \n\t" + " jb 1b \n\t" + : "+r" (d), "+r"(s) + : "r" (mm_end), "m" (mask3215g), "m" (mask3216br), "m" (mul3215) + ); + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register int rgb = *(const uint32_t*)s; s += 4; + *d++ = ((rgb&0xFF)>>3) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>9); + } +} + +static inline void rgb32tobgr15_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); + __asm__ volatile( + "movq %0, %%mm7 \n\t" + "movq %1, %%mm6 \n\t" + ::"m"(red_15mask),"m"(green_15mask)); + mm_end = end - 15; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 4(%1), %%mm3 \n\t" + "punpckldq 8(%1), %%mm0 \n\t" + "punpckldq 12(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm3, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "psllq $7, %%mm0 \n\t" + "psllq $7, %%mm3 \n\t" + "pand %%mm7, %%mm0 \n\t" + "pand %%mm7, %%mm3 \n\t" + "psrlq $6, %%mm1 \n\t" + "psrlq $6, %%mm4 \n\t" + "pand %%mm6, %%mm1 \n\t" + "pand %%mm6, %%mm4 \n\t" + "psrlq $19, %%mm2 \n\t" + "psrlq $19, %%mm5 \n\t" + "pand %2, %%mm2 \n\t" + "pand %2, %%mm5 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm2, %%mm0 \n\t" + "por %%mm5, %%mm3 \n\t" + "psllq $16, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + ::"r"(d),"r"(s),"m"(blue_15mask):"memory"); + d += 4; + s += 16; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register int rgb = *(const uint32_t*)s; s += 4; + *d++ = ((rgb&0xF8)<<7) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>19); + } +} + +static inline void rgb24tobgr16_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); + __asm__ volatile( + "movq %0, %%mm7 \n\t" + "movq %1, %%mm6 \n\t" + ::"m"(red_16mask),"m"(green_16mask)); + mm_end = end - 11; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 3(%1), %%mm3 \n\t" + "punpckldq 6(%1), %%mm0 \n\t" + "punpckldq 9(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm3, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "psrlq $3, %%mm0 \n\t" + "psrlq $3, %%mm3 \n\t" + "pand %2, %%mm0 \n\t" + "pand %2, %%mm3 \n\t" + "psrlq $5, %%mm1 \n\t" + "psrlq $5, %%mm4 \n\t" + "pand %%mm6, %%mm1 \n\t" + "pand %%mm6, %%mm4 \n\t" + "psrlq $8, %%mm2 \n\t" + "psrlq $8, %%mm5 \n\t" + "pand %%mm7, %%mm2 \n\t" + "pand %%mm7, %%mm5 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm2, %%mm0 \n\t" + "por %%mm5, %%mm3 \n\t" + "psllq $16, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + ::"r"(d),"r"(s),"m"(blue_16mask):"memory"); + d += 4; + s += 12; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + const int b = *s++; + const int g = *s++; + const int r = *s++; + *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); + } +} + +static inline void rgb24to16_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); + __asm__ volatile( + "movq %0, %%mm7 \n\t" + "movq %1, %%mm6 \n\t" + ::"m"(red_16mask),"m"(green_16mask)); + mm_end = end - 15; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 3(%1), %%mm3 \n\t" + "punpckldq 6(%1), %%mm0 \n\t" + "punpckldq 9(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm3, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "psllq $8, %%mm0 \n\t" + "psllq $8, %%mm3 \n\t" + "pand %%mm7, %%mm0 \n\t" + "pand %%mm7, %%mm3 \n\t" + "psrlq $5, %%mm1 \n\t" + "psrlq $5, %%mm4 \n\t" + "pand %%mm6, %%mm1 \n\t" + "pand %%mm6, %%mm4 \n\t" + "psrlq $19, %%mm2 \n\t" + "psrlq $19, %%mm5 \n\t" + "pand %2, %%mm2 \n\t" + "pand %2, %%mm5 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm2, %%mm0 \n\t" + "por %%mm5, %%mm3 \n\t" + "psllq $16, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + ::"r"(d),"r"(s),"m"(blue_16mask):"memory"); + d += 4; + s += 12; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + const int r = *s++; + const int g = *s++; + const int b = *s++; + *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); + } +} + +static inline void rgb24tobgr15_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); + __asm__ volatile( + "movq %0, %%mm7 \n\t" + "movq %1, %%mm6 \n\t" + ::"m"(red_15mask),"m"(green_15mask)); + mm_end = end - 11; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 3(%1), %%mm3 \n\t" + "punpckldq 6(%1), %%mm0 \n\t" + "punpckldq 9(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm3, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "psrlq $3, %%mm0 \n\t" + "psrlq $3, %%mm3 \n\t" + "pand %2, %%mm0 \n\t" + "pand %2, %%mm3 \n\t" + "psrlq $6, %%mm1 \n\t" + "psrlq $6, %%mm4 \n\t" + "pand %%mm6, %%mm1 \n\t" + "pand %%mm6, %%mm4 \n\t" + "psrlq $9, %%mm2 \n\t" + "psrlq $9, %%mm5 \n\t" + "pand %%mm7, %%mm2 \n\t" + "pand %%mm7, %%mm5 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm2, %%mm0 \n\t" + "por %%mm5, %%mm3 \n\t" + "psllq $16, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + ::"r"(d),"r"(s),"m"(blue_15mask):"memory"); + d += 4; + s += 12; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + const int b = *s++; + const int g = *s++; + const int r = *s++; + *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7); + } +} + +static inline void rgb24to15_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint8_t *s = src; + const uint8_t *end; + const uint8_t *mm_end; + uint16_t *d = (uint16_t *)dst; + end = s + src_size; + __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); + __asm__ volatile( + "movq %0, %%mm7 \n\t" + "movq %1, %%mm6 \n\t" + ::"m"(red_15mask),"m"(green_15mask)); + mm_end = end - 15; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movd (%1), %%mm0 \n\t" + "movd 3(%1), %%mm3 \n\t" + "punpckldq 6(%1), %%mm0 \n\t" + "punpckldq 9(%1), %%mm3 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm3, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "psllq $7, %%mm0 \n\t" + "psllq $7, %%mm3 \n\t" + "pand %%mm7, %%mm0 \n\t" + "pand %%mm7, %%mm3 \n\t" + "psrlq $6, %%mm1 \n\t" + "psrlq $6, %%mm4 \n\t" + "pand %%mm6, %%mm1 \n\t" + "pand %%mm6, %%mm4 \n\t" + "psrlq $19, %%mm2 \n\t" + "psrlq $19, %%mm5 \n\t" + "pand %2, %%mm2 \n\t" + "pand %2, %%mm5 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm2, %%mm0 \n\t" + "por %%mm5, %%mm3 \n\t" + "psllq $16, %%mm3 \n\t" + "por %%mm3, %%mm0 \n\t" + MOVNTQ" %%mm0, (%0) \n\t" + ::"r"(d),"r"(s),"m"(blue_15mask):"memory"); + d += 4; + s += 12; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + const int r = *s++; + const int g = *s++; + const int b = *s++; + *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7); + } +} + +static inline void rgb15tobgr24_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint16_t *end; + const uint16_t *mm_end; + uint8_t *d = dst; + const uint16_t *s = (const uint16_t*)src; + end = s + src_size/2; + __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); + mm_end = end - 7; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movq (%1), %%mm0 \n\t" + "movq (%1), %%mm1 \n\t" + "movq (%1), %%mm2 \n\t" + "pand %2, %%mm0 \n\t" + "pand %3, %%mm1 \n\t" + "pand %4, %%mm2 \n\t" + "psllq $5, %%mm0 \n\t" + "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" + "pmulhw "MANGLE(mul15_mid)", %%mm1 \n\t" + "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" + "movq %%mm0, %%mm3 \n\t" + "movq %%mm1, %%mm4 \n\t" + "movq %%mm2, %%mm5 \n\t" + "punpcklwd %5, %%mm0 \n\t" + "punpcklwd %5, %%mm1 \n\t" + "punpcklwd %5, %%mm2 \n\t" + "punpckhwd %5, %%mm3 \n\t" + "punpckhwd %5, %%mm4 \n\t" + "punpckhwd %5, %%mm5 \n\t" + "psllq $8, %%mm1 \n\t" + "psllq $16, %%mm2 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm2, %%mm0 \n\t" + "psllq $8, %%mm4 \n\t" + "psllq $16, %%mm5 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm5, %%mm3 \n\t" + + "movq %%mm0, %%mm6 \n\t" + "movq %%mm3, %%mm7 \n\t" + + "movq 8(%1), %%mm0 \n\t" + "movq 8(%1), %%mm1 \n\t" + "movq 8(%1), %%mm2 \n\t" + "pand %2, %%mm0 \n\t" + "pand %3, %%mm1 \n\t" + "pand %4, %%mm2 \n\t" + "psllq $5, %%mm0 \n\t" + "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" + "pmulhw "MANGLE(mul15_mid)", %%mm1 \n\t" + "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" + "movq %%mm0, %%mm3 \n\t" + "movq %%mm1, %%mm4 \n\t" + "movq %%mm2, %%mm5 \n\t" + "punpcklwd %5, %%mm0 \n\t" + "punpcklwd %5, %%mm1 \n\t" + "punpcklwd %5, %%mm2 \n\t" + "punpckhwd %5, %%mm3 \n\t" + "punpckhwd %5, %%mm4 \n\t" + "punpckhwd %5, %%mm5 \n\t" + "psllq $8, %%mm1 \n\t" + "psllq $16, %%mm2 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm2, %%mm0 \n\t" + "psllq $8, %%mm4 \n\t" + "psllq $16, %%mm5 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm5, %%mm3 \n\t" + + :"=m"(*d) + :"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null) + NAMED_CONSTRAINTS_ADD(mul15_mid,mul15_hi) + :"memory"); + /* borrowed 32 to 24 */ + __asm__ volatile( + "movq %%mm0, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "movq %%mm6, %%mm0 \n\t" + "movq %%mm7, %%mm1 \n\t" + + "movq %%mm4, %%mm6 \n\t" + "movq %%mm5, %%mm7 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm1, %%mm3 \n\t" + + STORE_BGR24_MMX + + :: "r"(d), "m"(*s) + NAMED_CONSTRAINTS_ADD(mask24l,mask24h) + :"memory"); + d += 24; + s += 8; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register uint16_t bgr; + bgr = *s++; + *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); + *d++ = ((bgr&0x3E0)>>2) | ((bgr&0x3E0)>>7); + *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12); + } +} + +static inline void rgb16tobgr24_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint16_t *end; + const uint16_t *mm_end; + uint8_t *d = (uint8_t *)dst; + const uint16_t *s = (const uint16_t *)src; + end = s + src_size/2; + __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); + mm_end = end - 7; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movq (%1), %%mm0 \n\t" + "movq (%1), %%mm1 \n\t" + "movq (%1), %%mm2 \n\t" + "pand %2, %%mm0 \n\t" + "pand %3, %%mm1 \n\t" + "pand %4, %%mm2 \n\t" + "psllq $5, %%mm0 \n\t" + "psrlq $1, %%mm2 \n\t" + "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" + "pmulhw "MANGLE(mul16_mid)", %%mm1 \n\t" + "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" + "movq %%mm0, %%mm3 \n\t" + "movq %%mm1, %%mm4 \n\t" + "movq %%mm2, %%mm5 \n\t" + "punpcklwd %5, %%mm0 \n\t" + "punpcklwd %5, %%mm1 \n\t" + "punpcklwd %5, %%mm2 \n\t" + "punpckhwd %5, %%mm3 \n\t" + "punpckhwd %5, %%mm4 \n\t" + "punpckhwd %5, %%mm5 \n\t" + "psllq $8, %%mm1 \n\t" + "psllq $16, %%mm2 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm2, %%mm0 \n\t" + "psllq $8, %%mm4 \n\t" + "psllq $16, %%mm5 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm5, %%mm3 \n\t" + + "movq %%mm0, %%mm6 \n\t" + "movq %%mm3, %%mm7 \n\t" + + "movq 8(%1), %%mm0 \n\t" + "movq 8(%1), %%mm1 \n\t" + "movq 8(%1), %%mm2 \n\t" + "pand %2, %%mm0 \n\t" + "pand %3, %%mm1 \n\t" + "pand %4, %%mm2 \n\t" + "psllq $5, %%mm0 \n\t" + "psrlq $1, %%mm2 \n\t" + "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" + "pmulhw "MANGLE(mul16_mid)", %%mm1 \n\t" + "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" + "movq %%mm0, %%mm3 \n\t" + "movq %%mm1, %%mm4 \n\t" + "movq %%mm2, %%mm5 \n\t" + "punpcklwd %5, %%mm0 \n\t" + "punpcklwd %5, %%mm1 \n\t" + "punpcklwd %5, %%mm2 \n\t" + "punpckhwd %5, %%mm3 \n\t" + "punpckhwd %5, %%mm4 \n\t" + "punpckhwd %5, %%mm5 \n\t" + "psllq $8, %%mm1 \n\t" + "psllq $16, %%mm2 \n\t" + "por %%mm1, %%mm0 \n\t" + "por %%mm2, %%mm0 \n\t" + "psllq $8, %%mm4 \n\t" + "psllq $16, %%mm5 \n\t" + "por %%mm4, %%mm3 \n\t" + "por %%mm5, %%mm3 \n\t" + :"=m"(*d) + :"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null) + NAMED_CONSTRAINTS_ADD(mul15_mid,mul16_mid,mul15_hi) + :"memory"); + /* borrowed 32 to 24 */ + __asm__ volatile( + "movq %%mm0, %%mm4 \n\t" + "movq %%mm3, %%mm5 \n\t" + "movq %%mm6, %%mm0 \n\t" + "movq %%mm7, %%mm1 \n\t" + + "movq %%mm4, %%mm6 \n\t" + "movq %%mm5, %%mm7 \n\t" + "movq %%mm0, %%mm2 \n\t" + "movq %%mm1, %%mm3 \n\t" + + STORE_BGR24_MMX + + :: "r"(d), "m"(*s) + NAMED_CONSTRAINTS_ADD(mask24l,mask24h) + :"memory"); + d += 24; + s += 8; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register uint16_t bgr; + bgr = *s++; + *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); + *d++ = ((bgr&0x7E0)>>3) | ((bgr&0x7E0)>>9); + *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13); + } +} + +/* + * mm0 = 00 B3 00 B2 00 B1 00 B0 + * mm1 = 00 G3 00 G2 00 G1 00 G0 + * mm2 = 00 R3 00 R2 00 R1 00 R0 + * mm6 = FF FF FF FF FF FF FF FF + * mm7 = 00 00 00 00 00 00 00 00 + */ +#define PACK_RGB32 \ + "packuswb %%mm7, %%mm0 \n\t" /* 00 00 00 00 B3 B2 B1 B0 */ \ + "packuswb %%mm7, %%mm1 \n\t" /* 00 00 00 00 G3 G2 G1 G0 */ \ + "packuswb %%mm7, %%mm2 \n\t" /* 00 00 00 00 R3 R2 R1 R0 */ \ + "punpcklbw %%mm1, %%mm0 \n\t" /* G3 B3 G2 B2 G1 B1 G0 B0 */ \ + "punpcklbw %%mm6, %%mm2 \n\t" /* FF R3 FF R2 FF R1 FF R0 */ \ + "movq %%mm0, %%mm3 \n\t" \ + "punpcklwd %%mm2, %%mm0 \n\t" /* FF R1 G1 B1 FF R0 G0 B0 */ \ + "punpckhwd %%mm2, %%mm3 \n\t" /* FF R3 G3 B3 FF R2 G2 B2 */ \ + MOVNTQ" %%mm0, (%0) \n\t" \ + MOVNTQ" %%mm3, 8(%0) \n\t" \ + +static inline void rgb15to32_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint16_t *end; + const uint16_t *mm_end; + uint8_t *d = dst; + const uint16_t *s = (const uint16_t *)src; + end = s + src_size/2; + __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); + __asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory"); + __asm__ volatile("pcmpeqd %%mm6,%%mm6 \n\t":::"memory"); + mm_end = end - 3; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movq (%1), %%mm0 \n\t" + "movq (%1), %%mm1 \n\t" + "movq (%1), %%mm2 \n\t" + "pand %2, %%mm0 \n\t" + "pand %3, %%mm1 \n\t" + "pand %4, %%mm2 \n\t" + "psllq $5, %%mm0 \n\t" + "pmulhw %5, %%mm0 \n\t" + "pmulhw %5, %%mm1 \n\t" + "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" + PACK_RGB32 + ::"r"(d),"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r) ,"m"(mul15_mid) + NAMED_CONSTRAINTS_ADD(mul15_hi) + :"memory"); + d += 16; + s += 4; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register uint16_t bgr; + bgr = *s++; + *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); + *d++ = ((bgr&0x3E0)>>2) | ((bgr&0x3E0)>>7); + *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12); + *d++ = 255; + } +} + +static inline void rgb16to32_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + const uint16_t *end; + const uint16_t *mm_end; + uint8_t *d = dst; + const uint16_t *s = (const uint16_t*)src; + end = s + src_size/2; + __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); + __asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory"); + __asm__ volatile("pcmpeqd %%mm6,%%mm6 \n\t":::"memory"); + mm_end = end - 3; + while (s < mm_end) { + __asm__ volatile( + PREFETCH" 32(%1) \n\t" + "movq (%1), %%mm0 \n\t" + "movq (%1), %%mm1 \n\t" + "movq (%1), %%mm2 \n\t" + "pand %2, %%mm0 \n\t" + "pand %3, %%mm1 \n\t" + "pand %4, %%mm2 \n\t" + "psllq $5, %%mm0 \n\t" + "psrlq $1, %%mm2 \n\t" + "pmulhw %5, %%mm0 \n\t" + "pmulhw "MANGLE(mul16_mid)", %%mm1 \n\t" + "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" + PACK_RGB32 + ::"r"(d),"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mul15_mid) + NAMED_CONSTRAINTS_ADD(mul16_mid,mul15_hi) + :"memory"); + d += 16; + s += 4; + } + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + while (s < end) { + register uint16_t bgr; + bgr = *s++; + *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); + *d++ = ((bgr&0x7E0)>>3) | ((bgr&0x7E0)>>9); + *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13); + *d++ = 255; + } +} + +static inline void rgb24tobgr24_mmxext(const uint8_t *src, uint8_t *dst, int src_size) +{ + x86_reg mmx_size= 23 - src_size; + __asm__ volatile ( + "test %%"FF_REG_a", %%"FF_REG_a" \n\t" + "jns 2f \n\t" + "movq "MANGLE(mask24r)", %%mm5 \n\t" + "movq "MANGLE(mask24g)", %%mm6 \n\t" + "movq "MANGLE(mask24b)", %%mm7 \n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 32(%1, %%"FF_REG_a") \n\t" + "movq (%1, %%"FF_REG_a"), %%mm0 \n\t" // BGR BGR BG + "movq (%1, %%"FF_REG_a"), %%mm1 \n\t" // BGR BGR BG + "movq 2(%1, %%"FF_REG_a"), %%mm2 \n\t" // R BGR BGR B + "psllq $16, %%mm0 \n\t" // 00 BGR BGR + "pand %%mm5, %%mm0 \n\t" + "pand %%mm6, %%mm1 \n\t" + "pand %%mm7, %%mm2 \n\t" + "por %%mm0, %%mm1 \n\t" + "por %%mm2, %%mm1 \n\t" + "movq 6(%1, %%"FF_REG_a"), %%mm0 \n\t" // BGR BGR BG + MOVNTQ" %%mm1,(%2, %%"FF_REG_a") \n\t" // RGB RGB RG + "movq 8(%1, %%"FF_REG_a"), %%mm1 \n\t" // R BGR BGR B + "movq 10(%1, %%"FF_REG_a"), %%mm2 \n\t" // GR BGR BGR + "pand %%mm7, %%mm0 \n\t" + "pand %%mm5, %%mm1 \n\t" + "pand %%mm6, %%mm2 \n\t" + "por %%mm0, %%mm1 \n\t" + "por %%mm2, %%mm1 \n\t" + "movq 14(%1, %%"FF_REG_a"), %%mm0 \n\t" // R BGR BGR B + MOVNTQ" %%mm1, 8(%2, %%"FF_REG_a")\n\t" // B RGB RGB R + "movq 16(%1, %%"FF_REG_a"), %%mm1 \n\t" // GR BGR BGR + "movq 18(%1, %%"FF_REG_a"), %%mm2 \n\t" // BGR BGR BG + "pand %%mm6, %%mm0 \n\t" + "pand %%mm7, %%mm1 \n\t" + "pand %%mm5, %%mm2 \n\t" + "por %%mm0, %%mm1 \n\t" + "por %%mm2, %%mm1 \n\t" + MOVNTQ" %%mm1, 16(%2, %%"FF_REG_a") \n\t" + "add $24, %%"FF_REG_a" \n\t" + " js 1b \n\t" + "2: \n\t" + : "+a" (mmx_size) + : "r" (src-mmx_size), "r"(dst-mmx_size) + NAMED_CONSTRAINTS_ADD(mask24r,mask24g,mask24b) + ); + + __asm__ volatile(SFENCE:::"memory"); + __asm__ volatile(EMMS:::"memory"); + + if (mmx_size==23) return; //finished, was multiple of 8 + + src+= src_size; + dst+= src_size; + src_size= 23-mmx_size; + src-= src_size; + dst-= src_size; + for (unsigned i = 0; i < src_size; i +=3) { + register uint8_t x; + x = src[i + 2]; + dst[i + 1] = src[i + 1]; + dst[i + 2] = src[i + 0]; + dst[i + 0] = x; + } +} + +static inline void yuvPlanartoyuy2_mmxext(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride, int vertLumPerChroma) +{ + const x86_reg chromWidth= width>>1; + for (int y = 0; y < height; y++) { + //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway) + __asm__ volatile( + "xor %%"FF_REG_a", %%"FF_REG_a" \n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 32(%1, %%"FF_REG_a", 2) \n\t" + PREFETCH" 32(%2, %%"FF_REG_a") \n\t" + PREFETCH" 32(%3, %%"FF_REG_a") \n\t" + "movq (%2, %%"FF_REG_a"), %%mm0 \n\t" // U(0) + "movq %%mm0, %%mm2 \n\t" // U(0) + "movq (%3, %%"FF_REG_a"), %%mm1 \n\t" // V(0) + "punpcklbw %%mm1, %%mm0 \n\t" // UVUV UVUV(0) + "punpckhbw %%mm1, %%mm2 \n\t" // UVUV UVUV(8) + + "movq (%1, %%"FF_REG_a",2), %%mm3 \n\t" // Y(0) + "movq 8(%1, %%"FF_REG_a",2), %%mm5 \n\t" // Y(8) + "movq %%mm3, %%mm4 \n\t" // Y(0) + "movq %%mm5, %%mm6 \n\t" // Y(8) + "punpcklbw %%mm0, %%mm3 \n\t" // YUYV YUYV(0) + "punpckhbw %%mm0, %%mm4 \n\t" // YUYV YUYV(4) + "punpcklbw %%mm2, %%mm5 \n\t" // YUYV YUYV(8) + "punpckhbw %%mm2, %%mm6 \n\t" // YUYV YUYV(12) + + MOVNTQ" %%mm3, (%0, %%"FF_REG_a", 4) \n\t" + MOVNTQ" %%mm4, 8(%0, %%"FF_REG_a", 4) \n\t" + MOVNTQ" %%mm5, 16(%0, %%"FF_REG_a", 4) \n\t" + MOVNTQ" %%mm6, 24(%0, %%"FF_REG_a", 4) \n\t" + + "add $8, %%"FF_REG_a" \n\t" + "cmp %4, %%"FF_REG_a" \n\t" + " jb 1b \n\t" + ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth) + : "%"FF_REG_a + ); + if ((y&(vertLumPerChroma-1)) == vertLumPerChroma-1) { + usrc += chromStride; + vsrc += chromStride; + } + ysrc += lumStride; + dst += dstStride; + } + __asm__(EMMS" \n\t" + SFENCE" \n\t" + :::"memory"); +} + +/** + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) + */ +static inline void yv12toyuy2_mmxext(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride) +{ + //FIXME interpolate chroma + yuvPlanartoyuy2_mmxext(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2); +} + +static inline void yuvPlanartouyvy_mmxext(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride, int vertLumPerChroma) +{ + const x86_reg chromWidth= width>>1; + for (int y = 0; y < height; y++) { + //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway) + __asm__ volatile( + "xor %%"FF_REG_a", %%"FF_REG_a" \n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 32(%1, %%"FF_REG_a", 2) \n\t" + PREFETCH" 32(%2, %%"FF_REG_a") \n\t" + PREFETCH" 32(%3, %%"FF_REG_a") \n\t" + "movq (%2, %%"FF_REG_a"), %%mm0 \n\t" // U(0) + "movq %%mm0, %%mm2 \n\t" // U(0) + "movq (%3, %%"FF_REG_a"), %%mm1 \n\t" // V(0) + "punpcklbw %%mm1, %%mm0 \n\t" // UVUV UVUV(0) + "punpckhbw %%mm1, %%mm2 \n\t" // UVUV UVUV(8) + + "movq (%1, %%"FF_REG_a",2), %%mm3 \n\t" // Y(0) + "movq 8(%1, %%"FF_REG_a",2), %%mm5 \n\t" // Y(8) + "movq %%mm0, %%mm4 \n\t" // Y(0) + "movq %%mm2, %%mm6 \n\t" // Y(8) + "punpcklbw %%mm3, %%mm0 \n\t" // YUYV YUYV(0) + "punpckhbw %%mm3, %%mm4 \n\t" // YUYV YUYV(4) + "punpcklbw %%mm5, %%mm2 \n\t" // YUYV YUYV(8) + "punpckhbw %%mm5, %%mm6 \n\t" // YUYV YUYV(12) + + MOVNTQ" %%mm0, (%0, %%"FF_REG_a", 4) \n\t" + MOVNTQ" %%mm4, 8(%0, %%"FF_REG_a", 4) \n\t" + MOVNTQ" %%mm2, 16(%0, %%"FF_REG_a", 4) \n\t" + MOVNTQ" %%mm6, 24(%0, %%"FF_REG_a", 4) \n\t" + + "add $8, %%"FF_REG_a" \n\t" + "cmp %4, %%"FF_REG_a" \n\t" + " jb 1b \n\t" + ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth) + : "%"FF_REG_a + ); + if ((y&(vertLumPerChroma-1)) == vertLumPerChroma-1) { + usrc += chromStride; + vsrc += chromStride; + } + ysrc += lumStride; + dst += dstStride; + } + __asm__(EMMS" \n\t" + SFENCE" \n\t" + :::"memory"); +} + +/** + * Height should be a multiple of 2 and width should be a multiple of 16 + * (If this is a problem for anyone then tell me, and I will fix it.) + */ +static inline void yv12touyvy_mmxext(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride) +{ + //FIXME interpolate chroma + yuvPlanartouyvy_mmxext(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2); +} + +/** + * Width should be a multiple of 16. + */ +static inline void yuv422ptouyvy_mmxext(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride) +{ + yuvPlanartouyvy_mmxext(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1); +} + +/** + * Width should be a multiple of 16. + */ +static inline void yuv422ptoyuy2_mmxext(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride) +{ + yuvPlanartoyuy2_mmxext(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1); +} + +/** + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) + */ +static inline void yuy2toyv12_mmxext(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + int width, int height, + int lumStride, int chromStride, int srcStride) +{ + const x86_reg chromWidth= width>>1; + for (int y = 0; y < height; y += 2) { + __asm__ volatile( + "xor %%"FF_REG_a", %%"FF_REG_a"\n\t" + "pcmpeqw %%mm7, %%mm7 \n\t" + "psrlw $8, %%mm7 \n\t" // FF,00,FF,00... + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 64(%0, %%"FF_REG_a", 4) \n\t" + "movq (%0, %%"FF_REG_a", 4), %%mm0 \n\t" // YUYV YUYV(0) + "movq 8(%0, %%"FF_REG_a", 4), %%mm1 \n\t" // YUYV YUYV(4) + "movq %%mm0, %%mm2 \n\t" // YUYV YUYV(0) + "movq %%mm1, %%mm3 \n\t" // YUYV YUYV(4) + "psrlw $8, %%mm0 \n\t" // U0V0 U0V0(0) + "psrlw $8, %%mm1 \n\t" // U0V0 U0V0(4) + "pand %%mm7, %%mm2 \n\t" // Y0Y0 Y0Y0(0) + "pand %%mm7, %%mm3 \n\t" // Y0Y0 Y0Y0(4) + "packuswb %%mm1, %%mm0 \n\t" // UVUV UVUV(0) + "packuswb %%mm3, %%mm2 \n\t" // YYYY YYYY(0) + + MOVNTQ" %%mm2, (%1, %%"FF_REG_a", 2) \n\t" + + "movq 16(%0, %%"FF_REG_a", 4), %%mm1 \n\t" // YUYV YUYV(8) + "movq 24(%0, %%"FF_REG_a", 4), %%mm2 \n\t" // YUYV YUYV(12) + "movq %%mm1, %%mm3 \n\t" // YUYV YUYV(8) + "movq %%mm2, %%mm4 \n\t" // YUYV YUYV(12) + "psrlw $8, %%mm1 \n\t" // U0V0 U0V0(8) + "psrlw $8, %%mm2 \n\t" // U0V0 U0V0(12) + "pand %%mm7, %%mm3 \n\t" // Y0Y0 Y0Y0(8) + "pand %%mm7, %%mm4 \n\t" // Y0Y0 Y0Y0(12) + "packuswb %%mm2, %%mm1 \n\t" // UVUV UVUV(8) + "packuswb %%mm4, %%mm3 \n\t" // YYYY YYYY(8) + + MOVNTQ" %%mm3, 8(%1, %%"FF_REG_a", 2) \n\t" + + "movq %%mm0, %%mm2 \n\t" // UVUV UVUV(0) + "movq %%mm1, %%mm3 \n\t" // UVUV UVUV(8) + "psrlw $8, %%mm0 \n\t" // V0V0 V0V0(0) + "psrlw $8, %%mm1 \n\t" // V0V0 V0V0(8) + "pand %%mm7, %%mm2 \n\t" // U0U0 U0U0(0) + "pand %%mm7, %%mm3 \n\t" // U0U0 U0U0(8) + "packuswb %%mm1, %%mm0 \n\t" // VVVV VVVV(0) + "packuswb %%mm3, %%mm2 \n\t" // UUUU UUUU(0) + + MOVNTQ" %%mm0, (%3, %%"FF_REG_a") \n\t" + MOVNTQ" %%mm2, (%2, %%"FF_REG_a") \n\t" + + "add $8, %%"FF_REG_a" \n\t" + "cmp %4, %%"FF_REG_a" \n\t" + " jb 1b \n\t" + ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth) + : "memory", "%"FF_REG_a + ); + + ydst += lumStride; + src += srcStride; + + __asm__ volatile( + "xor %%"FF_REG_a", %%"FF_REG_a"\n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 64(%0, %%"FF_REG_a", 4) \n\t" + "movq (%0, %%"FF_REG_a", 4), %%mm0 \n\t" // YUYV YUYV(0) + "movq 8(%0, %%"FF_REG_a", 4), %%mm1 \n\t" // YUYV YUYV(4) + "movq 16(%0, %%"FF_REG_a", 4), %%mm2 \n\t" // YUYV YUYV(8) + "movq 24(%0, %%"FF_REG_a", 4), %%mm3 \n\t" // YUYV YUYV(12) + "pand %%mm7, %%mm0 \n\t" // Y0Y0 Y0Y0(0) + "pand %%mm7, %%mm1 \n\t" // Y0Y0 Y0Y0(4) + "pand %%mm7, %%mm2 \n\t" // Y0Y0 Y0Y0(8) + "pand %%mm7, %%mm3 \n\t" // Y0Y0 Y0Y0(12) + "packuswb %%mm1, %%mm0 \n\t" // YYYY YYYY(0) + "packuswb %%mm3, %%mm2 \n\t" // YYYY YYYY(8) + + MOVNTQ" %%mm0, (%1, %%"FF_REG_a", 2) \n\t" + MOVNTQ" %%mm2, 8(%1, %%"FF_REG_a", 2) \n\t" + + "add $8, %%"FF_REG_a"\n\t" + "cmp %4, %%"FF_REG_a"\n\t" + " jb 1b \n\t" + + ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth) + : "memory", "%"FF_REG_a + ); + udst += chromStride; + vdst += chromStride; + ydst += lumStride; + src += srcStride; + } + __asm__ volatile(EMMS" \n\t" + SFENCE" \n\t" + :::"memory"); +} + +static inline void planar2x_mmxext(const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride) +{ + dst[0]= src[0]; + + // first line + for (int x = 0; x < srcWidth - 1; x++) { + dst[2*x+1]= (3*src[x] + src[x+1])>>2; + dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; + } + dst[2*srcWidth-1]= src[srcWidth-1]; + + dst+= dstStride; + + for (int y = 1; y < srcHeight; y++) { + x86_reg mmxSize= srcWidth&~15; + + if (mmxSize) { + __asm__ volatile( + "mov %4, %%"FF_REG_a" \n\t" + "movq "MANGLE(mmx_ff)", %%mm0 \n\t" + "movq (%0, %%"FF_REG_a"), %%mm4 \n\t" + "movq %%mm4, %%mm2 \n\t" + "psllq $8, %%mm4 \n\t" + "pand %%mm0, %%mm2 \n\t" + "por %%mm2, %%mm4 \n\t" + "movq (%1, %%"FF_REG_a"), %%mm5 \n\t" + "movq %%mm5, %%mm3 \n\t" + "psllq $8, %%mm5 \n\t" + "pand %%mm0, %%mm3 \n\t" + "por %%mm3, %%mm5 \n\t" + "1: \n\t" + "movq (%0, %%"FF_REG_a"), %%mm0 \n\t" + "movq (%1, %%"FF_REG_a"), %%mm1 \n\t" + "movq 1(%0, %%"FF_REG_a"), %%mm2 \n\t" + "movq 1(%1, %%"FF_REG_a"), %%mm3 \n\t" + PAVGB" %%mm0, %%mm5 \n\t" + PAVGB" %%mm0, %%mm3 \n\t" + PAVGB" %%mm0, %%mm5 \n\t" + PAVGB" %%mm0, %%mm3 \n\t" + PAVGB" %%mm1, %%mm4 \n\t" + PAVGB" %%mm1, %%mm2 \n\t" + PAVGB" %%mm1, %%mm4 \n\t" + PAVGB" %%mm1, %%mm2 \n\t" + "movq %%mm5, %%mm7 \n\t" + "movq %%mm4, %%mm6 \n\t" + "punpcklbw %%mm3, %%mm5 \n\t" + "punpckhbw %%mm3, %%mm7 \n\t" + "punpcklbw %%mm2, %%mm4 \n\t" + "punpckhbw %%mm2, %%mm6 \n\t" + MOVNTQ" %%mm5, (%2, %%"FF_REG_a", 2) \n\t" + MOVNTQ" %%mm7, 8(%2, %%"FF_REG_a", 2) \n\t" + MOVNTQ" %%mm4, (%3, %%"FF_REG_a", 2) \n\t" + MOVNTQ" %%mm6, 8(%3, %%"FF_REG_a", 2) \n\t" + "add $8, %%"FF_REG_a" \n\t" + "movq -1(%0, %%"FF_REG_a"), %%mm4 \n\t" + "movq -1(%1, %%"FF_REG_a"), %%mm5 \n\t" + " js 1b \n\t" + :: "r" (src + mmxSize ), "r" (src + srcStride + mmxSize ), + "r" (dst + mmxSize*2), "r" (dst + dstStride + mmxSize*2), + "g" (-mmxSize) + NAMED_CONSTRAINTS_ADD(mmx_ff) + : "%"FF_REG_a + ); + } else { + mmxSize = 1; + dst[0] = (src[0] * 3 + src[srcStride]) >> 2; + dst[dstStride] = (src[0] + 3 * src[srcStride]) >> 2; + } + + for (int x = mmxSize - 1; x < srcWidth - 1; x++) { + dst[2*x +1]= (3*src[x+0] + src[x+srcStride+1])>>2; + dst[2*x+dstStride+2]= ( src[x+0] + 3*src[x+srcStride+1])>>2; + dst[2*x+dstStride+1]= ( src[x+1] + 3*src[x+srcStride ])>>2; + dst[2*x +2]= (3*src[x+1] + src[x+srcStride ])>>2; + } + dst[srcWidth*2 -1 ]= (3*src[srcWidth-1] + src[srcWidth-1 + srcStride])>>2; + dst[srcWidth*2 -1 + dstStride]= ( src[srcWidth-1] + 3*src[srcWidth-1 + srcStride])>>2; + + dst+=dstStride*2; + src+=srcStride; + } + + // last line + dst[0]= src[0]; + + for (int x = 0; x < srcWidth - 1; x++) { + dst[2*x+1]= (3*src[x] + src[x+1])>>2; + dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; + } + dst[2*srcWidth-1]= src[srcWidth-1]; + + __asm__ volatile(EMMS" \n\t" + SFENCE" \n\t" + :::"memory"); +} + +/** + * Height should be a multiple of 2 and width should be a multiple of 2. + * (If this is a problem for anyone then tell me, and I will fix it.) + * Chrominance data is only taken from every second line, + * others are ignored in the C version. + * FIXME: Write HQ version. + */ +#if HAVE_7REGS +static inline void rgb24toyv12_mmxext(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + int width, int height, + int lumStride, int chromStride, int srcStride, + int32_t *rgb2yuv) +{ +#define BGR2Y_IDX "16*4+16*32" +#define BGR2U_IDX "16*4+16*33" +#define BGR2V_IDX "16*4+16*34" + int y; + const x86_reg chromWidth= width>>1; + + if (height > 2) { + ff_rgb24toyv12_c(src, ydst, udst, vdst, width, 2, lumStride, chromStride, srcStride, rgb2yuv); + src += 2*srcStride; + ydst += 2*lumStride; + udst += chromStride; + vdst += chromStride; + height -= 2; + } + + for (y = 0; y < height - 2; y += 2) { + for (int i = 0; i < 2; i++) { + __asm__ volatile( + "mov %2, %%"FF_REG_a"\n\t" + "movq "BGR2Y_IDX"(%3), %%mm6 \n\t" + "movq "MANGLE(ff_w1111)", %%mm5 \n\t" + "pxor %%mm7, %%mm7 \n\t" + "lea (%%"FF_REG_a", %%"FF_REG_a", 2), %%"FF_REG_d" \n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 64(%0, %%"FF_REG_d") \n\t" + "movd (%0, %%"FF_REG_d"), %%mm0 \n\t" + "movd 3(%0, %%"FF_REG_d"), %%mm1 \n\t" + "punpcklbw %%mm7, %%mm0 \n\t" + "punpcklbw %%mm7, %%mm1 \n\t" + "movd 6(%0, %%"FF_REG_d"), %%mm2 \n\t" + "movd 9(%0, %%"FF_REG_d"), %%mm3 \n\t" + "punpcklbw %%mm7, %%mm2 \n\t" + "punpcklbw %%mm7, %%mm3 \n\t" + "pmaddwd %%mm6, %%mm0 \n\t" + "pmaddwd %%mm6, %%mm1 \n\t" + "pmaddwd %%mm6, %%mm2 \n\t" + "pmaddwd %%mm6, %%mm3 \n\t" + "psrad $8, %%mm0 \n\t" + "psrad $8, %%mm1 \n\t" + "psrad $8, %%mm2 \n\t" + "psrad $8, %%mm3 \n\t" + "packssdw %%mm1, %%mm0 \n\t" + "packssdw %%mm3, %%mm2 \n\t" + "pmaddwd %%mm5, %%mm0 \n\t" + "pmaddwd %%mm5, %%mm2 \n\t" + "packssdw %%mm2, %%mm0 \n\t" + "psraw $7, %%mm0 \n\t" + + "movd 12(%0, %%"FF_REG_d"), %%mm4 \n\t" + "movd 15(%0, %%"FF_REG_d"), %%mm1 \n\t" + "punpcklbw %%mm7, %%mm4 \n\t" + "punpcklbw %%mm7, %%mm1 \n\t" + "movd 18(%0, %%"FF_REG_d"), %%mm2 \n\t" + "movd 21(%0, %%"FF_REG_d"), %%mm3 \n\t" + "punpcklbw %%mm7, %%mm2 \n\t" + "punpcklbw %%mm7, %%mm3 \n\t" + "pmaddwd %%mm6, %%mm4 \n\t" + "pmaddwd %%mm6, %%mm1 \n\t" + "pmaddwd %%mm6, %%mm2 \n\t" + "pmaddwd %%mm6, %%mm3 \n\t" + "psrad $8, %%mm4 \n\t" + "psrad $8, %%mm1 \n\t" + "psrad $8, %%mm2 \n\t" + "psrad $8, %%mm3 \n\t" + "packssdw %%mm1, %%mm4 \n\t" + "packssdw %%mm3, %%mm2 \n\t" + "pmaddwd %%mm5, %%mm4 \n\t" + "pmaddwd %%mm5, %%mm2 \n\t" + "add $24, %%"FF_REG_d"\n\t" + "packssdw %%mm2, %%mm4 \n\t" + "psraw $7, %%mm4 \n\t" + + "packuswb %%mm4, %%mm0 \n\t" + "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0 \n\t" + + MOVNTQ" %%mm0, (%1, %%"FF_REG_a") \n\t" + "add $8, %%"FF_REG_a" \n\t" + " js 1b \n\t" + : : "r" (src+width*3), "r" (ydst+width), "g" ((x86_reg)-width), "r"(rgb2yuv) + NAMED_CONSTRAINTS_ADD(ff_w1111,ff_bgr2YOffset) + : "%"FF_REG_a, "%"FF_REG_d + ); + ydst += lumStride; + src += srcStride; + } + src -= srcStride*2; + __asm__ volatile( + "mov %4, %%"FF_REG_a"\n\t" + "movq "MANGLE(ff_w1111)", %%mm5 \n\t" + "movq "BGR2U_IDX"(%5), %%mm6 \n\t" + "pxor %%mm7, %%mm7 \n\t" + "lea (%%"FF_REG_a", %%"FF_REG_a", 2), %%"FF_REG_d" \n\t" + "add %%"FF_REG_d", %%"FF_REG_d"\n\t" + ".p2align 4 \n\t" + "1: \n\t" + PREFETCH" 64(%0, %%"FF_REG_d") \n\t" + PREFETCH" 64(%1, %%"FF_REG_d") \n\t" + "movq (%0, %%"FF_REG_d"), %%mm0 \n\t" + "movq (%1, %%"FF_REG_d"), %%mm1 \n\t" + "movq 6(%0, %%"FF_REG_d"), %%mm2 \n\t" + "movq 6(%1, %%"FF_REG_d"), %%mm3 \n\t" + PAVGB" %%mm1, %%mm0 \n\t" + PAVGB" %%mm3, %%mm2 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm2, %%mm3 \n\t" + "psrlq $24, %%mm0 \n\t" + "psrlq $24, %%mm2 \n\t" + PAVGB" %%mm1, %%mm0 \n\t" + PAVGB" %%mm3, %%mm2 \n\t" + "punpcklbw %%mm7, %%mm0 \n\t" + "punpcklbw %%mm7, %%mm2 \n\t" + "movq "BGR2V_IDX"(%5), %%mm1 \n\t" + "movq "BGR2V_IDX"(%5), %%mm3 \n\t" + + "pmaddwd %%mm0, %%mm1 \n\t" + "pmaddwd %%mm2, %%mm3 \n\t" + "pmaddwd %%mm6, %%mm0 \n\t" + "pmaddwd %%mm6, %%mm2 \n\t" + "psrad $8, %%mm0 \n\t" + "psrad $8, %%mm1 \n\t" + "psrad $8, %%mm2 \n\t" + "psrad $8, %%mm3 \n\t" + "packssdw %%mm2, %%mm0 \n\t" + "packssdw %%mm3, %%mm1 \n\t" + "pmaddwd %%mm5, %%mm0 \n\t" + "pmaddwd %%mm5, %%mm1 \n\t" + "packssdw %%mm1, %%mm0 \n\t" // V1 V0 U1 U0 + "psraw $7, %%mm0 \n\t" + + "movq 12(%0, %%"FF_REG_d"), %%mm4 \n\t" + "movq 12(%1, %%"FF_REG_d"), %%mm1 \n\t" + "movq 18(%0, %%"FF_REG_d"), %%mm2 \n\t" + "movq 18(%1, %%"FF_REG_d"), %%mm3 \n\t" + PAVGB" %%mm1, %%mm4 \n\t" + PAVGB" %%mm3, %%mm2 \n\t" + "movq %%mm4, %%mm1 \n\t" + "movq %%mm2, %%mm3 \n\t" + "psrlq $24, %%mm4 \n\t" + "psrlq $24, %%mm2 \n\t" + PAVGB" %%mm1, %%mm4 \n\t" + PAVGB" %%mm3, %%mm2 \n\t" + "punpcklbw %%mm7, %%mm4 \n\t" + "punpcklbw %%mm7, %%mm2 \n\t" + "movq "BGR2V_IDX"(%5), %%mm1 \n\t" + "movq "BGR2V_IDX"(%5), %%mm3 \n\t" + + "pmaddwd %%mm4, %%mm1 \n\t" + "pmaddwd %%mm2, %%mm3 \n\t" + "pmaddwd %%mm6, %%mm4 \n\t" + "pmaddwd %%mm6, %%mm2 \n\t" + "psrad $8, %%mm4 \n\t" + "psrad $8, %%mm1 \n\t" + "psrad $8, %%mm2 \n\t" + "psrad $8, %%mm3 \n\t" + "packssdw %%mm2, %%mm4 \n\t" + "packssdw %%mm3, %%mm1 \n\t" + "pmaddwd %%mm5, %%mm4 \n\t" + "pmaddwd %%mm5, %%mm1 \n\t" + "add $24, %%"FF_REG_d"\n\t" + "packssdw %%mm1, %%mm4 \n\t" // V3 V2 U3 U2 + "psraw $7, %%mm4 \n\t" + + "movq %%mm0, %%mm1 \n\t" + "punpckldq %%mm4, %%mm0 \n\t" + "punpckhdq %%mm4, %%mm1 \n\t" + "packsswb %%mm1, %%mm0 \n\t" + "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0 \n\t" + "movd %%mm0, (%2, %%"FF_REG_a") \n\t" + "punpckhdq %%mm0, %%mm0 \n\t" + "movd %%mm0, (%3, %%"FF_REG_a") \n\t" + "add $4, %%"FF_REG_a" \n\t" + " js 1b \n\t" + : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth), "r"(rgb2yuv) + NAMED_CONSTRAINTS_ADD(ff_w1111,ff_bgr2UVOffset) + : "%"FF_REG_a, "%"FF_REG_d + ); + + udst += chromStride; + vdst += chromStride; + src += srcStride*2; + } + + __asm__ volatile(EMMS" \n\t" + SFENCE" \n\t" + :::"memory"); + + ff_rgb24toyv12_c(src, ydst, udst, vdst, width, height-y, lumStride, chromStride, srcStride, rgb2yuv); +} +#endif /* HAVE_7REGS */ + +static inline void vu9_to_vu12_mmxext(const uint8_t *src1, const uint8_t *src2, + uint8_t *dst1, uint8_t *dst2, + int width, int height, + int srcStride1, int srcStride2, + int dstStride1, int dstStride2) +{ + int w,h; + w=width/2; h=height/2; + __asm__ volatile( + PREFETCH" %0 \n\t" + PREFETCH" %1 \n\t" + ::"m"(*(src1+srcStride1)),"m"(*(src2+srcStride2)):"memory"); + for (x86_reg y = 0; y < h; y++) { + const uint8_t* s1=src1+srcStride1*(y>>1); + uint8_t* d=dst1+dstStride1*y; + x86_reg x = 0; + for (;x>1); + uint8_t* d=dst2+dstStride2*y; + x86_reg x = 0; + for (;x>2); + const uint8_t* vp=src3+srcStride3*(y>>2); + uint8_t* d=dst+dstStride*y; + x86_reg x = 0; + for (;x>1; + dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1; + count++; + } +} + +static void extract_odd2_mmxext(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count) +{ + dst0+= count; + dst1+= count; + src += 4*count; + count= - count; + if(count <= -8) { + count += 7; + __asm__ volatile( + "pcmpeqw %%mm7, %%mm7 \n\t" + "psrlw $8, %%mm7 \n\t" + "1: \n\t" + "movq -28(%1, %0, 4), %%mm0 \n\t" + "movq -20(%1, %0, 4), %%mm1 \n\t" + "movq -12(%1, %0, 4), %%mm2 \n\t" + "movq -4(%1, %0, 4), %%mm3 \n\t" + "psrlw $8, %%mm0 \n\t" + "psrlw $8, %%mm1 \n\t" + "psrlw $8, %%mm2 \n\t" + "psrlw $8, %%mm3 \n\t" + "packuswb %%mm1, %%mm0 \n\t" + "packuswb %%mm3, %%mm2 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm2, %%mm3 \n\t" + "psrlw $8, %%mm0 \n\t" + "psrlw $8, %%mm2 \n\t" + "pand %%mm7, %%mm1 \n\t" + "pand %%mm7, %%mm3 \n\t" + "packuswb %%mm2, %%mm0 \n\t" + "packuswb %%mm3, %%mm1 \n\t" + MOVNTQ" %%mm0,- 7(%3, %0) \n\t" + MOVNTQ" %%mm1,- 7(%2, %0) \n\t" + "add $8, %0 \n\t" + " js 1b \n\t" + : "+r"(count) + : "r"(src), "r"(dst0), "r"(dst1) + ); + count -= 7; + } + src++; + while(count<0) { + dst0[count]= src[4*count+0]; + dst1[count]= src[4*count+2]; + count++; + } +} + +static void extract_odd2avg_mmxext(const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count) +{ + dst0 += count; + dst1 += count; + src0 += 4*count; + src1 += 4*count; + count= - count; +#ifdef PAVGB + if(count <= -8) { + count += 7; + __asm__ volatile( + "pcmpeqw %%mm7, %%mm7 \n\t" + "psrlw $8, %%mm7 \n\t" + "1: \n\t" + "movq -28(%1, %0, 4), %%mm0 \n\t" + "movq -20(%1, %0, 4), %%mm1 \n\t" + "movq -12(%1, %0, 4), %%mm2 \n\t" + "movq -4(%1, %0, 4), %%mm3 \n\t" + PAVGB" -28(%2, %0, 4), %%mm0 \n\t" + PAVGB" -20(%2, %0, 4), %%mm1 \n\t" + PAVGB" -12(%2, %0, 4), %%mm2 \n\t" + PAVGB" - 4(%2, %0, 4), %%mm3 \n\t" + "psrlw $8, %%mm0 \n\t" + "psrlw $8, %%mm1 \n\t" + "psrlw $8, %%mm2 \n\t" + "psrlw $8, %%mm3 \n\t" + "packuswb %%mm1, %%mm0 \n\t" + "packuswb %%mm3, %%mm2 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm2, %%mm3 \n\t" + "psrlw $8, %%mm0 \n\t" + "psrlw $8, %%mm2 \n\t" + "pand %%mm7, %%mm1 \n\t" + "pand %%mm7, %%mm3 \n\t" + "packuswb %%mm2, %%mm0 \n\t" + "packuswb %%mm3, %%mm1 \n\t" + MOVNTQ" %%mm0,- 7(%4, %0) \n\t" + MOVNTQ" %%mm1,- 7(%3, %0) \n\t" + "add $8, %0 \n\t" + " js 1b \n\t" + : "+r"(count) + : "r"(src0), "r"(src1), "r"(dst0), "r"(dst1) + ); + count -= 7; + } +#endif + src0++; + src1++; + while(count<0) { + dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1; + dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1; + count++; + } +} + +static void yuyvtoyuv420_mmxext(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride) +{ + const int chromWidth = AV_CEIL_RSHIFT(width, 1); + + for (int y = 0; y < height; y++) { + extract_even_mmxext(src, ydst, width); + if(y&1) { + extract_odd2avg_mmxext(src-srcStride, src, udst, vdst, chromWidth); + udst+= chromStride; + vdst+= chromStride; + } + + src += srcStride; + ydst+= lumStride; + } + __asm__( + EMMS" \n\t" + SFENCE" \n\t" + ::: "memory" + ); +} + +static void yuyvtoyuv422_mmxext(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride) +{ + const int chromWidth = AV_CEIL_RSHIFT(width, 1); + + for (int y = 0; y < height; y++) { + extract_even_mmxext(src, ydst, width); + extract_odd2_mmxext(src, udst, vdst, chromWidth); + + src += srcStride; + ydst+= lumStride; + udst+= chromStride; + vdst+= chromStride; + } + __asm__( + EMMS" \n\t" + SFENCE" \n\t" + ::: "memory" + ); +} + +static void uyvytoyuv420_mmxext(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride) +{ + const int chromWidth = AV_CEIL_RSHIFT(width, 1); + + for (int y = 0; y < height; y++) { + extract_odd_mmxext(src, ydst, width); + if(y&1) { + extract_even2avg_mmxext(src-srcStride, src, udst, vdst, chromWidth); + udst+= chromStride; + vdst+= chromStride; + } + + src += srcStride; + ydst+= lumStride; + } + __asm__( + EMMS" \n\t" + SFENCE" \n\t" + ::: "memory" + ); +} + +#if ARCH_X86_32 +static void uyvytoyuv422_mmxext(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride) +{ + const int chromWidth = AV_CEIL_RSHIFT(width, 1); + + for (int y = 0; y < height; y++) { + extract_odd_mmxext(src, ydst, width); + extract_even2_mmxext(src, udst, vdst, chromWidth); + + src += srcStride; + ydst+= lumStride; + udst+= chromStride; + vdst+= chromStride; + } + __asm__( + EMMS" \n\t" + SFENCE" \n\t" + ::: "memory" + ); +} +#endif /* ARCH_X86_32 */ + +static av_cold void rgb2rgb_init_mmxext(void) +{ + rgb15to16 = rgb15to16_mmxext; + rgb15tobgr24 = rgb15tobgr24_mmxext; + rgb15to32 = rgb15to32_mmxext; + rgb16tobgr24 = rgb16tobgr24_mmxext; + rgb16to32 = rgb16to32_mmxext; + rgb16to15 = rgb16to15_mmxext; + rgb24tobgr16 = rgb24tobgr16_mmxext; + rgb24tobgr15 = rgb24tobgr15_mmxext; + rgb24tobgr32 = rgb24tobgr32_mmxext; + rgb32to16 = rgb32to16_mmxext; + rgb32to15 = rgb32to15_mmxext; + rgb32tobgr24 = rgb32tobgr24_mmxext; + rgb24to15 = rgb24to15_mmxext; + rgb24to16 = rgb24to16_mmxext; + rgb24tobgr24 = rgb24tobgr24_mmxext; + rgb32tobgr16 = rgb32tobgr16_mmxext; + rgb32tobgr15 = rgb32tobgr15_mmxext; + yv12toyuy2 = yv12toyuy2_mmxext; + yv12touyvy = yv12touyvy_mmxext; + yuv422ptoyuy2 = yuv422ptoyuy2_mmxext; + yuv422ptouyvy = yuv422ptouyvy_mmxext; + yuy2toyv12 = yuy2toyv12_mmxext; + vu9_to_vu12 = vu9_to_vu12_mmxext; + yvu9_to_yuy2 = yvu9_to_yuy2_mmxext; +#if ARCH_X86_32 + uyvytoyuv422 = uyvytoyuv422_mmxext; +#endif + yuyvtoyuv422 = yuyvtoyuv422_mmxext; + + planar2x = planar2x_mmxext; +#if HAVE_7REGS + ff_rgb24toyv12 = rgb24toyv12_mmxext; +#endif /* HAVE_7REGS */ + + yuyvtoyuv420 = yuyvtoyuv420_mmxext; + uyvytoyuv420 = uyvytoyuv420_mmxext; +} //SSE2 versions -#undef RENAME -#undef COMPILE_TEMPLATE_SSE2 -#define COMPILE_TEMPLATE_SSE2 1 -#define RENAME(a) a ## _sse2 -#include "rgb2rgb_template.c" - -//AVX versions -#undef RENAME -#undef COMPILE_TEMPLATE_AVX -#define COMPILE_TEMPLATE_AVX 1 -#define RENAME(a) a ## _avx -#include "rgb2rgb_template.c" +static void interleave_bytes_sse2(const uint8_t *src1, const uint8_t *src2, uint8_t *dest, + int width, int height, int src1Stride, + int src2Stride, int dstStride) +{ + for (int h = 0; h < height; h++) { + if (width >= 16) { + if (!((((intptr_t)src1) | ((intptr_t)src2) | ((intptr_t)dest))&15)) { + __asm__( + "xor %%"FF_REG_a", %%"FF_REG_a" \n\t" + "1: \n\t" + PREFETCH" 64(%1, %%"FF_REG_a") \n\t" + PREFETCH" 64(%2, %%"FF_REG_a") \n\t" + "movdqa (%1, %%"FF_REG_a"), %%xmm0 \n\t" + "movdqa (%1, %%"FF_REG_a"), %%xmm1 \n\t" + "movdqa (%2, %%"FF_REG_a"), %%xmm2 \n\t" + "punpcklbw %%xmm2, %%xmm0 \n\t" + "punpckhbw %%xmm2, %%xmm1 \n\t" + "movntdq %%xmm0, (%0, %%"FF_REG_a", 2) \n\t" + "movntdq %%xmm1, 16(%0, %%"FF_REG_a", 2) \n\t" + "add $16, %%"FF_REG_a" \n\t" + "cmp %3, %%"FF_REG_a" \n\t" + " jb 1b \n\t" + ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15) + : "memory", XMM_CLOBBERS("xmm0", "xmm1", "xmm2",) "%"FF_REG_a + ); + } else + __asm__( + "xor %%"FF_REG_a", %%"FF_REG_a" \n\t" + "1: \n\t" + PREFETCH" 64(%1, %%"FF_REG_a") \n\t" + PREFETCH" 64(%2, %%"FF_REG_a") \n\t" + "movq (%1, %%"FF_REG_a"), %%mm0 \n\t" + "movq 8(%1, %%"FF_REG_a"), %%mm2 \n\t" + "movq %%mm0, %%mm1 \n\t" + "movq %%mm2, %%mm3 \n\t" + "movq (%2, %%"FF_REG_a"), %%mm4 \n\t" + "movq 8(%2, %%"FF_REG_a"), %%mm5 \n\t" + "punpcklbw %%mm4, %%mm0 \n\t" + "punpckhbw %%mm4, %%mm1 \n\t" + "punpcklbw %%mm5, %%mm2 \n\t" + "punpckhbw %%mm5, %%mm3 \n\t" + MOVNTQ" %%mm0, (%0, %%"FF_REG_a", 2) \n\t" + MOVNTQ" %%mm1, 8(%0, %%"FF_REG_a", 2) \n\t" + MOVNTQ" %%mm2, 16(%0, %%"FF_REG_a", 2) \n\t" + MOVNTQ" %%mm3, 24(%0, %%"FF_REG_a", 2) \n\t" + "add $16, %%"FF_REG_a" \n\t" + "cmp %3, %%"FF_REG_a" \n\t" + " jb 1b \n\t" + ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15) + : "memory", "%"FF_REG_a + ); + + } + for (int w = (width & (~15)); w < width; w++) { + dest[2*w+0] = src1[w]; + dest[2*w+1] = src2[w]; + } + dest += dstStride; + src1 += src1Stride; + src2 += src2Stride; + } + __asm__( + EMMS" \n\t" + SFENCE" \n\t" + ::: "memory" + ); +} /* RGB15->RGB16 original by Strepto/Astral @@ -116,7 +2343,6 @@ DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2UVOffset); #endif /* HAVE_INLINE_ASM */ -void ff_shuffle_bytes_2103_mmxext(const uint8_t *src, uint8_t *dst, int src_size); void ff_shuffle_bytes_2103_ssse3(const uint8_t *src, uint8_t *dst, int src_size); void ff_shuffle_bytes_0321_ssse3(const uint8_t *src, uint8_t *dst, int src_size); void ff_shuffle_bytes_1230_ssse3(const uint8_t *src, uint8_t *dst, int src_size); @@ -136,6 +2362,36 @@ void ff_uyvytoyuv422_sse2(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, void ff_uyvytoyuv422_avx(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride); +void ff_uyvytoyuv422_avx2(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int lumStride, int chromStride, int srcStride); +#endif + +#define DEINTERLEAVE_BYTES(cpuext) \ +void ff_nv12ToUV_ ## cpuext(uint8_t *dstU, uint8_t *dstV, \ + const uint8_t *unused, \ + const uint8_t *src1, \ + const uint8_t *src2, \ + int w, \ + uint32_t *unused2, \ + void *opq); \ +static void deinterleave_bytes_ ## cpuext(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, \ + int width, int height, int srcStride, \ + int dst1Stride, int dst2Stride) \ +{ \ + for (int h = 0; h < height; h++) { \ + ff_nv12ToUV_ ## cpuext(dst1, dst2, NULL, src, NULL, width, NULL, NULL); \ + src += srcStride; \ + dst1 += dst1Stride; \ + dst2 += dst2Stride; \ + } \ +} + +#if HAVE_SSE2_EXTERNAL +DEINTERLEAVE_BYTES(sse2) +#endif +#if HAVE_AVX_EXTERNAL +DEINTERLEAVE_BYTES(avx) #endif av_cold void rgb2rgb_init_x86(void) @@ -146,19 +2402,17 @@ av_cold void rgb2rgb_init_x86(void) if (INLINE_MMXEXT(cpu_flags)) rgb2rgb_init_mmxext(); if (INLINE_SSE2(cpu_flags)) - rgb2rgb_init_sse2(); - if (INLINE_AVX(cpu_flags)) - rgb2rgb_init_avx(); + interleaveBytes = interleave_bytes_sse2; #endif /* HAVE_INLINE_ASM */ - if (EXTERNAL_MMXEXT(cpu_flags)) { - shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext; - } +#if HAVE_SSE2_EXTERNAL if (EXTERNAL_SSE2(cpu_flags)) { #if ARCH_X86_64 uyvytoyuv422 = ff_uyvytoyuv422_sse2; #endif + deinterleaveBytes = deinterleave_bytes_sse2; } +#endif if (EXTERNAL_SSSE3(cpu_flags)) { shuffle_bytes_0321 = ff_shuffle_bytes_0321_ssse3; shuffle_bytes_2103 = ff_shuffle_bytes_2103_ssse3; @@ -166,7 +2420,12 @@ av_cold void rgb2rgb_init_x86(void) shuffle_bytes_3012 = ff_shuffle_bytes_3012_ssse3; shuffle_bytes_3210 = ff_shuffle_bytes_3210_ssse3; } +#if HAVE_AVX_EXTERNAL + if (EXTERNAL_AVX(cpu_flags)) { + deinterleaveBytes = deinterleave_bytes_avx; #if ARCH_X86_64 + uyvytoyuv422 = ff_uyvytoyuv422_avx; + } if (EXTERNAL_AVX2_FAST(cpu_flags)) { shuffle_bytes_0321 = ff_shuffle_bytes_0321_avx2; shuffle_bytes_2103 = ff_shuffle_bytes_2103_avx2; @@ -174,8 +2433,9 @@ av_cold void rgb2rgb_init_x86(void) shuffle_bytes_3012 = ff_shuffle_bytes_3012_avx2; shuffle_bytes_3210 = ff_shuffle_bytes_3210_avx2; } - if (EXTERNAL_AVX(cpu_flags)) { - uyvytoyuv422 = ff_uyvytoyuv422_avx; + if (EXTERNAL_AVX2_FAST(cpu_flags)) { + uyvytoyuv422 = ff_uyvytoyuv422_avx2; +#endif } #endif } diff --git a/src/ExtLib/ffmpeg/libswscale/x86/rgb_2_rgb.asm b/src/ExtLib/ffmpeg/libswscale/x86/rgb_2_rgb.asm index 76ca1eec03..45a21dd0bf 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/rgb_2_rgb.asm +++ b/src/ExtLib/ffmpeg/libswscale/x86/rgb_2_rgb.asm @@ -25,7 +25,6 @@ SECTION_RODATA -pb_mask_shuffle2103_mmx times 8 dw 255 pb_shuffle2103: db 2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15 pb_shuffle0321: db 0, 3, 2, 1, 4, 7, 6, 5, 8, 11, 10, 9, 12, 15, 14, 13 pb_shuffle1230: db 1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8, 13, 14, 15, 12 @@ -34,79 +33,19 @@ pb_shuffle3210: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 SECTION .text -%macro RSHIFT_COPY 3 +%macro RSHIFT_COPY 5 ; %1 dst ; %2 src ; %3 shift -%if cpuflag(avx) - psrldq %1, %2, %3 +%if mmsize == 32 + vperm2i128 %1, %2, %3, %5 + RSHIFT %1, %4 +%elif cpuflag(avx) + psrldq %1, %2, %4 %else mova %1, %2 - RSHIFT %1, %3 + RSHIFT %1, %4 %endif %endmacro -;------------------------------------------------------------------------------ -; shuffle_bytes_2103_mmext (const uint8_t *src, uint8_t *dst, int src_size) -;------------------------------------------------------------------------------ -INIT_MMX mmxext -cglobal shuffle_bytes_2103, 3, 5, 8, src, dst, w, tmp, x - mova m6, [pb_mask_shuffle2103_mmx] - mova m7, m6 - psllq m7, 8 - - movsxdifnidn wq, wd - mov xq, wq - - add srcq, wq - add dstq, wq - neg wq - -;calc scalar loop - and xq, mmsize*2 -4 - je .loop_simd - -.loop_scalar: - mov tmpb, [srcq + wq + 2] - mov [dstq+wq + 0], tmpb - mov tmpb, [srcq + wq + 1] - mov [dstq+wq + 1], tmpb - mov tmpb, [srcq + wq + 0] - mov [dstq+wq + 2], tmpb - mov tmpb, [srcq + wq + 3] - mov [dstq+wq + 3], tmpb - add wq, 4 - sub xq, 4 - jg .loop_scalar - -;check if src_size < mmsize * 2 -cmp wq, 0 -jge .end - -.loop_simd: - movu m0, [srcq+wq] - movu m1, [srcq+wq+8] - - pshufw m3, m0, 177 - pshufw m5, m1, 177 - - pand m0, m7 - pand m3, m6 - - pand m1, m7 - pand m5, m6 - - por m0, m3 - por m1, m5 - - movu [dstq+wq], m0 - movu [dstq+wq + 8], m1 - - add wq, mmsize*2 - jl .loop_simd - -.end: - emms - RET - ;------------------------------------------------------------------------------ ; shuffle_bytes_## (const uint8_t *src, uint8_t *dst, int src_size) ;------------------------------------------------------------------------------ @@ -233,26 +172,37 @@ cglobal uyvytoyuv422, 9, 14, 8, ydst, udst, vdst, src, w, h, lum_stride, chrom_s jge .end_line .loop_simd: +%if mmsize == 32 + movu xm2, [srcq + wtwoq ] + movu xm3, [srcq + wtwoq + 16 ] + movu xm4, [srcq + wtwoq + 16 * 2] + movu xm5, [srcq + wtwoq + 16 * 3] + vinserti128 m2, m2, [srcq + wtwoq + 16 * 4], 1 + vinserti128 m3, m3, [srcq + wtwoq + 16 * 5], 1 + vinserti128 m4, m4, [srcq + wtwoq + 16 * 6], 1 + vinserti128 m5, m5, [srcq + wtwoq + 16 * 7], 1 +%else movu m2, [srcq + wtwoq ] movu m3, [srcq + wtwoq + mmsize ] movu m4, [srcq + wtwoq + mmsize * 2] movu m5, [srcq + wtwoq + mmsize * 3] +%endif ; extract y part 1 - RSHIFT_COPY m6, m2, 1 ; UYVY UYVY -> YVYU YVY... + RSHIFT_COPY m6, m2, m4, 1, 0x20 ; UYVY UYVY -> YVYU YVY... pand m6, m1; YxYx YxYx... - RSHIFT_COPY m7, m3, 1 ; UYVY UYVY -> YVYU YVY... + RSHIFT_COPY m7, m3, m5, 1, 0x20 ; UYVY UYVY -> YVYU YVY... pand m7, m1 ; YxYx YxYx... packuswb m6, m7 ; YYYY YYYY... movu [ydstq + wq], m6 ; extract y part 2 - RSHIFT_COPY m6, m4, 1 ; UYVY UYVY -> YVYU YVY... + RSHIFT_COPY m6, m4, m2, 1, 0x13 ; UYVY UYVY -> YVYU YVY... pand m6, m1; YxYx YxYx... - RSHIFT_COPY m7, m5, 1 ; UYVY UYVY -> YVYU YVY... + RSHIFT_COPY m7, m5, m3, 1, 0x13 ; UYVY UYVY -> YVYU YVY... pand m7, m1 ; YxYx YxYx... packuswb m6, m7 ; YYYY YYYY... @@ -309,4 +259,8 @@ UYVY_TO_YUV422 INIT_XMM avx UYVY_TO_YUV422 +%if HAVE_AVX2_EXTERNAL +INIT_YMM avx2 +UYVY_TO_YUV422 +%endif %endif diff --git a/src/ExtLib/ffmpeg/libswscale/x86/swscale.c b/src/ExtLib/ffmpeg/libswscale/x86/swscale.c index fff8bb4396..5a9da23265 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/swscale.c +++ b/src/ExtLib/ffmpeg/libswscale/x86/swscale.c @@ -321,6 +321,12 @@ void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \ INPUT_FUNCS(sse2); INPUT_FUNCS(ssse3); INPUT_FUNCS(avx); +INPUT_FUNC(rgba, avx2); +INPUT_FUNC(bgra, avx2); +INPUT_FUNC(argb, avx2); +INPUT_FUNC(abgr, avx2); +INPUT_FUNC(rgb24, avx2); +INPUT_FUNC(bgr24, avx2); #if ARCH_X86_64 #define YUV2NV_DECL(fmt, opt) \ @@ -634,6 +640,15 @@ switch(c->dstBpc){ \ } if (EXTERNAL_AVX2_FAST(cpu_flags)) { + if (ARCH_X86_64) + switch (c->srcFormat) { + case_rgb(rgb24, RGB24, avx2); + case_rgb(bgr24, BGR24, avx2); + case_rgb(bgra, BGRA, avx2); + case_rgb(rgba, RGBA, avx2); + case_rgb(abgr, ABGR, avx2); + case_rgb(argb, ARGB, avx2); + } switch (c->dstFormat) { case AV_PIX_FMT_NV12: case AV_PIX_FMT_NV24: From af89390c73ed1e9a42e58214641530e10dc4c6d2 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 15 Jun 2024 11:48:30 +0300 Subject: [PATCH 007/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20VVdeC=20v2.3.0-20-gc26979f.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 3 ++- docs/Changelog.txt | 3 ++- src/ExtLib/vvdec/vvdec | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 6277da33eb..255f939492 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -7,7 +7,8 @@ Обновлен японский перевод (автор tsubasanouta). Обновлены библиотеки: - ffmpeg git-n7.1-dev-1370-gbe2cabce32. + ffmpeg git-n7.1-dev-1370-gbe2cabce32; + vvdec git-v2.3.0-20-gc26979f. 1.7.2 - 2024-06-07 diff --git a/docs/Changelog.txt b/docs/Changelog.txt index cc42391ded..3107ea3e0e 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -7,7 +7,8 @@ Updated Korean translation (by Hackjjang). Updated Japanese translation (by tsubasanouta). Updated libraries: - ffmpeg git-n7.1-dev-1370-gbe2cabce32. + ffmpeg git-n7.1-dev-1370-gbe2cabce32; + vvdec git-v2.3.0-20-gc26979f. 1.7.2 - 2024-06-07 diff --git a/src/ExtLib/vvdec/vvdec b/src/ExtLib/vvdec/vvdec index ffe30100f1..c26979fac0 160000 --- a/src/ExtLib/vvdec/vvdec +++ b/src/ExtLib/vvdec/vvdec @@ -1 +1 @@ -Subproject commit ffe30100f191e8e3d70a924f039d39158bcadb1c +Subproject commit c26979fac06cf0405da7c901b7826ed517444f95 From bff746daa05fe618ca3c91130d2b6d7b7f3bdc1d Mon Sep 17 00:00:00 2001 From: Andrei Miloiu Date: Sat, 15 Jun 2024 18:56:03 +0300 Subject: [PATCH 008/102] Update mplayerc.ro.rc.txt --- src/apps/mpcresources/text/mplayerc.ro.rc.txt | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.ro.rc.txt b/src/apps/mpcresources/text/mplayerc.ro.rc.txt index 7dd7e42dc0..b998cae4ef 100644 --- a/src/apps/mpcresources/text/mplayerc.ro.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ro.rc.txt @@ -15,20 +15,20 @@ BEGIN DIALOGEX IDD_ADDCOMMAND_DLG LINES 11 3 "Comanda de selecție" 6 "Filtru:" 9 "OK" -10 "Anulare" +10 "Revocare" END BEGIN DIALOGEX IDD_ADDREGFILTER LINES 10 3 "Alege filtru" 7 "Răsfoire..." 8 "OK" -9 "Anulare" +9 "Revocare" END BEGIN DIALOGEX IDD_AUTH_DLG LINES 15 3 "Este necesară autentificarea" 6 "OK" -7 "Anulare" +7 "Revocare" 9 "Zonă restricționată" 10 "Nume utilizator:" 11 "Parolă:" @@ -60,7 +60,7 @@ BEGIN DIALOGEX IDD_FAVADD LINES 12 8 "Memorează poziția" 9 "Unitate relativă" 10 "OK" -11 "Anulare" +11 "Revocare" END BEGIN DIALOGEX IDD_FAVORGANIZE LINES 13 @@ -112,7 +112,7 @@ END BEGIN DIALOGEX IDD_ITEMPROPERTIES_DIALOG LINES 11 5 "&Salvează" -6 "&Anulare" +6 "&Revocare" 7 "Titlu:" 9 "Cale:" END @@ -137,7 +137,7 @@ BEGIN DIALOGEX IDD_OPEN_DLG LINES 18 11 "Dublaj:" 13 "Răsfoire..." 14 "OK" -15 "Anulare" +15 "Revocare" 16 "Adaugă la lista de redare fără a deschide" 17 "Lipește URL-ul din clipboard" END @@ -145,7 +145,7 @@ END BEGIN DIALOGEX IDD_PLAYLISTNAME LINES 10 3 "Dialogul numelui listei de redare" 6 "OK" -7 "Anulare" +7 "Revocare" 9 "Nume:" END @@ -156,7 +156,7 @@ BEGIN DIALOGEX IDD_PNSPRESET_DLG LINES 22 14 "Sus" 15 "Jos" 16 "&Setează" -18 "&Anulare" +18 "&Revocare" 19 "&Salvează" 20 "Poziție: 0.0 -> 1.0" 21 "Mărire: 0.2 -> 5.0" @@ -630,7 +630,7 @@ END BEGIN DIALOGEX IDD_SELECTMEDIATYPE LINES 9 3 "Selectează tipul media" 7 "OK" -8 "Anulare" +8 "Revocare" END BEGIN DIALOGEX IDD_SHADERCOMBINE_DLG LINES 19 @@ -642,7 +642,7 @@ BEGIN DIALOGEX IDD_SHADERCOMBINE_DLG LINES 19 15 "Mută în &sus" 16 "Mută în &jos" 17 "OK" -18 "Anulare" +18 "Revocare" END BEGIN DIALOGEX IDD_SHADEREDITOR_DLG LINES 13 @@ -655,7 +655,7 @@ BEGIN DIALOGEX IDD_SHADERNEW_DLG LINES 10 3 "Crează un nou nuanțator" 6 "Nume:" 8 "OK" -9 "Anulare" +9 "Revocare" END BEGIN DIALOGEX IDD_SUBTITLEDL_DLG LINES 9 @@ -687,12 +687,12 @@ END BEGIN MENU IDR_MAINFRAME LINES 137 3 "&Fișier" 5 "&Deschide rapid un fișier..." -7 "&Deschide fișier..." -8 "Deschide &DVD/BD..." +7 "De&schide fișier..." +8 "Deschide DVD/&BD..." 9 "Deschide dis&pozitiv..." 10 "Deschide director..." 11 "Deschide imaginea &Iso..." -12 "De&schide disc" +12 "Des&chide disc" 13 "Fișiere recente" 14 "&Închide" 16 "&Salvează o copie..." @@ -719,7 +719,7 @@ BEGIN MENU IDR_MAINFRAME LINES 137 43 "&Compact" 44 "&Normal" 47 "Pe tot ecranu&l" -48 "&Mărire/Micșorare" +48 "&Mărire/Micșorare (Scalare)" 53 "Autopotrivire" 56 "&Limbă (Language)" 58 "Setările randorului" @@ -746,7 +746,7 @@ BEGIN MENU IDR_MAINFRAME LINES 137 89 "În timpul redării video" 91 "&Opțiuni..." 93 "&Redare" -95 "&Redare/Pauză" +95 "R&edare/Pauză" 96 "&Oprește" 97 "Pas cad&ru" 98 "&Mergi la..." @@ -759,7 +759,7 @@ BEGIN MENU IDR_MAINFRAME LINES 137 109 "&Micșorează rata" 110 "Resetează rata" 112 "&Filtre" -113 "N&uanțatoare (S&hadere)" +113 "Nuanțatoare (S&hadere)" 115 "&Audio" 116 "Su&btitrări" 119 "Vol&um" @@ -769,7 +769,7 @@ BEGIN MENU IDR_MAINFRAME LINES 137 125 "După redare" 127 "&Navigare" 128 "F&avorite" -129 "&Ajutor" +129 "A&jutor" 131 "&Pagină de pornire" 132 "&Verifică pentru actualizări" 133 "&Comutatoare în linie de comandă" @@ -780,16 +780,16 @@ END BEGIN MENU IDR_POPUP LINES 130 5 "&Fișier" 7 "&Deschide rapid un fișier..." -9 "&Deschide fișier..." +9 "&Deschide fișierul..." 10 "Deschide &DVD/BD..." -11 "Deschide dis&pozitiv..." -12 "Deschide director..." +11 "Deschide dis&pozitivul..." +12 "Deschide directorul..." 13 "Deschide imaginea &Iso..." 14 "De&schide disc" 15 "Fișiere recente" 16 "&Închide" 18 "&Salvează o copie..." -19 "Salvează &imagine..." +19 "Salvează &imaginea..." 20 "Salvează &miniaturi..." 22 "&Încarcă subtitrare..." 23 "Salvează s&ubtitrare..." @@ -803,7 +803,7 @@ BEGIN MENU IDR_POPUP LINES 130 37 "A-B (Marchează &A)" 38 "A-B (Marchează &B)" 41 "Ecran comp&let" -42 "&Mărire/Micșorare" +42 "&Mărire/Micșorare (Scalare) (Scalare)" 47 "Autopotrivire" 50 "Cadru &video" 51 "Panoramare și s&canare" @@ -872,7 +872,7 @@ BEGIN MENU IDR_POPUPMAIN LINES 166 15 "Fișiere recente" 16 "&Închide" 18 "&Salvează o copie..." -19 "Salvează imagine..." +19 "Salvează imaginea..." 20 "Salvează &miniaturi..." 22 "&Încarcă subtitrare..." 23 "Salvează s&ubtitrare..." @@ -895,7 +895,7 @@ BEGIN MENU IDR_POPUPMAIN LINES 166 44 "&Compact" 45 "&Normal" 48 "Pe tot ecranu&l" -49 "&Mărire/Micșorare" +49 "&Mărire/Micșorare (Scalare)" 54 "Autopotrivire" 57 "Setări randor" 59 "&Test de rupere (tearing)" @@ -1029,8 +1029,8 @@ BEGIN MENU IDR_POPUP_VIDEOFRAME LINES 26 7 "&Mărime dublă" 8 "&Întinde cât fereastra" 9 "Atinge fereastra din &interior" -10 "Scalare &1" -11 "Scalare &2" +10 "Mărire/Micșorare (Scalare) &1" +11 "Mărire/Micșorare (Scalare) &2" 12 "Atinge fereastra din exteri&or" 14 "&Menține raportul de aspect" 15 "Suprascrie raportul de aspect" @@ -1113,7 +1113,7 @@ STRING IDS_AG_AUDIO_FILE "Fișier audio" STRING IDS_AG_AUTO "Auto(mat)" STRING IDS_AG_AUTOSAVE_DISPLAY "Salvează imaginea afișată (automat)" STRING IDS_AG_AUTOSAVE_IMAGE "Salvează imaginea (automat)" -STRING IDS_AG_BOSS_KEY "Tastă " +STRING IDS_AG_BOSS_KEY "Tasta Şef (Boss)" STRING IDS_AG_BUFFERS "Preîncărcări" STRING IDS_AG_CHAPTER "Capitol %d" STRING IDS_AG_CHAPTER2 "Capitol: " @@ -1232,15 +1232,15 @@ STRING IDS_AG_PREV_VIDEO "Videoclipul anterior/Unghiul DVD" STRING IDS_AG_PROPERTIES "Proprietăți" STRING IDS_AG_RECOMMENDED "recomandat" STRING IDS_AG_REMOVING "Se șterge: " -STRING IDS_AG_REOPEN "Redeschide fișier" +STRING IDS_AG_REOPEN "Redeschide fișierul" STRING IDS_AG_RESET_RATE "Resetează rata" STRING IDS_AG_RESET_STATS "Resetează statisticile randorului Sync" STRING IDS_AG_SAVE_AS "Salvează ca" -STRING IDS_AG_SAVE_IMAGE "Salvează imagine" +STRING IDS_AG_SAVE_IMAGE "Salvează imaginea" STRING IDS_AG_SAVE_SUBTITLE "Salvează subtitrare" STRING IDS_AG_SETTINGS "Setări" STRING IDS_AG_SHADER "nuanțator: " -STRING IDS_AG_SHADERS "Nuanțatoare" +STRING IDS_AG_SHADERS "Nuanțatoare (Shadere)" STRING IDS_AG_SHADERS_1_ENABLE "Comută nuanțatoare pixel" STRING IDS_AG_SHADERS_2_ENABLE "Comută nuanțatoare pixel pentru spațiu ecran" STRING IDS_AG_SHADERS_SELECT "Selectează nuanțatoarele" @@ -1294,10 +1294,10 @@ STRING IDS_AG_VSYNCINTERNAL "VSync Intern" STRING IDS_AG_VSYNCOFFSET_DECREASE "Micșorează decalajul VSync" STRING IDS_AG_VSYNCOFFSET_INCREASE "Mărește decalajul VSync" STRING IDS_AG_WINDOW_TO_PRIMARYSCREEN "Mută fereastra în ecranul principal (PrimaryScreen)" -STRING IDS_AG_ZOOM "Scalare" -STRING IDS_AG_ZOOM_100 "Mărire 100%" -STRING IDS_AG_ZOOM_200 "Mărire 200%" -STRING IDS_AG_ZOOM_50 "Micșorare 50%" +STRING IDS_AG_ZOOM "Mărire/Micșorare (Scalare)" +STRING IDS_AG_ZOOM_100 "Scalare 100%" +STRING IDS_AG_ZOOM_200 "Scalare 200%" +STRING IDS_AG_ZOOM_50 "Scalare 50%" STRING IDS_AG_ZOOM_AUTO_FIT "Autopotrivire scalare" STRING IDS_APPLY "Aplică" STRING IDS_APP_DESCRIPTION "Unul dintre cele mai puternice și configurabile lectoare multimedia pentru sistemul de operare Windows. Creat la început de un dezvoltator maghiar cunoscut ca Gabest, această versiune are aptitudini adiționale cum ar fi mod pe tot ecranul Direct 3D și o compatibilitate mai bună cu Vista/7." @@ -1353,7 +1353,7 @@ STRING IDS_BDA_ERROR_DEMULTIPLEXER "Demultiplexorul nu poate fi creat." STRING IDS_BLOCK_EXTERNAL_VR "Puteți adăuga %s ca un filtru extern.\nTrebuie să vă selectați randorul video preferat de pe pagina de setări Video." STRING IDS_BRIGHTNESS_DEC "Micșorare luminozitate" STRING IDS_BRIGHTNESS_INC "Mărire luminozitate" -STRING IDS_CANCEL "Anulare" +STRING IDS_CANCEL "Revocare" STRING IDS_CANNOT_CHANGE_FORMAT "MPC-BE nu are destule drepturi pentru a schimba asocierea cu formatele de fișiere. Dați clic pe butonul ""Modifică"" pentru a obține drepturi de administrator." STRING IDS_CAPTURE_CHANNEL_FREQ "Canal %d (%.1f MHz)" STRING IDS_CAPTURE_ERROR "Eroare captură" @@ -1469,7 +1469,7 @@ STRING IDS_EXPORT_SETTINGS "Exportă setările" STRING IDS_EXPORT_SETTINGS_FAILED "Exportarea a eșuat! Acest lucru se poate întâmpla când nu aveți drepturile necesare." STRING IDS_EXPORT_SETTINGS_SUCCESS "Setările au fost exportate cu succes." STRING IDS_EXPORT_SETTINGS_WARNING "Unele modificări nu au fost încă salvate.\nDoriți să le salvați înainte de exportare?" -STRING IDS_EXTERNAL "external" +STRING IDS_EXTERNAL "extern" STRING IDS_EXTERNAL_FILTERS_ERROR_MT "Acest tip se află deja în listă!" STRING IDS_FAVDVDS "DVD-uri" STRING IDS_FAVFILES "Fișiere" @@ -1479,7 +1479,7 @@ STRING IDS_FAVORITES_QUICKADD "Adăugare rapidă la favorite" STRING IDS_FILE_FAV_ADDED "Fişier adăugat la favorite" STRING IDS_FILE_SAVE_THUMBNAILS "Salvează miniaturi" STRING IDS_FILTERS_AUDIO "Decodoare audio" -STRING IDS_FILTERS_COPY_TO_CLIPBOARD "&Copy filters list to clipboard" +STRING IDS_FILTERS_COPY_TO_CLIPBOARD "&Copiază lista filtrelor în clipboard" STRING IDS_FILTERS_SOURCE "Filtre sursă" STRING IDS_FILTERS_VIDEO "Decodoare video" STRING IDS_FILTER_RESET_SETTINGS "Resetează" From 91819777956946bfdf6cc3c9a7fe710db9de9819 Mon Sep 17 00:00:00 2001 From: Andrei Miloiu Date: Sat, 15 Jun 2024 19:02:08 +0300 Subject: [PATCH 009/102] Update mplayerc.ro.rc.txt --- src/apps/mpcresources/text/mplayerc.ro.rc.txt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.ro.rc.txt b/src/apps/mpcresources/text/mplayerc.ro.rc.txt index b998cae4ef..c2d34f0374 100644 --- a/src/apps/mpcresources/text/mplayerc.ro.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ro.rc.txt @@ -105,7 +105,7 @@ BEGIN DIALOGEX IDD_GOTO_DLG LINES 14 END BEGIN DIALOGEX IDD_HISTORY LINES 10 -3 "History" +3 "Istoric" 6 "MENU" 8 "Șterge selecția" END @@ -432,7 +432,7 @@ BEGIN DIALOGEX IDD_PPAGEPLAYER LINES 49 35 "Arată OSD (necesită repornire player)" 36 "Afișează numele în fișierul media" 37 "Afișează timpul de căutare" -38 "Dezactivează meniul ""Deschide Disc""" +38 "Dezactivează meniul ""Deschide discul""" 39 "Prioritatea procesării peste normal" 40 "Întreruperi de rețea" 41 "Conexiune:" @@ -689,14 +689,14 @@ BEGIN MENU IDR_MAINFRAME LINES 137 5 "&Deschide rapid un fișier..." 7 "De&schide fișier..." 8 "Deschide DVD/&BD..." -9 "Deschide dis&pozitiv..." -10 "Deschide director..." +9 "Deschide dis&pozitivul..." +10 "Deschide directorul..." 11 "Deschide imaginea &Iso..." -12 "Des&chide disc" +12 "Des&chide discul" 13 "Fișiere recente" 14 "&Închide" 16 "&Salvează o copie..." -17 "Salvează &imagine..." +17 "Salvează &imaginea..." 18 "Salvează &miniaturi..." 20 "&Încarcă subtitrare..." 21 "Salvează s&ubtitrare..." @@ -785,7 +785,7 @@ BEGIN MENU IDR_POPUP LINES 130 11 "Deschide dis&pozitivul..." 12 "Deschide directorul..." 13 "Deschide imaginea &Iso..." -14 "De&schide disc" +14 "De&schide discul" 15 "Fișiere recente" 16 "&Închide" 18 "&Salvează o copie..." @@ -865,10 +865,10 @@ BEGIN MENU IDR_POPUPMAIN LINES 166 7 "&Deschide rapid un fișier..." 9 "&Deschide fișier..." 10 "Deschide &DVD..." -11 "Deschide dis&pozitiv..." -12 "Deschide director..." +11 "Deschide dis&pozitivul..." +12 "Deschide directorul..." 13 "Deschide imaginea &Iso..." -14 "De&schide disc" +14 "De&schide discul" 15 "Fișiere recente" 16 "&Închide" 18 "&Salvează o copie..." From 573402970995b1b9ab2fcd182a979f0ae3208faf Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 15 Jun 2024 21:17:09 +0300 Subject: [PATCH 010/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=80=D1=83=D0=BC=D1=8B=D0=BD=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20(=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=20Andrei=20Miloiu).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mpcresources/mplayerc.ro.rc | 94 ++++++++++++++-------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/apps/mpcresources/mplayerc.ro.rc b/src/apps/mpcresources/mplayerc.ro.rc index 3cd36c85c4..9d00f337ed 100644 --- a/src/apps/mpcresources/mplayerc.ro.rc +++ b/src/apps/mpcresources/mplayerc.ro.rc @@ -66,7 +66,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN COMBOBOX IDC_COMBO1,5,5,215,37,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP DEFPUSHBUTTON "OK",IDOK,116,28,50,14 - PUSHBUTTON "Anulare",IDCANCEL,170,28,50,14 + PUSHBUTTON "Revocare",IDCANCEL,170,28,50,14 END IDD_CAPTURE_DLG DIALOGEX 0, 0, 132, 293 @@ -204,7 +204,7 @@ BEGIN COMBOBOX IDC_COMBO2,10,68,188,20,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Răsfoire...",IDC_BUTTON2,200,67,50,14 DEFPUSHBUTTON "OK",IDOK,148,94,50,14,WS_GROUP - PUSHBUTTON "Anulare",IDCANCEL,200,94,50,14 + PUSHBUTTON "Revocare",IDCANCEL,200,94,50,14 CONTROL "Adaugă la lista de redare fără a deschide",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,84,188,9 CONTROL "Lipește URL-ul din clipboard",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,96,134,9 END @@ -291,7 +291,7 @@ BEGIN CONTROL "Arată OSD (necesită repornire player)",IDC_SHOW_OSD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,159,156,9 CONTROL "Afișează numele în fișierul media",IDC_CHECK14,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,171,148,9 CONTROL "Afișează timpul de căutare",IDC_CHECK15,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,183,148,9 - CONTROL "Dezactivează meniul ""Deschide Disc""",IDC_CHECK10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,196,156,9 + CONTROL "Dezactivează meniul ""Deschide discul""",IDC_CHECK10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,196,156,9 CONTROL "Prioritatea procesării peste normal",IDC_CHECK9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,208,156,9 GROUPBOX "Întreruperi de rețea",IDC_STATIC,124,222,167,41,WS_GROUP LTEXT "Conexiune:",IDC_STATIC,129,233,96,8 @@ -590,7 +590,7 @@ BEGIN CONTROL "Memorează poziția",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,38,232,9 CONTROL "Unitate relativă",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,50,232,10 DEFPUSHBUTTON "OK",IDOK,143,62,50,14 - PUSHBUTTON "Anulare",IDCANCEL,197,62,50,14 + PUSHBUTTON "Revocare",IDCANCEL,197,62,50,14 END IDD_FAVORGANIZE DIALOGEX 0, 0, 276, 170 @@ -624,7 +624,7 @@ BEGIN PUSHBUTTON "Jos",IDC_BUTTON5,125,76,35,12 PUSHBUTTON "&Setează",IDC_BUTTON1,165,76,35,12 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,93,188,1 - PUSHBUTTON "&Anulare",IDCANCEL,49,100,50,14 + PUSHBUTTON "&Revocare",IDCANCEL,49,100,50,14 PUSHBUTTON "&Salvează",IDOK,105,100,50,14 LTEXT "Poziție: 0.0 -> 1.0",IDC_STATIC,134,5,70,8 LTEXT "Mărire: 0.2 -> 5.0",IDC_STATIC,134,32,70,8 @@ -715,7 +715,7 @@ BEGIN CONTROL "",IDC_LIST2,"SysListView32",LVS_LIST | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_TABSTOP,5,5,275,154,WS_EX_CLIENTEDGE PUSHBUTTON "Răsfoire...",IDC_BUTTON1,5,163,60,14 DEFPUSHBUTTON "OK",IDOK,177,163,50,14 - PUSHBUTTON "Anulare",IDCANCEL,230,163,50,14 + PUSHBUTTON "Revocare",IDCANCEL,230,163,50,14 END IDD_PPAGESUBSTYLE DIALOGEX 0, 0, 296, 264 @@ -943,7 +943,7 @@ CAPTION "Este necesară autentificarea" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,106,108,50,14 - PUSHBUTTON "Anulare",IDCANCEL,158,108,50,14 + PUSHBUTTON "Revocare",IDCANCEL,158,108,50,14 CONTROL 337,IDC_STATIC,"Static",SS_BITMAP,0,0,213,37 LTEXT "Zonă restricționată",IDC_STATIC,10,40,198,11 LTEXT "Nume utilizator:",IDC_STATIC,10,56,66,8 @@ -1017,7 +1017,7 @@ BEGIN PUSHBUTTON "Mută în &sus",IDC_BUTTON1,162,90,50,14 PUSHBUTTON "Mută în &jos",IDC_BUTTON4,162,108,50,14 DEFPUSHBUTTON "OK",IDOK,162,153,50,14 - PUSHBUTTON "Anulare",IDCANCEL,162,173,50,14 + PUSHBUTTON "Revocare",IDCANCEL,162,173,50,14 END IDD_SHADEREDITOR_DLG DIALOGEX 0, 0, 205, 73 @@ -1261,7 +1261,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "&Salvează",IDOK,129,82,50,14 - PUSHBUTTON "&Anulare",IDCANCEL,182,82,50,14 + PUSHBUTTON "&Revocare",IDCANCEL,182,82,50,14 LTEXT "Titlu:",IDC_STATIC,10,6,50,8 EDITTEXT IDC_EDIT1,10,18,219,13,ES_AUTOHSCROLL LTEXT "Cale:",IDC_STATIC,10,36,50,8 @@ -1276,7 +1276,7 @@ BEGIN LTEXT "Nume:",IDC_STATIC,4,5,50,8 EDITTEXT IDC_EDIT1,58,4,188,13,ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,142,23,50,14 - PUSHBUTTON "Anulare",IDCANCEL,196,23,50,14 + PUSHBUTTON "Revocare",IDCANCEL,196,23,50,14 END IDD_CMD_LINE_HELP DIALOGEX 0, 0, 309, 177 @@ -1295,7 +1295,7 @@ CAPTION "Dialogul numelui listei de redare" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,150,42,50,14 - PUSHBUTTON "Anulare",IDCANCEL,204,42,50,14 + PUSHBUTTON "Revocare",IDCANCEL,204,42,50,14 EDITTEXT IDC_EDIT1,94,14,159,14,ES_AUTOHSCROLL RTEXT "Nume:",IDC_STATIC,7,16,84,8 END @@ -1309,12 +1309,12 @@ BEGIN EDITTEXT IDC_EDIT1,38,5,86,13,ES_AUTOHSCROLL CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,20,275,139,WS_EX_CLIENTEDGE DEFPUSHBUTTON "OK",IDOK,177,163,50,14 - PUSHBUTTON "Anulare",IDCANCEL,230,163,50,14 + PUSHBUTTON "Revocare",IDCANCEL,230,163,50,14 END IDD_HISTORY DIALOGEX 0, 0, 276, 170 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "History" +CAPTION "Istoric" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN PUSHBUTTON "MENU",IDC_BUTTON1,4,4,31,14 @@ -1604,17 +1604,17 @@ BEGIN BEGIN MENUITEM "&Deschide rapid un fișier...", ID_FILE_OPENFILE MENUITEM SEPARATOR - MENUITEM "&Deschide fișier...", ID_FILE_OPENFILEURL - MENUITEM "Deschide &DVD/BD...", ID_FILE_OPENDVD - MENUITEM "Deschide dis&pozitiv...", ID_FILE_OPENDEVICE - MENUITEM "Deschide director...", ID_FILE_OPENDIRECTORY + MENUITEM "De&schide fișier...", ID_FILE_OPENFILEURL + MENUITEM "Deschide DVD/&BD...", ID_FILE_OPENDVD + MENUITEM "Deschide dis&pozitivul...", ID_FILE_OPENDEVICE + MENUITEM "Deschide directorul...", ID_FILE_OPENDIRECTORY MENUITEM "Deschide imaginea &Iso...", ID_FILE_OPENISO - MENUITEM "De&schide disc", ID_SUBMENU_OPENDISC + MENUITEM "Des&chide discul", ID_SUBMENU_OPENDISC MENUITEM "Fișiere recente", ID_SUBMENU_RECENTFILES MENUITEM "&Închide", ID_FILE_CLOSEPLAYLIST MENUITEM SEPARATOR MENUITEM "&Salvează o copie...", ID_FILE_SAVE_COPY - MENUITEM "Salvează &imagine...", ID_FILE_SAVE_IMAGE + MENUITEM "Salvează &imaginea...", ID_FILE_SAVE_IMAGE MENUITEM "Salvează &miniaturi...", ID_FILE_SAVE_THUMBNAILS MENUITEM SEPARATOR MENUITEM "&Încarcă subtitrare...", ID_FILE_LOAD_SUBTITLE @@ -1645,7 +1645,7 @@ BEGIN END MENUITEM SEPARATOR MENUITEM "Pe tot ecranu&l", ID_VIEW_FULLSCREEN - POPUP "&Mărire/Micșorare" + POPUP "&Mărire/Micșorare (Scalare)" BEGIN MENUITEM "&50%", ID_VIEW_ZOOM_50 MENUITEM "&100%", ID_VIEW_ZOOM_100 @@ -1692,7 +1692,7 @@ BEGIN END POPUP "&Redare" BEGIN - MENUITEM "&Redare/Pauză", ID_PLAY_PLAYPAUSE + MENUITEM "R&edare/Pauză", ID_PLAY_PLAYPAUSE MENUITEM "&Oprește", ID_PLAY_STOP MENUITEM "Pas cad&ru", ID_PLAY_FRAMESTEP MENUITEM "&Mergi la...", ID_PLAY_GOTO @@ -1710,7 +1710,7 @@ BEGIN MENUITEM "Resetează rata", ID_PLAY_RESETRATE MENUITEM SEPARATOR MENUITEM "&Filtre", ID_SUBMENU_FILTERS - MENUITEM "N&uanțatoare (S&hadere)", ID_SUBMENU_SHADERS + MENUITEM "Nuanțatoare (S&hadere)", ID_SUBMENU_SHADERS MENUITEM SEPARATOR MENUITEM "&Audio", ID_SUBMENU_AUDIOLANG MENUITEM "Su&btitrări", ID_SUBMENU_SUBTITLELANG @@ -1726,7 +1726,7 @@ BEGIN END MENUITEM "&Navigare", ID_SUBMENU_NAVIGATE_MAIN MENUITEM "F&avorite", ID_SUBMENU_FAVORITES_MAIN - POPUP "&Ajutor" + POPUP "A&jutor" BEGIN MENUITEM "&Pagină de pornire", ID_HELP_HOMEPAGE MENUITEM "&Verifică pentru actualizări", ID_HELP_CHECKFORUPDATE @@ -1744,17 +1744,17 @@ BEGIN BEGIN MENUITEM "&Deschide rapid un fișier...", ID_FILE_OPENFILE MENUITEM SEPARATOR - MENUITEM "&Deschide fișier...", ID_FILE_OPENFILEURL + MENUITEM "&Deschide fișierul...", ID_FILE_OPENFILEURL MENUITEM "Deschide &DVD/BD...", ID_FILE_OPENDVD - MENUITEM "Deschide dis&pozitiv...", ID_FILE_OPENDEVICE - MENUITEM "Deschide director...", ID_FILE_OPENDIRECTORY + MENUITEM "Deschide dis&pozitivul...", ID_FILE_OPENDEVICE + MENUITEM "Deschide directorul...", ID_FILE_OPENDIRECTORY MENUITEM "Deschide imaginea &Iso...", ID_FILE_OPENISO - MENUITEM "De&schide disc", ID_SUBMENU_OPENDISC + MENUITEM "De&schide discul", ID_SUBMENU_OPENDISC MENUITEM "Fișiere recente", ID_SUBMENU_RECENTFILES MENUITEM "&Închide", ID_FILE_CLOSEPLAYLIST MENUITEM SEPARATOR MENUITEM "&Salvează o copie...", ID_FILE_SAVE_COPY - MENUITEM "Salvează &imagine...", ID_FILE_SAVE_IMAGE + MENUITEM "Salvează &imaginea...", ID_FILE_SAVE_IMAGE MENUITEM "Salvează &miniaturi...", ID_FILE_SAVE_THUMBNAILS MENUITEM SEPARATOR MENUITEM "&Încarcă subtitrare...", ID_FILE_LOAD_SUBTITLE @@ -1777,7 +1777,7 @@ BEGIN END MENUITEM SEPARATOR MENUITEM "Ecran comp&let", ID_VIEW_FULLSCREEN - POPUP "&Mărire/Micșorare" + POPUP "&Mărire/Micșorare (Scalare) (Scalare)" BEGIN MENUITEM "&50%", ID_VIEW_ZOOM_50 MENUITEM "&100%", ID_VIEW_ZOOM_100 @@ -1877,15 +1877,15 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Deschide fișier...", ID_FILE_OPENFILEURL MENUITEM "Deschide &DVD...", ID_FILE_OPENDVD - MENUITEM "Deschide dis&pozitiv...", ID_FILE_OPENDEVICE - MENUITEM "Deschide director...", ID_FILE_OPENDIRECTORY + MENUITEM "Deschide dis&pozitivul...", ID_FILE_OPENDEVICE + MENUITEM "Deschide directorul...", ID_FILE_OPENDIRECTORY MENUITEM "Deschide imaginea &Iso...", ID_FILE_OPENISO - MENUITEM "De&schide disc", ID_SUBMENU_OPENDISC + MENUITEM "De&schide discul", ID_SUBMENU_OPENDISC MENUITEM "Fișiere recente", ID_SUBMENU_RECENTFILES MENUITEM "&Închide", ID_FILE_CLOSEPLAYLIST MENUITEM SEPARATOR MENUITEM "&Salvează o copie...", ID_FILE_SAVE_COPY - MENUITEM "Salvează imagine...", ID_FILE_SAVE_IMAGE + MENUITEM "Salvează imaginea...", ID_FILE_SAVE_IMAGE MENUITEM "Salvează &miniaturi...", ID_FILE_SAVE_THUMBNAILS MENUITEM SEPARATOR MENUITEM "&Încarcă subtitrare...", ID_FILE_LOAD_SUBTITLE @@ -1915,7 +1915,7 @@ BEGIN END MENUITEM SEPARATOR MENUITEM "Pe tot ecranu&l", ID_VIEW_FULLSCREEN - POPUP "&Mărire/Micșorare" + POPUP "&Mărire/Micșorare (Scalare)" BEGIN MENUITEM "&50%", ID_VIEW_ZOOM_50 MENUITEM "&100%", ID_VIEW_ZOOM_100 @@ -2043,8 +2043,8 @@ BEGIN MENUITEM "&Mărime dublă", ID_VIEW_VF_DOUBLE MENUITEM "&Întinde cât fereastra", ID_VIEW_VF_STRETCH MENUITEM "Atinge fereastra din &interior", ID_VIEW_VF_FROMINSIDE - MENUITEM "Scalare &1", ID_VIEW_VF_ZOOM1 - MENUITEM "Scalare &2", ID_VIEW_VF_ZOOM2 + MENUITEM "Mărire/Micșorare (Scalare) &1", ID_VIEW_VF_ZOOM1 + MENUITEM "Mărire/Micșorare (Scalare) &2", ID_VIEW_VF_ZOOM2 MENUITEM "Atinge fereastra din exteri&or", ID_VIEW_VF_FROMOUTSIDE MENUITEM SEPARATOR MENUITEM "&Menține raportul de aspect", ID_VIEW_VF_KEEPASPECTRATIO @@ -2373,7 +2373,7 @@ STRINGTABLE BEGIN IDS_RECORD_START "Înregistrează" IDS_RECORD_STOP "Oprește" - IDS_FILTERS_COPY_TO_CLIPBOARD "&Copy filters list to clipboard" + IDS_FILTERS_COPY_TO_CLIPBOARD "&Copiază lista filtrelor în clipboard" IDS_AG_COPY_IMAGE "Copiază imaginea din clipboard" IDS_PLAYLOOPMODE_AB "Repetă A-B: Resetează pozițiile" IDS_PLAYLOOPMODE_AB_MARK_A "Repetă A-B: Marchează poziția A" @@ -2627,7 +2627,7 @@ END STRINGTABLE BEGIN IDS_AG_AUDIO "Audio" - IDS_AG_ZOOM "Scalare" + IDS_AG_ZOOM "Mărire/Micșorare (Scalare)" IDS_FAVORITES_ADD "&Adăugare la favorite..." IDS_FAVORITES_ORGANIZE "&Organizare favorite..." IDS_CONTROLS_CLOSING "Închidere..." @@ -2728,7 +2728,7 @@ BEGIN IDS_VIDEO_STREAM "Video: %s" IDS_APPLY "Aplică" IDS_CLEAR "Goleşte" - IDS_CANCEL "Anulare" + IDS_CANCEL "Revocare" IDS_TEXTFILE_ENC "Codare:" IDS_SAVE_FILE "Se salvează fișierul" IDS_VOLUME_OSD_MUTE "Volum: %d%% [Mut]" @@ -2759,7 +2759,7 @@ STRINGTABLE BEGIN IDS_AG_OPEN_DEVICE "Deschide dispozitiv" IDS_AG_SAVE_AS "Salvează ca" - IDS_AG_SAVE_IMAGE "Salvează imagine" + IDS_AG_SAVE_IMAGE "Salvează imaginea" IDS_AG_AUTOSAVE_IMAGE "Salvează imaginea (automat)" IDS_OSD_IMAGE_SAVED "Imagine salvată cu succes" IDS_AG_LOAD_SUBTITLE "Încarcă subtitrare" @@ -2878,7 +2878,7 @@ END STRINGTABLE BEGIN IDS_AG_WINDOW_TO_PRIMARYSCREEN "Mută fereastra în ecranul principal (PrimaryScreen)" - IDS_EXTERNAL "external" + IDS_EXTERNAL "extern" IDS_SUB_SAVE_EXTERNAL_STYLE_FILE "Salvează stilul personalizat" END @@ -2913,7 +2913,7 @@ BEGIN IDS_AG_DVD_MENU_ACTIVATE "Meniu DVD activare" IDS_AG_DVD_MENU_BACK "Meniu DVD înapoi" IDS_AG_DVD_MENU_LEAVE "Meniu DVD ieşire" - IDS_AG_BOSS_KEY "Tastă " + IDS_AG_BOSS_KEY "Tasta Şef (Boss)" IDS_AG_MENU_PLAYER_S "Meniul player-ului (scurt)" IDS_AG_MENU_PLAYER_L "Meniul player-ului (lung)" IDS_AG_MENU_FILTERS "Meniul Filtre" @@ -3048,7 +3048,7 @@ STRINGTABLE BEGIN IDS_AG_JUMP_TO "Sari la..." IDS_AG_FAVORITES "Favorites" - IDS_AG_SHADERS "Nuanțatoare" + IDS_AG_SHADERS "Nuanțatoare (Shadere)" IDS_AG_VIDEO_FRAME "Cadru video" IDS_AG_PANSCAN "Panoramare și scanare" IDS_AG_ASPECT_RATIO "Raport de aspect" @@ -3412,9 +3412,9 @@ BEGIN IDS_AG_TOGGLE_PLAYLIST "Comută bara listă de redare" IDS_AG_TOGGLE_CAPTURE "Comută bara de captură" IDS_AG_TOGGLE_SHADER "Comută bara editor de nuanțator" - IDS_AG_ZOOM_50 "Micșorare 50%" - IDS_AG_ZOOM_100 "Mărire 100%" - IDS_AG_ZOOM_200 "Mărire 200%" + IDS_AG_ZOOM_50 "Scalare 50%" + IDS_AG_ZOOM_100 "Scalare 100%" + IDS_AG_ZOOM_200 "Scalare 200%" IDS_AG_NEXT_AR_PRESET "Următoarea setare prestabilită RA" IDS_AG_VIDFRM_STRETCH "Cadru video întins" IDS_AG_VIDFRM_INSIDE "Cadru video în interior" @@ -3499,7 +3499,7 @@ BEGIN IDS_ZOOM2 "Scalare 2" IDS_TOUCH_WINDOW_FROM_OUTSIDE "Atinge fereastra din exterior" IDS_AUDIO_STREAM "Audio %u/%u: %s" - IDS_AG_REOPEN "Redeschide fișier" + IDS_AG_REOPEN "Redeschide fișierul" IDS_PROPERTIESFOR "Proprietăți pentru '%s'" IDS_AUDIO_ONLY "numai audio (sunet)" END From fb1ffed6f25a5cab297c1183dd000808448b53e1 Mon Sep 17 00:00:00 2001 From: Andrei Miloiu Date: Sun, 16 Jun 2024 11:33:57 +0300 Subject: [PATCH 011/102] Update mplayerc.ro.rc.txt --- src/apps/mpcresources/text/mplayerc.ro.rc.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.ro.rc.txt b/src/apps/mpcresources/text/mplayerc.ro.rc.txt index c2d34f0374..1697be6879 100644 --- a/src/apps/mpcresources/text/mplayerc.ro.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ro.rc.txt @@ -1,4 +1,4 @@ -BEGIN DIALOGEX IDD_ABOUTBOX LINES 26 +BEGIN DIALOGEX IDD_ABOUTBOX LINES 26 3 "Despre" 7 "MPC-BE" 8 "Drepturi de autor © 2002-2024 vedeți Authors.txt" @@ -687,7 +687,7 @@ END BEGIN MENU IDR_MAINFRAME LINES 137 3 "&Fișier" 5 "&Deschide rapid un fișier..." -7 "De&schide fișier..." +7 "De&schide fișierul..." 8 "Deschide DVD/&BD..." 9 "Deschide dis&pozitivul..." 10 "Deschide directorul..." @@ -1762,8 +1762,8 @@ STRING IDS_OSD_RS_INPUT_TYPE_AUTO "Tip de intrare: autodetecție" STRING IDS_OSD_RS_INPUT_TYPE_HDTV "Tip de intrare: HDTV" STRING IDS_OSD_RS_INPUT_TYPE_SD_NTSC "Tip de intrare: SDTV NTSC" STRING IDS_OSD_RS_INPUT_TYPE_SD_PAL "Tip de intrare: SDTV PAL" -STRING IDS_OSD_RS_INTERNAL_VSYNC_OFF "Internal VSync: Off" -STRING IDS_OSD_RS_INTERNAL_VSYNC_ON "Internal VSync: On" +STRING IDS_OSD_RS_INTERNAL_VSYNC_OFF "VSync intern: oprit" +STRING IDS_OSD_RS_INTERNAL_VSYNC_ON "VSync intern: pornit" STRING IDS_OSD_RS_NO_DESKTOP_COMP_OFF "Dezactivare compoziție desktop: oprită" STRING IDS_OSD_RS_NO_DESKTOP_COMP_ON "Dezactivare compoziție desktop: pornită" STRING IDS_OSD_RS_OUTPUT_RANGE "Interval de ieșire: %s" @@ -1870,7 +1870,7 @@ STRING IDS_PPSDB_PROTOCOLERR "Nepotrivire versiune protocol, actualizați playe STRING IDS_PPSDB_URLCORRECT "URL-ul pare a fi corect!" STRING IDS_PROPERTIESFOR "Proprietăți pentru '%s'" STRING IDS_PROPSHEET_PROPERTIES "Proprietăți" -STRING IDS_PUBLISHED "Publicat : " +STRING IDS_PUBLISHED "Publicat: " STRING IDS_RECENT_FILES "Fișiere recente" STRING IDS_RECENT_FILES_CLEAR "Curăță lista" STRING IDS_RECENT_FILES_QUESTION "Sigur doriți să ștergeți lista de fișiere recente?" @@ -2016,7 +2016,7 @@ STRING IDS_TOUCH_WINDOW_FROM_INSIDE "Atinge fereastra din interior" STRING IDS_TOUCH_WINDOW_FROM_OUTSIDE "Atinge fereastra din exterior" STRING IDS_TRA_DVD_VIDEO "Bazat pe libmpeg2" STRING IDS_TRA_FFMPEG "Bazat pe FFmpeg, http://ffmpeg.org/" -STRING IDS_TRA_INTEL_MSDK "Based on Intel Media SDK, requires external library(libmfxsw32.dll/libmfxsw64.dll)" +STRING IDS_TRA_INTEL_MSDK "Bazat pe Intel Media SDK, necesită biblioteca externă (libmfxsw32.dll/libmfxsw64.dll)" STRING IDS_TRA_PS2AUD "Decodează fluxurile audio din fișiere PSS" STRING IDS_UNDETERMINED "Nedeterminat" STRING IDS_UNIT_SIZE_GB "GB" From 1156d3bae79620076bd51baf5b4c9acb4b440bb3 Mon Sep 17 00:00:00 2001 From: Andrei Miloiu Date: Sun, 16 Jun 2024 11:41:10 +0300 Subject: [PATCH 012/102] Update mplayerc.ro.rc.txt --- src/apps/mpcresources/text/mplayerc.ro.rc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.ro.rc.txt b/src/apps/mpcresources/text/mplayerc.ro.rc.txt index 1697be6879..fedf8b91c9 100644 --- a/src/apps/mpcresources/text/mplayerc.ro.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ro.rc.txt @@ -65,7 +65,7 @@ END BEGIN DIALOGEX IDD_FAVORGANIZE LINES 13 3 "Organizare favorite" -8 "Edit" +8 "Editare" 9 "Mută în sus" 10 "Mută în jos" 11 "Șterge" @@ -106,7 +106,7 @@ END BEGIN DIALOGEX IDD_HISTORY LINES 10 3 "Istoric" -6 "MENU" +6 "MENIU" 8 "Șterge selecția" END From 537b9dfea87bd38cdf723893d6fcd5511d9bb15b Mon Sep 17 00:00:00 2001 From: Andrei Miloiu Date: Sun, 16 Jun 2024 11:43:48 +0300 Subject: [PATCH 013/102] Update mplayerc.ro.rc.txt --- src/apps/mpcresources/text/mplayerc.ro.rc.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.ro.rc.txt b/src/apps/mpcresources/text/mplayerc.ro.rc.txt index fedf8b91c9..30ed536bfa 100644 --- a/src/apps/mpcresources/text/mplayerc.ro.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ro.rc.txt @@ -803,7 +803,7 @@ BEGIN MENU IDR_POPUP LINES 130 37 "A-B (Marchează &A)" 38 "A-B (Marchează &B)" 41 "Ecran comp&let" -42 "&Mărire/Micșorare (Scalare) (Scalare)" +42 "&Mărire/Micșorare (Scalare)" 47 "Autopotrivire" 50 "Cadru &video" 51 "Panoramare și s&canare" @@ -1924,7 +1924,7 @@ STRING IDS_SUBDL_DLG_DISC_COL "Disc" STRING IDS_SUBDL_DLG_DOWNLOADING "Descărcare subtitrare(ări), vă rugăm să aşteptaţi." STRING IDS_SUBDL_DLG_FILENAME_COL "Fişier" STRING IDS_SUBDL_DLG_FORMAT_COL "Format" -STRING IDS_SUBDL_DLG_LANGUAGE_COL "Limbă" +STRING IDS_SUBDL_DLG_LANGUAGE_COL "Limbă (Language)" STRING IDS_SUBDL_DLG_NOT_FOUND "Nu s-au găsit subtitrări." STRING IDS_SUBDL_DLG_PARSING "Analizarea listei..." STRING IDS_SUBDL_DLG_SUBS_AVAIL " %d subtitrare(ări) disponibilă(e)." @@ -2080,8 +2080,8 @@ STRING IDS_VOLUME_OSD_MUTE "Volum: %d%% [Mut]" STRING IDS_VTSREADER_LOAD_PGC "Activează o alegere de Titlu" STRING IDS_WEBSERVER_ERROR_TEST "Trebuie să aplicați noile setări înainte de a le testa." STRING IDS_WEBUI_DISABLED_PREVIEW_MSG "Previzualizarea este deocamdată dezactivată. Se poate activa în opțiunile lui MPC-BE." -STRING IDS_ZOOM1 "Scalare 1" -STRING IDS_ZOOM2 "Scalare 2" +STRING IDS_ZOOM1 "Mărire/Micșorare (Scalare) 1" +STRING IDS_ZOOM2 "Mărire/Micșorare (Scalare) 2" STRING IDS_ZOOM_AUTOFIT "Potrivire automată" STRING IDS_ZOOM_AUTOFITLARGE "Potrivire automată (doar mai mare)" STRING ID_NAVIGATE_SKIPBACK "Sari înapoi\nSari înapoi" From 6c65c1a29e56c7b00b174ffe4aa48d2c82a53d42 Mon Sep 17 00:00:00 2001 From: v0lt Date: Mon, 17 Jun 2024 06:21:06 +0300 Subject: [PATCH 014/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=80=D1=83=D0=BC=D1=8B=D0=BD=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20(=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=20Andrei=20Miloiu).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mpcresources/mplayerc.ro.rc | 22 +++++++++---------- src/apps/mpcresources/text/mplayerc.ro.rc.txt | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/apps/mpcresources/mplayerc.ro.rc b/src/apps/mpcresources/mplayerc.ro.rc index 9d00f337ed..86afc09ff5 100644 --- a/src/apps/mpcresources/mplayerc.ro.rc +++ b/src/apps/mpcresources/mplayerc.ro.rc @@ -600,7 +600,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL "",IDC_TAB1,"SysTabControl32",0x0,5,5,205,160 CONTROL "",IDC_LIST2,"SysListView32",LVS_REPORT | LVS_EDITLABELS | LVS_OWNERDRAWFIXED | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,8,21,199,141,WS_EX_CLIENTEDGE - PUSHBUTTON "Edit",IDC_BUTTON1,214,17,58,14 + PUSHBUTTON "Editare",IDC_BUTTON1,214,17,58,14 PUSHBUTTON "Mută în sus",IDC_BUTTON3,214,43,58,14 PUSHBUTTON "Mută în jos",IDC_BUTTON4,214,58,58,14 PUSHBUTTON "Șterge",IDC_BUTTON2,214,84,58,14 @@ -1317,7 +1317,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPT CAPTION "Istoric" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - PUSHBUTTON "MENU",IDC_BUTTON1,4,4,31,14 + PUSHBUTTON "MENIU",IDC_BUTTON1,4,4,31,14 EDITTEXT IDC_EDIT1,39,5,100,14,ES_AUTOHSCROLL PUSHBUTTON "Șterge selecția",IDC_BUTTON2,143,4,76,14 CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,23,268,142,WS_EX_CLIENTEDGE @@ -1604,7 +1604,7 @@ BEGIN BEGIN MENUITEM "&Deschide rapid un fișier...", ID_FILE_OPENFILE MENUITEM SEPARATOR - MENUITEM "De&schide fișier...", ID_FILE_OPENFILEURL + MENUITEM "De&schide fișierul...", ID_FILE_OPENFILEURL MENUITEM "Deschide DVD/&BD...", ID_FILE_OPENDVD MENUITEM "Deschide dis&pozitivul...", ID_FILE_OPENDEVICE MENUITEM "Deschide directorul...", ID_FILE_OPENDIRECTORY @@ -1777,7 +1777,7 @@ BEGIN END MENUITEM SEPARATOR MENUITEM "Ecran comp&let", ID_VIEW_FULLSCREEN - POPUP "&Mărire/Micșorare (Scalare) (Scalare)" + POPUP "&Mărire/Micșorare (Scalare)" BEGIN MENUITEM "&50%", ID_VIEW_ZOOM_50 MENUITEM "&100%", ID_VIEW_ZOOM_100 @@ -2585,7 +2585,7 @@ BEGIN IDS_TRA_DVD_VIDEO "Bazat pe libmpeg2" IDS_TRA_PS2AUD "Decodează fluxurile audio din fișiere PSS" IDS_TRA_FFMPEG "Bazat pe FFmpeg, http://ffmpeg.org/" - IDS_TRA_INTEL_MSDK "Based on Intel Media SDK, requires external library(libmfxsw32.dll/libmfxsw64.dll)" + IDS_TRA_INTEL_MSDK "Bazat pe Intel Media SDK, necesită biblioteca externă (libmfxsw32.dll/libmfxsw64.dll)" END STRINGTABLE @@ -3495,8 +3495,8 @@ BEGIN IDS_DISABLE_DXVA_FILTERS "Dezactivează filtrele DXVA" IDS_STRETCH_TO_WINDOW "Întinde cât fereastra" IDS_TOUCH_WINDOW_FROM_INSIDE "Atinge fereastra din interior" - IDS_ZOOM1 "Scalare 1" - IDS_ZOOM2 "Scalare 2" + IDS_ZOOM1 "Mărire/Micșorare (Scalare) 1" + IDS_ZOOM2 "Mărire/Micșorare (Scalare) 2" IDS_TOUCH_WINDOW_FROM_OUTSIDE "Atinge fereastra din exterior" IDS_AUDIO_STREAM "Audio %u/%u: %s" IDS_AG_REOPEN "Redeschide fișierul" @@ -3592,8 +3592,8 @@ STRINGTABLE BEGIN IDS_OSD_RS_VSYNC_ON "VSync: pornit" IDS_OSD_RS_VSYNC_OFF "VSync: oprit" - IDS_OSD_RS_INTERNAL_VSYNC_ON "Internal VSync: On" - IDS_OSD_RS_INTERNAL_VSYNC_OFF "Internal VSync: Off" + IDS_OSD_RS_INTERNAL_VSYNC_ON "VSync intern: pornit" + IDS_OSD_RS_INTERNAL_VSYNC_OFF "VSync intern: oprit" IDS_OSD_RS_SYNC_TO_DISPLAY_ON "Sincronizare video cu afișarea: pornită" IDS_OSD_RS_SYNC_TO_DISPLAY_OFF "Sincronizare video cu afișarea: oprită" IDS_OSD_RS_SYNC_TO_VIDEO_ON "Sincronizare afișare cu video: pornită" @@ -3694,7 +3694,7 @@ BEGIN IDS_GOTO_ERROR_INVALID_TIME "Timpul introdus este mai mare decât durata fişierului." IDS_SCREENSHOT_ERROR_MADVR "Funcțiile ""Salvează imagine"" și ""Salvează miniaturi"" nu funcționează cu randorul video madVR.\nSchimbați randorul video în opțiunile de ieșire ale MPC și redeschideți fișierul." IDS_SUBDL_DLG_FILENAME_COL "Fişier" - IDS_SUBDL_DLG_LANGUAGE_COL "Limbă" + IDS_SUBDL_DLG_LANGUAGE_COL "Limbă (Language)" IDS_SUBDL_DLG_FORMAT_COL "Format" END @@ -3824,7 +3824,7 @@ END STRINGTABLE BEGIN - IDS_PUBLISHED "Publicat : " + IDS_PUBLISHED "Publicat: " END STRINGTABLE diff --git a/src/apps/mpcresources/text/mplayerc.ro.rc.txt b/src/apps/mpcresources/text/mplayerc.ro.rc.txt index 30ed536bfa..7d6eba5528 100644 --- a/src/apps/mpcresources/text/mplayerc.ro.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.ro.rc.txt @@ -1,4 +1,4 @@ -BEGIN DIALOGEX IDD_ABOUTBOX LINES 26 +BEGIN DIALOGEX IDD_ABOUTBOX LINES 26 3 "Despre" 7 "MPC-BE" 8 "Drepturi de autor © 2002-2024 vedeți Authors.txt" From 7f69083b919e19eb60fe3d64858668355a22a063 Mon Sep 17 00:00:00 2001 From: v0lt Date: Wed, 19 Jun 2024 17:33:44 +0300 Subject: [PATCH 015/102] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D0=B5=20=D0=BD=D1=83?= =?UTF-8?q?=D0=BB=D0=B5=D0=B2=D1=8B=D0=B5=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D1=80=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82=D0=BE=D1=80=D0=B0=20?= =?UTF-8?q?CRect.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/OSD.cpp | 4 ++-- src/apps/mplayerc/PPageFileInfoClip.cpp | 4 ++-- src/apps/mplayerc/PPageFileInfoDetails.cpp | 4 ++-- src/apps/mplayerc/PPageFileInfoRes.cpp | 4 ++-- src/apps/mplayerc/PlayerListCtrl.cpp | 6 ++++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/apps/mplayerc/OSD.cpp b/src/apps/mplayerc/OSD.cpp index 5ddfb4dda1..a936b6c5fd 100644 --- a/src/apps/mplayerc/OSD.cpp +++ b/src/apps/mplayerc/OSD.cpp @@ -419,7 +419,7 @@ void COSD::DrawMessage() } if (m_nMessagePos != OSD_NOMESSAGE) { - CRect rectText(0, 0, 0, 0); + CRect rectText; CRect rectMessages; m_MemDC.SelectObject(m_MainFont); @@ -484,7 +484,7 @@ void COSD::DrawDebug() m_MemDC.SelectObject(m_MainFont); - CRect rectText(0, 0, 0, 0); + CRect rectText; CRect rectMessages; m_MemDC.DrawText(msg, &rectText, DT_CALCRECT | DT_NOPREFIX); rectText.InflateRect(20, 10); diff --git a/src/apps/mplayerc/PPageFileInfoClip.cpp b/src/apps/mplayerc/PPageFileInfoClip.cpp index 7086814445..6ae9ce6074 100644 --- a/src/apps/mplayerc/PPageFileInfoClip.cpp +++ b/src/apps/mplayerc/PPageFileInfoClip.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -240,7 +240,7 @@ void CPPageFileInfoClip::OnSize(UINT nType, int cx, int cy) int dy = cy - m_rCrt.Height(); GetClientRect(&m_rCrt); - CRect r(0, 0, 0, 0); + CRect r; if (::IsWindow(m_desc.GetSafeHwnd())) { m_desc.GetWindowRect(&r); r.right += dx; diff --git a/src/apps/mplayerc/PPageFileInfoDetails.cpp b/src/apps/mplayerc/PPageFileInfoDetails.cpp index 0c131aed81..193a39e0a3 100644 --- a/src/apps/mplayerc/PPageFileInfoDetails.cpp +++ b/src/apps/mplayerc/PPageFileInfoDetails.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -468,7 +468,7 @@ void CPPageFileInfoDetails::OnSize(UINT nType, int cx, int cy) int dy = cy - m_rCrt.Height(); GetClientRect(&m_rCrt); - CRect r(0, 0, 0, 0); + CRect r; if (::IsWindow(m_encoding.GetSafeHwnd())) { m_encoding.GetWindowRect(&r); r.right += dx; diff --git a/src/apps/mplayerc/PPageFileInfoRes.cpp b/src/apps/mplayerc/PPageFileInfoRes.cpp index 9be5338138..6131d119f1 100644 --- a/src/apps/mplayerc/PPageFileInfoRes.cpp +++ b/src/apps/mplayerc/PPageFileInfoRes.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -177,7 +177,7 @@ void CPPageFileInfoRes::OnSize(UINT nType, int cx, int cy) int dy = cy - m_rCrt.Height(); GetClientRect(&m_rCrt); - CRect r(0, 0, 0, 0); + CRect r; if (::IsWindow(m_list.GetSafeHwnd())) { m_list.GetWindowRect(&r); r.right += dx; diff --git a/src/apps/mplayerc/PlayerListCtrl.cpp b/src/apps/mplayerc/PlayerListCtrl.cpp index 7d4de4e6dc..7a2c915187 100644 --- a/src/apps/mplayerc/PlayerListCtrl.cpp +++ b/src/apps/mplayerc/PlayerListCtrl.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -563,7 +563,9 @@ CImageList* CPlayerListCtrl::CreateDragImageEx(LPPOINT lpPoint) return nullptr; } - CRect cSingleRect, cCompleteRect(0, 0, 0, 0); + CRect cSingleRect; + CRect cCompleteRect; + GetClientRect(cSingleRect); int nWidth = cSingleRect.Width(); From 9877de17fa1d637efcd7427d667ad7bf3de50e9c Mon Sep 17 00:00:00 2001 From: v0lt Date: Wed, 19 Jun 2024 18:04:29 +0300 Subject: [PATCH 016/102] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BE=D0=BA=D0=BD=D0=B0=20=D1=81=D0=B2=D0=BE?= =?UTF-8?q?=D0=B9=D1=81=D1=82=D0=B2=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=BC=D0=B5=D0=B6=D0=B4=D1=83=20=D0=B4=D0=B8=D1=81=D0=BF=D0=BB?= =?UTF-8?q?=D0=B5=D1=8F=D0=BC=D0=B8=20=D1=81=20=D1=80=D0=B0=D0=B7=D0=BD?= =?UTF-8?q?=D1=8B=D0=BC=D0=B8=20=D0=BC=D0=B0=D1=81=D1=88=D1=82=D0=B0=D0=B1?= =?UTF-8?q?=D0=B0=D0=BC=D0=B8=20=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=B0.=20?= =?UTF-8?q?=D0=9D=D0=B5=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80?= =?UTF-8?q?=D1=8B=20=D0=BC=D0=B0=D1=81=D1=88=D1=82=D0=B0=D0=B1=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=81=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BE=D0=BA=D0=BD=D0=B0.=20?= =?UTF-8?q?=D0=97=D0=B0=D1=82=D1=80=D0=B0=D0=B3=D0=B8=D0=B2=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20Issue=20#497.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/PPageFileInfoSheet.cpp | 19 ++++++++++++++----- src/apps/mplayerc/PPageFileInfoSheet.h | 8 ++++---- src/apps/mplayerc/PPageFileMediaInfo.cpp | 9 +++++---- src/apps/mplayerc/PPageFileMediaInfo.h | 8 ++++---- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/apps/mplayerc/PPageFileInfoSheet.cpp b/src/apps/mplayerc/PPageFileInfoSheet.cpp index 7b2634c00a..1fc0314039 100644 --- a/src/apps/mplayerc/PPageFileInfoSheet.cpp +++ b/src/apps/mplayerc/PPageFileInfoSheet.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -38,8 +38,7 @@ CPPageFileInfoSheet::CPPageFileInfoSheet(const std::list& files, CMainF , m_clip(files.front(), pMainFrame->m_pGB) , m_details(files.front(), pMainFrame->m_pGB, pMainFrame->m_pCAP, pMainFrame->m_pDVDI) , m_res(files.front(), pMainFrame->m_pGB) - , m_mi(files, pMainFrame) - , m_pMainFrame(pMainFrame) + , m_mi(files, (CDPI*)this) , m_bNeedInit(TRUE) , m_nMinCX(0) , m_nMinCY(0) @@ -75,6 +74,7 @@ BEGIN_MESSAGE_MAP(CPPageFileInfoSheet, CMPCPropertySheet) ON_WM_DESTROY() ON_WM_GETMINMAXINFO() ON_WM_SIZE() + ON_MESSAGE(WM_DPICHANGED, OnDpiChanged) ON_BN_CLICKED(IDC_BUTTON_MI_SAVEAS, OnSaveAs) ON_BN_CLICKED(IDC_BUTTON_MI_CLIPBOARD, OnCopyToClipboard) END_MESSAGE_MAP() @@ -97,12 +97,12 @@ BOOL CPPageFileInfoSheet::OnInitDialog() GetDlgItem(IDOK)->MoveWindow(r); r.MoveToX(5); - r.right = r.left + m_pMainFrame->ScaleX(120); + r.right = r.left + ScaleX(120); m_Button_MI_SaveAs.Create(ResStr(IDS_AG_SAVE_AS), WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE, r, this, IDC_BUTTON_MI_SAVEAS); m_Button_MI_SaveAs.SetFont(GetFont()); m_Button_MI_SaveAs.ShowWindow(SW_HIDE); - r.MoveToX(r.Width() + m_pMainFrame->ScaleX(10)); + r.MoveToX(r.Width() + ScaleX(10)); m_Button_MI_Clipboard.Create(ResStr(IDS_COPY_TO_CLIPBOARD), WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE, r, this, IDC_BUTTON_MI_CLIPBOARD); m_Button_MI_Clipboard.SetFont(GetFont()); m_Button_MI_Clipboard.ShowWindow(SW_HIDE); @@ -272,3 +272,12 @@ void CPPageFileInfoSheet::OnDestroy() CPropertySheet::OnDestroy(); } + +LRESULT CPPageFileInfoSheet::OnDpiChanged(WPARAM wParam, LPARAM lParam) +{ + const int dpix = LOWORD(wParam); + const int dpiy = HIWORD(wParam); + OverrideDPI(dpix, dpiy); + + return 0; +} diff --git a/src/apps/mplayerc/PPageFileInfoSheet.h b/src/apps/mplayerc/PPageFileInfoSheet.h index 8d65b5d84d..5b3f675c06 100644 --- a/src/apps/mplayerc/PPageFileInfoSheet.h +++ b/src/apps/mplayerc/PPageFileInfoSheet.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -21,6 +21,7 @@ #pragma once +#include #include "PPageFileInfoClip.h" #include "PPageFileInfoDetails.h" #include "PPageFileInfoRes.h" @@ -61,13 +62,11 @@ class CMPCPropertySheet: public CPropertySheet // CPPageFileInfoSheet -class CPPageFileInfoSheet : public CMPCPropertySheet +class CPPageFileInfoSheet : public CMPCPropertySheet, public CDPI { DECLARE_DYNAMIC(CPPageFileInfoSheet) private: - CMainFrame* m_pMainFrame; - CPPageFileInfoDetails m_details; CPPageFileInfoClip m_clip; CPPageFileInfoRes m_res; @@ -96,6 +95,7 @@ class CPPageFileInfoSheet : public CMPCPropertySheet afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); afx_msg void OnDestroy(); + LRESULT OnDpiChanged(WPARAM wParam, LPARAM lParam); DECLARE_MESSAGE_MAP() }; diff --git a/src/apps/mplayerc/PPageFileMediaInfo.cpp b/src/apps/mplayerc/PPageFileMediaInfo.cpp index a666bfac7e..432ebbcc92 100644 --- a/src/apps/mplayerc/PPageFileMediaInfo.cpp +++ b/src/apps/mplayerc/PPageFileMediaInfo.cpp @@ -1,5 +1,5 @@ /* - * (C) 2012-2023 see Authors.txt + * (C) 2012-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -70,11 +70,12 @@ static String mi_get_lang_file() // CPPageFileMediaInfo dialog IMPLEMENT_DYNAMIC(CPPageFileMediaInfo, CPropertyPage) -CPPageFileMediaInfo::CPPageFileMediaInfo(const std::list& files, CMainFrame* pMainFrame) +CPPageFileMediaInfo::CPPageFileMediaInfo(const std::list& files, CDPI* pSheetDpi) : CPropertyPage(CPPageFileMediaInfo::IDD, CPPageFileMediaInfo::IDD) , m_files(files) - , m_pMainFrame(pMainFrame) + , m_pSheetDpi(pSheetDpi) { + ASSERT(pSheetDpi); } void CPPageFileMediaInfo::DoDataExchange(CDataExchange* pDX) @@ -112,7 +113,7 @@ BOOL CPPageFileMediaInfo::OnInitDialog() LOGFONTW lf = {}; lf.lfPitchAndFamily = DEFAULT_PITCH | FF_MODERN; - lf.lfHeight = -m_pMainFrame->ScaleY(12); + lf.lfHeight = -m_pSheetDpi->ScaleY(12); UINT i = 0; BOOL success; diff --git a/src/apps/mplayerc/PPageFileMediaInfo.h b/src/apps/mplayerc/PPageFileMediaInfo.h index 988222ed5b..7edd414c12 100644 --- a/src/apps/mplayerc/PPageFileMediaInfo.h +++ b/src/apps/mplayerc/PPageFileMediaInfo.h @@ -1,5 +1,5 @@ /* - * (C) 2012-2023 see Authors.txt + * (C) 2012-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -27,17 +27,17 @@ class CPPageFileMediaInfo : public CPropertyPage DECLARE_DYNAMIC(CPPageFileMediaInfo) private: + CDPI* m_pSheetDpi; + CComboBox m_cbFilename; CEdit m_edMediainfo; CFont m_font; - CMainFrame* m_pMainFrame; - std::list m_files; int m_fileindex = -1; public: - CPPageFileMediaInfo(const std::list& files, CMainFrame* pMainFrame); + CPPageFileMediaInfo(const std::list& files, CDPI* pSheetDpi); virtual ~CPPageFileMediaInfo() = default; enum { IDD = IDD_FILEMEDIAINFO }; From 107f547a06c9f816f338ad4b3b1f4caf50c9ea5b Mon Sep 17 00:00:00 2001 From: v0lt Date: Fri, 21 Jun 2024 20:50:02 +0300 Subject: [PATCH 017/102] =?UTF-8?q?=D0=9A=D0=BE=D1=81=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=B4=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SubPic/DX11SubPic.cpp | 2 +- src/apps/mplayerc/ComPropertyPage.cpp | 4 ++-- src/apps/mplayerc/ComPropertySheet.cpp | 6 +++--- src/apps/mplayerc/MainFrm.cpp | 2 +- src/apps/mplayerc/OSD.cpp | 2 +- src/apps/mplayerc/PlayerFlyBar.cpp | 4 ++-- src/apps/mplayerc/ShockwaveGraph.cpp | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/SubPic/DX11SubPic.cpp b/src/SubPic/DX11SubPic.cpp index 6ff578a112..b6932676f5 100644 --- a/src/SubPic/DX11SubPic.cpp +++ b/src/SubPic/DX11SubPic.cpp @@ -366,7 +366,7 @@ STDMETHODIMP CDX11SubPicAllocator::SetMaxTextureSize(SIZE MaxTextureSize) } SetCurSize(MaxTextureSize); - SetCurVidRect(CRect(CPoint(0,0), MaxTextureSize)); + SetCurVidRect(CRect(POINT{0,0}, MaxTextureSize)); return S_OK; } diff --git a/src/apps/mplayerc/ComPropertyPage.cpp b/src/apps/mplayerc/ComPropertyPage.cpp index d20b9ce2fd..b84de0162c 100644 --- a/src/apps/mplayerc/ComPropertyPage.cpp +++ b/src/apps/mplayerc/ComPropertyPage.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2018 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -52,7 +52,7 @@ BOOL CComPropertyPage::OnInitDialog() CRect r; PROPPAGEINFO ppi; m_pPage->GetPageInfo(&ppi); - r = CRect(CPoint(0,0), ppi.size); + r = CRect(POINT{0,0}, ppi.size); m_pPage->Activate(m_hWnd, r, FALSE); m_pPage->Show(SW_SHOW); diff --git a/src/apps/mplayerc/ComPropertySheet.cpp b/src/apps/mplayerc/ComPropertySheet.cpp index 111f962346..cb07058ba8 100644 --- a/src/apps/mplayerc/ComPropertySheet.cpp +++ b/src/apps/mplayerc/ComPropertySheet.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -194,10 +194,10 @@ void CComPropertySheet::OnActivated(CPropertyPage* pPage) } } - bounds |= CRect(0,0,0,0); + bounds |= RECT{0,0,0,0}; bounds.SetRect(0, 0, bounds.right + std::max(bounds.left, 4L), bounds.bottom + std::max(bounds.top, 4L)); - CRect r = CRect(CPoint(0,0), bounds.Size()); + CRect r = CRect(POINT{0,0}, bounds.Size()); pTC->AdjustRect(TRUE, r); r.SetRect(twr.TopLeft(), twr.TopLeft() + r.Size()); ScreenToClient(r); diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index 20b920876a..80ac434ae5 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -724,7 +724,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) // create a Main View Window if (!m_wndView.Create(nullptr, nullptr, AFX_WS_DEFAULT_VIEW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, - CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST)) { + RECT{0,0,0,0}, this, AFX_IDW_PANE_FIRST)) { DLog(L"Failed to create Main View Window"); return -1; } diff --git a/src/apps/mplayerc/OSD.cpp b/src/apps/mplayerc/OSD.cpp index a936b6c5fd..3fef8a4dac 100644 --- a/src/apps/mplayerc/OSD.cpp +++ b/src/apps/mplayerc/OSD.cpp @@ -90,7 +90,7 @@ HRESULT COSD::Create(CWnd* pWnd) dwStyleEx |= WS_EX_TOPMOST; } - if (!CreateEx(dwStyleEx, AfxRegisterWndClass(0), nullptr, dwStyle, CRect(0, 0, 0, 0), pWnd, 0, nullptr)) { + if (!CreateEx(dwStyleEx, AfxRegisterWndClass(0), nullptr, dwStyle, RECT{0,0,0,0}, pWnd, 0, nullptr)) { DLog(L"Failed to create OSD Window"); return E_FAIL; } diff --git a/src/apps/mplayerc/PlayerFlyBar.cpp b/src/apps/mplayerc/PlayerFlyBar.cpp index 950ce95aac..edd8d3bd5b 100644 --- a/src/apps/mplayerc/PlayerFlyBar.cpp +++ b/src/apps/mplayerc/PlayerFlyBar.cpp @@ -1,5 +1,5 @@ /* - * (C) 2012-2021 see Authors.txt + * (C) 2012-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -40,7 +40,7 @@ CFlyBar::~CFlyBar() HRESULT CFlyBar::Create(CWnd* pWnd) { - if (!CreateEx(WS_EX_TOPMOST | WS_EX_LAYERED, AfxRegisterWndClass(0), nullptr, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), pWnd, 0, nullptr)) { + if (!CreateEx(WS_EX_TOPMOST | WS_EX_LAYERED, AfxRegisterWndClass(0), nullptr, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, RECT{0,0,0,0}, pWnd, 0, nullptr)) { DLog(L"Failed to create Flybar Window"); return E_FAIL; } diff --git a/src/apps/mplayerc/ShockwaveGraph.cpp b/src/apps/mplayerc/ShockwaveGraph.cpp index ec121b8218..1925ad1546 100644 --- a/src/apps/mplayerc/ShockwaveGraph.cpp +++ b/src/apps/mplayerc/ShockwaveGraph.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2022 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -38,13 +38,13 @@ CShockwaveGraph::CShockwaveGraph(HWND hParent, HRESULT& hr) hr = S_OK; if (!m_wndWindowFrame.Create(nullptr, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - CRect(0, 0, 0, 0), CWnd::FromHandle(hParent), 0, nullptr)) { + RECT{0,0,0,0}, CWnd::FromHandle(hParent), 0, nullptr)) { hr = E_FAIL; return; } if (!m_wndDestFrame.Create(nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, - CRect(0, 0, 0, 0), &m_wndWindowFrame, 0)) { + RECT{0,0,0,0}, &m_wndWindowFrame, 0)) { hr = E_FAIL; return; } From 8003cc7b94ddae81b0171b20ea5f463c74dacf29 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 22 Jun 2024 12:54:20 +0300 Subject: [PATCH 018/102] =?UTF-8?q?=D0=9A=D0=BE=D1=81=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0.=20=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=20=D0=B8=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D0=BC=D0=B8=20=D0=B8=D0=B7=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82=D0=BE=D1=80=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/PPageAudio.cpp | 5 --- src/apps/mplayerc/PPageAudio.h | 8 ++--- src/apps/mplayerc/PPageCapture.cpp | 4 +-- src/apps/mplayerc/PPageCapture.h | 4 +-- src/apps/mplayerc/PPageColor.cpp | 6 +--- src/apps/mplayerc/PPageColor.h | 8 ++--- src/apps/mplayerc/PPageExternalFilters.cpp | 2 -- src/apps/mplayerc/PPageExternalFilters.h | 4 +-- src/apps/mplayerc/PPageFileInfoClip.cpp | 1 - src/apps/mplayerc/PPageFileInfoClip.h | 26 +++++++------- src/apps/mplayerc/PPageFileInfoDetails.cpp | 1 - src/apps/mplayerc/PPageFileInfoDetails.h | 20 +++++------ src/apps/mplayerc/PPageFileInfoRes.cpp | 1 - src/apps/mplayerc/PPageFileInfoRes.h | 4 +-- src/apps/mplayerc/PPageFileInfoSheet.cpp | 3 -- src/apps/mplayerc/PPageFileInfoSheet.h | 6 ++-- src/apps/mplayerc/PPageInterface.cpp | 20 ----------- src/apps/mplayerc/PPageInterface.h | 40 +++++++++++----------- src/apps/mplayerc/PPageLogo.cpp | 4 +-- src/apps/mplayerc/PPageLogo.h | 6 ++-- src/apps/mplayerc/PPagePlayer.cpp | 13 ------- src/apps/mplayerc/PPagePlayer.h | 28 ++++++++------- src/apps/mplayerc/PPageSheet.cpp | 3 +- src/apps/mplayerc/PPageSheet.h | 4 +-- src/apps/mplayerc/PPageSubRend.cpp | 7 +--- src/apps/mplayerc/PPageSubRend.h | 12 +++---- src/apps/mplayerc/PPageSubStyle.cpp | 8 +---- src/apps/mplayerc/PPageSubStyle.h | 14 ++++---- src/apps/mplayerc/PPageSubtitles.cpp | 7 +--- src/apps/mplayerc/PPageSubtitles.h | 10 +++--- src/apps/mplayerc/PPageSync.cpp | 3 +- src/apps/mplayerc/PPageSync.h | 4 +-- src/apps/mplayerc/PPageVideo.cpp | 8 +---- src/apps/mplayerc/PPageVideo.h | 14 ++++---- src/apps/mplayerc/PPageWebServer.cpp | 11 +----- src/apps/mplayerc/PPageWebServer.h | 20 +++++------ src/apps/mplayerc/PlayerPlaylistBar.cpp | 7 ---- src/apps/mplayerc/PlayerPlaylistBar.h | 16 ++++----- src/apps/mplayerc/ShockwaveGraph.cpp | 2 -- src/apps/mplayerc/ShockwaveGraph.h | 6 ++-- src/apps/mplayerc/TunerScanDlg.cpp | 3 +- src/apps/mplayerc/TunerScanDlg.h | 4 +-- 42 files changed, 141 insertions(+), 236 deletions(-) diff --git a/src/apps/mplayerc/PPageAudio.cpp b/src/apps/mplayerc/PPageAudio.cpp index cf63a279d2..f6405e182f 100644 --- a/src/apps/mplayerc/PPageAudio.cpp +++ b/src/apps/mplayerc/PPageAudio.cpp @@ -30,11 +30,6 @@ IMPLEMENT_DYNAMIC(CPPageAudio, CPPageBase) CPPageAudio::CPPageAudio() : CPPageBase(CPPageAudio::IDD, CPPageAudio::IDD) - , m_iAudioRendererType(0) - , m_iSecAudioRendererType(1) - - , m_fAutoloadAudio(FALSE) - , m_fPrioritizeExternalAudio(FALSE) { } diff --git a/src/apps/mplayerc/PPageAudio.h b/src/apps/mplayerc/PPageAudio.h index cfc6085d57..b667b8f9a4 100644 --- a/src/apps/mplayerc/PPageAudio.h +++ b/src/apps/mplayerc/PPageAudio.h @@ -39,9 +39,9 @@ class CPPageAudio : public CPPageBase enum { IDD = IDD_PPAGEAUDIO }; - int m_iAudioRendererType; + int m_iAudioRendererType = 0; CComboBox m_iAudioRendererTypeCtrl; - int m_iSecAudioRendererType; + int m_iSecAudioRendererType = 1; CComboBox m_iSecAudioRendererTypeCtrl; CButton m_audRendPropButton; CButton m_DualAudioOutput; @@ -51,9 +51,9 @@ class CPPageAudio : public CPPageBase int m_nBalance = 0; CSliderCtrl m_balancectrl; - BOOL m_fAutoloadAudio; + BOOL m_fAutoloadAudio = FALSE; CString m_sAudioPaths; - BOOL m_fPrioritizeExternalAudio; + BOOL m_fPrioritizeExternalAudio = FALSE; void ShowPPage(CUnknown* (WINAPI * CreateInstance)(LPUNKNOWN lpunk, HRESULT* phr)); diff --git a/src/apps/mplayerc/PPageCapture.cpp b/src/apps/mplayerc/PPageCapture.cpp index 3a02d50239..61862247c4 100644 --- a/src/apps/mplayerc/PPageCapture.cpp +++ b/src/apps/mplayerc/PPageCapture.cpp @@ -1,5 +1,5 @@ /* - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -281,9 +281,7 @@ IMPLEMENT_DYNAMIC(CPPageCapture, CPPageBase) CPPageCapture::CPPageCapture() : CPPageBase(CPPageCapture::IDD, CPPageCapture::IDD) - , m_iDefaultDevice(0) { - } CPPageCapture::~CPPageCapture() diff --git a/src/apps/mplayerc/PPageCapture.h b/src/apps/mplayerc/PPageCapture.h index 7d8bb22bfe..45b847e9ed 100644 --- a/src/apps/mplayerc/PPageCapture.h +++ b/src/apps/mplayerc/PPageCapture.h @@ -1,5 +1,5 @@ /* - * (C) 2006-2016 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -40,7 +40,7 @@ class CPPageCapture : public CPPageBase CComboBox m_cbDigitalNetworkProvider; CComboBox m_cbDigitalTuner; CComboBox m_cbDigitalReceiver; - int m_iDefaultDevice; + int m_iDefaultDevice = 0; public: CPPageCapture(); diff --git a/src/apps/mplayerc/PPageColor.cpp b/src/apps/mplayerc/PPageColor.cpp index 7561125988..6ac82023a4 100644 --- a/src/apps/mplayerc/PPageColor.cpp +++ b/src/apps/mplayerc/PPageColor.cpp @@ -1,5 +1,5 @@ /* - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -28,10 +28,6 @@ IMPLEMENT_DYNAMIC(CPPageColor, CPPageBase) CPPageColor::CPPageColor() : CPPageBase(CPPageColor::IDD, CPPageColor::IDD) - , m_iBrightness(0) - , m_iContrast(0) - , m_iHue(0) - , m_iSaturation(0) { } diff --git a/src/apps/mplayerc/PPageColor.h b/src/apps/mplayerc/PPageColor.h index 2d15766045..63861444e9 100644 --- a/src/apps/mplayerc/PPageColor.h +++ b/src/apps/mplayerc/PPageColor.h @@ -30,10 +30,10 @@ class CPPageColor : public CPPageBase private: // Color control - int m_iBrightness; - int m_iContrast; - int m_iHue; - int m_iSaturation; + int m_iBrightness = 0; + int m_iContrast = 0; + int m_iHue = 0; + int m_iSaturation = 0; CString m_sBrightness; CString m_sContrast; CString m_sHue; diff --git a/src/apps/mplayerc/PPageExternalFilters.cpp b/src/apps/mplayerc/PPageExternalFilters.cpp index cc76102931..539723cb87 100644 --- a/src/apps/mplayerc/PPageExternalFilters.cpp +++ b/src/apps/mplayerc/PPageExternalFilters.cpp @@ -165,8 +165,6 @@ static const std::vector s_SubTypes = { IMPLEMENT_DYNAMIC(CPPageExternalFilters, CPPageBase) CPPageExternalFilters::CPPageExternalFilters() : CPPageBase(CPPageExternalFilters::IDD, CPPageExternalFilters::IDD) - , m_iLoadType(FilterOverride::PREFERRED) - , m_pLastSelFilter(nullptr) { } diff --git a/src/apps/mplayerc/PPageExternalFilters.h b/src/apps/mplayerc/PPageExternalFilters.h index a1c4e64010..a5da197fcf 100644 --- a/src/apps/mplayerc/PPageExternalFilters.h +++ b/src/apps/mplayerc/PPageExternalFilters.h @@ -37,7 +37,7 @@ class CPPageExternalFilters : public CPPageBase void StepDown(CCheckListBox& list); std::list> m_ExtFilters; - FilterOverride* m_pLastSelFilter; + FilterOverride* m_pLastSelFilter = nullptr; FilterOverride* GetCurFilter(); public: @@ -47,7 +47,7 @@ class CPPageExternalFilters : public CPPageBase enum { IDD = IDD_PPAGEEXTERNALFILTERS }; CCheckListBox m_filters; - int m_iLoadType; + int m_iLoadType = FilterOverride::PREFERRED; CHexEdit m_dwMerit; CTreeCtrl m_tree; diff --git a/src/apps/mplayerc/PPageFileInfoClip.cpp b/src/apps/mplayerc/PPageFileInfoClip.cpp index 6ae9ce6074..42fdc0958b 100644 --- a/src/apps/mplayerc/PPageFileInfoClip.cpp +++ b/src/apps/mplayerc/PPageFileInfoClip.cpp @@ -36,7 +36,6 @@ CPPageFileInfoClip::CPPageFileInfoClip(const CString& fn, IFilterGraph* pFG) , m_rating(ResStr(IDS_AG_NONE)) , m_location_str(ResStr(IDS_AG_NONE)) , m_album(ResStr(IDS_AG_NONE)) - , m_hIcon(nullptr) { auto pFrame = AfxGetMainFrame(); diff --git a/src/apps/mplayerc/PPageFileInfoClip.h b/src/apps/mplayerc/PPageFileInfoClip.h index e88e3f2194..933e372da1 100644 --- a/src/apps/mplayerc/PPageFileInfoClip.h +++ b/src/apps/mplayerc/PPageFileInfoClip.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2019 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -31,19 +31,19 @@ class CPPageFileInfoClip : public CPropertyPage DECLARE_DYNAMIC(CPPageFileInfoClip) private: - HICON m_hIcon; + HICON m_hIcon = nullptr; - CStatic m_icon; - CString m_fn; - CString m_clip; - CString m_author; - CString m_album; - CString m_copyright; - CString m_rating; - CString m_location_str; - CString m_descText; - CEdit m_location; - CEdit m_desc; + CStatic m_icon; + CString m_fn; + CString m_clip; + CString m_author; + CString m_album; + CString m_copyright; + CString m_rating; + CString m_location_str; + CString m_descText; + CEdit m_location; + CEdit m_desc; public: CPPageFileInfoClip(const CString& fn, IFilterGraph* pFG); diff --git a/src/apps/mplayerc/PPageFileInfoDetails.cpp b/src/apps/mplayerc/PPageFileInfoDetails.cpp index 193a39e0a3..007345d729 100644 --- a/src/apps/mplayerc/PPageFileInfoDetails.cpp +++ b/src/apps/mplayerc/PPageFileInfoDetails.cpp @@ -58,7 +58,6 @@ IMPLEMENT_DYNAMIC(CPPageFileInfoDetails, CPropertyPage) CPPageFileInfoDetails::CPPageFileInfoDetails(const CString& fn, IFilterGraph* pFG, IAllocatorPresenter* pCAP, IDvdInfo2* pDVDI) : CPropertyPage(CPPageFileInfoDetails::IDD, CPPageFileInfoDetails::IDD) , m_fn(fn) - , m_hIcon(nullptr) , m_type(ResStr(IDS_AG_NOT_KNOWN)) , m_size(ResStr(IDS_AG_NOT_KNOWN)) , m_time(ResStr(IDS_AG_NOT_KNOWN)) diff --git a/src/apps/mplayerc/PPageFileInfoDetails.h b/src/apps/mplayerc/PPageFileInfoDetails.h index 6a13f3aee2..126e58f040 100644 --- a/src/apps/mplayerc/PPageFileInfoDetails.h +++ b/src/apps/mplayerc/PPageFileInfoDetails.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2022 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -32,17 +32,17 @@ class CPPageFileInfoDetails : public CPropertyPage DECLARE_DYNAMIC(CPPageFileInfoDetails) private: - HICON m_hIcon; + HICON m_hIcon = nullptr; - CStatic m_icon; - CString m_fn; - CString m_type; - CString m_size; - CString m_time; - CString m_resolution; - CString m_created; + CStatic m_icon; + CString m_fn; + CString m_type; + CString m_size; + CString m_time; + CString m_resolution; + CString m_created; CString m_encodingText; - CEdit m_encoding; + CEdit m_encoding; void InitEncoding(IFilterGraph* pFG, IDvdInfo2* pDVDI); diff --git a/src/apps/mplayerc/PPageFileInfoRes.cpp b/src/apps/mplayerc/PPageFileInfoRes.cpp index 6131d119f1..7cd77706f3 100644 --- a/src/apps/mplayerc/PPageFileInfoRes.cpp +++ b/src/apps/mplayerc/PPageFileInfoRes.cpp @@ -31,7 +31,6 @@ CPPageFileInfoRes::CPPageFileInfoRes(const CString& fn, IFilterGraph* pFG) : CPPageBase(CPPageFileInfoRes::IDD, CPPageFileInfoRes::IDD) , m_fn(fn) , m_fullfn(fn) - , m_hIcon(nullptr) { m_fn.TrimRight('/'); int i = std::max(m_fn.ReverseFind('\\'), m_fn.ReverseFind('/')); diff --git a/src/apps/mplayerc/PPageFileInfoRes.h b/src/apps/mplayerc/PPageFileInfoRes.h index ee4aa8798f..0aaba6572b 100644 --- a/src/apps/mplayerc/PPageFileInfoRes.h +++ b/src/apps/mplayerc/PPageFileInfoRes.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -34,7 +34,7 @@ class CPPageFileInfoRes : public CPPageBase DECLARE_DYNAMIC(CPPageFileInfoRes) private: - HICON m_hIcon; + HICON m_hIcon = nullptr; std::list m_resources; CStatic m_icon; diff --git a/src/apps/mplayerc/PPageFileInfoSheet.cpp b/src/apps/mplayerc/PPageFileInfoSheet.cpp index 1fc0314039..ab6c4d6c20 100644 --- a/src/apps/mplayerc/PPageFileInfoSheet.cpp +++ b/src/apps/mplayerc/PPageFileInfoSheet.cpp @@ -39,9 +39,6 @@ CPPageFileInfoSheet::CPPageFileInfoSheet(const std::list& files, CMainF , m_details(files.front(), pMainFrame->m_pGB, pMainFrame->m_pCAP, pMainFrame->m_pDVDI) , m_res(files.front(), pMainFrame->m_pGB) , m_mi(files, (CDPI*)this) - , m_bNeedInit(TRUE) - , m_nMinCX(0) - , m_nMinCY(0) { if (!bOnlyMI) { AddPage(&m_details); diff --git a/src/apps/mplayerc/PPageFileInfoSheet.h b/src/apps/mplayerc/PPageFileInfoSheet.h index 5b3f675c06..f1d9c22c3b 100644 --- a/src/apps/mplayerc/PPageFileInfoSheet.h +++ b/src/apps/mplayerc/PPageFileInfoSheet.h @@ -75,11 +75,11 @@ class CPPageFileInfoSheet : public CMPCPropertySheet, public CDPI CButton m_Button_MI_SaveAs; CButton m_Button_MI_Clipboard; - BOOL m_bNeedInit; + BOOL m_bNeedInit = TRUE; CRect m_rCrt; CRect m_rWnd; - int m_nMinCX; - int m_nMinCY; + int m_nMinCX = 0; + int m_nMinCY = 0; public: CPPageFileInfoSheet(const std::list& files, CMainFrame* pMainFrame, CWnd* pParentWnd, const bool bOnlyMI = false); diff --git a/src/apps/mplayerc/PPageInterface.cpp b/src/apps/mplayerc/PPageInterface.cpp index 283e8527b1..7a48bb6043 100644 --- a/src/apps/mplayerc/PPageInterface.cpp +++ b/src/apps/mplayerc/PPageInterface.cpp @@ -29,26 +29,6 @@ IMPLEMENT_DYNAMIC(CPPageInterface, CPPageBase) CPPageInterface::CPPageInterface() : CPPageBase(CPPageInterface::IDD, CPPageInterface::IDD) - , m_bUseDarkTheme(FALSE) - , m_nThemeBrightness(0) - , m_nThemeRed(255) - , m_nThemeGreen(255) - , m_nThemeBlue(255) - , m_fUseTimeTooltip(TRUE) - , m_fSmartSeek(FALSE) - , m_bSmartSeekOnline(FALSE) - , m_fChapterMarker(FALSE) - , m_fFlybar(TRUE) - , m_fFontShadow(FALSE) - , m_fFontAA(TRUE) - , m_nOSDTransparent(0) - , m_OSDBorder(1) - , m_fUseWin7TaskBar(TRUE) - , m_clrFaceABGR(0x00ffffff) - , m_clrOutlineABGR(0x00868686) - , m_clrFontABGR(0x00E0E0E0) - , m_clrGrad1ABGR(0x00302820) - , m_clrGrad2ABGR(0x00302820) { } diff --git a/src/apps/mplayerc/PPageInterface.h b/src/apps/mplayerc/PPageInterface.h index fd9437240b..d059758145 100644 --- a/src/apps/mplayerc/PPageInterface.h +++ b/src/apps/mplayerc/PPageInterface.h @@ -36,21 +36,21 @@ class CPPageInterface : public CPPageBase virtual ~CPPageInterface(); enum { IDD = IDD_PPAGEINTERFACE }; - BOOL m_bUseDarkTheme; - int m_nThemeBrightness; - int m_nThemeRed; - int m_nThemeGreen; - int m_nThemeBlue; - BOOL m_fUseTimeTooltip; - BOOL m_fSmartSeek; - BOOL m_bSmartSeekOnline; - BOOL m_fChapterMarker; - BOOL m_fFlybar; - BOOL m_fFontShadow; - BOOL m_fFontAA; - int m_nOSDTransparent; - int m_OSDBorder; - BOOL m_fUseWin7TaskBar; + BOOL m_bUseDarkTheme = FALSE; + int m_nThemeBrightness = 0; + int m_nThemeRed = 255; + int m_nThemeGreen = 255; + int m_nThemeBlue = 255; + BOOL m_fUseTimeTooltip = TRUE; + BOOL m_fSmartSeek = FALSE; + BOOL m_bSmartSeekOnline = FALSE; + BOOL m_fChapterMarker = FALSE; + BOOL m_fFlybar = TRUE; + BOOL m_fFontShadow = FALSE; + BOOL m_fFontAA = TRUE; + int m_nOSDTransparent = 0; + int m_OSDBorder = 1; + BOOL m_fUseWin7TaskBar = TRUE; CString m_OSD_Font; CButton m_UseDarkThemeCtrl; @@ -70,11 +70,11 @@ class CPPageInterface : public CPPageBase CSpinButtonCtrl m_spOSDFontSize; CSpinButtonCtrl m_OSDBorderCtrl; - COLORREF m_clrFaceABGR; - COLORREF m_clrOutlineABGR; - COLORREF m_clrFontABGR; - COLORREF m_clrGrad1ABGR; - COLORREF m_clrGrad2ABGR; + COLORREF m_clrFaceABGR = 0x00ffffff; + COLORREF m_clrOutlineABGR = 0x00868686; + COLORREF m_clrFontABGR = 0x00E0E0E0; + COLORREF m_clrGrad1ABGR = 0x00302820; + COLORREF m_clrGrad2ABGR = 0x00302820; int m_nThemeBrightness_Old; int m_nThemeRed_Old; diff --git a/src/apps/mplayerc/PPageLogo.cpp b/src/apps/mplayerc/PPageLogo.cpp index 866062ab7f..42fd9a6880 100644 --- a/src/apps/mplayerc/PPageLogo.cpp +++ b/src/apps/mplayerc/PPageLogo.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -29,8 +29,6 @@ IMPLEMENT_DYNAMIC(CPPageLogo, CPPageBase) CPPageLogo::CPPageLogo() : CPPageBase(CPPageLogo::IDD, CPPageLogo::IDD) - , m_intext(0) - , m_logoidpos(0) { m_logoids.emplace_back(IDF_LOGO0); m_logoids.emplace_back(IDF_LOGO1); diff --git a/src/apps/mplayerc/PPageLogo.h b/src/apps/mplayerc/PPageLogo.h index 373a9700df..5a76809e9e 100644 --- a/src/apps/mplayerc/PPageLogo.h +++ b/src/apps/mplayerc/PPageLogo.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2020 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -29,8 +29,8 @@ class CPPageLogo : public CPPageBase private: std::vector m_logoids; - int m_logoidpos; - int m_intext; + int m_logoidpos = 0; + int m_intext = 0; CString m_logofn; CStatic m_logopreview; CString m_author; diff --git a/src/apps/mplayerc/PPagePlayer.cpp b/src/apps/mplayerc/PPagePlayer.cpp index a69cfe4603..cc30b3d2f2 100644 --- a/src/apps/mplayerc/PPagePlayer.cpp +++ b/src/apps/mplayerc/PPagePlayer.cpp @@ -29,19 +29,6 @@ IMPLEMENT_DYNAMIC(CPPagePlayer, CPPageBase) CPPagePlayer::CPPagePlayer() : CPPageBase(CPPagePlayer::IDD, CPPagePlayer::IDD) - , m_iMultipleInst(1) - , m_bKeepHistory(FALSE) - , m_bRememberDVDPos(FALSE) - , m_bRememberFilePos(FALSE) - , m_bSavePnSZoom(FALSE) - , m_bRememberPlaylistItems(FALSE) - , m_bRecentFilesShowUrlTitle(FALSE) - , m_bTrayIcon(FALSE) - , m_bShowOSD(FALSE) - , m_bOSDFileName(FALSE) - , m_bOSDSeekTime(FALSE) - , m_bHideCDROMsSubMenu(FALSE) - , m_bPriority(FALSE) { } diff --git a/src/apps/mplayerc/PPagePlayer.h b/src/apps/mplayerc/PPagePlayer.h index 9861e14bcb..1fdb2938a4 100644 --- a/src/apps/mplayerc/PPagePlayer.h +++ b/src/apps/mplayerc/PPagePlayer.h @@ -37,19 +37,21 @@ class CPPagePlayer : public CPPageBase int m_iCurSetsLocation = 0; int m_iSetsLocation = 0; - int m_iMultipleInst; - BOOL m_bKeepHistory; - BOOL m_bRememberDVDPos; - BOOL m_bRememberFilePos; - BOOL m_bSavePnSZoom; - BOOL m_bRememberPlaylistItems; - BOOL m_bRecentFilesShowUrlTitle; - BOOL m_bTrayIcon; - BOOL m_bShowOSD; - BOOL m_bOSDFileName; - BOOL m_bOSDSeekTime; - BOOL m_bHideCDROMsSubMenu; - BOOL m_bPriority; + int m_iMultipleInst = 1; + + BOOL m_bKeepHistory = FALSE; + BOOL m_bRememberDVDPos = FALSE; + BOOL m_bRememberFilePos = FALSE; + BOOL m_bSavePnSZoom = FALSE; + BOOL m_bRememberPlaylistItems = FALSE; + BOOL m_bRecentFilesShowUrlTitle = FALSE; + + BOOL m_bTrayIcon = FALSE; + BOOL m_bShowOSD = FALSE; + BOOL m_bOSDFileName = FALSE; + BOOL m_bOSDSeekTime = FALSE; + BOOL m_bHideCDROMsSubMenu = FALSE; + BOOL m_bPriority = FALSE; CComboBox m_cbTitleBarPrefix; CComboBox m_cbSeekBarText; diff --git a/src/apps/mplayerc/PPageSheet.cpp b/src/apps/mplayerc/PPageSheet.cpp index a5eb8bcf67..943fb748a4 100644 --- a/src/apps/mplayerc/PPageSheet.cpp +++ b/src/apps/mplayerc/PPageSheet.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -29,7 +29,6 @@ IMPLEMENT_DYNAMIC(CPPageSheet, CTreePropSheet) CPPageSheet::CPPageSheet(LPCWSTR pszCaption, CWnd* pParentWnd, UINT idPage) : CTreePropSheet(pszCaption, pParentWnd, 0) - , m_bLockPage(false) { int nWidth = 210; diff --git a/src/apps/mplayerc/PPageSheet.h b/src/apps/mplayerc/PPageSheet.h index 5ad73d02c1..a42c598b6e 100644 --- a/src/apps/mplayerc/PPageSheet.h +++ b/src/apps/mplayerc/PPageSheet.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -70,7 +70,7 @@ class CPPageSheet : public TreePropSheet::CTreePropSheet DECLARE_DYNAMIC(CPPageSheet) private: - bool m_bLockPage; + bool m_bLockPage = false; CPPagePlayer m_player; CPPageFormats m_formats; diff --git a/src/apps/mplayerc/PPageSubRend.cpp b/src/apps/mplayerc/PPageSubRend.cpp index 698dc33721..9fc073959d 100644 --- a/src/apps/mplayerc/PPageSubRend.cpp +++ b/src/apps/mplayerc/PPageSubRend.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2022 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -29,11 +29,6 @@ IMPLEMENT_DYNAMIC(CPPageSubRend, CPPageBase) CPPageSubRend::CPPageSubRend() : CPPageBase(CPPageSubRend::IDD, CPPageSubRend::IDD) - , m_fOverridePlacement(FALSE) - , m_nSPCSize(RS_SPCSIZE_DEF) - , m_bSPCAllowAnimationWhenBuffering(TRUE) - , m_bbSPAllowDropSubPic(TRUE) - , m_nSubDelayInterval(0) { } diff --git a/src/apps/mplayerc/PPageSubRend.h b/src/apps/mplayerc/PPageSubRend.h index ac246c0ac6..23482436b5 100644 --- a/src/apps/mplayerc/PPageSubRend.h +++ b/src/apps/mplayerc/PPageSubRend.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -35,17 +35,17 @@ class CPPageSubRend : public CPPageBase CPPageSubRend(); virtual ~CPPageSubRend(); - BOOL m_fOverridePlacement; + BOOL m_fOverridePlacement = FALSE; CIntEdit m_edtHorPos; CSpinButtonCtrl m_nHorPosCtrl; CIntEdit m_edtVerPos; CSpinButtonCtrl m_nVerPosCtrl; - int m_nSPCSize; + int m_nSPCSize = RS_SPCSIZE_DEF; CSpinButtonCtrl m_nSPCSizeCtrl; CComboBox m_spmaxres; - BOOL m_bSPCAllowAnimationWhenBuffering; - BOOL m_bbSPAllowDropSubPic; - int m_nSubDelayInterval; + BOOL m_bSPCAllowAnimationWhenBuffering = TRUE; + BOOL m_bbSPAllowDropSubPic = TRUE; + int m_nSubDelayInterval = 0; enum { IDD = IDD_PPAGESUBRENDERING }; diff --git a/src/apps/mplayerc/PPageSubStyle.cpp b/src/apps/mplayerc/PPageSubStyle.cpp index 24ea9bd198..26243cc263 100644 --- a/src/apps/mplayerc/PPageSubStyle.cpp +++ b/src/apps/mplayerc/PPageSubStyle.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -28,12 +28,6 @@ IMPLEMENT_DYNAMIC(CPPageSubStyle, CPPageBase) CPPageSubStyle::CPPageSubStyle() : CPPageBase(CPPageSubStyle::IDD, CPPageSubStyle::IDD) - , m_iCharset(0) - , m_borderstyle(0) - , m_screenalignment(0) - , m_linkalphasliders(FALSE) - , m_relativeTo(FALSE) - , m_bUseDefaultStyle(TRUE) , m_stss(&AfxGetAppSettings().subdefstyle) , m_stss_init(AfxGetAppSettings().subdefstyle) { diff --git a/src/apps/mplayerc/PPageSubStyle.h b/src/apps/mplayerc/PPageSubStyle.h index 635be95524..a660060f01 100644 --- a/src/apps/mplayerc/PPageSubStyle.h +++ b/src/apps/mplayerc/PPageSubStyle.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -34,7 +34,7 @@ class CPPageSubStyle : public CPPageBase CString m_title; STSStyle* m_stss; STSStyle m_stss_init; - BOOL m_bUseDefaultStyle; + BOOL m_bUseDefaultStyle = TRUE; void AskColor(int i); @@ -49,7 +49,7 @@ class CPPageSubStyle : public CPPageBase enum { IDD = IDD_PPAGESUBSTYLE }; CButton m_font; - int m_iCharset; + int m_iCharset = 0; CComboBox m_charset; CFloatEdit m_spacing; CIntEdit m_angle; @@ -58,10 +58,10 @@ class CPPageSubStyle : public CPPageBase CSpinButtonCtrl m_scalexspin; CIntEdit m_scaley; CSpinButtonCtrl m_scaleyspin; - int m_borderstyle; + int m_borderstyle = 0; CFloatEdit m_borderwidth; CFloatEdit m_shadowdepth; - int m_screenalignment; + int m_screenalignment = 0; CIntEdit m_marginleft; CIntEdit m_marginright; CIntEdit m_margintop; @@ -72,8 +72,8 @@ class CPPageSubStyle : public CPPageBase CSpinButtonCtrl m_marginbottomspin; int m_alpha[4]; CSliderCtrl m_alphasliders[4]; - BOOL m_linkalphasliders; - BOOL m_relativeTo; + BOOL m_linkalphasliders = FALSE; + BOOL m_relativeTo = FALSE; protected: virtual void DoDataExchange(CDataExchange* pDX); diff --git a/src/apps/mplayerc/PPageSubtitles.cpp b/src/apps/mplayerc/PPageSubtitles.cpp index 10a9694776..417a6c111e 100644 --- a/src/apps/mplayerc/PPageSubtitles.cpp +++ b/src/apps/mplayerc/PPageSubtitles.cpp @@ -1,5 +1,5 @@ /* - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -29,12 +29,7 @@ IMPLEMENT_DYNAMIC(CPPageSubtitles, CPPageBase) CPPageSubtitles::CPPageSubtitles() : CPPageBase(CPPageSubtitles::IDD, CPPageSubtitles::IDD) - , m_fPrioritizeExternalSubtitles(FALSE) - , m_fDisableInternalSubtitles(FALSE) - , m_fAutoReloadExtSubtitles(FALSE) - , m_fUseSybresync(FALSE) { - } CPPageSubtitles::~CPPageSubtitles() diff --git a/src/apps/mplayerc/PPageSubtitles.h b/src/apps/mplayerc/PPageSubtitles.h index 3206195f7e..9de3b55cc1 100644 --- a/src/apps/mplayerc/PPageSubtitles.h +++ b/src/apps/mplayerc/PPageSubtitles.h @@ -1,5 +1,5 @@ /* - * (C) 2006-2015 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -35,10 +35,10 @@ class CPPageSubtitles : public CPPageBase enum { IDD = IDD_PPAGESUBTITLES }; CComboBox m_cbSubtitleRenderer; - BOOL m_fPrioritizeExternalSubtitles; - BOOL m_fDisableInternalSubtitles; - BOOL m_fAutoReloadExtSubtitles; - BOOL m_fUseSybresync; + BOOL m_fPrioritizeExternalSubtitles = FALSE; + BOOL m_fDisableInternalSubtitles = FALSE; + BOOL m_fAutoReloadExtSubtitles = FALSE; + BOOL m_fUseSybresync = FALSE; CString m_szAutoloadPaths; protected: diff --git a/src/apps/mplayerc/PPageSync.cpp b/src/apps/mplayerc/PPageSync.cpp index c410e066bf..778fb1b17a 100644 --- a/src/apps/mplayerc/PPageSync.cpp +++ b/src/apps/mplayerc/PPageSync.cpp @@ -1,5 +1,5 @@ /* - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -29,7 +29,6 @@ IMPLEMENT_DYNAMIC(CPPageSync, CPPageBase) CPPageSync::CPPageSync() : CPPageBase(CPPageSync::IDD, CPPageSync::IDD) - , m_iSyncMode(0) { } diff --git a/src/apps/mplayerc/PPageSync.h b/src/apps/mplayerc/PPageSync.h index e08ce3bfbb..089bce3cdb 100644 --- a/src/apps/mplayerc/PPageSync.h +++ b/src/apps/mplayerc/PPageSync.h @@ -1,5 +1,5 @@ /* - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -42,7 +42,7 @@ class CPPageSync: public CPPageBase CButton m_chkFlushGPUAfterPresent; CButton m_chkFlushGPUWait; - int m_iSyncMode; + int m_iSyncMode = 0; CFloatEdit m_edtCycleDelta; CIntEdit m_edtTargetSyncOffset; diff --git a/src/apps/mplayerc/PPageVideo.cpp b/src/apps/mplayerc/PPageVideo.cpp index f46782a398..c260482e7a 100644 --- a/src/apps/mplayerc/PPageVideo.cpp +++ b/src/apps/mplayerc/PPageVideo.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -54,12 +54,6 @@ static HRESULT IsRendererAvailable(int VideoRendererType) IMPLEMENT_DYNAMIC(CPPageVideo, CPPageBase) CPPageVideo::CPPageVideo() : CPPageBase(CPPageVideo::IDD, CPPageVideo::IDD) - , m_iVideoRendererType(VIDRNDT_EVR) - , m_iVideoRendererType_store(VIDRNDT_EVR) - , m_bResetDevice(FALSE) - , m_iEvrBuffers(RS_EVRBUFFERS_DEF) - , m_bD3D9RenderDevice(FALSE) - , m_iD3D9RenderDevice(-1) { } diff --git a/src/apps/mplayerc/PPageVideo.h b/src/apps/mplayerc/PPageVideo.h index b9f7a0aa41..d2b1aef636 100644 --- a/src/apps/mplayerc/PPageVideo.h +++ b/src/apps/mplayerc/PPageVideo.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -49,15 +49,15 @@ class CPPageVideo : public CPPageBase CButton m_chkNoSmallUpscale; CButton m_chkNoSmallDownscale; - int m_iEvrBuffers; + int m_iEvrBuffers = RS_EVRBUFFERS_DEF; CSpinButtonCtrl m_spnEvrBuffers; - int m_iVideoRendererType_store; - int m_iVideoRendererType; + int m_iVideoRendererType_store = VIDRNDT_EVR; + int m_iVideoRendererType = VIDRNDT_EVR; - BOOL m_bD3D9RenderDevice; - int m_iD3D9RenderDevice; - BOOL m_bResetDevice; + BOOL m_bD3D9RenderDevice = FALSE; + int m_iD3D9RenderDevice = -1; + BOOL m_bResetDevice = FALSE; public: CPPageVideo(); diff --git a/src/apps/mplayerc/PPageWebServer.cpp b/src/apps/mplayerc/PPageWebServer.cpp index 699a427f40..8bb4ea5f52 100644 --- a/src/apps/mplayerc/PPageWebServer.cpp +++ b/src/apps/mplayerc/PPageWebServer.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2021 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -31,15 +31,6 @@ IMPLEMENT_DYNAMIC(CPPageWebServer, CPPageBase) CPPageWebServer::CPPageWebServer() : CPPageBase(CPPageWebServer::IDD, CPPageWebServer::IDD) - , m_fEnableWebServer(FALSE) - , m_nWebServerPort(APP_WEBSRVPORT_DEF) - , m_nWebServerQuality(APP_WEBSRVQUALITY_DEF) - , m_launch(L"http://localhost:13579/") - , m_fWebServerPrintDebugInfo(FALSE) - , m_fWebServerUseCompression(FALSE) - , m_fWebRoot(FALSE) - , m_fWebServerLocalhostOnly(FALSE) - , m_bWebUIEnablePreview(FALSE) { } diff --git a/src/apps/mplayerc/PPageWebServer.h b/src/apps/mplayerc/PPageWebServer.h index 1bd2c64bad..0f16a99db8 100644 --- a/src/apps/mplayerc/PPageWebServer.h +++ b/src/apps/mplayerc/PPageWebServer.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2020 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -41,16 +41,16 @@ class CPPageWebServer : public CPPageBase virtual ~CPPageWebServer(); enum { IDD = IDD_PPAGEWEBSERVER }; - BOOL m_fEnableWebServer; - int m_nWebServerPort; - int m_nWebServerQuality; + BOOL m_fEnableWebServer = FALSE; + int m_nWebServerPort = APP_WEBSRVPORT_DEF; + int m_nWebServerQuality = APP_WEBSRVQUALITY_DEF; CSpinButtonCtrl m_nWebServerQualityCtrl; - CStaticLink m_launch; - BOOL m_fWebServerPrintDebugInfo; - BOOL m_fWebServerUseCompression; - BOOL m_fWebServerLocalhostOnly; - BOOL m_bWebUIEnablePreview; - BOOL m_fWebRoot; + CStaticLink m_launch = L"http://localhost:13579/"; + BOOL m_fWebServerPrintDebugInfo = FALSE; + BOOL m_fWebServerUseCompression = FALSE; + BOOL m_fWebServerLocalhostOnly = FALSE; + BOOL m_bWebUIEnablePreview = FALSE; + BOOL m_fWebRoot = FALSE; CString m_WebRoot; CString m_WebServerCGI; CString m_WebDefIndex; diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp index e9831381ea..ed9369ab7c 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.cpp +++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp @@ -799,13 +799,6 @@ IMPLEMENT_DYNAMIC(CPlayerPlaylistBar, CPlayerBar) CPlayerPlaylistBar::CPlayerPlaylistBar(CMainFrame* pMainFrame) : m_pMainFrame(pMainFrame) , m_list(0) - , m_nTimeColWidth(0) - , m_bDragging(FALSE) - , m_bHiddenDueToFullscreen(false) - , m_bVisible(false) - , m_cntOffset(0) - , m_iTFontSize(0) - , m_nSearchBarHeight(20) { CAppSettings& s = AfxGetAppSettings(); m_bUseDarkTheme = s.bUseDarkTheme; diff --git a/src/apps/mplayerc/PlayerPlaylistBar.h b/src/apps/mplayerc/PlayerPlaylistBar.h index cc0e1f44f8..75c6a674da 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.h +++ b/src/apps/mplayerc/PlayerPlaylistBar.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -124,7 +124,7 @@ class CPlayerPlaylistBar : public CPlayerBar CImageList m_fakeImageList; CPlayerListCtrl m_list; - int m_nTimeColWidth; + int m_nTimeColWidth = 0; void ResizeListColumn(); void AddItem(std::list& fns, CSubtitleItemList* subs); @@ -145,7 +145,7 @@ class CPlayerPlaylistBar : public CPlayerBar POSITION FindPos(int i); CImageList* m_pDragImage; - BOOL m_bDragging; + BOOL m_bDragging = FALSE; int m_nDragIndex; // dragged item for which the mouse is dragged std::vector m_DragIndexes; // all selected dragged items int m_nDropIndex; // the position where dragged items will be moved @@ -154,9 +154,9 @@ class CPlayerPlaylistBar : public CPlayerBar void DropItemOnList(); - bool m_bHiddenDueToFullscreen; + bool m_bHiddenDueToFullscreen = false; - bool m_bVisible; + bool m_bVisible = false; CFont m_font; void ScaleFontInternal(); @@ -249,15 +249,15 @@ class CPlayerPlaylistBar : public CPlayerBar bool bTMenuPopup = false; CRect m_rcTPage; - size_t m_cntOffset; + size_t m_cntOffset = 0; - int m_nSearchBarHeight; + int m_nSearchBarHeight = 20; CColorEdit m_REdit; int TGetFirstVisible(); int TGetOffset(); int TGetPathType(const CString& path) const; - int m_iTFontSize; + int m_iTFontSize = 0; bool TNavigate(); bool TSelectFolder(CString path); int TGetFocusedElement() const; diff --git a/src/apps/mplayerc/ShockwaveGraph.cpp b/src/apps/mplayerc/ShockwaveGraph.cpp index 1925ad1546..465b32e097 100644 --- a/src/apps/mplayerc/ShockwaveGraph.cpp +++ b/src/apps/mplayerc/ShockwaveGraph.cpp @@ -32,8 +32,6 @@ using namespace DSObjects; CShockwaveGraph::CShockwaveGraph(HWND hParent, HRESULT& hr) : m_fs(State_Stopped) - , vsize(0, 0) - , m_fInitialVolume(1) { hr = S_OK; diff --git a/src/apps/mplayerc/ShockwaveGraph.h b/src/apps/mplayerc/ShockwaveGraph.h index a76d177a79..8d86030e38 100644 --- a/src/apps/mplayerc/ShockwaveGraph.h +++ b/src/apps/mplayerc/ShockwaveGraph.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2016 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -36,9 +36,9 @@ namespace DSObjects FILTER_STATE m_fs; - CSize vsize; + CSize vsize = { 0, 0 }; CComPtr m_pSimpleVolume; - float m_fInitialVolume; + float m_fInitialVolume = 1; public: CShockwaveGraph(HWND hParent, HRESULT& hr); diff --git a/src/apps/mplayerc/TunerScanDlg.cpp b/src/apps/mplayerc/TunerScanDlg.cpp index a98aeb0c81..eb5aa404d9 100644 --- a/src/apps/mplayerc/TunerScanDlg.cpp +++ b/src/apps/mplayerc/TunerScanDlg.cpp @@ -1,5 +1,5 @@ /* - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -37,7 +37,6 @@ IMPLEMENT_DYNAMIC(CTunerScanDlg, CDialog) CTunerScanDlg::CTunerScanDlg(CWnd* pParent /*=nullptr*/) : CDialog(CTunerScanDlg::IDD, pParent) - , m_bInProgress(false) { CAppSettings& s = AfxGetAppSettings(); diff --git a/src/apps/mplayerc/TunerScanDlg.h b/src/apps/mplayerc/TunerScanDlg.h index f7341472f7..0744f0a562 100644 --- a/src/apps/mplayerc/TunerScanDlg.h +++ b/src/apps/mplayerc/TunerScanDlg.h @@ -1,5 +1,5 @@ /* - * (C) 2006-2017 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -62,7 +62,7 @@ class CTunerScanDlg : public CDialog CProgressCtrl m_Strength; CProgressCtrl m_Quality; CListCtrl m_ChannelList; - bool m_bInProgress; + bool m_bInProgress = false; afx_msg LRESULT OnScanProgress(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnScanEnd(WPARAM wParam, LPARAM lParam); From 2b6f83b23618ab53fd0d0fb159b81d6426121a49 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Sun, 23 Jun 2024 09:48:15 +1000 Subject: [PATCH 019/102] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=B7=D0=B0=D0=BF?= =?UTF-8?q?=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0=D0=BD=D0=B8=D1=8F/=D0=B2=D0=BE?= =?UTF-8?q?=D1=81=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=B7=D0=B8=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D1=85=20DVD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/MainFrm.cpp | 35 +++++++++++++++++++++-------------- src/apps/mplayerc/MainFrm.h | 3 ++- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index 80ac434ae5..ae898d1e30 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -3242,7 +3242,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) OpenDVDData* pDVDData = dynamic_cast(m_lastOMD.get()); ASSERT(pDVDData); - CString Domain('-'); + CString Domain(L'-'); switch (m_iDVDDomain) { case DVD_DOMAIN_FirstPlay: @@ -3343,19 +3343,21 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) // if the playback is reinitialized so we clear the saved state pDVDData->pDvdState.Release(); } - else if (s.bKeepHistory && s.bRememberDVDPos) { + else if (s.bKeepHistory && s.bRememberDVDPos && m_SessionInfo.DVDTitle > 0) { // restore DVD-Video position - hr = m_pDVDC->PlayTitle(m_SessionInfo.DVDTitle, DVD_CMD_FLAG_Flush, nullptr); + hr = m_pDVDC->PlayTitle(m_SessionInfo.DVDTitle, DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); if (SUCCEEDED(hr)) { - hr = m_pDVDC->Resume(DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); - if (SUCCEEDED(hr)) { - hr = m_pDVDC->PlayAtTime(&m_SessionInfo.DVDTimecode, DVD_CMD_FLAG_Flush, nullptr); - } else { - hr = m_pDVDC->PlayChapterInTitle(m_SessionInfo.DVDTitle, 1, DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); + if (m_SessionInfo.DVDTimecode.bSeconds > 0 || m_SessionInfo.DVDTimecode.bMinutes > 0 || m_SessionInfo.DVDTimecode.bHours > 0 || m_SessionInfo.DVDTimecode.bFrames > 0) { + hr = m_pDVDC->Resume(DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); if (SUCCEEDED(hr)) { hr = m_pDVDC->PlayAtTime(&m_SessionInfo.DVDTimecode, DVD_CMD_FLAG_Flush, nullptr); - if (FAILED(hr)) { - hr = m_pDVDC->PlayAtTimeInTitle(m_SessionInfo.DVDTitle, &m_SessionInfo.DVDTimecode, DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); + } else { + hr = m_pDVDC->PlayChapterInTitle(m_SessionInfo.DVDTitle, 1, DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); + if (SUCCEEDED(hr)) { + hr = m_pDVDC->PlayAtTime(&m_SessionInfo.DVDTimecode, DVD_CMD_FLAG_Flush, nullptr); + if (FAILED(hr)) { + hr = m_pDVDC->PlayAtTimeInTitle(m_SessionInfo.DVDTitle, &m_SessionInfo.DVDTimecode, DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); + } } } } @@ -3392,6 +3394,8 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam) m_OSD.DebugMessage(L"%s", Domain); } + m_iDVDTitleForHistory = m_iDVDTitle; + if (!m_bValidDVDOpen) { m_bValidDVDOpen = true; m_pDVDC->ShowMenu(DVD_MENU_Title, DVD_CMD_FLAG_Block | DVD_CMD_FLAG_Flush, nullptr); @@ -10266,7 +10270,7 @@ void CMainFrame::AddFavorite(bool bDisplayMessage/* = false*/, bool bShowDialog/ } else if (GetPlaybackMode() == PM_DVD) { // RememberPos - if (s.bFavRememberPos) { + if (s.bFavRememberPos && m_iDVDTitleForHistory > 0) { CDVDStateStream stream; stream.AddRef(); CComPtr pStateData; @@ -10276,7 +10280,7 @@ void CMainFrame::AddFavorite(bool bDisplayMessage/* = false*/, bool bShowDialog/ && SUCCEEDED(OleSaveToStream(pPersistStream, (IStream*)&stream))) { sesInfo.DVDState = stream.m_data; } - sesInfo.DVDTitle = m_iDVDTitle; + sesInfo.DVDTitle = m_iDVDTitleForHistory; sesInfo.DVDTimecode = m_SessionInfo.DVDTimecode; } AfxGetMyApp()->m_FavoritesFile.AppendFavorite(sesInfo); @@ -14572,6 +14576,9 @@ void CMainFrame::CloseMediaPrivate() m_bIsLiveOnline = false; + m_iDVDTitle = 0; + m_iDVDTitleForHistory = 0; + DLog(L"CMainFrame::CloseMediaPrivate() : end"); } @@ -20873,8 +20880,8 @@ void CMainFrame::SaveHistory() } historyFile.SaveSessionInfo(m_SessionInfo); } else if (GetPlaybackMode() == PM_DVD && m_SessionInfo.DVDId) { - if (s.bRememberDVDPos) { - m_SessionInfo.DVDTitle = m_iDVDTitle; + if (s.bRememberDVDPos && m_iDVDTitleForHistory > 0) { + m_SessionInfo.DVDTitle = m_iDVDTitleForHistory; CDVDStateStream stream; stream.AddRef(); diff --git a/src/apps/mplayerc/MainFrm.h b/src/apps/mplayerc/MainFrm.h index dcf5cf8770..d17ba9fdcd 100644 --- a/src/apps/mplayerc/MainFrm.h +++ b/src/apps/mplayerc/MainFrm.h @@ -487,7 +487,8 @@ class CMainFrame : public CFrameWnd, public CDropTarget, public CDPI SessionInfo m_SessionInfo; DVD_DOMAIN m_iDVDDomain; - DWORD m_iDVDTitle; + DWORD m_iDVDTitle = 0; + DWORD m_iDVDTitleForHistory = 0; bool m_bDVDRestorePos = false; std::vector m_RecentPaths; // used in SetupRecentFilesSubMenu and OnRecentFile std::list m_FavFiles; // used in SetupFavoritesSubMenu and OnFavoritesFile From 24f8e60d4ffb8441de8980fb486254d6d8959998 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 23 Jun 2024 06:51:55 +0300 Subject: [PATCH 020/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20ffmpeg=20git-n7.1-dev-1509-g0c0e7ec8?= =?UTF-8?q?1e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- src/ExtLib/ffmpeg/LICENSE.md | 129 + src/ExtLib/ffmpeg/MAINTAINERS | 596 ---- src/ExtLib/ffmpeg/README.md | 46 + src/ExtLib/ffmpeg/ffmpeg.mak | 1 + src/ExtLib/ffmpeg/libavcodec/aac.h | 16 + src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c | 18 +- src/ExtLib/ffmpeg/libavcodec/aac/aacdec.h | 3 +- src/ExtLib/ffmpeg/libavcodec/aac/aacdec_ac.h | 2 +- .../ffmpeg/libavcodec/aac/aacdec_usac.c | 58 +- src/ExtLib/ffmpeg/libavcodec/allcodecs.c | 1 + src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c | 21 +- src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c | 46 + src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h | 31 +- src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c | 151 +- .../ffmpeg/libavcodec/error_resilience.c | 8 +- src/ExtLib/ffmpeg/libavcodec/h261.h | 9 +- src/ExtLib/ffmpeg/libavcodec/h261data.c | 14 +- src/ExtLib/ffmpeg/libavcodec/h261dec.c | 84 +- src/ExtLib/ffmpeg/libavcodec/h263dec.c | 16 +- src/ExtLib/ffmpeg/libavcodec/h263enc.h | 30 +- src/ExtLib/ffmpeg/libavcodec/h264_parse.h | 2 +- src/ExtLib/ffmpeg/libavcodec/h264dec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/h264dec.h | 8 + src/ExtLib/ffmpeg/libavcodec/ituh263dec.c | 55 +- src/ExtLib/ffmpeg/libavcodec/jpeg2000dec.c | 11 +- src/ExtLib/ffmpeg/libavcodec/mathops.h | 2 - src/ExtLib/ffmpeg/libavcodec/me_cmp.c | 122 +- src/ExtLib/ffmpeg/libavcodec/me_cmp.h | 16 +- src/ExtLib/ffmpeg/libavcodec/motion_est.c | 135 +- src/ExtLib/ffmpeg/libavcodec/motion_est.h | 17 +- .../ffmpeg/libavcodec/motion_est_template.c | 60 +- src/ExtLib/ffmpeg/libavcodec/mpeg12.c | 42 +- src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c | 48 +- src/ExtLib/ffmpeg/libavcodec/mpeg12dec.h | 2 + src/ExtLib/ffmpeg/libavcodec/mpeg4video.c | 6 +- .../ffmpeg/libavcodec/mpeg4video_parser.c | 2 +- src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c | 117 +- src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.h | 2 + src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c | 4 +- src/ExtLib/ffmpeg/libavcodec/mpeg_er.c | 13 +- src/ExtLib/ffmpeg/libavcodec/mpegpicture.h | 11 +- src/ExtLib/ffmpeg/libavcodec/mpegutils.c | 60 +- src/ExtLib/ffmpeg/libavcodec/mpegutils.h | 33 +- src/ExtLib/ffmpeg/libavcodec/mpegvideo.c | 65 +- src/ExtLib/ffmpeg/libavcodec/mpegvideo.h | 9 +- src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c | 50 +- .../libavcodec/mpv_reconstruct_mb_template.c | 50 +- src/ExtLib/ffmpeg/libavcodec/msmpeg4.c | 4 +- src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c | 8 +- src/ExtLib/ffmpeg/libavcodec/rv10.c | 29 +- src/ExtLib/ffmpeg/libavcodec/rv34.c | 18 +- src/ExtLib/ffmpeg/libavcodec/vc1.c | 18 +- src/ExtLib/ffmpeg/libavcodec/vc1_block.c | 6 +- src/ExtLib/ffmpeg/libavcodec/version.h | 2 +- src/ExtLib/ffmpeg/libavcodec/wmv2dec.c | 12 +- .../ffmpeg/libavcodec/x86/me_cmp_init.c | 2 +- .../libavutil/ambient_viewing_environment.c | 10 + src/ExtLib/ffmpeg/libavutil/dovi_meta.h | 2 + src/ExtLib/ffmpeg/libavutil/intreadwrite.h | 4 +- .../libavutil/mastering_display_metadata.c | 16 +- src/ExtLib/ffmpeg/libavutil/stereo3d.c | 66 +- src/ExtLib/ffmpeg/libavutil/stereo3d.h | 78 + src/ExtLib/ffmpeg/libavutil/timer.h | 4 +- src/ExtLib/ffmpeg/libavutil/version.h | 2 +- .../ffmpeg/libswscale/swscale_internal.h | 2 + src/ExtLib/ffmpeg/libswscale/utils.c | 6 +- .../ffmpeg/libswscale/x86/rgb2rgb_template.c | 2453 ----------------- src/ExtLib/ffmpeg/libswscale/x86/swscale.c | 35 + 70 files changed, 1173 insertions(+), 3832 deletions(-) create mode 100644 src/ExtLib/ffmpeg/LICENSE.md delete mode 100644 src/ExtLib/ffmpeg/MAINTAINERS create mode 100644 src/ExtLib/ffmpeg/README.md delete mode 100644 src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb_template.c diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 255f939492..d1d32e07ef 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -7,7 +7,7 @@ Обновлен японский перевод (автор tsubasanouta). Обновлены библиотеки: - ffmpeg git-n7.1-dev-1370-gbe2cabce32; + ffmpeg git-n7.1-dev-1509-g0c0e7ec81e; vvdec git-v2.3.0-20-gc26979f. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 3107ea3e0e..f8d4bf1718 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -7,7 +7,7 @@ Updated Korean translation (by Hackjjang). Updated Japanese translation (by tsubasanouta). Updated libraries: - ffmpeg git-n7.1-dev-1370-gbe2cabce32; + ffmpeg git-n7.1-dev-1509-g0c0e7ec81e; vvdec git-v2.3.0-20-gc26979f. diff --git a/src/ExtLib/ffmpeg/LICENSE.md b/src/ExtLib/ffmpeg/LICENSE.md new file mode 100644 index 0000000000..613070e1b6 --- /dev/null +++ b/src/ExtLib/ffmpeg/LICENSE.md @@ -0,0 +1,129 @@ +# License + +Most files in FFmpeg are under the GNU Lesser General Public License version 2.1 +or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other +files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to +FFmpeg. + +Some optional parts of FFmpeg are licensed under the GNU General Public License +version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of +these parts are used by default, you have to explicitly pass `--enable-gpl` to +configure to activate them. In this case, FFmpeg's license changes to GPL v2+. + +Specifically, the GPL parts of FFmpeg are: + +- libpostproc +- optional x86 optimization in the files + - `libavcodec/x86/flac_dsp_gpl.asm` + - `libavcodec/x86/idct_mmx.c` + - `libavfilter/x86/vf_removegrain.asm` +- the following building and testing tools + - `compat/solaris/make_sunver.pl` + - `doc/t2h.pm` + - `doc/texi2pod.pl` + - `libswresample/tests/swresample.c` + - `tests/checkasm/*` + - `tests/tiny_ssim.c` +- the following filters in libavfilter: + - `signature_lookup.c` + - `vf_blackframe.c` + - `vf_boxblur.c` + - `vf_colormatrix.c` + - `vf_cover_rect.c` + - `vf_cropdetect.c` + - `vf_delogo.c` + - `vf_eq.c` + - `vf_find_rect.c` + - `vf_fspp.c` + - `vf_histeq.c` + - `vf_hqdn3d.c` + - `vf_kerndeint.c` + - `vf_lensfun.c` (GPL version 3 or later) + - `vf_mcdeint.c` + - `vf_mpdecimate.c` + - `vf_nnedi.c` + - `vf_owdenoise.c` + - `vf_perspective.c` + - `vf_phase.c` + - `vf_pp.c` + - `vf_pp7.c` + - `vf_pullup.c` + - `vf_repeatfields.c` + - `vf_sab.c` + - `vf_signature.c` + - `vf_smartblur.c` + - `vf_spp.c` + - `vf_stereo3d.c` + - `vf_super2xsai.c` + - `vf_tinterlace.c` + - `vf_uspp.c` + - `vf_vaguedenoiser.c` + - `vsrc_mptestsrc.c` + +Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then +the configure parameter `--enable-version3` will activate this licensing option +for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts, +`COPYING.GPLv3` to learn the exact legal terms that apply in this case. + +There are a handful of files under other licensing terms, namely: + +* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and + `libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for + licensing details. Specifically note that you must credit the IJG in the + documentation accompanying your program if you only distribute executables. + You must also indicate any changes including additions and deletions to + those three files in the documentation. +* `tests/reference.pnm` is under the expat license. + + +## External libraries + +FFmpeg can be combined with a number of external libraries, which sometimes +affect the licensing of binaries resulting from the combination. + +### Compatible libraries + +The following libraries are under GPL version 2: +- avisynth +- frei0r +- libcdio +- libdavs2 +- librubberband +- libvidstab +- libx264 +- libx265 +- libxavs +- libxavs2 +- libxvid + +When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by +passing `--enable-gpl` to configure. + +The following libraries are under LGPL version 3: +- gmp +- libaribb24 +- liblensfun + +When combining them with FFmpeg, use the configure option `--enable-version3` to +upgrade FFmpeg to the LGPL v3. + +The VMAF, mbedTLS, RK MPI, OpenCORE and VisualOn libraries are under the Apache License +2.0. That license is incompatible with the LGPL v2.1 and the GPL v2, but not with +version 3 of those licenses. So to combine these libraries with FFmpeg, the +license version needs to be upgraded by passing `--enable-version3` to configure. + +The smbclient library is under the GPL v3, to combine it with FFmpeg, +the options `--enable-gpl` and `--enable-version3` have to be passed to +configure to upgrade FFmpeg to the GPL v3. + +### Incompatible libraries + +There are certain libraries you can combine with FFmpeg whose licenses are not +compatible with the GPL and/or the LGPL. If you wish to enable these +libraries, even in circumstances that their license may be incompatible, pass +`--enable-nonfree` to configure. This will cause the resulting binary to be +unredistributable. + +The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are +incompatible with the GPLv2 and v3. To the best of our knowledge, they are +compatible with the LGPL. diff --git a/src/ExtLib/ffmpeg/MAINTAINERS b/src/ExtLib/ffmpeg/MAINTAINERS deleted file mode 100644 index 41a98744ad..0000000000 --- a/src/ExtLib/ffmpeg/MAINTAINERS +++ /dev/null @@ -1,596 +0,0 @@ -FFmpeg maintainers -================== - -Below is a list of the people maintaining different parts of the -FFmpeg code. - -Please try to keep entries where you are the maintainer up to date! - -Names in () mean that the maintainer currently has no time to maintain the code. -A (CC
) after the name means that the maintainer prefers to be CC-ed on -patches and related discussions. - - -Applications -============ - -ffmpeg: - ffmpeg.c Michael Niedermayer, Anton Khirnov - -ffplay: - ffplay.c Marton Balint - -ffprobe: - ffprobe.c Stefano Sabatini - -Commandline utility code: - cmdutils.c, cmdutils.h Michael Niedermayer - -QuickTime faststart: - tools/qt-faststart.c Baptiste Coudurier - - -Miscellaneous Areas -=================== - -documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Gyan Doshi -project server day to day operations Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov -project server emergencies Árpád Gereöffy, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov -presets Robert Swain -metadata subsystem Aurelien Jacobs -release management Michael Niedermayer -API tests Ludmila Glinskih - - -Communication -============= - -website Deby Barbara Lepage -fate.ffmpeg.org Timothy Gu -Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos -Patchwork Andriy Gelman -mailing lists Baptiste Coudurier -Twitter Reynaldo H. Verdejo Pinochet -Launchpad Timothy Gu -ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, rcombs, wm4 - - -libavutil -========= - -External Interfaces: - libavutil/avutil.h Michael Niedermayer -Internal Interfaces: - libavutil/common.h Michael Niedermayer - -Other: - aes_ctr.c, aes_ctr.h Eran Kornblau - bprint Nicolas George - bswap.h - des Reimar Doeffinger - dynarray.h Nicolas George - eval.c, eval.h Michael Niedermayer - float_dsp Loren Merritt - hash Reimar Doeffinger - hwcontext_cuda* Timo Rothenpieler - hwcontext_vulkan* Lynne - intfloat* Michael Niedermayer - integer.c, integer.h Michael Niedermayer - lzo Reimar Doeffinger - mathematics.c, mathematics.h Michael Niedermayer - mem.c, mem.h Michael Niedermayer - opencl.c, opencl.h Wei Gao - opt.c, opt.h Michael Niedermayer - rational.c, rational.h Michael Niedermayer - rc4 Reimar Doeffinger - ripemd.c, ripemd.h James Almer - tx* Lynne - - -libavcodec -========== - -Generic Parts: - External Interfaces: - avcodec.h Michael Niedermayer - utility code: - utils.c Michael Niedermayer - audio and video frame extraction: - parser.c Michael Niedermayer - bitstream reading: - bitstream.c, bitstream.h Michael Niedermayer - CABAC: - cabac.h, cabac.c Michael Niedermayer - codec names: - codec_names.sh Nicolas George - DSP utilities: - dsputils.c, dsputils.h Michael Niedermayer - entropy coding: - rangecoder.c, rangecoder.h Michael Niedermayer - lzw.* Michael Niedermayer - floating point AAN DCT: - faandct.c, faandct.h Michael Niedermayer - Golomb coding: - golomb.c, golomb.h Michael Niedermayer - motion estimation: - motion* Michael Niedermayer - rate control: - ratecontrol.c Michael Niedermayer - simple IDCT: - simple_idct.c, simple_idct.h Michael Niedermayer - postprocessing: - libpostproc/* Michael Niedermayer - table generation: - tableprint.c, tableprint.h Reimar Doeffinger - fixed point FFT: - fft* Zeljko Lukac - Text Subtitles Clément Bœsch - -Codecs: - 4xm.c Michael Niedermayer - 8bps.c Roberto Togni - 8svx.c Jaikrishnan Menon - aacenc*, aaccoder.c Rostislav Pehlivanov - adpcm.c Zane van Iperen - alacenc.c Jaikrishnan Menon - alsdec.c Thilo Borgmann, Umair Khan - amfenc* Dmitrii Ovchinnikov - aptx.c Aurelien Jacobs - ass* Aurelien Jacobs - asv* Michael Niedermayer - atrac3plus* Maxim Poliakovski - audiotoolbox* rcombs - avs2* Huiwen Ren - bgmc.c, bgmc.h Thilo Borgmann - binkaudio.c Peter Ross - cavs* Stefan Gehrer - celp_filters.* Vitor Sessak - cinepak.c Roberto Togni - cinepakenc.c Rl / Aetey G.T. AB - ccaption_dec.c Anshul Maheshwari, Aman Gupta - cljr Alex Beregszaszi - cpia.c Stephan Hilb - cscd.c Reimar Doeffinger - cuviddec.c Timo Rothenpieler - dca* foo86 - dfpwm* Jack Bruienne - dirac* Rostislav Pehlivanov - dnxhd* Baptiste Coudurier - dolby_e* foo86 - dpcm.c Mike Melanson - dss_sp.c Oleksij Rempel - dv.c Roman Shaposhnik - dvbsubdec.c Anshul Maheshwari - eacmv*, eaidct*, eat* Peter Ross - exif.c, exif.h Thilo Borgmann - ffv1* Michael Niedermayer - ffwavesynth.c Nicolas George - fifo.c Jan Sebechlebsky - flicvideo.c Mike Melanson - g722.c Martin Storsjo - g726.c Roman Shaposhnik - gifdec.c Baptiste Coudurier - h261* Michael Niedermayer - h263* Michael Niedermayer - h264* Loren Merritt, Michael Niedermayer - hap* Tom Butterworth - huffyuv* Michael Niedermayer - idcinvideo.c Mike Melanson - interplayvideo.c Mike Melanson - jni*, ffjni* Matthieu Bouron - jpeg2000* Nicolas Bertrand - jpegxl* Leo Izen - jvdec.c Peter Ross - lcl*.c Roberto Togni, Reimar Doeffinger - libcelt_dec.c Nicolas George - libcodec2.c Tomas Härdin - libdirac* David Conrad - libdavs2.c Huiwen Ren - libjxl*.c, libjxl.h Leo Izen - libgsm.c Michel Bardiaux - libkvazaar.c Arttu Ylä-Outinen - libopenh264enc.c Martin Storsjo, Linjie Fu - libopenjpeg.c Jaikrishnan Menon - libopenjpegenc.c Michael Bradshaw - libtheoraenc.c David Conrad - libvorbis.c David Conrad - libvpx* James Zern - libxavs.c Stefan Gehrer - libxavs2.c Huiwen Ren - libzvbi-teletextdec.c Marton Balint - lzo.h, lzo.c Reimar Doeffinger - mdec.c Michael Niedermayer - mimic.c Ramiro Polla - mjpeg*.c Michael Niedermayer - mlp* Ramiro Polla, Jai Luthra - mmvideo.c Peter Ross - mpeg12.c, mpeg12data.h Michael Niedermayer - mpegvideo.c, mpegvideo.h Michael Niedermayer - mqc* Nicolas Bertrand - msmpeg4.c, msmpeg4data.h Michael Niedermayer - msrle.c Mike Melanson - msrleenc.c Tomas Härdin - msvideo1.c Mike Melanson - nuv.c Reimar Doeffinger - nvdec*, nvenc* Timo Rothenpieler - omx.c Martin Storsjo, Aman Gupta - opus* Rostislav Pehlivanov - pcx.c Ivo van Poorten - pgssubdec.c Reimar Doeffinger - ptx.c Ivo van Poorten - qcelp* Reynaldo H. Verdejo Pinochet - qdm2.c, qdm2data.h Roberto Togni - qsv* Mark Thompson, Zhong Li, Haihao Xiang - qtrle.c Mike Melanson - ra144.c, ra144.h, ra288.c, ra288.h Roberto Togni - resample2.c Michael Niedermayer - rl2.c Sascha Sommer - rpza.c Roberto Togni - rtjpeg.c, rtjpeg.h Reimar Doeffinger - rv10.c Michael Niedermayer - smc.c Mike Melanson - snow* Michael Niedermayer, Loren Merritt - sonic.c Alex Beregszaszi - speedhq.c Steinar H. Gunderson - srt* Aurelien Jacobs - sunrast.c Ivo van Poorten - svq3.c Michael Niedermayer - truemotion1* Mike Melanson - tta.c Alex Beregszaszi, Jaikrishnan Menon - txd.c Ivo van Poorten - v4l2_* Jorge Ramirez-Ortiz - vc2* Rostislav Pehlivanov - vcr1.c Michael Niedermayer - videotoolboxenc.c Rick Kern, Aman Gupta - vorbisdec.c Denes Balatoni, David Conrad - vorbisenc.c Oded Shimon - vp3* Mike Melanson - vp5 Aurelien Jacobs - vp6 Aurelien Jacobs - vp8 David Conrad, Ronald Bultje - vp9 Ronald Bultje - vqavideo.c Mike Melanson - vvc Nuo Mi - wmaprodec.c Sascha Sommer - wmavoice.c Ronald S. Bultje - wmv2.c Michael Niedermayer - xan.c Mike Melanson - xface Stefano Sabatini - -Hardware acceleration: - dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme - d3d11va* Steve Lhomme - mediacodec* Matthieu Bouron, Aman Gupta, Zhao Zhili - vaapi* Haihao Xiang - vaapi_encode* Mark Thompson, Haihao Xiang - vdpau* Philip Langdale, Carl Eugen Hoyos - videotoolbox* Rick Kern, Aman Gupta, Zhao Zhili - - -libavdevice -=========== - External Interface: - libavdevice/avdevice.h - - - avfoundation.m Thilo Borgmann - android_camera.c Felix Matouschek - decklink* Marton Balint - dshow.c Roger Pack (CC rogerdpack@gmail.com) - fbdev_enc.c Lukasz Marek - gdigrab.c Roger Pack (CC rogerdpack@gmail.com) - iec61883.c Georg Lippitsch - lavfi Stefano Sabatini - libdc1394.c Roman Shaposhnik - opengl_enc.c Lukasz Marek - pulse_audio_enc.c Lukasz Marek - sdl Stefano Sabatini - sdl2.c Josh de Kock - v4l2.c Giorgio Vazzana - vfwcap.c Ramiro Polla - xv.c Lukasz Marek - -libavfilter -=========== - -Generic parts: - graphdump.c Nicolas George - - motion_estimation.c Davinder Singh - -Filters: - af_amerge.c Nicolas George - af_aresample.c Michael Niedermayer - af_atempo.c Pavel Koshevoy - af_firequalizer.c Muhammad Faiz - af_hdcd.c Burt P. - af_loudnorm.c Kyle Swanson - af_pan.c Nicolas George - avf_showcqt.c Muhammad Faiz - vf_bwdif Thomas Mundt (CC ) - vf_chromakey.c Timo Rothenpieler - vf_colorconstancy.c Mina Sami (CC ) - vf_colorkey.c Timo Rothenpieler - vf_coreimage.m Thilo Borgmann - vf_dejudder.c Nicholas Robbins - vf_delogo.c Jean Delvare (CC ) - vf_drawbox.c/drawgrid Andrey Utkin - vf_fsync.c Thilo Borgmann - vf_hqx.c Clément Bœsch - vf_idet.c Pascal Massimino - vf_(t)interlace Thomas Mundt (CC ) - vf_lenscorrection.c Daniel Oberhoff - vf_libplacebo.c Niklas Haas - vf_mestimate.c Davinder Singh - vf_minterpolate.c Davinder Singh - vf_readvitc.c Tobias Rapp (CC t.rapp at noa-archive dot com) - vf_scale.c Michael Niedermayer - vf_tonemap_opencl.c Ruiling Song - vf_yadif.c Michael Niedermayer - -Sources: - vsrc_mandelbrot.c Michael Niedermayer - -dnn Yejun Guo - -libavformat -=========== - -Generic parts: - External Interface: - libavformat/avformat.h Michael Niedermayer - Utility Code: - libavformat/utils.c Michael Niedermayer - Text Subtitles Clément Bœsch - - -Muxers/Demuxers: - 4xm.c Mike Melanson - aadec.c Vesselin Bontchev (vesselin.bontchev at yandex dot com) - adtsenc.c Robert Swain - aiffdec.c Baptiste Coudurier, Matthieu Bouron - aiffenc.c Baptiste Coudurier, Matthieu Bouron - alp.c Zane van Iperen - amvenc.c Zane van Iperen - apm.c Zane van Iperen - apngdec.c Benoit Fouet - argo_asf.c Zane van Iperen - argo_brp.c Zane van Iperen - argo_cvg.c Zane van Iperen - ass* Aurelien Jacobs - astenc.c James Almer - avi* Michael Niedermayer - avisynth.c Stephen Hutchinson - bink.c Peter Ross - boadec.c Michael Niedermayer - caf* Peter Ross - codec2.c Tomas Härdin - crc.c Michael Niedermayer - dashdec.c Steven Liu - dashenc.c Karthick Jeyapal - daud.c Reimar Doeffinger - dfpwmdec.c Jack Bruienne - dss.c Oleksij Rempel - dtsdec.c foo86 - dv.c Roman Shaposhnik - dvdvideodec.c Marth64 - electronicarts.c Peter Ross - evc* Samsung (Dawid Kozinski) - ffm* Baptiste Coudurier - flic.c Mike Melanson - flvdec.c Michael Niedermayer - flvenc.c Michael Niedermayer, Steven Liu - gxf.c Reimar Doeffinger - gxfenc.c Baptiste Coudurier - hlsenc.c Christian Suloway, Steven Liu - idcin.c Mike Melanson - idroqdec.c Mike Melanson - iff.c Jaikrishnan Menon - imf* Pierre-Anthony Lemieux - img2*.c Michael Niedermayer - ipmovie.c Mike Melanson - iss.c Stefan Gehrer - jpegxl* Leo Izen - jvdec.c Peter Ross - kvag.c Zane van Iperen - libmodplug.c Clément Bœsch - libopenmpt.c Josh de Kock - lmlm4.c Ivo van Poorten - lxfdec.c Tomas Härdin - matroska.c Aurelien Jacobs, Andreas Rheinhardt - matroskadec.c Aurelien Jacobs, Andreas Rheinhardt - matroskaenc.c David Conrad, Andreas Rheinhardt - matroska subtitles (matroskaenc.c) John Peebles - metadata* Aurelien Jacobs - microdvd* Aurelien Jacobs - mm.c Peter Ross - mov.c Baptiste Coudurier - movenc.c Baptiste Coudurier, Matthieu Bouron - movenccenc.c Eran Kornblau - mpeg.c Michael Niedermayer - mpegenc.c Michael Niedermayer - mpegts.c Marton Balint - mpegtsenc.c Baptiste Coudurier - msnwc_tcp.c Ramiro Polla - mtv.c Reynaldo H. Verdejo Pinochet - mxf* Baptiste Coudurier, Tomas Härdin - nsvdec.c Francois Revol - nut* Michael Niedermayer - nuv.c Reimar Doeffinger - oggdec.c, oggdec.h David Conrad - oggenc.c Baptiste Coudurier - oggparse*.c David Conrad - oma.c Maxim Poliakovski - pp_bnk.c Zane van Iperen - psxstr.c Mike Melanson - pva.c Ivo van Poorten - r3d.c Baptiste Coudurier - raw.c Michael Niedermayer - rcwtenc.c Marth64 - rdt.c Ronald S. Bultje - rl2.c Sascha Sommer - rmdec.c, rmenc.c Ronald S. Bultje - rtp.c, rtpenc.c Martin Storsjo - rtpdec_ac3.* Gilles Chanteperdrix - rtpdec_dv.* Thomas Volkert - rtpdec_h261.*, rtpenc_h261.* Thomas Volkert - rtpdec_hevc.*, rtpenc_hevc.* Thomas Volkert - rtpdec_mpa_robust.* Gilles Chanteperdrix - rtpdec_asf.* Ronald S. Bultje - rtpdec_vc2hq.*, rtpenc_vc2hq.* Thomas Volkert - rtpdec_vp9.c Thomas Volkert - rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo - s337m.c foo86 - sbgdec.c Nicolas George - sdp.c Martin Storsjo - segafilm.c Mike Melanson - segment.c Stefano Sabatini - spdif* Anssi Hannula - srtdec.c Aurelien Jacobs - swf.c Baptiste Coudurier - tta.c Alex Beregszaszi - txd.c Ivo van Poorten - voc.c Aurelien Jacobs - wav.c Michael Niedermayer - wc3movie.c Mike Melanson - webm dash (matroskaenc.c) Vignesh Venkatasubramanian - webvtt* Matthew J Heaney - westwood.c Mike Melanson - wtv.c Peter Ross - -Protocols: - async.c Zhang Rui - bluray.c Petri Hintukainen - ftp.c Lukasz Marek - http.c Ronald S. Bultje - libsrt.c Zhao Zhili - libssh.c Lukasz Marek - libzmq.c Andriy Gelman - mms*.c Ronald S. Bultje - udp.c Luca Abeni - icecast.c Marvin Scholz - - -libswresample -============= - -Generic parts: - audioconvert.c Michael Niedermayer - dither.c Michael Niedermayer - rematrix*.c Michael Niedermayer - swresample*.c Michael Niedermayer - -Resamplers: - resample*.c Michael Niedermayer - soxr_resample.c Rob Sykes - - -Operating systems / CPU architectures -===================================== - -*BSD Brad Smith -Alpha Falk Hueffner -MIPS Manojkumar Bhosale, Shiyou Yin -LoongArch Shiyou Yin -Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier -Amiga / PowerPC Colin Ward -Linux / PowerPC Lauri Kasanen -RISC-V Rémi Denis-Courmont -Windows MinGW Alex Beregszaszi, Ramiro Polla -Windows Cygwin Victor Paesa -Windows MSVC Hendrik Leppkes -ADI/Blackfin DSP Marc Hoffman -Sparc Roman Shaposhnik -OS/2 KO Myung-Hun - - -Developers with git write access who are currently not maintaining any specific part -==================================================================================== -Alex Converse -Andreas Cadhalpun -Anuradha Suraparaju -Ben Littler -Benjamin Larsson -Bobby Bingham -Daniel Verkamp -Derek Buitenhuis -Ganesh Ajjanagadde -Henrik Gramner -Ivan Uskov -James Darnley -Jan Ekström -Joakim Plate -Jun Zhao -Kieran Kunhya -Kirill Gavrilov -Limin Wang -Martin Storsjö -Panagiotis Issaris -Pedro Arthur -Sebastien Zwickert -Vittorio Giovara -wm4 -(this list is incomplete) - - -Releases -======== - -2.8 Michael Niedermayer -2.7 Michael Niedermayer -2.6 Michael Niedermayer -2.5 Michael Niedermayer - -If you want to maintain an older release, please contact us - - -GnuPG Fingerprints and IRC nicknames of maintainers and contributors -==================================================================== - -IRC nicknames are in parentheses. These apply -to the IRC channels listed on the website. - -Alexander Strasser 1C96 78B7 83CB 8AA7 9AF5 D1EB A7D8 A57B A876 E58F -Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB -Ash Hughes 694D 43D2 D180 C7C7 6421 ABD3 A641 D0B7 623D 6029 -Attila Kinali 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765 -Baptiste Coudurier 8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA -Ben Littler 3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C -Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8 -Clément Bœsch 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9 -Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7 -FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8 -Ganesh Ajjanagadde C96A 848E 97C3 CEA2 AB72 5CE4 45F9 6A2D 3C36 FB1B -Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4 -Haihao Xiang (haihao) 1F0C 31E8 B4FE F7A4 4DC1 DC99 E0F5 76D4 76FC 437F -Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368 -James Almer 7751 2E8C FD94 A169 57E6 9A7A 1463 01AD 7376 59E0 -Jean Delvare 7CA6 9F44 60F1 BDC4 1FD2 C858 A552 6B9B B3CD 4E6A -Leo Izen (Traneptora) B6FD 3CFC 7ACF 83FC 9137 6945 5A71 C331 FD2F A19A -Leo Izen (Traneptora) 1D83 0A0B CE46 709E 203B 26FC 764E 48EA 4822 1833 -Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE -Lynne FE50 139C 6805 72CA FD52 1F8D A2FE A5F0 3F03 4464 -Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB - DD1E C9E8 DE08 5C62 9B3E 1846 B18E 8928 B394 8D64 -Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93 -Niklas Haas (haasn) 1DDB 8076 B14D 5B48 32FC 99D9 EB52 DA9C 02BA 6FB4 -Nikolay Aleksandrov 8978 1D8C FB71 588E 4B27 EAA8 C4F0 B5FC E011 13B1 -Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029 -Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B -Philip Langdale 5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E -Pierre-Anthony Lemieux (pal) F4B3 9492 E6F2 E4AF AEC8 46CB 698F A1F0 F8D4 EED4 -Ramiro Polla 7859 C65B 751B 1179 792E DAE8 8E95 8B2F 9B6C 5700 -Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7 -Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4 -Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A -Robert Swain EE7A 56EA 4A81 A7B5 2001 A521 67FA 362D A2FC 3E71 -Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C -Stefano Sabatini 0D0B AD6B 5330 BBAD D3D6 6A0C 719C 2839 FC43 2D5F -Steinar H. Gunderson C2E9 004F F028 C18E 4EAD DB83 7F61 7561 7797 8F76 -Stephan Hilb 4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863 -Thilo Borgmann (thilo) CE1D B7F4 4D20 FC3A DD9F FE5A 257C 5B8F 1D20 B92F -Tiancheng "Timothy" Gu 9456 AFC0 814A 8139 E994 8351 7FE6 B095 B582 B0D4 -Tim Nicholson 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83 -Tomas Härdin (thardin) A79D 4E3D F38F 763F 91F5 8B33 A01E 8AE0 41BB 2551 -Wei Gao 4269 7741 857A 0E60 9EC5 08D2 4744 4EFA 62C1 87B9 -Zane van Iperen (zane) 61AE D40F 368B 6F26 9DAE 3892 6861 6B2D 8AC4 DCC5 diff --git a/src/ExtLib/ffmpeg/README.md b/src/ExtLib/ffmpeg/README.md new file mode 100644 index 0000000000..f8c23f2870 --- /dev/null +++ b/src/ExtLib/ffmpeg/README.md @@ -0,0 +1,46 @@ +FFmpeg README +============= + +FFmpeg is a collection of libraries and tools to process multimedia content +such as audio, video, subtitles and related metadata. + +## Libraries + +* `libavcodec` provides implementation of a wider range of codecs. +* `libavformat` implements streaming protocols, container formats and basic I/O access. +* `libavutil` includes hashers, decompressors and miscellaneous utility functions. +* `libavfilter` provides means to alter decoded audio and video through a directed graph of connected filters. +* `libavdevice` provides an abstraction to access capture and playback devices. +* `libswresample` implements audio mixing and resampling routines. +* `libswscale` implements color conversion and scaling routines. + +## Tools + +* [ffmpeg](https://ffmpeg.org/ffmpeg.html) is a command line toolbox to + manipulate, convert and stream multimedia content. +* [ffplay](https://ffmpeg.org/ffplay.html) is a minimalistic multimedia player. +* [ffprobe](https://ffmpeg.org/ffprobe.html) is a simple analysis tool to inspect + multimedia content. +* Additional small tools such as `aviocat`, `ismindex` and `qt-faststart`. + +## Documentation + +The offline documentation is available in the **doc/** directory. + +The online documentation is available in the main [website](https://ffmpeg.org) +and in the [wiki](https://trac.ffmpeg.org). + +### Examples + +Coding examples are available in the **doc/examples** directory. + +## License + +FFmpeg codebase is mainly LGPL-licensed with optional components licensed under +GPL. Please refer to the LICENSE file for detailed information. + +## Contributing + +Patches should be submitted to the ffmpeg-devel mailing list using +`git format-patch` or `git send-email`. Github pull requests should be +avoided because they are not part of our review process and will be ignored. diff --git a/src/ExtLib/ffmpeg/ffmpeg.mak b/src/ExtLib/ffmpeg/ffmpeg.mak index bbb94aa942..f0b80389e8 100644 --- a/src/ExtLib/ffmpeg/ffmpeg.mak +++ b/src/ExtLib/ffmpeg/ffmpeg.mak @@ -929,6 +929,7 @@ SRCS_YASM_LR = \ SRCS_YASM_LS = \ libswscale/x86/input.asm \ libswscale/x86/output.asm \ + libswscale/x86/range_convert.asm \ libswscale/x86/rgb_2_rgb.asm \ libswscale/x86/scale.asm \ libswscale/x86/scale_avx2.asm \ diff --git a/src/ExtLib/ffmpeg/libavcodec/aac.h b/src/ExtLib/ffmpeg/libavcodec/aac.h index fc6d1361b2..78026a5887 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac.h +++ b/src/ExtLib/ffmpeg/libavcodec/aac.h @@ -103,4 +103,20 @@ typedef struct Pulse { int amp[4]; } Pulse; +static inline int ff_aac_sample_rate_idx(int rate) +{ + if (92017 <= rate) return 0; + else if (75132 <= rate) return 1; + else if (55426 <= rate) return 2; + else if (46009 <= rate) return 3; + else if (37566 <= rate) return 4; + else if (27713 <= rate) return 5; + else if (23004 <= rate) return 6; + else if (18783 <= rate) return 7; + else if (13856 <= rate) return 8; + else if (11502 <= rate) return 9; + else if (9391 <= rate) return 10; + else return 11; +} + #endif /* AVCODEC_AAC_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c index eecb6d8f3d..ea2ba84a80 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c @@ -1095,22 +1095,6 @@ static int decode_audio_specific_config(AACDecContext *ac, sync_extension); } -static int sample_rate_idx (int rate) -{ - if (92017 <= rate) return 0; - else if (75132 <= rate) return 1; - else if (55426 <= rate) return 2; - else if (46009 <= rate) return 3; - else if (37566 <= rate) return 4; - else if (27713 <= rate) return 5; - else if (23004 <= rate) return 6; - else if (18783 <= rate) return 7; - else if (13856 <= rate) return 8; - else if (11502 <= rate) return 9; - else if (9391 <= rate) return 10; - else return 11; -} - static av_cold int decode_close(AVCodecContext *avctx) { AACDecContext *ac = avctx->priv_data; @@ -1211,7 +1195,7 @@ av_cold int ff_aac_decode_init(AVCodecContext *avctx) uint8_t layout_map[MAX_ELEM_ID*4][3]; int layout_map_tags; - sr = sample_rate_idx(avctx->sample_rate); + sr = ff_aac_sample_rate_idx(avctx->sample_rate); ac->oc[1].m4ac.sampling_index = sr; ac->oc[1].m4ac.channels = avctx->ch_layout.nb_channels; ac->oc[1].m4ac.sbr = -1; diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.h b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.h index 86faf6454a..e5a79a7139 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.h +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.h @@ -315,7 +315,7 @@ typedef struct AACUsacElemConfig { uint8_t freq_scale; /* dflt_freq_scale */ uint8_t alter_scale : 1; /* dflt_alter_scale */ - uint8_t noise_scale; /* dflt_noise_scale */ + uint8_t noise_bands; /* dflt_noise_bands */ uint8_t limiter_bands; /* dflt_limiter_bands */ uint8_t limiter_gains; /* dflt_limiter_gains */ @@ -350,7 +350,6 @@ typedef struct AACUsacElemConfig { typedef struct AACUSACConfig { uint8_t core_sbr_frame_len_idx; /* coreSbrFrameLengthIndex */ - uint8_t rate_idx; uint16_t core_frame_len; uint16_t stream_identifier; diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_ac.h b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_ac.h index 0b98c0f0d9..b8d4ade4c6 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_ac.h +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_ac.h @@ -25,7 +25,7 @@ #include "libavcodec/get_bits.h" typedef struct AACArithState { - uint8_t last[512 /* 2048 / 4 */]; + uint8_t last[512 /* 2048 / 4 */ + 1]; int last_len; uint8_t cur[4]; uint16_t state_pre; diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c index 98e8c1c0bc..e5504117d0 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c @@ -162,11 +162,11 @@ static void decode_usac_sbr_data(AACUsacElemConfig *e, GetBitContext *gb) e->sbr.dflt.freq_scale = 2; e->sbr.dflt.alter_scale = 1; - e->sbr.dflt.noise_scale = 2; + e->sbr.dflt.noise_bands = 2; if (header_extra1) { e->sbr.dflt.freq_scale = get_bits(gb, 2); /* dflt_freq_scale */ e->sbr.dflt.alter_scale = get_bits1(gb); /* dflt_alter_scale */ - e->sbr.dflt.noise_scale = get_bits(gb, 2); /* dflt_noise_scale */ + e->sbr.dflt.noise_bands = get_bits(gb, 2); /* dflt_noise_bands */ } e->sbr.dflt.limiter_bands = 2; @@ -316,7 +316,7 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, GetBitContext *gb, OutputConfiguration *oc, int channel_config) { - int ret, idx; + int ret; uint8_t freq_idx; uint8_t channel_config_idx; int nb_channels = 0; @@ -334,20 +334,10 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, freq_idx = get_bits(gb, 5); /* usacSamplingFrequencyIndex */ if (freq_idx == 0x1f) { samplerate = get_bits(gb, 24); /* usacSamplingFrequency */ - - /* Try to match up an index for the custom sample rate. - * TODO: not sure if correct */ - for (idx = 0; idx < /* FF_ARRAY_ELEMS(ff_aac_usac_samplerate) */ 32; idx++) { - if (ff_aac_usac_samplerate[idx] >= samplerate) - break; - } - idx = FFMIN(idx, /* FF_ARRAY_ELEMS(ff_aac_usac_samplerate) */ 32 - 1); - usac->rate_idx = idx; } else { samplerate = ff_aac_usac_samplerate[freq_idx]; if (samplerate < 0) return AVERROR(EINVAL); - usac->rate_idx = freq_idx; } m4ac->sample_rate = avctx->sample_rate = samplerate; @@ -364,6 +354,8 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, usac->core_sbr_frame_len_idx == 4 ? 1 : 0; + m4ac->sampling_index = ff_aac_sample_rate_idx(m4ac->sample_rate); + channel_config_idx = get_bits(gb, 5); /* channelConfigurationIndex */ if (!channel_config_idx) { /* UsacChannelConfig() */ @@ -751,18 +743,19 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce, { AACUsacElemData *ue = &sce->ue; IndividualChannelStream *ics = &sce->ics; + const int sampling_index = ac->oc[1].m4ac.sampling_index; /* Setup window parameters */ ics->prev_num_window_groups = FFMAX(ics->num_window_groups, 1); if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { if (usac->core_frame_len == 768) { - ics->swb_offset = ff_swb_offset_96[usac->rate_idx]; - ics->num_swb = ff_aac_num_swb_96[usac->rate_idx]; + ics->swb_offset = ff_swb_offset_96[sampling_index]; + ics->num_swb = ff_aac_num_swb_96[sampling_index]; } else { - ics->swb_offset = ff_swb_offset_128[usac->rate_idx]; - ics->num_swb = ff_aac_num_swb_128[usac->rate_idx]; + ics->swb_offset = ff_swb_offset_128[sampling_index]; + ics->num_swb = ff_aac_num_swb_128[sampling_index]; } - ics->tns_max_bands = ff_tns_max_bands_usac_128[usac->rate_idx]; + ics->tns_max_bands = ff_tns_max_bands_usac_128[sampling_index]; /* Setup scalefactor grouping. 7 bit mask. */ ics->num_window_groups = 0; @@ -779,13 +772,13 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce, ics->num_windows = 8; } else { if (usac->core_frame_len == 768) { - ics->swb_offset = ff_swb_offset_768[usac->rate_idx]; - ics->num_swb = ff_aac_num_swb_768[usac->rate_idx]; + ics->swb_offset = ff_swb_offset_768[sampling_index]; + ics->num_swb = ff_aac_num_swb_768[sampling_index]; } else { - ics->swb_offset = ff_swb_offset_1024[usac->rate_idx]; - ics->num_swb = ff_aac_num_swb_1024[usac->rate_idx]; + ics->swb_offset = ff_swb_offset_1024[sampling_index]; + ics->num_swb = ff_aac_num_swb_1024[sampling_index]; } - ics->tns_max_bands = ff_tns_max_bands_usac_1024[usac->rate_idx]; + ics->tns_max_bands = ff_tns_max_bands_usac_1024[sampling_index]; ics->group_len[0] = 1; ics->num_window_groups = 1; @@ -835,6 +828,11 @@ static int decode_usac_stereo_info(AACDecContext *ac, AACUSACConfig *usac, tns_active = get_bits1(gb); us->common_window = get_bits1(gb); + if (!us->common_window || indep_flag) { + memset(us->prev_alpha_q_re, 0, sizeof(us->prev_alpha_q_re)); + memset(us->prev_alpha_q_im, 0, sizeof(us->prev_alpha_q_im)); + } + if (us->common_window) { /* ics_info() */ ics1->window_sequence[1] = ics1->window_sequence[0]; @@ -845,6 +843,20 @@ static int decode_usac_stereo_info(AACDecContext *ac, AACUSACConfig *usac, ics2->use_kb_window[1] = ics2->use_kb_window[0]; ics1->use_kb_window[0] = ics2->use_kb_window[0] = get_bits1(gb); + /* If there's a change in the transform sequence, zero out last frame's + * stereo prediction coefficients */ + if ((ics1->window_sequence[0] == EIGHT_SHORT_SEQUENCE && + ics1->window_sequence[1] != EIGHT_SHORT_SEQUENCE) || + (ics1->window_sequence[1] == EIGHT_SHORT_SEQUENCE && + ics1->window_sequence[0] != EIGHT_SHORT_SEQUENCE) || + (ics2->window_sequence[0] == EIGHT_SHORT_SEQUENCE && + ics2->window_sequence[1] != EIGHT_SHORT_SEQUENCE) || + (ics2->window_sequence[1] == EIGHT_SHORT_SEQUENCE && + ics2->window_sequence[0] != EIGHT_SHORT_SEQUENCE)) { + memset(us->prev_alpha_q_re, 0, sizeof(us->prev_alpha_q_re)); + memset(us->prev_alpha_q_im, 0, sizeof(us->prev_alpha_q_im)); + } + if (ics1->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { ics1->max_sfb = ics2->max_sfb = get_bits(gb, 4); ue1->scale_factor_grouping = ue2->scale_factor_grouping = get_bits(gb, 7); diff --git a/src/ExtLib/ffmpeg/libavcodec/allcodecs.c b/src/ExtLib/ffmpeg/libavcodec/allcodecs.c index d1485e40db..b6ee47549a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/allcodecs.c +++ b/src/ExtLib/ffmpeg/libavcodec/allcodecs.c @@ -800,6 +800,7 @@ extern const FFCodec ff_libvpx_vp8_encoder; extern const FFCodec ff_libvpx_vp8_decoder; extern FFCodec ff_libvpx_vp9_encoder; extern const FFCodec ff_libvpx_vp9_decoder; +extern const FFCodec ff_libvvenc_encoder; // ==> Start patch MPC extern const FFCodec ff_libvvdec_decoder; // ==> End patch MPC diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c index c5f167334d..e2389f124e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c @@ -789,9 +789,28 @@ static int cbs_h26 ## h26n ## _replace_ ## ps_var(CodedBitstreamContext *ctx, \ } cbs_h266_replace_ps(6, VPS, vps, vps_video_parameter_set_id) -cbs_h266_replace_ps(6, SPS, sps, sps_seq_parameter_set_id) cbs_h266_replace_ps(6, PPS, pps, pps_pic_parameter_set_id) +static int cbs_h266_replace_sps(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit) +{ + CodedBitstreamH266Context *priv = ctx->priv_data; + H266RawSPS *sps = unit->content; + unsigned int id = sps->sps_seq_parameter_set_id; + int err = ff_cbs_make_unit_refcounted(ctx, unit); + if (err < 0) + return err; + av_assert0(unit->content_ref); + if (priv->sps[id] && memcmp(priv->sps[id], unit->content_ref, sizeof(*priv->sps[id]))) { + for (unsigned int i = 0; i < VVC_MAX_PPS_COUNT; i++) { + if (priv->pps[i] && priv->pps[i]->pps_seq_parameter_set_id == id) + ff_refstruct_unref(&priv->pps[i]); + } + } + ff_refstruct_replace(&priv->sps[id], unit->content_ref); + return 0; +} + static int cbs_h266_replace_ph(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, H266RawPictureHeader *ph) diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c index b26c19dd5e..5130a9598d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c @@ -28,6 +28,7 @@ void ff_dovi_ctx_unref(DOVIContext *s) { + ff_refstruct_unref(&s->dm); for (int i = 0; i < FF_ARRAY_ELEMS(s->vdr); i++) ff_refstruct_unref(&s->vdr[i]); ff_refstruct_unref(&s->ext_blocks); @@ -40,6 +41,7 @@ void ff_dovi_ctx_unref(DOVIContext *s) void ff_dovi_ctx_flush(DOVIContext *s) { + ff_refstruct_unref(&s->dm); for (int i = 0; i < FF_ARRAY_ELEMS(s->vdr); i++) ff_refstruct_unref(&s->vdr[i]); ff_refstruct_unref(&s->ext_blocks); @@ -60,6 +62,7 @@ void ff_dovi_ctx_replace(DOVIContext *s, const DOVIContext *s0) s->header = s0->header; s->mapping = s0->mapping; s->color = s0->color; + ff_refstruct_replace(&s->dm, s0->dm); for (int i = 0; i <= DOVI_MAX_DM_ID; i++) ff_refstruct_replace(&s->vdr[i], s0->vdr[i]); ff_refstruct_replace(&s->ext_blocks, s0->ext_blocks); @@ -86,3 +89,46 @@ int ff_dovi_guess_profile_hevc(const AVDOVIRpuDataHeader *hdr) return 0; /* unknown */ } + +const AVDOVIColorMetadata ff_dovi_color_default = { + .dm_metadata_id = 0, + .scene_refresh_flag = 0, + .ycc_to_rgb_matrix = { + { 9575, 8192 }, + { 0, 8192 }, + { 14742, 8192 }, + { 9575, 8192 }, + { 1754, 8192 }, + { 4383, 8192 }, + { 9575, 8192 }, + { 17372, 8192 }, + { 0, 8192 }, + }, + .ycc_to_rgb_offset = { + { 1, 4 }, + { 2, 1 }, + { 2, 1 }, + }, + .rgb_to_lms_matrix = { + { 5845, 16384 }, + { 9702, 16384 }, + { 837, 16384 }, + { 2568, 16384 }, + { 12256, 16384 }, + { 1561, 16384 }, + { 0, 16384 }, + { 679, 16384 }, + { 15705, 16384 }, + }, + .signal_eotf = 39322, + .signal_eotf_param0 = 15867, + .signal_eotf_param1 = 228, + .signal_eotf_param2 = 1383604, + .signal_bit_depth = 14, + .signal_color_space = 0, + .signal_chroma_format = 0, + .signal_full_range_flag = 1, + .source_min_pq = 62, + .source_max_pq = 3696, + .source_diagonal = 42, +}; diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h index 8ce0c88e9d..bfb118d6b5 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h @@ -74,7 +74,8 @@ typedef struct DOVIContext { /** * Private fields internal to dovi_rpu.c */ - struct DOVIVdr *vdr[DOVI_MAX_DM_ID+1]; ///< RefStruct references + AVDOVIColorMetadata *dm; ///< RefStruct + AVDOVIDataMapping *vdr[DOVI_MAX_DM_ID+1]; ///< RefStruct references uint8_t *rpu_buf; ///< temporary buffer unsigned rpu_buf_sz; @@ -121,21 +122,6 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame); */ int ff_dovi_configure(DOVIContext *s, AVCodecContext *avctx); - -/*************************************************** - * The following section is for internal use only. * - ***************************************************/ - -typedef struct DOVIVdr { - AVDOVIDataMapping mapping; - AVDOVIColorMetadata color; -} DOVIVdr; - -enum { - RPU_COEFF_FIXED = 0, - RPU_COEFF_FLOAT = 1, -}; - /** * Synthesize a Dolby Vision RPU reflecting the current state. Note that this * assumes all previous calls to `ff_dovi_rpu_generate` have been appropriately @@ -150,6 +136,16 @@ enum { int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, uint8_t **out_rpu, int *out_size); + +/*************************************************** + * The following section is for internal use only. * + ***************************************************/ + +enum { + RPU_COEFF_FIXED = 0, + RPU_COEFF_FLOAT = 1, +}; + /** * Internal helper function to guess the correct DV profile for HEVC. * @@ -157,4 +153,7 @@ int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, */ int ff_dovi_guess_profile_hevc(const AVDOVIRpuDataHeader *hdr); +/* Default values for AVDOVIColorMetadata */ +extern const AVDOVIColorMetadata ff_dovi_color_default; + #endif /* AVCODEC_DOVI_RPU_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c index a477dbd4e3..8cafdcf5e6 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c @@ -58,7 +58,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) /* Copy only the parts of these structs known to us at compiler-time. */ #define COPY(t, a, b, last) memcpy(a, b, offsetof(t, last) + sizeof((b)->last)) - COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag); + COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, ext_mapping_idc_5_7); COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq_pivots); COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal); ext_sz = FFMIN(sizeof(AVDOVIDmData), dovi->ext_block_size); @@ -123,11 +123,12 @@ static inline unsigned get_variable_bits(GetBitContext *gb, int n) if (VAR < MIN || VAR > MAX) { \ av_log(s->logctx, AV_LOG_ERROR, "RPU validation failed: " \ #MIN" <= "#VAR" = %d <= "#MAX"\n", (int) VAR); \ - goto fail; \ + ff_dovi_ctx_unref(s); \ + return AVERROR_INVALIDDATA; \ } \ } while (0) -static void parse_ext_v1(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm) +static int parse_ext_v1(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm) { switch (dm->level) { case 1: @@ -143,6 +144,7 @@ static void parse_ext_v1(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm) dm->l2.trim_chroma_weight = get_bits(gb, 12); dm->l2.trim_saturation_gain = get_bits(gb, 12); dm->l2.ms_weight = get_sbits(gb, 13); + VALIDATE(dm->l2.ms_weight, -1, 4095); break; case 4: dm->l4.anchor_pq = get_bits(gb, 12); @@ -170,6 +172,8 @@ static void parse_ext_v1(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm) av_log(s->logctx, AV_LOG_WARNING, "Unknown Dolby Vision DM v1 level: %u\n", dm->level); } + + return 0; } static AVCIExy get_cie_xy(GetBitContext *gb) @@ -181,8 +185,8 @@ static AVCIExy get_cie_xy(GetBitContext *gb) return xy; } -static void parse_ext_v2(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm, - int ext_block_length) +static int parse_ext_v2(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm, + int ext_block_length) { switch (dm->level) { case 3: @@ -254,11 +258,13 @@ static void parse_ext_v2(DOVIContext *s, GetBitContext *gb, AVDOVIDmData *dm, av_log(s->logctx, AV_LOG_WARNING, "Unknown Dolby Vision DM v2 level: %u\n", dm->level); } + + return 0; } static int parse_ext_blocks(DOVIContext *s, GetBitContext *gb, int ver) { - int num_ext_blocks, ext_block_length, start_pos, parsed_bits; + int num_ext_blocks, ext_block_length, start_pos, parsed_bits, ret; num_ext_blocks = get_ue_golomb_31(gb); align_get_bits(gb); @@ -278,10 +284,14 @@ static int parse_ext_blocks(DOVIContext *s, GetBitContext *gb, int ver) start_pos = get_bits_count(gb); switch (ver) { - case 1: parse_ext_v1(s, gb, dm); break; - case 2: parse_ext_v2(s, gb, dm, ext_block_length); break; + case 1: ret = parse_ext_v1(s, gb, dm); break; + case 2: ret = parse_ext_v2(s, gb, dm, ext_block_length); break; + default: return AVERROR_BUG; } + if (ret < 0) + return ret; + parsed_bits = get_bits_count(gb) - start_pos; if (parsed_bits > ext_block_length * 8) return AVERROR_INVALIDDATA; @@ -296,7 +306,6 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, { AVDOVIRpuDataHeader *hdr = &s->header; GetBitContext *gb = &(GetBitContext){0}; - DOVIVdr *vdr; int ret; uint8_t rpu_type; @@ -307,7 +316,7 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, uint8_t profile; if (rpu_size < 5) - goto fail; + return AVERROR_INVALIDDATA; /* Container */ if (s->cfg.dv_profile == 10 /* dav1.10 */) { @@ -361,7 +370,7 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, } if (!rpu_size || rpu[rpu_size - 1] != 0x80) - goto fail; + return AVERROR_INVALIDDATA; if (err_recognition & AV_EF_CRCCHECK) { uint32_t crc = av_bswap32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), @@ -369,7 +378,7 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, if (crc) { av_log(s->logctx, AV_LOG_ERROR, "RPU CRC mismatch: %X\n", crc); if (err_recognition & AV_EF_EXPLODE) - goto fail; + return AVERROR_INVALIDDATA; } } @@ -413,14 +422,22 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, int bl_bit_depth_minus8 = get_ue_golomb_31(gb); int el_bit_depth_minus8 = get_ue_golomb_31(gb); int vdr_bit_depth_minus8 = get_ue_golomb_31(gb); + int reserved_zero_3bits; + /* ext_mapping_idc is in the upper 8 bits of el_bit_depth_minus8 */ + int ext_mapping_idc = el_bit_depth_minus8 >> 8; + el_bit_depth_minus8 = el_bit_depth_minus8 & 0xFF; VALIDATE(bl_bit_depth_minus8, 0, 8); VALIDATE(el_bit_depth_minus8, 0, 8); + VALIDATE(ext_mapping_idc, 0, 0xFF); VALIDATE(vdr_bit_depth_minus8, 0, 8); hdr->bl_bit_depth = bl_bit_depth_minus8 + 8; hdr->el_bit_depth = el_bit_depth_minus8 + 8; + hdr->ext_mapping_idc_0_4 = ext_mapping_idc & 0x1f; /* 5 bits */ + hdr->ext_mapping_idc_5_7 = ext_mapping_idc >> 5; hdr->vdr_bit_depth = vdr_bit_depth_minus8 + 8; hdr->spatial_resampling_filter_flag = get_bits1(gb); - skip_bits(gb, 3); /* reserved_zero_3bits */ + reserved_zero_3bits = get_bits(gb, 3); + VALIDATE(reserved_zero_3bits, 0, 0); hdr->el_spatial_resampling_filter_flag = get_bits1(gb); hdr->disable_residual_flag = get_bits1(gb); } @@ -438,37 +455,44 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, profile = s->cfg.dv_profile ? s->cfg.dv_profile : ff_dovi_guess_profile_hevc(hdr); if (profile == 5 && use_nlq) { av_log(s->logctx, AV_LOG_ERROR, "Profile 5 RPUs should not use NLQ\n"); - goto fail; + ff_dovi_ctx_unref(s); + return AVERROR_INVALIDDATA; } if (use_prev_vdr_rpu) { int prev_vdr_rpu_id = get_ue_golomb_31(gb); VALIDATE(prev_vdr_rpu_id, 0, DOVI_MAX_DM_ID); + if (!s->vdr[prev_vdr_rpu_id]) + prev_vdr_rpu_id = 0; if (!s->vdr[prev_vdr_rpu_id]) { + /* FIXME: Technically, the spec says that in this case we should + * synthesize "neutral" vdr metadata, but easier to just error + * out as this corner case is not hit in practice */ av_log(s->logctx, AV_LOG_ERROR, "Unknown previous RPU ID: %u\n", prev_vdr_rpu_id); - goto fail; + ff_dovi_ctx_unref(s); + return AVERROR_INVALIDDATA; } - vdr = s->vdr[prev_vdr_rpu_id]; - s->mapping = &vdr->mapping; + s->mapping = s->vdr[prev_vdr_rpu_id]; } else { + AVDOVIDataMapping *mapping; int vdr_rpu_id = get_ue_golomb_31(gb); VALIDATE(vdr_rpu_id, 0, DOVI_MAX_DM_ID); if (!s->vdr[vdr_rpu_id]) { - s->vdr[vdr_rpu_id] = ff_refstruct_allocz(sizeof(DOVIVdr)); - if (!s->vdr[vdr_rpu_id]) + s->vdr[vdr_rpu_id] = ff_refstruct_allocz(sizeof(AVDOVIDataMapping)); + if (!s->vdr[vdr_rpu_id]) { + ff_dovi_ctx_unref(s); return AVERROR(ENOMEM); + } } - vdr = s->vdr[vdr_rpu_id]; - s->mapping = &vdr->mapping; - - vdr->mapping.vdr_rpu_id = vdr_rpu_id; - vdr->mapping.mapping_color_space = get_ue_golomb_31(gb); - vdr->mapping.mapping_chroma_format_idc = get_ue_golomb_31(gb); + s->mapping = mapping = s->vdr[vdr_rpu_id]; + mapping->vdr_rpu_id = vdr_rpu_id; + mapping->mapping_color_space = get_ue_golomb_31(gb); + mapping->mapping_chroma_format_idc = get_ue_golomb_31(gb); for (int c = 0; c < 3; c++) { - AVDOVIReshapingCurve *curve = &vdr->mapping.curves[c]; + AVDOVIReshapingCurve *curve = &mapping->curves[c]; int num_pivots_minus_2 = get_ue_golomb_31(gb); int pivot = 0; @@ -482,28 +506,28 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, if (use_nlq) { int nlq_pivot = 0; - vdr->mapping.nlq_method_idc = get_bits(gb, 3); + mapping->nlq_method_idc = get_bits(gb, 3); for (int i = 0; i < 2; i++) { nlq_pivot += get_bits(gb, hdr->bl_bit_depth); - vdr->mapping.nlq_pivots[i] = av_clip_uint16(nlq_pivot); + mapping->nlq_pivots[i] = av_clip_uint16(nlq_pivot); } /** * The patent mentions another legal value, NLQ_MU_LAW, but it's * not documented anywhere how to parse or apply that type of NLQ. */ - VALIDATE(vdr->mapping.nlq_method_idc, 0, AV_DOVI_NLQ_LINEAR_DZ); + VALIDATE(mapping->nlq_method_idc, 0, AV_DOVI_NLQ_LINEAR_DZ); } else { - vdr->mapping.nlq_method_idc = AV_DOVI_NLQ_NONE; + mapping->nlq_method_idc = AV_DOVI_NLQ_NONE; } - vdr->mapping.num_x_partitions = get_ue_golomb_long(gb) + 1; - vdr->mapping.num_y_partitions = get_ue_golomb_long(gb) + 1; + mapping->num_x_partitions = get_ue_golomb_long(gb) + 1; + mapping->num_y_partitions = get_ue_golomb_long(gb) + 1; /* End of rpu_data_header(), start of vdr_rpu_data_payload() */ for (int c = 0; c < 3; c++) { - AVDOVIReshapingCurve *curve = &vdr->mapping.curves[c]; + AVDOVIReshapingCurve *curve = &mapping->curves[c]; for (int i = 0; i < curve->num_pivots - 1; i++) { int mapping_idc = get_ue_golomb_31(gb); VALIDATE(mapping_idc, 0, 1); @@ -544,10 +568,10 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, if (use_nlq) { for (int c = 0; c < 3; c++) { - AVDOVINLQParams *nlq = &vdr->mapping.nlq[c]; + AVDOVINLQParams *nlq = &mapping->nlq[c]; nlq->nlq_offset = get_bits(gb, hdr->el_bit_depth); nlq->vdr_in_max = get_ue_coef(gb, hdr); - switch (vdr->mapping.nlq_method_idc) { + switch (mapping->nlq_method_idc) { case AV_DOVI_NLQ_LINEAR_DZ: nlq->linear_deadzone_slope = get_ue_coef(gb, hdr); nlq->linear_deadzone_threshold = get_ue_coef(gb, hdr); @@ -563,25 +587,25 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, int current_dm_id = get_ue_golomb_31(gb); VALIDATE(affected_dm_id, 0, DOVI_MAX_DM_ID); VALIDATE(current_dm_id, 0, DOVI_MAX_DM_ID); - if (!s->vdr[affected_dm_id]) { - s->vdr[affected_dm_id] = ff_refstruct_allocz(sizeof(DOVIVdr)); - if (!s->vdr[affected_dm_id]) - return AVERROR(ENOMEM); + if (affected_dm_id != current_dm_id) { + /* The spec does not explain these fields at all, and there is + * a lack of samples to understand how they're supposed to work, + * so just assert them being equal for now */ + avpriv_request_sample(s->logctx, "affected/current_dm_metadata_id " + "mismatch? %u != %u\n", affected_dm_id, current_dm_id); + ff_dovi_ctx_unref(s); + return AVERROR_PATCHWELCOME; } - if (!s->vdr[current_dm_id]) { - av_log(s->logctx, AV_LOG_ERROR, "Unknown previous RPU DM ID: %u\n", - current_dm_id); - goto fail; + if (!s->dm) { + s->dm = ff_refstruct_allocz(sizeof(AVDOVIColorMetadata)); + if (!s->dm) { + ff_dovi_ctx_unref(s); + return AVERROR(ENOMEM); + } } - /* Update current pointer based on current_dm_id */ - vdr = s->vdr[current_dm_id]; - s->color = &vdr->color; - - /* Update values of affected_dm_id */ - vdr = s->vdr[affected_dm_id]; - color = &vdr->color; + s->color = color = s->dm; color->dm_metadata_id = affected_dm_id; color->scene_refresh_flag = get_ue_golomb_31(gb); for (int i = 0; i < 9; i++) @@ -611,25 +635,24 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, color->source_min_pq = get_bits(gb, 12); color->source_max_pq = get_bits(gb, 12); color->source_diagonal = get_bits(gb, 10); - } - - /* Parse extension blocks */ - s->num_ext_blocks = 0; - if ((ret = parse_ext_blocks(s, gb, 1)) < 0) { - ff_dovi_ctx_unref(s); - return ret; - } - if (get_bits_left(gb) > 48 /* padding + CRC32 + terminator */) { - if ((ret = parse_ext_blocks(s, gb, 2)) < 0) { + /* Parse extension blocks */ + s->num_ext_blocks = 0; + if ((ret = parse_ext_blocks(s, gb, 1)) < 0) { ff_dovi_ctx_unref(s); return ret; } + + if (get_bits_left(gb) > 48 /* padding + CRC32 + terminator */) { + if ((ret = parse_ext_blocks(s, gb, 2)) < 0) { + ff_dovi_ctx_unref(s); + return ret; + } + } + } else { + s->color = &ff_dovi_color_default; + s->num_ext_blocks = 0; } return 0; - -fail: - ff_dovi_ctx_unref(s); /* don't leak potentially invalid state */ - return AVERROR_INVALIDDATA; } diff --git a/src/ExtLib/ffmpeg/libavcodec/error_resilience.c b/src/ExtLib/ffmpeg/libavcodec/error_resilience.c index 56844d5084..6edc2dc15f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/error_resilience.c +++ b/src/ExtLib/ffmpeg/libavcodec/error_resilience.c @@ -902,6 +902,7 @@ void ff_er_frame_end(ERContext *s, int *decode_error_flags) int threshold = 50; int is_intra_likely; int size = s->b8_stride * 2 * s->mb_height; + int guessed_mb_type; /* We do not support ER of field pictures yet, * though it should not crash if enabled. */ @@ -1117,16 +1118,15 @@ void ff_er_frame_end(ERContext *s, int *decode_error_flags) is_intra_likely = is_intra_more_likely(s); /* set unknown mb-type to most likely */ + guessed_mb_type = is_intra_likely ? MB_TYPE_INTRA4x4 : + (MB_TYPE_16x16 | (s->avctx->codec_id == AV_CODEC_ID_H264 ? MB_TYPE_L0 : MB_TYPE_FORWARD_MV)); for (i = 0; i < s->mb_num; i++) { const int mb_xy = s->mb_index2xy[i]; int error = s->error_status_table[mb_xy]; if (!((error & ER_DC_ERROR) && (error & ER_MV_ERROR))) continue; - if (is_intra_likely) - s->cur_pic.mb_type[mb_xy] = MB_TYPE_INTRA4x4; - else - s->cur_pic.mb_type[mb_xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[mb_xy] = guessed_mb_type; } // change inter to intra blocks if no reference frames are available diff --git a/src/ExtLib/ffmpeg/libavcodec/h261.h b/src/ExtLib/ffmpeg/libavcodec/h261.h index f2b9a7e794..ae50455e2c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h261.h +++ b/src/ExtLib/ffmpeg/libavcodec/h261.h @@ -28,6 +28,7 @@ #ifndef AVCODEC_H261_H #define AVCODEC_H261_H +#include "mpegutils.h" #include "mpegvideo.h" #include "rl.h" @@ -38,17 +39,21 @@ typedef struct H261Context { int mtype; } H261Context; -#define MB_TYPE_H261_FIL 0x800000 +#define MB_TYPE_H261_FIL MB_TYPE_CODEC_SPECIFIC extern const uint8_t ff_h261_mba_code[35]; extern const uint8_t ff_h261_mba_bits[35]; extern const uint8_t ff_h261_mtype_code[10]; extern const uint8_t ff_h261_mtype_bits[10]; -extern const int ff_h261_mtype_map[10]; +extern const uint16_t ff_h261_mtype_map[10]; extern const uint8_t ff_h261_mv_tab[17][2]; extern const uint8_t ff_h261_cbp_tab[63][2]; extern RLTable ff_h261_rl_tcoeff; +extern const uint16_t ff_h261_tcoeff_vlc[65][2]; +extern const int8_t ff_h261_tcoeff_level[64]; +extern const int8_t ff_h261_tcoeff_run[64]; + void ff_h261_loop_filter(MpegEncContext *s); #endif /* AVCODEC_H261_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/h261data.c b/src/ExtLib/ffmpeg/libavcodec/h261data.c index ddc205fd91..54a70b040e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h261data.c +++ b/src/ExtLib/ffmpeg/libavcodec/h261data.c @@ -72,7 +72,7 @@ const uint8_t ff_h261_mtype_bits[10] = { 2, 6 }; -const int ff_h261_mtype_map[10] = { +const uint16_t ff_h261_mtype_map[10] = { MB_TYPE_INTRA4x4, MB_TYPE_INTRA4x4 | MB_TYPE_QUANT, MB_TYPE_CBP, @@ -104,7 +104,7 @@ const uint8_t ff_h261_cbp_tab[63][2] = { }; // H.261 VLC table for transform coefficients -static const uint16_t h261_tcoeff_vlc[65][2] = { +const uint16_t ff_h261_tcoeff_vlc[65][2] = { { 0x2, 2 }, { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 }, { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 }, { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, @@ -124,7 +124,7 @@ static const uint16_t h261_tcoeff_vlc[65][2] = { { 0x1, 6 } // escape }; -static const int8_t h261_tcoeff_level[64] = { +const int8_t ff_h261_tcoeff_level[64] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 1, @@ -135,7 +135,7 @@ static const int8_t h261_tcoeff_level[64] = { 1, 1, 1, 1, 1, 1, 1, 1 }; -static const int8_t h261_tcoeff_run[64] = { +const int8_t ff_h261_tcoeff_run[64] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, @@ -150,7 +150,7 @@ static const int8_t h261_tcoeff_run[64] = { RLTable ff_h261_rl_tcoeff = { 64, 64, - h261_tcoeff_vlc, - h261_tcoeff_run, - h261_tcoeff_level, + ff_h261_tcoeff_vlc, + ff_h261_tcoeff_run, + ff_h261_tcoeff_level, }; diff --git a/src/ExtLib/ffmpeg/libavcodec/h261dec.c b/src/ExtLib/ffmpeg/libavcodec/h261dec.c index 392f1aef1d..cabca33c8d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h261dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/h261dec.c @@ -67,9 +67,10 @@ static av_cold void h261_decode_init_static(void) VLC_INIT_STATIC_TABLE(h261_mba_vlc, H261_MBA_VLC_BITS, 35, ff_h261_mba_bits, 1, 1, ff_h261_mba_code, 1, 1, 0); - VLC_INIT_STATIC_TABLE(h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, - ff_h261_mtype_bits, 1, 1, - ff_h261_mtype_code, 1, 1, 0); + VLC_INIT_STATIC_SPARSE_TABLE(h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, + ff_h261_mtype_bits, 1, 1, + ff_h261_mtype_code, 1, 1, + ff_h261_mtype_map, 2, 2, 0); VLC_INIT_STATIC_TABLE(h261_mv_vlc, H261_MV_VLC_BITS, 17, &ff_h261_mv_tab[0][1], 2, 1, &ff_h261_mv_tab[0][0], 2, 1, 0); @@ -86,6 +87,8 @@ static av_cold int h261_decode_init(AVCodecContext *avctx) MpegEncContext *const s = &h->s; int ret; + avctx->framerate = (AVRational) { 30000, 1001 }; + s->private_ctx = &h->common; // set defaults ret = ff_mpv_decode_init(s, avctx); @@ -96,8 +99,6 @@ static av_cold int h261_decode_init(AVCodecContext *avctx) s->low_delay = 1; avctx->pix_fmt = AV_PIX_FMT_YUV420P; - h->gob_start_code_skipped = 0; - ff_thread_once(&init_static_once, h261_decode_init_static); return 0; @@ -166,47 +167,6 @@ static int h261_decode_gob_header(H261DecContext *h) return 0; } -/** - * Decode the group of blocks / video packet header. - * @return <0 if no resync found - */ -static int h261_resync(H261DecContext *h) -{ - MpegEncContext *const s = &h->s; - int left, ret; - - if (h->gob_start_code_skipped) { - ret = h261_decode_gob_header(h); - if (ret >= 0) - return 0; - } else { - if (show_bits(&s->gb, 15) == 0) { - ret = h261_decode_gob_header(h); - if (ret >= 0) - return 0; - } - // OK, it is not where it is supposed to be ... - s->gb = s->last_resync_gb; - align_get_bits(&s->gb); - left = get_bits_left(&s->gb); - - for (; left > 15 + 1 + 4 + 5; left -= 8) { - if (show_bits(&s->gb, 15) == 0) { - GetBitContext bak = s->gb; - - ret = h261_decode_gob_header(h); - if (ret >= 0) - return 0; - - s->gb = bak; - } - skip_bits(&s->gb, 8); - } - } - - return -1; -} - /** * Decode skipped macroblocks. * @return 0 @@ -231,7 +191,7 @@ static int h261_decode_mb_skipped(H261DecContext *h, int mba1, int mba2) s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; - s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; s->mb_skipped = 1; @@ -250,10 +210,6 @@ static int h261_decode_mb_skipped(H261DecContext *h, int mba1, int mba2) return 0; } -static const int mvmap[17] = { - 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16 -}; - static int decode_mv_component(GetBitContext *gb, int v) { int mv_diff = get_vlc2(gb, h261_mv_vlc, H261_MV_VLC_BITS, 2); @@ -262,9 +218,7 @@ static int decode_mv_component(GetBitContext *gb, int v) if (mv_diff < 0) return v; - mv_diff = mvmap[mv_diff]; - - if (mv_diff && !get_bits1(gb)) + if (mv_diff && get_bits1(gb)) mv_diff = -mv_diff; v += mv_diff; @@ -286,6 +240,7 @@ static int h261_decode_block(H261DecContext *h, int16_t *block, int n, int coded int level, i, j, run; const RLTable *rl = &ff_h261_rl_tcoeff; const uint8_t *scan_table; + const int qmul = s->qscale << 1, qadd = (s->qscale - 1) | 1; /* For the variable length encoding there are two code tables, one being * used for the first transmitted LEVEL in INTER, INTER + MC and @@ -307,7 +262,7 @@ static int h261_decode_block(H261DecContext *h, int16_t *block, int n, int coded * being coded as 1111 1111. */ if (level == 255) level = 128; - block[0] = level; + block[0] = level * s->y_dc_scale; i = 1; } else if (coded) { // Run Level Code @@ -318,7 +273,8 @@ static int h261_decode_block(H261DecContext *h, int16_t *block, int n, int coded i = 0; if (check & 0x2) { skip_bits(&s->gb, 2); - block[0] = (check & 0x1) ? -1 : 1; + block[0] = qmul + qadd; + block[0] *= (check & 0x1) ? -1 : 1; i = 1; } } else { @@ -348,10 +304,15 @@ static int h261_decode_block(H261DecContext *h, int16_t *block, int n, int coded run = SHOW_UBITS(re, &s->gb, 6) + 1; SKIP_CACHE(re, &s->gb, 6); level = SHOW_SBITS(re, &s->gb, 8); + if (level > 0) + level = level * qmul + qadd; + else if (level < 0) + level = level * qmul - qadd; SKIP_COUNTER(re, &s->gb, 6 + 8); } else if (level == 0) { break; } else { + level = level * qmul + qadd; if (SHOW_UBITS(re, &s->gb, 1)) level = -level; SKIP_COUNTER(re, &s->gb, 1); @@ -414,12 +375,9 @@ static int h261_decode_mb(H261DecContext *h) // Read mtype com->mtype = get_vlc2(&s->gb, h261_mtype_vlc, H261_MTYPE_VLC_BITS, 2); if (com->mtype < 0) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid mtype index %d\n", - com->mtype); + av_log(s->avctx, AV_LOG_ERROR, "Invalid mtype index\n"); return SLICE_ERROR; } - av_assert0(com->mtype < FF_ARRAY_ELEMS(ff_h261_mtype_map)); - com->mtype = ff_h261_mtype_map[com->mtype]; // Read mquant if (IS_QUANT(com->mtype)) @@ -462,7 +420,7 @@ static int h261_decode_mb(H261DecContext *h) //set motion vectors s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; - s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; s->mv[0][0][0] = h->current_mv_x * 2; // gets divided by 2 in motion compensation s->mv[0][0][1] = h->current_mv_y * 2; @@ -517,8 +475,6 @@ static int h261_decode_picture_header(H261DecContext *h) /* temporal reference */ skip_bits(&s->gb, 5); /* picture timestamp */ - s->avctx->framerate = (AVRational) { 30000, 1001 }; - /* PTYPE starts here */ skip_bits1(&s->gb); /* split screen off */ skip_bits1(&s->gb); /* camera off */ @@ -646,7 +602,7 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict, s->mb_y = 0; while (h->gob_number < (s->mb_height == 18 ? 12 : 5)) { - if (h261_resync(h) < 0) + if (h261_decode_gob_header(h) < 0) break; h261_decode_gob(h); } diff --git a/src/ExtLib/ffmpeg/libavcodec/h263dec.c b/src/ExtLib/ffmpeg/libavcodec/h263dec.c index eee7978452..0c23012584 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h263dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/h263dec.c @@ -99,10 +99,14 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - s->quant_precision = 5; s->decode_mb = ff_h263_decode_mb; s->low_delay = 1; + // dct_unquantize defaults for H.263; + // they might change on a per-frame basis for MPEG-4. + s->dct_unquantize_intra = s->dct_unquantize_h263_intra; + s->dct_unquantize_inter = s->dct_unquantize_h263_inter; + /* select sub codec */ switch (avctx->codec->id) { case AV_CODEC_ID_H263: @@ -110,6 +114,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) avctx->chroma_sample_location = AVCHROMA_LOC_CENTER; break; case AV_CODEC_ID_MPEG4: + // dct_unquantize_inter is only used with MPEG-2 quantizers, + // so we can already set dct_unquantize_inter here once and for all. + s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter; break; case AV_CODEC_ID_MSMPEG4V1: s->h263_pred = 1; @@ -132,6 +139,8 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) s->msmpeg4_version = MSMP4_WMV2; break; case AV_CODEC_ID_H263I: + case AV_CODEC_ID_RV10: + case AV_CODEC_ID_RV20: break; case AV_CODEC_ID_FLV1: s->h263_flv = 1; @@ -523,6 +532,11 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, goto retry; if (s->studio_profile != (s->idsp.idct == NULL)) ff_mpv_idct_init(s); + if (s->mpeg_quant) { + s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra; + } else { + s->dct_unquantize_intra = s->dct_unquantize_h263_intra; + } } /* After H.263 & MPEG-4 header decode we have the height, width, diff --git a/src/ExtLib/ffmpeg/libavcodec/h263enc.h b/src/ExtLib/ffmpeg/libavcodec/h263enc.h index cd5ded1593..784500ca7a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h263enc.h +++ b/src/ExtLib/ffmpeg/libavcodec/h263enc.h @@ -32,42 +32,16 @@ void ff_h263_encode_mb(MpegEncContext *s, int motion_x, int motion_y); void ff_h263_encode_mba(MpegEncContext *s); -void ff_init_qscale_tab(MpegEncContext *s); void ff_clean_h263_qscales(MpegEncContext *s); void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code); void ff_h263_update_mb(MpegEncContext *s); -static inline int h263_get_motion_length(int val, int f_code) -{ - int bit_size, code, sign; - - if (val == 0) { - return 1; /* ff_mvtab[0][1] */ - } else { - bit_size = f_code - 1; - /* modulo encoding */ - val = sign_extend(val, 6 + bit_size); - sign = val >> 31; - val = (val ^ sign) - sign; /* val = FFABS(val) */ - val--; - code = (val >> bit_size) + 1; - - return ff_mvtab[code][1] + 1 + bit_size; - } -} - static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y, int f_code) { - if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT) { - skip_put_bits(&s->pb, - h263_get_motion_length(x, f_code) + - h263_get_motion_length(y, f_code)); - } else { - ff_h263_encode_motion(&s->pb, x, f_code); - ff_h263_encode_motion(&s->pb, y, f_code); - } + ff_h263_encode_motion(&s->pb, x, f_code); + ff_h263_encode_motion(&s->pb, y, f_code); } static inline int get_p_cbp(MpegEncContext * s, diff --git a/src/ExtLib/ffmpeg/libavcodec/h264_parse.h b/src/ExtLib/ffmpeg/libavcodec/h264_parse.h index 0826b84e9c..8b98dcd4cb 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h264_parse.h +++ b/src/ExtLib/ffmpeg/libavcodec/h264_parse.h @@ -33,7 +33,7 @@ #include "get_bits.h" #include "h264_ps.h" -#define MB_TYPE_REF0 MB_TYPE_ACPRED // dirty but it fits in 16 bit +#define MB_TYPE_REF0 MB_TYPE_CODEC_SPECIFIC #define MB_TYPE_8x8DCT 0x01000000 // This table must be here because scan8[constant] must be known at compiletime diff --git a/src/ExtLib/ffmpeg/libavcodec/h264dec.c b/src/ExtLib/ffmpeg/libavcodec/h264dec.c index a3b952dd48..39609cdc8b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h264dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/h264dec.c @@ -1008,7 +1008,7 @@ static int finalize_frame(H264Context *h, AVFrame *dst, H264Picture *out, int *g *got_frame = 1; if (CONFIG_MPEGVIDEODEC) { - ff_print_debug_info2(h->avctx, dst, NULL, + ff_print_debug_info2(h->avctx, dst, out->mb_type, out->qscale_table, out->motion_val, diff --git a/src/ExtLib/ffmpeg/libavcodec/h264dec.h b/src/ExtLib/ffmpeg/libavcodec/h264dec.h index 511ab32225..8d46ffb22b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/h264dec.h +++ b/src/ExtLib/ffmpeg/libavcodec/h264dec.h @@ -95,6 +95,14 @@ #define IS_REF0(a) ((a) & MB_TYPE_REF0) #define IS_8x8DCT(a) ((a) & MB_TYPE_8x8DCT) +#define IS_SUB_8X8(a) ((a) & MB_TYPE_16x16) // note reused +#define IS_SUB_8X4(a) ((a) & MB_TYPE_16x8) // note reused +#define IS_SUB_4X8(a) ((a) & MB_TYPE_8x16) // note reused +#define IS_SUB_4X4(a) ((a) & MB_TYPE_8x8) // note reused +#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0 << ((part) + 2 * (list)))) + +// does this mb use listX, note does not work if subMBs +#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list)))) /** * Memory management control operation. diff --git a/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c b/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c index 0809048362..e0f3034e57 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/ituh263dec.c @@ -59,19 +59,19 @@ #define H263_MBTYPE_B_VLC_BITS 6 #define CBPC_B_VLC_BITS 3 -static const int h263_mb_type_b_map[15]= { - MB_TYPE_DIRECT2 | MB_TYPE_L0L1, - MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP, - MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT, - MB_TYPE_L0 | MB_TYPE_16x16, - MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_16x16, - MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, - MB_TYPE_L1 | MB_TYPE_16x16, - MB_TYPE_L1 | MB_TYPE_CBP | MB_TYPE_16x16, - MB_TYPE_L1 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, - MB_TYPE_L0L1 | MB_TYPE_16x16, - MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_16x16, - MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, +static const int16_t h263_mb_type_b_map[15]= { + MB_TYPE_DIRECT2 | MB_TYPE_BIDIR_MV, + MB_TYPE_DIRECT2 | MB_TYPE_BIDIR_MV | MB_TYPE_CBP, + MB_TYPE_DIRECT2 | MB_TYPE_BIDIR_MV | MB_TYPE_CBP | MB_TYPE_QUANT, + MB_TYPE_FORWARD_MV | MB_TYPE_16x16, + MB_TYPE_FORWARD_MV | MB_TYPE_CBP | MB_TYPE_16x16, + MB_TYPE_FORWARD_MV | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, + MB_TYPE_BACKWARD_MV | MB_TYPE_16x16, + MB_TYPE_BACKWARD_MV | MB_TYPE_CBP | MB_TYPE_16x16, + MB_TYPE_BACKWARD_MV | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, + MB_TYPE_BIDIR_MV | MB_TYPE_16x16, + MB_TYPE_BIDIR_MV | MB_TYPE_CBP | MB_TYPE_16x16, + MB_TYPE_BIDIR_MV | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, 0, //stuffing MB_TYPE_INTRA4x4 | MB_TYPE_CBP, MB_TYPE_INTRA4x4 | MB_TYPE_CBP | MB_TYPE_QUANT, @@ -125,9 +125,10 @@ static av_cold void h263_decode_init_vlc(void) ff_h263_init_rl_inter(); VLC_INIT_RL(ff_h263_rl_inter, 554); INIT_FIRST_VLC_RL(ff_rl_intra_aic, 554); - VLC_INIT_STATIC_TABLE(h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, - &ff_h263_mbtype_b_tab[0][1], 2, 1, - &ff_h263_mbtype_b_tab[0][0], 2, 1, 0); + VLC_INIT_STATIC_SPARSE_TABLE(h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, + &ff_h263_mbtype_b_tab[0][1], 2, 1, + &ff_h263_mbtype_b_tab[0][0], 2, 1, + h263_mb_type_b_map, 2, 2, 0); VLC_INIT_STATIC_TABLE(cbpc_b_vlc, CBPC_B_VLC_BITS, 4, &ff_cbpc_b_tab[0][1], 2, 1, &ff_cbpc_b_tab[0][0], 2, 1, 0); @@ -363,7 +364,7 @@ static void preview_obmc(MpegEncContext *s){ mot_val[1 ]= mot_val[3 ]= mot_val[1+stride]= mot_val[3+stride]= 0; - s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; goto end; } cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2); @@ -382,7 +383,7 @@ static void preview_obmc(MpegEncContext *s){ } if ((cbpc & 16) == 0) { - s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; /* 16x16 motion prediction */ mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); if (s->umvplus) @@ -400,7 +401,7 @@ static void preview_obmc(MpegEncContext *s){ mot_val[1 ]= mot_val[3 ]= mot_val[1+stride]= mot_val[3+stride]= my; } else { - s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_FORWARD_MV; for(i=0;i<4;i++) { mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); if (s->umvplus) @@ -763,7 +764,7 @@ static int set_direct_mv(MpegEncContext *s) s->mv_type = MV_TYPE_8X8; for (i = 0; i < 4; i++) set_one_direct_mv(s, p, i); - return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1; + return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_BIDIR_MV; } else { set_one_direct_mv(s, p, 0); s->mv[0][1][0] = @@ -780,7 +781,7 @@ static int set_direct_mv(MpegEncContext *s) s->mv[1][3][1] = s->mv[1][0][1]; s->mv_type = MV_TYPE_8X8; // Note see prev line - return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; + return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_BIDIR_MV; } } @@ -803,7 +804,7 @@ int ff_h263_decode_mb(MpegEncContext *s, s->block_last_index[i] = -1; s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; - s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; s->mb_skipped = !(s->obmc | s->loop_filter); @@ -841,7 +842,7 @@ int ff_h263_decode_mb(MpegEncContext *s, s->mv_dir = MV_DIR_FORWARD; if ((cbpc & 16) == 0) { - s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; /* 16x16 motion prediction */ s->mv_type = MV_TYPE_16X16; ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); @@ -866,7 +867,7 @@ int ff_h263_decode_mb(MpegEncContext *s, if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ } else { - s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_FORWARD_MV; s->mv_type = MV_TYPE_8X8; for(i=0;i<4;i++) { mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); @@ -911,8 +912,6 @@ int ff_h263_decode_mb(MpegEncContext *s, av_log(s->avctx, AV_LOG_ERROR, "b mb_type damaged at %d %d\n", s->mb_x, s->mb_y); return SLICE_ERROR; } - - mb_type= h263_mb_type_b_map[ mb_type ]; }while(!mb_type); s->mb_intra = IS_INTRA(mb_type); @@ -952,7 +951,7 @@ int ff_h263_decode_mb(MpegEncContext *s, s->mv_type= MV_TYPE_16X16; //FIXME UMV - if(USES_LIST(mb_type, 0)){ + if (HAS_FORWARD_MV(mb_type)) { int16_t *mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); s->mv_dir = MV_DIR_FORWARD; @@ -979,7 +978,7 @@ int ff_h263_decode_mb(MpegEncContext *s, mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my; } - if(USES_LIST(mb_type, 1)){ + if (HAS_BACKWARD_MV(mb_type)) { int16_t *mot_val= ff_h263_pred_motion(s, 0, 1, &pred_x, &pred_y); s->mv_dir |= MV_DIR_BACKWARD; diff --git a/src/ExtLib/ffmpeg/libavcodec/jpeg2000dec.c b/src/ExtLib/ffmpeg/libavcodec/jpeg2000dec.c index d15502a527..091931b1ff 100644 --- a/src/ExtLib/ffmpeg/libavcodec/jpeg2000dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/jpeg2000dec.c @@ -1005,6 +1005,7 @@ static inline void select_header(Jpeg2000DecoderContext *s, const Jpeg2000Tile * { s->g = tile->tile_part[*tp_index].header_tpg; if (bytestream2_get_bytes_left(&s->g) == 0 && s->bit_index == 8) { + av_log(s->avctx, AV_LOG_WARNING, "Packet header bytes in PPM marker segment is too short.\n"); if (*tp_index < FF_ARRAY_ELEMS(tile->tile_part) - 1) { s->g = tile->tile_part[++(*tp_index)].tpg; } @@ -1014,10 +1015,18 @@ static inline void select_header(Jpeg2000DecoderContext *s, const Jpeg2000Tile * static inline void select_stream(Jpeg2000DecoderContext *s, const Jpeg2000Tile *tile, int *tp_index, const Jpeg2000CodingStyle *codsty) { + int32_t is_endof_tp; + s->g = tile->tile_part[*tp_index].tpg; - if (bytestream2_get_bytes_left(&s->g) == 0 && s->bit_index == 8) { + is_endof_tp = bytestream2_get_bytes_left(&s->g) == 0 && s->bit_index == 8; + // Following while loop is necessary because a tilepart may include only SOD marker. + // Such a tilepart has neither packet header nor compressed data. + while (is_endof_tp) { if (*tp_index < FF_ARRAY_ELEMS(tile->tile_part) - 1) { s->g = tile->tile_part[++(*tp_index)].tpg; + is_endof_tp = bytestream2_get_bytes_left(&s->g) == 0 && s->bit_index == 8; + } else { + is_endof_tp = 0; } } if (codsty->csty & JPEG2000_CSTY_SOP) { diff --git a/src/ExtLib/ffmpeg/libavcodec/mathops.h b/src/ExtLib/ffmpeg/libavcodec/mathops.h index a1dc323304..84a924f31b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mathops.h +++ b/src/ExtLib/ffmpeg/libavcodec/mathops.h @@ -39,8 +39,6 @@ extern const uint8_t ff_zigzag_scan[16+1]; #if ARCH_ARM # include "arm/mathops.h" -#elif ARCH_AVR32 -# include "avr32/mathops.h" #elif ARCH_MIPS # include "mips/mathops.h" #elif ARCH_PPC diff --git a/src/ExtLib/ffmpeg/libavcodec/me_cmp.c b/src/ExtLib/ffmpeg/libavcodec/me_cmp.c index fe39009093..592ee76084 100644 --- a/src/ExtLib/ffmpeg/libavcodec/me_cmp.c +++ b/src/ExtLib/ffmpeg/libavcodec/me_cmp.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "libavutil/attributes.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" @@ -473,74 +475,60 @@ static int zero_cmp(MpegEncContext *s, const uint8_t *a, const uint8_t *b, return 0; } -int ff_set_cmp(MECmpContext *c, me_cmp_func *cmp, int type) +av_cold int ff_set_cmp(const MECmpContext *c, me_cmp_func *cmp, int type, int mpvenc) { - int ret = 0; - int i; - - memset(cmp, 0, sizeof(void *) * 6); - - for (i = 0; i < 6; i++) { - switch (type & 0xFF) { - case FF_CMP_SAD: - cmp[i] = c->sad[i]; - break; - case FF_CMP_MEDIAN_SAD: - cmp[i] = c->median_sad[i]; - break; - case FF_CMP_SATD: - cmp[i] = c->hadamard8_diff[i]; - break; - case FF_CMP_SSE: - cmp[i] = c->sse[i]; - break; - case FF_CMP_DCT: - cmp[i] = c->dct_sad[i]; - break; - case FF_CMP_DCT264: - cmp[i] = c->dct264_sad[i]; - break; - case FF_CMP_DCTMAX: - cmp[i] = c->dct_max[i]; - break; - case FF_CMP_PSNR: - cmp[i] = c->quant_psnr[i]; - break; - case FF_CMP_BIT: - cmp[i] = c->bit[i]; - break; - case FF_CMP_RD: - cmp[i] = c->rd[i]; - break; - case FF_CMP_VSAD: - cmp[i] = c->vsad[i]; - break; - case FF_CMP_VSSE: - cmp[i] = c->vsse[i]; - break; - case FF_CMP_ZERO: - cmp[i] = zero_cmp; - break; - case FF_CMP_NSSE: - cmp[i] = c->nsse[i]; - break; -#if CONFIG_DWT - case FF_CMP_W53: - cmp[i]= c->w53[i]; - break; - case FF_CMP_W97: - cmp[i]= c->w97[i]; - break; +#define ENTRY(CMP_FLAG, ARRAY, MPVENC_ONLY) \ + [FF_CMP_ ## CMP_FLAG] = { \ + .offset = offsetof(MECmpContext, ARRAY), \ + .mpv_only = MPVENC_ONLY, \ + .available = 1, \ + } + static const struct { + char available; + char mpv_only; + uint16_t offset; + } cmp_func_list[] = { + ENTRY(SAD, sad, 0), + ENTRY(SSE, sse, 0), + ENTRY(SATD, hadamard8_diff, 0), + ENTRY(DCT, dct_sad, 1), + ENTRY(PSNR, quant_psnr, 1), + ENTRY(BIT, bit, 1), + ENTRY(RD, rd, 1), + ENTRY(VSAD, vsad, 0), + ENTRY(VSSE, vsse, 0), + ENTRY(NSSE, nsse, 0), +#if CONFIG_SNOW_DECODER || CONFIG_SNOW_ENCODER + ENTRY(W53, w53, 0), + ENTRY(W97, w97, 0), #endif - default: - av_log(NULL, AV_LOG_ERROR, - "invalid cmp function selection\n"); - ret = -1; - break; - } + ENTRY(DCTMAX, dct_max, 1), +#if CONFIG_GPL + ENTRY(DCT264, dct264_sad, 1), +#endif + ENTRY(MEDIAN_SAD, median_sad, 0), + }; + const me_cmp_func *me_cmp_func_array; + + type &= 0xFF; + + if (type == FF_CMP_ZERO) { + for (int i = 0; i < 6; i++) + cmp[i] = zero_cmp; + return 0; } + if (type > FF_ARRAY_ELEMS(cmp_func_list) || + !cmp_func_list[type].available || + !mpvenc && cmp_func_list[type].mpv_only) { + av_log(NULL, AV_LOG_ERROR, + "invalid cmp function selection\n"); + return AVERROR(EINVAL); + } + me_cmp_func_array = (const me_cmp_func*)(((const char*)c) + cmp_func_list[type].offset); + for (int i = 0; i < 6; i++) + cmp[i] = me_cmp_func_array[i]; - return ret; + return 0; } #define BUTTERFLY2(o1, o2, i1, i2) \ @@ -665,7 +653,7 @@ static int dct_sad8x8_c(MpegEncContext *s, const uint8_t *src1, s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride); s->fdsp.fdct(temp); - return s->mecc.sum_abs_dctelem(temp); + return s->sum_abs_dctelem(temp); } #if CONFIG_GPL @@ -831,7 +819,7 @@ static int rd8x8_c(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, s->idsp.idct_add(lsrc2, 8, temp); - distortion = s->mecc.sse[1](NULL, lsrc2, lsrc1, 8, 8); + distortion = s->sse_cmp[1](NULL, lsrc2, lsrc1, 8, 8); return distortion + ((bits * s->qscale * s->qscale * 109 + 64) >> 7); } @@ -1007,6 +995,8 @@ WRAPPER8_16_SQ(bit8x8_c, bit16_c) av_cold void ff_me_cmp_init(MECmpContext *c, AVCodecContext *avctx) { + memset(c, 0, sizeof(*c)); + c->sum_abs_dctelem = sum_abs_dctelem_c; /* TODO [0] 16 [1] 8 */ diff --git a/src/ExtLib/ffmpeg/libavcodec/me_cmp.h b/src/ExtLib/ffmpeg/libavcodec/me_cmp.h index fee0ecb28e..9053327c4c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/me_cmp.h +++ b/src/ExtLib/ffmpeg/libavcodec/me_cmp.h @@ -70,13 +70,6 @@ typedef struct MECmpContext { me_cmp_func dct_max[6]; me_cmp_func dct264_sad[6]; - me_cmp_func me_pre_cmp[6]; - me_cmp_func me_cmp[6]; - me_cmp_func me_sub_cmp[6]; - me_cmp_func mb_cmp[6]; - me_cmp_func ildct_cmp[6]; // only width 16 used - me_cmp_func frame_skip_cmp[6]; // only width 8 used - me_cmp_func pix_abs[2][4]; me_cmp_func median_sad[6]; } MECmpContext; @@ -90,7 +83,14 @@ void ff_me_cmp_init_riscv(MECmpContext *c, AVCodecContext *avctx); void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx); void ff_me_cmp_init_mips(MECmpContext *c, AVCodecContext *avctx); -int ff_set_cmp(MECmpContext *c, me_cmp_func *cmp, int type); +/** + * Fill the function pointer array cmp[6] with me_cmp_funcs from + * c based upon type. If mpvenc is not set, an error is returned + * if the type of comparison functions requires an initialized + * MpegEncContext. + */ +int ff_set_cmp(const MECmpContext *c, me_cmp_func *cmp, + int type, int mpvenc); void ff_dsputil_init_dwt(MECmpContext *c); diff --git a/src/ExtLib/ffmpeg/libavcodec/motion_est.c b/src/ExtLib/ffmpeg/libavcodec/motion_est.c index 162472d693..554fc9780e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/motion_est.c +++ b/src/ExtLib/ffmpeg/libavcodec/motion_est.c @@ -305,45 +305,44 @@ static int zero_cmp(MpegEncContext *s, const uint8_t *a, const uint8_t *b, static void zero_hpel(uint8_t *a, const uint8_t *b, ptrdiff_t stride, int h){ } -int ff_init_me(MpegEncContext *s){ - MotionEstContext * const c= &s->me; - int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255); +av_cold int ff_me_init(MotionEstContext *c, AVCodecContext *avctx, + const MECmpContext *mecc, int mpvenc) +{ + int cache_size = FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<dia_size) & 255, FFABS(avctx->pre_dia_size) & 255); int ret; - if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -FFMIN(ME_MAP_SIZE, MAX_SAB_SIZE)){ - av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n"); - return -1; + if (FFMIN(avctx->dia_size, avctx->pre_dia_size) < -FFMIN(ME_MAP_SIZE, MAX_SAB_SIZE)) { + av_log(avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n"); + return AVERROR(EINVAL); } - c->avctx= s->avctx; + c->avctx = avctx; - if(s->codec_id == AV_CODEC_ID_H261) - c->avctx->me_sub_cmp = c->avctx->me_cmp; + if (avctx->codec_id == AV_CODEC_ID_H261) + avctx->me_sub_cmp = avctx->me_cmp; - if(cache_size < 2*dia_size && !c->stride){ - av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n"); - } + if (cache_size < 2 * dia_size) + av_log(avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n"); - ret = ff_set_cmp(&s->mecc, s->mecc.me_pre_cmp, c->avctx->me_pre_cmp); - ret |= ff_set_cmp(&s->mecc, s->mecc.me_cmp, c->avctx->me_cmp); - ret |= ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, c->avctx->me_sub_cmp); - ret |= ff_set_cmp(&s->mecc, s->mecc.mb_cmp, c->avctx->mb_cmp); + ret = ff_set_cmp(mecc, c->me_pre_cmp, avctx->me_pre_cmp, mpvenc); + ret |= ff_set_cmp(mecc, c->me_cmp, avctx->me_cmp, mpvenc); + ret |= ff_set_cmp(mecc, c->me_sub_cmp, avctx->me_sub_cmp, mpvenc); + ret |= ff_set_cmp(mecc, c->mb_cmp, avctx->mb_cmp, mpvenc); if (ret < 0) return ret; - c->flags = get_flags(c, 0, c->avctx->me_cmp &FF_CMP_CHROMA); - c->sub_flags= get_flags(c, 0, c->avctx->me_sub_cmp&FF_CMP_CHROMA); - c->mb_flags = get_flags(c, 0, c->avctx->mb_cmp &FF_CMP_CHROMA); + c->sse = mecc->sse[0]; + memcpy(c->pix_abs, mecc->pix_abs, sizeof(c->pix_abs)); -/*FIXME s->no_rounding b_type*/ - if (s->avctx->flags & AV_CODEC_FLAG_QPEL) { + c->flags = get_flags(c, 0, avctx->me_cmp & FF_CMP_CHROMA); + c->sub_flags = get_flags(c, 0, avctx->me_sub_cmp & FF_CMP_CHROMA); + c->mb_flags = get_flags(c, 0, avctx->mb_cmp & FF_CMP_CHROMA); + + if (avctx->codec_id == AV_CODEC_ID_H261) { + c->sub_motion_search = no_sub_motion_search; + } else if (avctx->flags & AV_CODEC_FLAG_QPEL) { c->sub_motion_search= qpel_motion_search; - c->qpel_avg = s->qdsp.avg_qpel_pixels_tab; - if (s->no_rounding) - c->qpel_put = s->qdsp.put_no_rnd_qpel_pixels_tab; - else - c->qpel_put = s->qdsp.put_qpel_pixels_tab; }else{ if(c->avctx->me_sub_cmp&FF_CMP_CHROMA) c->sub_motion_search= hpel_motion_search; @@ -354,6 +353,32 @@ int ff_init_me(MpegEncContext *s){ else c->sub_motion_search= hpel_motion_search; } + + /* 8x8 fullpel search would need a 4x4 chroma compare, which we do + * not have yet, and even if we had, the motion estimation code + * does not expect it. */ + if (avctx->codec_id != AV_CODEC_ID_SNOW) { + if ((avctx->me_cmp & FF_CMP_CHROMA) /* && !c->me_cmp[2] */) + c->me_cmp[2] = zero_cmp; + if ((avctx->me_sub_cmp & FF_CMP_CHROMA) && !c->me_sub_cmp[2]) + c->me_sub_cmp[2] = zero_cmp; + } + + return 0; +} + +void ff_me_init_pic(MpegEncContext *s) +{ + MotionEstContext * const c= &s->me; + +/*FIXME s->no_rounding b_type*/ + if (s->avctx->flags & AV_CODEC_FLAG_QPEL) { + c->qpel_avg = s->qdsp.avg_qpel_pixels_tab; + if (s->no_rounding) + c->qpel_put = s->qdsp.put_no_rnd_qpel_pixels_tab; + else + c->qpel_put = s->qdsp.put_qpel_pixels_tab; + } c->hpel_avg = s->hdsp.avg_pixels_tab; if (s->no_rounding) c->hpel_put = s->hdsp.put_no_rnd_pixels_tab; @@ -367,29 +392,15 @@ int ff_init_me(MpegEncContext *s){ c->stride = 16*s->mb_width + 32; c->uvstride= 8*s->mb_width + 16; } - - /* 8x8 fullpel search would need a 4x4 chroma compare, which we do - * not have yet, and even if we had, the motion estimation code - * does not expect it. */ if (s->codec_id != AV_CODEC_ID_SNOW) { - if ((c->avctx->me_cmp & FF_CMP_CHROMA) /* && !s->mecc.me_cmp[2] */) - s->mecc.me_cmp[2] = zero_cmp; - if ((c->avctx->me_sub_cmp & FF_CMP_CHROMA) && !s->mecc.me_sub_cmp[2]) - s->mecc.me_sub_cmp[2] = zero_cmp; c->hpel_put[2][0]= c->hpel_put[2][1]= c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel; } - - if(s->codec_id == AV_CODEC_ID_H261){ - c->sub_motion_search= no_sub_motion_search; - } - - return 0; } #define CHECK_SAD_HALF_MV(suffix, x, y) \ {\ - d = s->mecc.pix_abs[size][(x ? 1 : 0) + (y ? 2 : 0)](NULL, pix, ptr + ((x) >> 1), stride, h); \ + d = c->pix_abs[size][(x ? 1 : 0) + (y ? 2 : 0)](NULL, pix, ptr + ((x) >> 1), stride, h); \ d += (mv_penalty[pen_x + x] + mv_penalty[pen_y + y])*penalty_factor;\ COPY3_IF_LT(dminh, d, dx, x, dy, y)\ } @@ -526,7 +537,7 @@ static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my, int mv4) /** * get fullpel ME search limits. */ -static inline void get_limits(MpegEncContext *s, int x, int y) +static inline void get_limits(MpegEncContext *s, int x, int y, int bframe) { MotionEstContext * const c= &s->me; int range= c->avctx->me_range >> (1 + !!(c->flags&FLAG_QPEL)); @@ -540,7 +551,7 @@ static inline void get_limits(MpegEncContext *s, int x, int y) c->ymin = - y - 16; c->xmax = - x + s->width; c->ymax = - y + s->height; - } else if (s->out_format == FMT_H261){ + } else if (!(av_builtin_constant_p(bframe) && bframe) && s->out_format == FMT_H261){ // Search range of H.261 is different from other codec standards c->xmin = (x > 15) ? - 15 : 0; c->ymin = (y > 15) ? - 15 : 0; @@ -642,7 +653,7 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h); - if (s->mecc.me_sub_cmp[0] != s->mecc.mb_cmp[0]) { + if (c->me_sub_cmp[0] != c->mb_cmp[0]) { int dxy; const int offset= ((block&1) + (block>>1)*stride)*8; uint8_t *dest_y = c->scratchpad + offset; @@ -684,11 +695,11 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) if(same) return INT_MAX; - if (s->mecc.me_sub_cmp[0] != s->mecc.mb_cmp[0]) { - dmin_sum += s->mecc.mb_cmp[0](s, - s->new_pic->data[0] + - s->mb_x * 16 + s->mb_y * 16 * stride, - c->scratchpad, stride, 16); + if (c->me_sub_cmp[0] != c->mb_cmp[0]) { + dmin_sum += c->mb_cmp[0](s, + s->new_pic->data[0] + + s->mb_x * 16 + s->mb_y * 16 * stride, + c->scratchpad, stride, 16); } if(c->avctx->mb_cmp&FF_CMP_CHROMA){ @@ -710,8 +721,8 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_pic.data[2] + offset, s->uvlinesize, 8); } - dmin_sum += s->mecc.mb_cmp[1](s, s->new_pic->data[1] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad, s->uvlinesize, 8); - dmin_sum += s->mecc.mb_cmp[1](s, s->new_pic->data[2] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad + 8, s->uvlinesize, 8); + dmin_sum += c->mb_cmp[1](s, s->new_pic->data[1] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad, s->uvlinesize, 8); + dmin_sum += c->mb_cmp[1](s, s->new_pic->data[2] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad + 8, s->uvlinesize, 8); } c->pred_x= mx; @@ -807,7 +818,7 @@ static int interlaced_search(MpegEncContext *s, int ref_index, mv_table[xy][0]= mx_i; mv_table[xy][1]= my_i; - if (s->mecc.me_sub_cmp[0] != s->mecc.mb_cmp[0]) { + if (c->me_sub_cmp[0] != c->mb_cmp[0]) { int dxy; //FIXME chroma ME @@ -819,7 +830,7 @@ static int interlaced_search(MpegEncContext *s, int ref_index, }else{ s->hdsp.put_pixels_tab [size][dxy](c->scratchpad, ref , stride, h); } - dmin = s->mecc.mb_cmp[size](s, c->src[block][0], c->scratchpad, stride, h); + dmin = c->mb_cmp[size](s, c->src[block][0], c->scratchpad, stride, h); dmin+= (mv_penalty[mx_i-c->pred_x] + mv_penalty[my_i-c->pred_y] + 1)*c->mb_penalty_factor; }else dmin+= c->mb_penalty_factor; //field_select bits @@ -910,7 +921,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp); c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV; - get_limits(s, 16*mb_x, 16*mb_y); + get_limits(s, 16*mb_x, 16*mb_y, 0); c->skip=0; /* intra / predictive decision */ @@ -965,7 +976,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, /* At this point (mx,my) are full-pell and the relative displacement */ ppix = c->ref[0][0] + (my * s->linesize) + mx; - vard = s->mecc.sse[0](NULL, pix, ppix, s->linesize, 16); + vard = c->sse(NULL, pix, ppix, s->linesize, 16); s->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8; c->mc_mb_var_sum_temp += (vard+128)>>8; @@ -1042,7 +1053,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, *(uint32_t*)(&c->scratchpad[i*s->linesize+12]) = mean; } - intra_score= s->mecc.mb_cmp[0](s, c->scratchpad, pix, s->linesize, 16); + intra_score= c->mb_cmp[0](s, c->scratchpad, pix, s->linesize, 16); } intra_score += c->mb_penalty_factor*16 + s->intra_penalty; @@ -1077,7 +1088,7 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s, c->pre_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_pre_cmp); c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV; - get_limits(s, 16*mb_x, 16*mb_y); + get_limits(s, 16*mb_x, 16*mb_y, 0); c->skip=0; P_LEFT[0] = s->p_mv_table[xy + 1][0]; @@ -1129,7 +1140,7 @@ static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y, c->current_mv_penalty= mv_penalty; - get_limits(s, 16*mb_x, 16*mb_y); + get_limits(s, 16*mb_x, 16*mb_y, 1); if (s->motion_est != FF_ME_ZERO) { P_LEFT[0] = mv_table[mot_xy - 1][0]; @@ -1229,7 +1240,7 @@ static inline int check_bidir_mv(MpegEncContext * s, fbmin = (mv_penalty_f[motion_fx-pred_fx] + mv_penalty_f[motion_fy-pred_fy])*c->mb_penalty_factor +(mv_penalty_b[motion_bx-pred_bx] + mv_penalty_b[motion_by-pred_by])*c->mb_penalty_factor - + s->mecc.mb_cmp[size](s, src_data[0], dest_y, stride, h); // FIXME new_pic + + c->mb_cmp[size](s, src_data[0], dest_y, stride, h); // FIXME new_pic if(c->avctx->mb_cmp&FF_CMP_CHROMA){ } @@ -1478,7 +1489,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip) dmin= get_mb_score(s, mx, my, 0, 0, 0, 16, 1); - get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed + get_limits(s, 16*mb_x, 16*mb_y, 1); //restore c->?min/max, maybe not needed mv_table[mot_xy][0]= mx; mv_table[mot_xy][1]= my; @@ -1498,7 +1509,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, init_ref(c, s->new_pic->data, s->last_pic.data, s->next_pic.data, 16 * mb_x, 16 * mb_y, 2); - get_limits(s, 16*mb_x, 16*mb_y); + get_limits(s, 16*mb_x, 16*mb_y, 1); c->skip=0; diff --git a/src/ExtLib/ffmpeg/libavcodec/motion_est.h b/src/ExtLib/ffmpeg/libavcodec/motion_est.h index f6a563b08c..12f7cd43ab 100644 --- a/src/ExtLib/ffmpeg/libavcodec/motion_est.h +++ b/src/ExtLib/ffmpeg/libavcodec/motion_est.h @@ -25,6 +25,7 @@ #include "avcodec.h" #include "hpeldsp.h" +#include "me_cmp.h" #include "qpeldsp.h" struct MpegEncContext; @@ -83,6 +84,14 @@ typedef struct MotionEstContext { int64_t mb_var_sum_temp; int scene_change_score; + me_cmp_func me_pre_cmp[6]; + me_cmp_func me_cmp[6]; + me_cmp_func me_sub_cmp[6]; + me_cmp_func mb_cmp[6]; + + me_cmp_func pix_abs[2][4]; + me_cmp_func sse; + op_pixels_func(*hpel_put)[4]; op_pixels_func(*hpel_avg)[4]; qpel_mc_func(*qpel_put)[16]; @@ -105,7 +114,13 @@ static inline int ff_h263_round_chroma(int x) return h263_chroma_roundtab[x & 0xf] + (x >> 3); } -int ff_init_me(struct MpegEncContext *s); +/** + * Performs one-time initialization of the MotionEstContext. + */ +int ff_me_init(MotionEstContext *c, struct AVCodecContext *avctx, + const struct MECmpContext *mecc, int mpvenc); + +void ff_me_init_pic(struct MpegEncContext *s); void ff_estimate_p_frame_motion(struct MpegEncContext *s, int mb_x, int mb_y); void ff_estimate_b_frame_motion(struct MpegEncContext *s, int mb_x, int mb_y); diff --git a/src/ExtLib/ffmpeg/libavcodec/motion_est_template.c b/src/ExtLib/ffmpeg/libavcodec/motion_est_template.c index 494ef71383..b60143fbaa 100644 --- a/src/ExtLib/ffmpeg/libavcodec/motion_est_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/motion_est_template.c @@ -64,8 +64,8 @@ static int hpel_motion_search(MpegEncContext * s, //FIXME factorize - cmp_sub = s->mecc.me_sub_cmp[size]; - chroma_cmp_sub = s->mecc.me_sub_cmp[size + 1]; + cmp_sub = c->me_sub_cmp[size]; + chroma_cmp_sub = c->me_sub_cmp[size + 1]; if(c->skip){ //FIXME move out of hpel? *mx_ptr = 0; @@ -178,8 +178,8 @@ static inline int get_mb_score(MpegEncContext *s, int mx, int my, //FIXME factorize - cmp_sub = s->mecc.mb_cmp[size]; - chroma_cmp_sub = s->mecc.mb_cmp[size + 1]; + cmp_sub = c->mb_cmp[size]; + chroma_cmp_sub = c->mb_cmp[size + 1]; d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags); //FIXME check cbp before adding penalty for (0,0) vector @@ -222,12 +222,12 @@ static int qpel_motion_search(MpegEncContext * s, LOAD_COMMON int flags= c->sub_flags; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; // FIXME: factorize + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; // FIXME: factorize //FIXME factorize - cmp_sub = s->mecc.me_sub_cmp[size]; - chroma_cmp_sub = s->mecc.me_sub_cmp[size + 1]; + cmp_sub = c->me_sub_cmp[size]; + chroma_cmp_sub = c->me_sub_cmp[size + 1]; if(c->skip){ //FIXME somehow move up (benchmark) *mx_ptr = 0; @@ -424,8 +424,8 @@ static av_always_inline int small_diamond_search(MpegEncContext * s, int *best, LOAD_COMMON2 unsigned map_generation = c->map_generation; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; { /* ensure that the best point is in the MAP as h/qpel refinement needs it */ const unsigned key = ((unsigned)best[1]<map_generation; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; for(dia_size=1; dia_size<=4; dia_size++){ int dir; @@ -508,8 +508,8 @@ static int hex_search(MpegEncContext * s, int *best, int dmin, int x,y,d; const int dec= dia_size & (dia_size-1); - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; for(;dia_size; dia_size= dec ? dia_size-1 : dia_size>>1){ do{ @@ -545,8 +545,8 @@ static int l2s_dia_search(MpegEncContext * s, int *best, int dmin, static const int hex[8][2]={{-2, 0}, {-1,-1}, { 0,-2}, { 1,-1}, { 2, 0}, { 1, 1}, { 0, 2}, {-1, 1}}; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; for(; dia_size; dia_size= dec ? dia_size-1 : dia_size>>1){ do{ @@ -584,8 +584,8 @@ static int umh_search(MpegEncContext * s, int *best, int dmin, {-2, 3}, { 0, 4}, { 2, 3}, {-2,-3}, { 0,-4}, { 2,-3},}; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; x= best[0]; y= best[1]; @@ -627,8 +627,8 @@ static int full_search(MpegEncContext * s, int *best, int dmin, int x,y, d; const int dia_size= c->dia_size&0xFF; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; for(y=FFMAX(-dia_size, ymin); y<=FFMIN(dia_size,ymax); y++){ for(x=FFMAX(-dia_size, xmin); x<=FFMIN(dia_size,xmax); x++){ @@ -693,8 +693,8 @@ static int sab_diamond_search(MpegEncContext * s, int *best, int dmin, av_assert1(minima_count <= MAX_SAB_SIZE); - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; /*Note jmap_generation; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; for(dia_size=1; dia_size<=c->dia_size; dia_size++){ int dir, start, end; @@ -880,12 +880,12 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int if(c->pre_pass){ penalty_factor= c->pre_penalty_factor; - cmpf = s->mecc.me_pre_cmp[size]; - chroma_cmpf = s->mecc.me_pre_cmp[size + 1]; + cmpf = c->me_pre_cmp[size]; + chroma_cmpf = c->me_pre_cmp[size + 1]; }else{ penalty_factor= c->penalty_factor; - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; } map_generation= update_map_generation(c); @@ -1008,8 +1008,8 @@ static int epzs_motion_search2(MpegEncContext * s, int flags= c->flags; LOAD_COMMON2 - cmpf = s->mecc.me_cmp[size]; - chroma_cmpf = s->mecc.me_cmp[size + 1]; + cmpf = c->me_cmp[size]; + chroma_cmpf = c->me_cmp[size + 1]; map_generation= update_map_generation(c); diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg12.c b/src/ExtLib/ffmpeg/libavcodec/mpeg12.c index b02d724670..cddf1613c8 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg12.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg12.c @@ -31,14 +31,12 @@ #include "libavutil/avassert.h" #include "libavutil/thread.h" -#include "avcodec.h" #include "mpegvideo.h" -#include "mpeg12.h" #include "mpeg12codecs.h" #include "mpeg12data.h" #include "mpeg12dec.h" +#include "mpegutils.h" #include "rl.h" -#include "startcode.h" static const uint8_t table_mb_ptype[7][2] = { { 3, 5 }, // 0x01 MB_INTRA @@ -64,6 +62,30 @@ static const uint8_t table_mb_btype[11][2] = { { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT }; +static const int16_t ptype2mb_type[7] = { + MB_TYPE_INTRA, + MB_TYPE_FORWARD_MV | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, + MB_TYPE_FORWARD_MV, + MB_TYPE_FORWARD_MV | MB_TYPE_CBP, + MB_TYPE_QUANT | MB_TYPE_INTRA, + MB_TYPE_QUANT | MB_TYPE_FORWARD_MV | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, + MB_TYPE_QUANT | MB_TYPE_FORWARD_MV | MB_TYPE_CBP, +}; + +static const int16_t btype2mb_type[11] = { + MB_TYPE_INTRA, + MB_TYPE_BACKWARD_MV, + MB_TYPE_BACKWARD_MV | MB_TYPE_CBP, + MB_TYPE_FORWARD_MV, + MB_TYPE_FORWARD_MV | MB_TYPE_CBP, + MB_TYPE_BIDIR_MV, + MB_TYPE_BIDIR_MV | MB_TYPE_CBP, + MB_TYPE_QUANT | MB_TYPE_INTRA, + MB_TYPE_QUANT | MB_TYPE_BACKWARD_MV | MB_TYPE_CBP, + MB_TYPE_QUANT | MB_TYPE_FORWARD_MV | MB_TYPE_CBP, + MB_TYPE_QUANT | MB_TYPE_BIDIR_MV | MB_TYPE_CBP, +}; + av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], const int8_t table_run[], const uint8_t table_level[], int n, unsigned static_size, int flags) @@ -146,12 +168,14 @@ static av_cold void mpeg12_init_vlcs(void) &ff_mpeg12_mbPatTable[0][1], 2, 1, &ff_mpeg12_mbPatTable[0][0], 2, 1, 0); - VLC_INIT_STATIC_TABLE(ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, - &table_mb_ptype[0][1], 2, 1, - &table_mb_ptype[0][0], 2, 1, 0); - VLC_INIT_STATIC_TABLE(ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, - &table_mb_btype[0][1], 2, 1, - &table_mb_btype[0][0], 2, 1, 0); + VLC_INIT_STATIC_SPARSE_TABLE(ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, + &table_mb_ptype[0][1], 2, 1, + &table_mb_ptype[0][0], 2, 1, + ptype2mb_type, 2, 2, 0); + VLC_INIT_STATIC_SPARSE_TABLE(ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, + &table_mb_btype[0][1], 2, 1, + &table_mb_btype[0][0], 2, 1, + btype2mb_type, 2, 2, 0); ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_mpeg12_run, ff_mpeg12_level, MPEG12_RL_NB_ELEMS, diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c index 28f95dd853..33383a5913 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c @@ -93,32 +93,6 @@ typedef struct Mpeg1Context { int64_t timecode_frame_start; /*< GOP timecode frame start number, in non drop frame format */ } Mpeg1Context; -#define MB_TYPE_ZERO_MV 0x20000000 - -static const uint32_t ptype2mb_type[7] = { - MB_TYPE_INTRA, - MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, - MB_TYPE_L0, - MB_TYPE_L0 | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_INTRA, - MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, - MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP, -}; - -static const uint32_t btype2mb_type[11] = { - MB_TYPE_INTRA, - MB_TYPE_L1, - MB_TYPE_L1 | MB_TYPE_CBP, - MB_TYPE_L0, - MB_TYPE_L0 | MB_TYPE_CBP, - MB_TYPE_L0L1, - MB_TYPE_L0L1 | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_INTRA, - MB_TYPE_QUANT | MB_TYPE_L1 | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_CBP, -}; - // ==> Start patch MPC int decode_chunks(AVCodecContext* avctx, AVFrame* picture, int* got_output, const uint8_t* buf, int buf_size); @@ -443,7 +417,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) if (s->pict_type == AV_PICTURE_TYPE_P) { s->mb_skipped = 1; s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride] = - MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16; + MB_TYPE_SKIP | MB_TYPE_FORWARD_MV | MB_TYPE_16x16; } else { int mb_type; @@ -488,7 +462,6 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) "Invalid mb type in P-frame at %d %d\n", s->mb_x, s->mb_y); return AVERROR_INVALIDDATA; } - mb_type = ptype2mb_type[mb_type]; break; case AV_PICTURE_TYPE_B: mb_type = get_vlc2(&s->gb, ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 1); @@ -497,7 +470,6 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) "Invalid mb type in B-frame at %d %d\n", s->mb_x, s->mb_y); return AVERROR_INVALIDDATA; } - mb_type = btype2mb_type[mb_type]; break; } ff_tlog(s->avctx, "mb_type=%x\n", mb_type); @@ -584,7 +556,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; } else { - av_assert2(mb_type & MB_TYPE_L0L1); + av_assert2(mb_type & MB_TYPE_BIDIR_MV); // FIXME decide if MBs in field pictures are MB_TYPE_INTERLACED /* get additional motion vector type */ if (s->picture_structure == PICT_FRAME && s->frame_pred_frame_dct) { @@ -599,7 +571,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) s->qscale = mpeg_get_qscale(s); /* motion vectors */ - s->mv_dir = (mb_type >> 13) & 3; + s->mv_dir = MB_TYPE_MV_2_MV_DIR(mb_type); ff_tlog(s->avctx, "motion_type=%d\n", motion_type); switch (motion_type) { case MT_FRAME: /* or MT_16X8 */ @@ -607,7 +579,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) mb_type |= MB_TYPE_16x16; s->mv_type = MV_TYPE_16X16; for (i = 0; i < 2; i++) { - if (USES_LIST(mb_type, i)) { + if (HAS_MV(mb_type, i)) { /* MT_FRAME */ s->mv[i][0][0] = s->last_mv[i][0][0] = @@ -630,7 +602,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; s->mv_type = MV_TYPE_16X8; for (i = 0; i < 2; i++) { - if (USES_LIST(mb_type, i)) { + if (HAS_MV(mb_type, i)) { /* MT_16X8 */ for (j = 0; j < 2; j++) { s->field_select[i][j] = get_bits1(&s->gb); @@ -650,7 +622,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) if (s->picture_structure == PICT_FRAME) { mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; for (i = 0; i < 2; i++) { - if (USES_LIST(mb_type, i)) { + if (HAS_MV(mb_type, i)) { for (j = 0; j < 2; j++) { s->field_select[i][j] = get_bits1(&s->gb); val = mpeg_decode_motion(s, s->mpeg_f_code[i][0], @@ -670,7 +642,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) av_assert0(!s->progressive_sequence); mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED; for (i = 0; i < 2; i++) { - if (USES_LIST(mb_type, i)) { + if (HAS_MV(mb_type, i)) { s->field_select[i][0] = get_bits1(&s->gb); for (k = 0; k < 2; k++) { val = mpeg_decode_motion(s, s->mpeg_f_code[i][k], @@ -690,7 +662,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) } s->mv_type = MV_TYPE_DMV; for (i = 0; i < 2; i++) { - if (USES_LIST(mb_type, i)) { + if (HAS_MV(mb_type, i)) { int dmx, dmy, mx, my, m; const int my_shift = s->picture_structure == PICT_FRAME; @@ -1058,6 +1030,8 @@ FF_ENABLE_DEPRECATION_WARNINGS if ((ret = ff_mpv_common_init(s)) < 0) return ret; + if (!s->avctx->lowres) + ff_mpv_framesize_disable(&s->sc); } return 0; } @@ -1932,6 +1906,8 @@ static int vcr2_init_sequence(AVCodecContext *avctx) if ((ret = ff_mpv_common_init(s)) < 0) return ret; + if (!s->avctx->lowres) + ff_mpv_framesize_disable(&s->sc); for (i = 0; i < 64; i++) { int j = s->idsp.idct_permutation[i]; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.h b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.h index 4641179149..79809b7c3e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.h @@ -25,6 +25,8 @@ #include "get_bits.h" #include "mpeg12vlc.h" +#define MB_TYPE_ZERO_MV MB_TYPE_CODEC_SPECIFIC + static inline int decode_dc(GetBitContext *gb, int component) { int code, diff; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c b/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c index 7bbd412aa8..3133cc22c4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4video.c @@ -141,7 +141,7 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my) s->mv_type = MV_TYPE_8X8; for (i = 0; i < 4; i++) ff_mpeg4_set_one_direct_mv(s, mx, my, i); - return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1; + return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_BIDIR_MV; } else if (IS_INTERLACED(colocated_mb_type)) { s->mv_type = MV_TYPE_FIELD; for (i = 0; i < 2; i++) { @@ -169,7 +169,7 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my) (time_pb - time_pp) / time_pp; } return MB_TYPE_DIRECT2 | MB_TYPE_16x8 | - MB_TYPE_L0L1 | MB_TYPE_INTERLACED; + MB_TYPE_BIDIR_MV | MB_TYPE_INTERLACED; } else { ff_mpeg4_set_one_direct_mv(s, mx, my, 0); s->mv[0][1][0] = @@ -190,6 +190,6 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my) else s->mv_type = MV_TYPE_8X8; // Note see prev line - return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; + return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_BIDIR_MV; } } diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4video_parser.c b/src/ExtLib/ffmpeg/libavcodec/mpeg4video_parser.c index 402594e01d..b00b523bde 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4video_parser.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4video_parser.c @@ -122,7 +122,7 @@ static av_cold int mpeg4video_parse_init(AVCodecParserContext *s) struct Mp4vParseContext *pc = s->priv_data; pc->first_picture = 1; - pc->dec_ctx.m.quant_precision = 5; + pc->dec_ctx.quant_precision = 5; pc->dec_ctx.m.slice_context_count = 1; pc->dec_ctx.showed_packed_warning = 1; return 0; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c b/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c index 81f05bbb28..debcafc4c0 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.c @@ -67,11 +67,11 @@ static VLCElem studio_chroma_dc[528]; static const uint8_t mpeg4_block_count[4] = { 0, 6, 8, 12 }; -static const int mb_type_b_map[4] = { - MB_TYPE_DIRECT2 | MB_TYPE_L0L1, - MB_TYPE_L0L1 | MB_TYPE_16x16, - MB_TYPE_L1 | MB_TYPE_16x16, - MB_TYPE_L0 | MB_TYPE_16x16, +static const int16_t mb_type_b_map[4] = { + MB_TYPE_DIRECT2 | MB_TYPE_BIDIR_MV, + MB_TYPE_BIDIR_MV | MB_TYPE_16x16, + MB_TYPE_BACKWARD_MV | MB_TYPE_16x16, + MB_TYPE_FORWARD_MV | MB_TYPE_16x16, }; static void gmc1_motion(MpegEncContext *s, const Mpeg4DecContext *ctx, @@ -728,7 +728,7 @@ int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx) s->mb_y = mb_num / s->mb_width; if (ctx->shape != BIN_ONLY_SHAPE) { - int qscale = get_bits(&s->gb, s->quant_precision); + int qscale = get_bits(&s->gb, ctx->quant_precision); if (qscale) s->chroma_qscale = s->qscale = qscale; } @@ -895,7 +895,7 @@ static inline int mpeg4_decode_dc(MpegEncContext *s, int n, int *dir_ptr) else code = get_vlc2(&s->gb, dc_chrom, DC_VLC_BITS, 1); - if (code < 0 || code > 9 /* && s->nbit < 9 */) { + if (code < 0) { av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n"); return AVERROR_INVALIDDATA; } @@ -949,8 +949,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) int dir = 0; mb_num++; - ff_update_block_index(s, s->avctx->bits_per_raw_sample, - s->avctx->lowres, s->chroma_x_shift); + ff_update_block_index(s, 8, s->avctx->lowres, 1); if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1) s->first_slice_line = 0; @@ -1010,13 +1009,13 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | - MB_TYPE_L0; + MB_TYPE_FORWARD_MV; mx = get_amv(ctx, 0); my = get_amv(ctx, 1); } else { s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | - MB_TYPE_L0; + MB_TYPE_FORWARD_MV; mx = my = 0; } mot_val[0] = @@ -1081,13 +1080,13 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) if (my >= 0xffff) return AVERROR_INVALIDDATA; s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | - MB_TYPE_L0; + MB_TYPE_FORWARD_MV; } else { mx = get_amv(ctx, 0); my = get_amv(ctx, 1); s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_GMC | - MB_TYPE_L0; + MB_TYPE_FORWARD_MV; } mot_val[0] = @@ -1101,7 +1100,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) } else { int i; s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | - MB_TYPE_L0; + MB_TYPE_FORWARD_MV; for (i = 0; i < 4; i++) { int16_t *mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); mx = ff_h263_decode_motion(s, pred_x, s->f_code); @@ -1141,8 +1140,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) const int xy = s->mb_x + s->mb_y * s->mb_stride; mb_num++; - ff_update_block_index(s, s->avctx->bits_per_raw_sample, - s->avctx->lowres, s->chroma_x_shift); + ff_update_block_index(s, 8, s->avctx->lowres, 1); if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1) s->first_slice_line = 0; @@ -1675,16 +1673,15 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | - MB_TYPE_L0; + MB_TYPE_FORWARD_MV; s->mcsel = 1; s->mv[0][0][0] = get_amv(ctx, 0); s->mv[0][0][1] = get_amv(ctx, 1); s->cur_pic.mbskip_table[xy] = 0; s->mb_skipped = 0; } else { - s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | - MB_TYPE_16x16 | - MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | + MB_TYPE_FORWARD_MV; s->mcsel = 0; s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; @@ -1729,9 +1726,8 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv_dir = MV_DIR_FORWARD; if ((cbpc & 16) == 0) { if (s->mcsel) { - s->cur_pic.mb_type[xy] = MB_TYPE_GMC | - MB_TYPE_16x16 | - MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_GMC | MB_TYPE_16x16 | + MB_TYPE_FORWARD_MV; /* 16x16 global motion prediction */ s->mv_type = MV_TYPE_16X16; mx = get_amv(ctx, 0); @@ -1739,8 +1735,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][0] = mx; s->mv[0][0][1] = my; } else if ((!s->progressive_sequence) && get_bits1(&s->gb)) { - s->cur_pic.mb_type[xy] = MB_TYPE_16x8 | - MB_TYPE_L0 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x8 | MB_TYPE_FORWARD_MV | MB_TYPE_INTERLACED; /* 16x8 field motion prediction */ s->mv_type = MV_TYPE_FIELD; @@ -1763,7 +1758,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][i][1] = my; } } else { - s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; /* 16x16 motion prediction */ s->mv_type = MV_TYPE_16X16; ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); @@ -1780,7 +1775,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][1] = my; } } else { - s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_FORWARD_MV; s->mv_type = MV_TYPE_8X8; for (i = 0; i < 4; i++) { int16_t *mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); @@ -1832,14 +1827,14 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[1][0][1] = 0; s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | - MB_TYPE_L0; + MB_TYPE_FORWARD_MV; goto end; } modb1 = get_bits1(&s->gb); if (modb1) { // like MB_TYPE_B_DIRECT but no vectors coded - mb_type = MB_TYPE_DIRECT2 | MB_TYPE_SKIP | MB_TYPE_L0L1; + mb_type = MB_TYPE_DIRECT2 | MB_TYPE_SKIP | MB_TYPE_BIDIR_MV; cbp = 0; } else { modb2 = get_bits1(&s->gb); @@ -1848,7 +1843,6 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) av_log(s->avctx, AV_LOG_ERROR, "illegal MB_type\n"); return AVERROR_INVALIDDATA; } - mb_type = mb_type_b_map[mb_type]; if (modb2) { cbp = 0; } else { @@ -1869,11 +1863,11 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; mb_type &= ~MB_TYPE_16x16; - if (USES_LIST(mb_type, 0)) { + if (HAS_FORWARD_MV(mb_type)) { s->field_select[0][0] = get_bits1(&s->gb); s->field_select[0][1] = get_bits1(&s->gb); } - if (USES_LIST(mb_type, 1)) { + if (HAS_BACKWARD_MV(mb_type)) { s->field_select[1][0] = get_bits1(&s->gb); s->field_select[1][1] = get_bits1(&s->gb); } @@ -1884,7 +1878,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) if ((mb_type & (MB_TYPE_DIRECT2 | MB_TYPE_INTERLACED)) == 0) { s->mv_type = MV_TYPE_16X16; - if (USES_LIST(mb_type, 0)) { + if (HAS_FORWARD_MV(mb_type)) { s->mv_dir = MV_DIR_FORWARD; mx = ff_h263_decode_motion(s, s->last_mv[0][0][0], s->f_code); @@ -1897,7 +1891,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][1] = my; } - if (USES_LIST(mb_type, 1)) { + if (HAS_BACKWARD_MV(mb_type)) { s->mv_dir |= MV_DIR_BACKWARD; mx = ff_h263_decode_motion(s, s->last_mv[1][0][0], s->b_code); @@ -1912,7 +1906,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) } else if (!IS_DIRECT(mb_type)) { s->mv_type = MV_TYPE_FIELD; - if (USES_LIST(mb_type, 0)) { + if (HAS_FORWARD_MV(mb_type)) { s->mv_dir = MV_DIR_FORWARD; for (i = 0; i < 2; i++) { @@ -1924,7 +1918,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) } } - if (USES_LIST(mb_type, 1)) { + if (HAS_BACKWARD_MV(mb_type)) { s->mv_dir |= MV_DIR_BACKWARD; for (i = 0; i < 2; i++) { @@ -2712,17 +2706,16 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) // FIXME sadct disable bit if verid!=1 && shape not rect if (get_bits1(gb) == 1) { /* not_8_bit */ - s->quant_precision = get_bits(gb, 4); /* quant_precision */ + ctx->quant_precision = get_bits(gb, 4); /* quant_precision */ if (get_bits(gb, 4) != 8) /* bits_per_pixel */ av_log(s->avctx, AV_LOG_ERROR, "N-bit not supported\n"); - if (s->quant_precision != 5) + if (ctx->quant_precision != 5) av_log(s->avctx, AV_LOG_ERROR, - "quant precision %d\n", s->quant_precision); - if (s->quant_precision<3 || s->quant_precision>9) { - s->quant_precision = 5; - } + "quant precision %d\n", ctx->quant_precision); + if (ctx->quant_precision < 3 || ctx->quant_precision > 9) + ctx->quant_precision = 5; } else { - s->quant_precision = 5; + ctx->quant_precision = 5; } // FIXME a bunch of grayscale shape things @@ -2910,7 +2903,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) av_log(s->avctx, AV_LOG_DEBUG, "tb %d/%d, tincrbits:%d, qp_prec:%d, ps:%d, low_delay:%d %s%s%s%s\n", s->avctx->framerate.den, s->avctx->framerate.num, ctx->time_increment_bits, - s->quant_precision, + ctx->quant_precision, s->progressive_sequence, s->low_delay, ctx->scalability ? "scalability " :"" , s->quarter_sample ? "qpel " : "", @@ -3257,22 +3250,17 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, } else s->alternate_scan = 0; } - if (s->alternate_scan) { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_vertical_scan, s->idsp.idct_permutation); - ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, - s->idsp.idct_permutation); } else { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_horizontal_scan, s->idsp.idct_permutation); - ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, - s->idsp.idct_permutation); } + ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); /* Skip at this point when only parsing since the remaining * data is not useful for a parser and requires the @@ -3297,7 +3285,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, } if (ctx->shape != BIN_ONLY_SHAPE) { - s->chroma_qscale = s->qscale = get_bits(gb, s->quant_precision); + s->chroma_qscale = s->qscale = get_bits(gb, ctx->quant_precision); if (s->qscale == 0) { av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG-4 header (qscale=0)\n"); @@ -3436,21 +3424,8 @@ static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) s->q_scale_type = get_bits1(gb); } - if (s->alternate_scan) { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); - ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_vertical_scan, - s->idsp.idct_permutation); - ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, - s->idsp.idct_permutation); - } else { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_horizontal_scan, - s->idsp.idct_permutation); - ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, - s->idsp.idct_permutation); - } + ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, + s->alternate_scan ? ff_alternate_vertical_scan : ff_zigzag_direct); mpeg4_load_default_matrices(s); @@ -3797,9 +3772,10 @@ static av_cold void mpeg4_init_static(void) VLC_INIT_STATIC_TABLE_FROM_LENGTHS(sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, ff_sprite_trajectory_lens, 1, NULL, 0, 0, 0, 0); - VLC_INIT_STATIC_TABLE(mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, - &ff_mb_type_b_tab[0][1], 2, 1, - &ff_mb_type_b_tab[0][0], 2, 1, 0); + VLC_INIT_STATIC_SPARSE_TABLE(mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, + &ff_mb_type_b_tab[0][1], 2, 1, + &ff_mb_type_b_tab[0][0], 2, 1, + mb_type_b_map, 2, 2, 0); } static av_cold int decode_init(AVCodecContext *avctx) @@ -3821,6 +3797,7 @@ static av_cold int decode_init(AVCodecContext *avctx) s->low_delay = 0; /* default, might be overridden in the vol header during header parsing */ s->decode_mb = mpeg4_decode_mb; ctx->time_increment_bits = 4; /* default value for broken headers */ + ctx->quant_precision = 5; avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.h b/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.h index 4a26d18987..734237b16f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4videodec.h @@ -60,6 +60,8 @@ typedef struct Mpeg4DecContext { int enhancement_type; int scalability; + int quant_precision; + /// QP above which the ac VLC should be used for intra dc int intra_dc_threshold; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c b/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c index 583ea9de6f..0b18776497 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg4videoenc.c @@ -673,7 +673,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], } diff = diff * 256 / (xe * ye); } else { - diff = s->mecc.sad[0](NULL, p_pic, b_pic, s->linesize, 16); + diff = s->sad_cmp[0](NULL, p_pic, b_pic, s->linesize, 16); } if (diff > s->qscale * 70) { // FIXME check that 70 is optimal s->mb_skipped = 0; @@ -1358,7 +1358,7 @@ void ff_mpeg4_encode_video_packet_header(MpegEncContext *s) put_bits(&s->pb, 1, 1); put_bits(&s->pb, mb_num_bits, s->mb_x + s->mb_y * s->mb_width); - put_bits(&s->pb, s->quant_precision, s->qscale); + put_bits(&s->pb, 5 /* quant_precision */, s->qscale); put_bits(&s->pb, 1, 0); /* no HEC */ } diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c b/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c index e7b3197bb1..3cbdeeebec 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg_er.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avassert.h" #include "libavutil/mem.h" #include "error_resilience.h" #include "mpegvideo.h" @@ -67,6 +68,8 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, { MpegEncContext *s = opaque; + av_assert1(!mb_intra); + s->mv_dir = mv_dir; s->mv_type = mv_type; s->mb_intra = mb_intra; @@ -76,13 +79,9 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, s->mcsel = 0; memcpy(s->mv, mv, sizeof(*mv)); - ff_init_block_index(s); - ff_update_block_index(s, s->avctx->bits_per_raw_sample, - s->avctx->lowres, s->chroma_x_shift); - - s->bdsp.clear_blocks(s->block[0]); - if (!s->chroma_y_shift) - s->bdsp.clear_blocks(s->block[6]); + // The following disables the IDCT. + for (size_t i = 0; i < FF_ARRAY_ELEMS(s->block_last_index); i++) + s->block_last_index[i] = -1; s->dest[0] = s->cur_pic.data[0] + s->mb_y * 16 * s->linesize + diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h b/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h index 86504fe8ca..196aa9b744 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpegpicture.h @@ -21,6 +21,7 @@ #ifndef AVCODEC_MPEGPICTURE_H #define AVCODEC_MPEGPICTURE_H +#include #include #include @@ -35,7 +36,6 @@ typedef struct ScratchpadContext { uint8_t *obmc_scratchpad; union { uint8_t *scratchpad_buf; ///< the other *_scratchpad point into this buffer - uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision }; int linesize; ///< linesize that the buffers in this context have been allocated for @@ -136,6 +136,15 @@ int ff_mpv_pic_check_linesize(void *logctx, const struct AVFrame *f, int ff_mpv_framesize_alloc(AVCodecContext *avctx, ScratchpadContext *sc, int linesize); +/** + * Disable allocating the ScratchpadContext's buffers in future calls + * to ff_mpv_framesize_alloc(). + */ +static inline void ff_mpv_framesize_disable(ScratchpadContext *sc) +{ + sc->linesize = INT_MAX; +} + void ff_mpv_unref_picture(MPVWorkPicture *pic); void ff_mpv_workpic_from_pic(MPVWorkPicture *wpic, MPVPicture *pic); void ff_mpv_replace_picture(MPVWorkPicture *dst, const MPVWorkPicture *src); diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegutils.c b/src/ExtLib/ffmpeg/libavcodec/mpegutils.c index 92ebdd3a98..73b6650b70 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegutils.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpegutils.c @@ -57,6 +57,7 @@ void ff_draw_horiz_band(AVCodecContext *avctx, int first_field, int low_delay) { const int field_pic = picture_structure != PICT_FRAME; + const AVPixFmtDescriptor *desc; const AVFrame *src; int offset[AV_NUM_DATA_POINTERS]; @@ -82,21 +83,13 @@ void ff_draw_horiz_band(AVCodecContext *avctx, else return; - if (cur->pict_type == AV_PICTURE_TYPE_B && - picture_structure == PICT_FRAME && - avctx->codec_id != AV_CODEC_ID_SVQ3) { - for (int i = 0; i < AV_NUM_DATA_POINTERS; i++) - offset[i] = 0; - } else { - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); - int vshift = desc->log2_chroma_h; - - offset[0] = y * src->linesize[0]; - offset[1] = - offset[2] = (y >> vshift) * src->linesize[1]; - for (int i = 3; i < AV_NUM_DATA_POINTERS; i++) - offset[i] = 0; - } + desc = av_pix_fmt_desc_get(avctx->pix_fmt); + + offset[0] = y * src->linesize[0]; + offset[1] = + offset[2] = (y >> desc->log2_chroma_h) * src->linesize[1]; + for (int i = 3; i < AV_NUM_DATA_POINTERS; i++) + offset[i] = 0; emms_c(); @@ -104,12 +97,14 @@ void ff_draw_horiz_band(AVCodecContext *avctx, y, picture_structure, h); } -static char get_type_mv_char(int mb_type) +#define HAS_MV_EXT(mb_type, flags, dir) ((mb_type) & flags[(dir)]) + +static char get_type_mv_char(int mb_type, const int mb_type_mv_flags[2]) { // Type & MV direction if (IS_PCM(mb_type)) return 'P'; - else if (IS_INTRA(mb_type) && IS_ACPRED(mb_type)) + else if (IS_ACPRED(mb_type)) return 'A'; else if (IS_INTRA4x4(mb_type)) return 'i'; @@ -125,12 +120,12 @@ static char get_type_mv_char(int mb_type) return 'G'; else if (IS_SKIP(mb_type)) return 'S'; - else if (!USES_LIST(mb_type, 1)) + else if (!HAS_MV_EXT(mb_type, 1, mb_type_mv_flags)) return '>'; - else if (!USES_LIST(mb_type, 0)) + else if (!HAS_MV_EXT(mb_type, 0, mb_type_mv_flags)) return '<'; else { - av_assert2(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1)); + av_assert2(HAS_MV_EXT(mb_type, 0, mb_type_mv_flags) && HAS_MV_EXT(mb_type, 1, mb_type_mv_flags)); return 'X'; } } @@ -158,16 +153,19 @@ static char get_interlacement_char(int mb_type) } void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, - const uint8_t *mbskip_table, const uint32_t *mbtype_table, + const uint32_t *mbtype_table, const int8_t *qscale_table, int16_t (*const motion_val[2])[2], int mb_width, int mb_height, int mb_stride, int quarter_sample) { + const int is_h264 = avctx->codec_id == AV_CODEC_ID_H264; + const int mb_type_mv_flags[2] = { is_h264 ? MB_TYPE_L0 : MB_TYPE_FORWARD_MV, + is_h264 ? MB_TYPE_L1 : MB_TYPE_BACKWARD_MV }; + if ((avctx->export_side_data & AV_CODEC_EXPORT_DATA_MVS) && mbtype_table && motion_val[0]) { const int shift = 1 + quarter_sample; const int scale = 1 << shift; - const int mv_sample_log2 = avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_SVQ3 ? 2 : 1; - const int mv_stride = (mb_width << mv_sample_log2) + - (avctx->codec->id == AV_CODEC_ID_H264 ? 0 : 1); + const int mv_sample_log2 = is_h264 ? 2 : 1; + const int mv_stride = (mb_width << mv_sample_log2) + !is_h264; int mb_x, mb_y, mbcount = 0; /* size is width * height * 2 * 4 where 2 is for directions and 4 is @@ -180,7 +178,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, for (mb_x = 0; mb_x < mb_width; mb_x++) { int i, direction, mb_type = mbtype_table[mb_x + mb_y * mb_stride]; for (direction = 0; direction < 2; direction++) { - if (!USES_LIST(mb_type, direction)) + if (!HAS_MV_EXT(mb_type, direction, mb_type_mv_flags)) continue; if (IS_8X8(mb_type)) { for (i = 0; i < 4; i++) { @@ -250,7 +248,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, return; - if (avctx->debug & (FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE)) { + if (avctx->debug & (FF_DEBUG_QP | FF_DEBUG_MB_TYPE)) { int x,y; AVBPrint buf; int n; @@ -269,8 +267,6 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, av_bprint_chars(&buf, ' ', margin_left); n = 0; - if (avctx->debug & FF_DEBUG_SKIP) - n++; if (avctx->debug & FF_DEBUG_QP) n += 2; if (avctx->debug & FF_DEBUG_MB_TYPE) @@ -286,12 +282,6 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, for (x = 0; x < mb_width; x++) { if (x == 0) av_bprintf(&buf, "%*d ", margin_left - 1, y << 4); - if (avctx->debug & FF_DEBUG_SKIP) { - int count = mbskip_table ? mbskip_table[x + y * mb_stride] : 0; - if (count > 9) - count = 9; - av_bprintf(&buf, "%1d", count); - } if (avctx->debug & FF_DEBUG_QP) { av_bprintf(&buf, "%2d", qscale_table[x + y * mb_stride]); } @@ -299,7 +289,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, int mb_type = mbtype_table[x + y * mb_stride]; av_bprintf(&buf, "%c%c%c", - get_type_mv_char(mb_type), + get_type_mv_char(mb_type, mb_type_mv_flags), get_segmentation_char(mb_type), get_interlacement_char(mb_type)); } diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegutils.h b/src/ExtLib/ffmpeg/libavcodec/mpegutils.h index 3ce25ae518..44754aad93 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegutils.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpegutils.h @@ -45,9 +45,12 @@ #define MB_TYPE_8x8 (1 << 6) #define MB_TYPE_INTERLACED (1 << 7) #define MB_TYPE_DIRECT2 (1 << 8) // FIXME -#define MB_TYPE_ACPRED (1 << 9) -#define MB_TYPE_GMC (1 << 10) -#define MB_TYPE_SKIP (1 << 11) +#define MB_TYPE_CBP (1 << 10) +#define MB_TYPE_QUANT (1 << 11) +#define MB_TYPE_FORWARD_MV (1 << 12) +#define MB_TYPE_BACKWARD_MV (1 << 13) +#define MB_TYPE_BIDIR_MV (MB_TYPE_FORWARD_MV | MB_TYPE_BACKWARD_MV) +// MB_TYPE_P[01]L[01], MB_TYPE_L[01] and MB_TYPE_L0L1 are H.264 only. #define MB_TYPE_P0L0 (1 << 12) #define MB_TYPE_P1L0 (1 << 13) #define MB_TYPE_P0L1 (1 << 14) @@ -55,11 +58,15 @@ #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0) #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1) #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1) -#define MB_TYPE_QUANT (1 << 16) -#define MB_TYPE_CBP (1 << 17) +#define MB_TYPE_GMC (1 << 16) +#define MB_TYPE_SKIP (1 << 17) +#define MB_TYPE_ACPRED (1 << 18) #define MB_TYPE_INTRA MB_TYPE_INTRA4x4 // default mb_type if there is just one type +// The following MB-type can be used by each codec as it sees fit. +#define MB_TYPE_CODEC_SPECIFIC (1 << 9) + #define IS_INTRA4x4(a) ((a) & MB_TYPE_INTRA4x4) #define IS_INTRA16x16(a) ((a) & MB_TYPE_INTRA16x16) #define IS_PCM(a) ((a) & MB_TYPE_INTRA_PCM) @@ -75,18 +82,16 @@ #define IS_16X8(a) ((a) & MB_TYPE_16x8) #define IS_8X16(a) ((a) & MB_TYPE_8x16) #define IS_8X8(a) ((a) & MB_TYPE_8x8) -#define IS_SUB_8X8(a) ((a) & MB_TYPE_16x16) // note reused -#define IS_SUB_8X4(a) ((a) & MB_TYPE_16x8) // note reused -#define IS_SUB_4X8(a) ((a) & MB_TYPE_8x16) // note reused -#define IS_SUB_4X4(a) ((a) & MB_TYPE_8x8) // note reused #define IS_ACPRED(a) ((a) & MB_TYPE_ACPRED) #define IS_QUANT(a) ((a) & MB_TYPE_QUANT) -#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0 << ((part) + 2 * (list)))) - -// does this mb use listX, note does not work if subMBs -#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list)))) #define HAS_CBP(a) ((a) & MB_TYPE_CBP) +#define HAS_FORWARD_MV(a) ((a) & MB_TYPE_FORWARD_MV) +#define HAS_BACKWARD_MV(a) ((a) & MB_TYPE_BACKWARD_MV) +// dir == 0 means forward, dir == 1 is backward +#define HAS_MV(a, dir) ((a) & (MB_TYPE_FORWARD_MV << (dir))) + +#define MB_TYPE_MV_2_MV_DIR(a) (((a) >> 12) & (MV_DIR_FORWARD | MV_DIR_BACKWARD)) /** * Draw a horizontal band if supported. @@ -101,7 +106,7 @@ void ff_draw_horiz_band(AVCodecContext *avctx, const AVFrame *cur, const AVFrame * Print debugging info for the given picture. */ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, - const uint8_t *mbskip_table, const uint32_t *mbtype_table, + const uint32_t *mbtype_table, const int8_t *qscale_table, int16_t (*const motion_val[2])[2], int mb_width, int mb_height, int mb_stride, int quarter_sample); diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c index 6692a44ebb..b9a0469335 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.c @@ -273,7 +273,7 @@ static void gray8(uint8_t *dst, const uint8_t *src, ptrdiff_t linesize, int h) } /* init common dct for both encoder and decoder */ -static av_cold int dct_init(MpegEncContext *s) +static av_cold void dsp_init(MpegEncContext *s) { ff_blockdsp_init(&s->bdsp); ff_hpeldsp_init(&s->hdsp, s->avctx->flags); @@ -291,50 +291,18 @@ static av_cold int dct_init(MpegEncContext *s) s->hdsp.put_no_rnd_pixels_tab[1][i] = gray8; } } - - s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c; - s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c; - s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c; - s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c; - s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c; - if (s->avctx->flags & AV_CODEC_FLAG_BITEXACT) - s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact; - s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c; - -#if HAVE_INTRINSICS_NEON - ff_mpv_common_init_neon(s); -#endif - -#if ARCH_ARM - ff_mpv_common_init_arm(s); -#elif ARCH_PPC - ff_mpv_common_init_ppc(s); -#elif ARCH_X86 - ff_mpv_common_init_x86(s); -#elif ARCH_MIPS - ff_mpv_common_init_mips(s); -#endif - - return 0; } av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable) { - int end; - st->scantable = src_scantable; - for (int i = 0; i < 64; i++) { + for (int i = 0, end = -1; i < 64; i++) { int j = src_scantable[i]; st->permutated[i] = permutation[j]; - } - - end = -1; - for (int i = 0; i < 64; i++) { - int j = st->permutated[i]; - if (j > end) - end = j; + if (permutation[j] > end) + end = permutation[j]; st->raster_end[i] = end; } } @@ -359,6 +327,29 @@ av_cold void ff_mpv_idct_init(MpegEncContext *s) s->idsp.idct_permutation); ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, s->idsp.idct_permutation); + + s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c; + s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c; + s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c; + s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c; + s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c; + if (s->avctx->flags & AV_CODEC_FLAG_BITEXACT) + s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact; + s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c; + +#if HAVE_INTRINSICS_NEON + ff_mpv_common_init_neon(s); +#endif + +#if ARCH_ARM + ff_mpv_common_init_arm(s); +#elif ARCH_PPC + ff_mpv_common_init_ppc(s); +#elif ARCH_X86 + ff_mpv_common_init_x86(s); +#elif ARCH_MIPS + ff_mpv_common_init_mips(s); +#endif } static int init_duplicate_context(MpegEncContext *s) @@ -718,7 +709,7 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) av_image_check_size(s->width, s->height, 0, s->avctx)) return AVERROR(EINVAL); - dct_init(s); + dsp_init(s); /* set chroma shifts */ ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h index 60dcf65288..8083299b66 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideo.h @@ -220,7 +220,6 @@ typedef struct MpegEncContext { H264ChromaContext h264chroma; HpelDSPContext hdsp; IDCTDSPContext idsp; - MECmpContext mecc; MpegvideoEncDSPContext mpvencdsp; PixblockDSPContext pdsp; QpelDSPContext qdsp; @@ -385,7 +384,6 @@ typedef struct MpegEncContext { uint16_t pp_field_time; uint16_t pb_field_time; ///< like above, just for interlaced int mcsel; - int quant_precision; int quarter_sample; ///< 1->qpel, 0->half pel ME/MC int data_partitioning; ///< data partitioning flag from header int partitioned_frame; ///< is current frame partitioned @@ -506,6 +504,12 @@ typedef struct MpegEncContext { int mpv_flags; ///< flags set by private options int quantizer_noise_shaping; + me_cmp_func ildct_cmp[2]; ///< 0 = intra, 1 = non-intra + me_cmp_func n_sse_cmp[2]; ///< either SSE or NSSE cmp func + me_cmp_func sad_cmp[2]; + me_cmp_func sse_cmp[2]; + int (*sum_abs_dctelem)(const int16_t *block); + /** * ratecontrol qmin qmax limiting method * 0-> clipping, 1-> use a nice continuous function to limit qscale within qmin/qmax. @@ -542,6 +546,7 @@ typedef struct MpegEncContext { int frame_skip_factor; int frame_skip_exp; int frame_skip_cmp; + me_cmp_func frame_skip_cmp_fn; int scenechange_threshold; int noise_reduction; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c b/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c index 0a50cfac5b..1cab108935 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpegvideo_dec.c @@ -59,6 +59,7 @@ int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) s->codec_tag = ff_toupper4(avctx->codec_tag); ff_mpv_idct_init(s); + ff_h264chroma_init(&s->h264chroma, 8); //for lowres if (s->picture_pool) // VC-1 can call this multiple times @@ -135,7 +136,6 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, // B-frame info s->max_b_frames = s1->max_b_frames; s->low_delay = s1->low_delay; - s->droppable = s1->droppable; // DivX handling (doesn't work) s->divx_packed = s1->divx_packed; @@ -153,14 +153,6 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, s1->bitstream_buffer_size); } - // linesize-dependent scratch buffer allocation - ret = ff_mpv_framesize_alloc(s->avctx, &s->sc, s1->linesize); - if (ret < 0) { - av_log(s->avctx, AV_LOG_ERROR, "Failed to allocate context " - "scratch buffers.\n"); - return ret; - } - // MPEG-2/interlacing info memcpy(&s->progressive_sequence, &s1->progressive_sequence, (char *) &s1->rtp_mode - (char *) &s1->progressive_sequence); @@ -393,20 +385,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) if (ret < 0) return ret; - /* set dequantizer, we can't do it during init as - * it might change for MPEG-4 and we can't do it in the header - * decode as init is not called for MPEG-4 there yet */ - if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG2VIDEO) { - s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra; - s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter; - } else if (s->out_format == FMT_H263 || s->out_format == FMT_H261) { - s->dct_unquantize_intra = s->dct_unquantize_h263_intra; - s->dct_unquantize_inter = s->dct_unquantize_h263_inter; - } else { - s->dct_unquantize_intra = s->dct_unquantize_mpeg1_intra; - s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter; - } - if (s->avctx->debug & FF_DEBUG_NOMC) color_frame(s->cur_pic.ptr->f, 0x80); @@ -424,7 +402,7 @@ void ff_mpv_frame_end(MpegEncContext *s) void ff_print_debug_info(const MpegEncContext *s, const MPVPicture *p, AVFrame *pict) { - ff_print_debug_info2(s->avctx, pict, s->mbskip_table, p->mb_type, + ff_print_debug_info2(s->avctx, pict, p->mb_type, p->qscale_table, p->motion_val, s->mb_width, s->mb_height, s->mb_stride, s->quarter_sample); } @@ -499,11 +477,13 @@ static inline int hpel_motion_lowres(MpegEncContext *s, int motion_x, int motion_y) { const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres, 3); + const int op_index = lowres; const int s_mask = (2 << lowres) - 1; int emu = 0; int sx, sy; + av_assert2(op_index <= 3); + if (s->quarter_sample) { motion_x /= 2; motion_y /= 2; @@ -552,12 +532,15 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, sx, sy, uvsx, uvsy; ptrdiff_t uvlinesize, linesize; const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres - 1 + s->chroma_x_shift, 3); + const int op_index = lowres - 1 + s->chroma_x_shift; const int block_s = 8 >> lowres; const int s_mask = (2 << lowres) - 1; const int h_edge_pos = s->h_edge_pos >> lowres; const int v_edge_pos = s->v_edge_pos >> lowres; int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h; + + av_assert2(op_index <= 3); + linesize = s->cur_pic.linesize[0] << field_based; uvlinesize = s->cur_pic.linesize[1] << field_based; @@ -682,7 +665,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s, int mx, int my) { const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres, 3); + const int op_index = lowres; const int block_s = 8 >> lowres; const int s_mask = (2 << lowres) - 1; const int h_edge_pos = s->h_edge_pos >> lowres + 1; @@ -691,6 +674,8 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s, ptrdiff_t offset; const uint8_t *ptr; + av_assert2(op_index <= 3); + if (s->quarter_sample) { mx /= 2; my /= 2; @@ -936,15 +921,16 @@ void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]) } } + av_assert2((s->out_format <= FMT_H261) == (s->out_format == FMT_H261 || s->out_format == FMT_MPEG1)); if (!s->avctx->lowres) { #if !CONFIG_SMALL - if (s->out_format == FMT_MPEG1) - mpv_reconstruct_mb_internal(s, block, 0, DEFINITELY_MPEG12); + if (s->out_format <= FMT_H261) + mpv_reconstruct_mb_internal(s, block, 0, DEFINITELY_MPEG12_H261); else - mpv_reconstruct_mb_internal(s, block, 0, NOT_MPEG12); + mpv_reconstruct_mb_internal(s, block, 0, NOT_MPEG12_H261); #else - mpv_reconstruct_mb_internal(s, block, 0, MAY_BE_MPEG12); + mpv_reconstruct_mb_internal(s, block, 0, MAY_BE_MPEG12_H261); #endif } else - mpv_reconstruct_mb_internal(s, block, 1, MAY_BE_MPEG12); + mpv_reconstruct_mb_internal(s, block, 1, MAY_BE_MPEG12_H261); } diff --git a/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c b/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c index 6ad353ddfd..dca982ae0f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c @@ -20,9 +20,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define NOT_MPEG12 0 -#define MAY_BE_MPEG12 1 -#define DEFINITELY_MPEG12 2 +#define NOT_MPEG12_H261 0 +#define MAY_BE_MPEG12_H261 1 +#define DEFINITELY_MPEG12_H261 2 /* put block[] to dest[] */ static inline void put_dct(MpegEncContext *s, @@ -56,14 +56,14 @@ static av_always_inline void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], int lowres_flag, int is_mpeg12) { -#define IS_MPEG12(s) (is_mpeg12 == MAY_BE_MPEG12 ? ((s)->out_format == FMT_MPEG1) : is_mpeg12) +#define IS_MPEG12_H261(s) (is_mpeg12 == MAY_BE_MPEG12_H261 ? ((s)->out_format <= FMT_H261) : is_mpeg12) const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; s->cur_pic.qscale_table[mb_xy] = s->qscale; /* update DC predictors for P macroblocks */ if (!s->mb_intra) { - if (is_mpeg12 != DEFINITELY_MPEG12 && (s->h263_pred || s->h263_aic)) { + if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic)) { if (s->mbintra_table[mb_xy]) ff_clean_intra_table_entries(s); } else { @@ -71,7 +71,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], s->last_dc[1] = s->last_dc[2] = 128 << s->intra_dc_precision; } - } else if (is_mpeg12 != DEFINITELY_MPEG12 && (s->h263_pred || s->h263_aic)) + } else if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic)) s->mbintra_table[mb_xy] = 1; #if IS_ENCODER @@ -80,11 +80,10 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], s->avctx->mb_decision != FF_MB_DECISION_RD)) // FIXME precalc #endif /* IS_ENCODER */ { - uint8_t *dest_y, *dest_cb, *dest_cr; + uint8_t *dest_y = s->dest[0], *dest_cb = s->dest[1], *dest_cr = s->dest[2]; int dct_linesize, dct_offset; const int linesize = s->cur_pic.linesize[0]; //not s->linesize as this would be wrong for field pics const int uvlinesize = s->cur_pic.linesize[1]; - const int readable = IS_ENCODER || lowres_flag || s->pict_type != AV_PICTURE_TYPE_B; const int block_size = lowres_flag ? 8 >> s->avctx->lowres : 8; /* avoid copy if macroblock skipped in last frame too */ @@ -106,22 +105,12 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], dct_linesize = linesize << s->interlaced_dct; dct_offset = s->interlaced_dct ? linesize : linesize * block_size; - if (readable) { - dest_y = s->dest[0]; - dest_cb = s->dest[1]; - dest_cr = s->dest[2]; - } else { - dest_y = s->sc.b_scratchpad; - dest_cb = s->sc.b_scratchpad + 16 * linesize; - dest_cr = s->sc.b_scratchpad + 32 * linesize; - } - if (!s->mb_intra) { /* motion handling */ /* decoding or more than one mb_type (MC was already done otherwise) */ #if !IS_ENCODER - if (HAVE_THREADS && is_mpeg12 != DEFINITELY_MPEG12 && + if (HAVE_THREADS && is_mpeg12 != DEFINITELY_MPEG12_H261 && s->avctx->active_thread_type & FF_THREAD_FRAME) { if (s->mv_dir & MV_DIR_FORWARD) { ff_thread_progress_await(&s->last_pic.ptr->progress, @@ -147,7 +136,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], const op_pixels_func (*op_pix)[4]; const qpel_mc_func (*op_qpix)[16]; - if ((is_mpeg12 == DEFINITELY_MPEG12 || !s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { + if ((is_mpeg12 == DEFINITELY_MPEG12_H261 || !s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { op_pix = s->hdsp.put_pixels_tab; op_qpix = s->qdsp.put_qpel_pixels_tab; } else { @@ -169,11 +158,11 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) || s->avctx->skip_idct >= AVDISCARD_ALL) - goto skip_idct; + return; } /* add dct residue */ - if (!(IS_MPEG12(s) || s->msmpeg4_version != MSMP4_UNUSED || + if (!(IS_MPEG12_H261(s) || s->msmpeg4_version != MSMP4_UNUSED || (s->codec_id == AV_CODEC_ID_MPEG4 && !s->mpeg_quant))) #endif /* !IS_ENCODER */ { @@ -183,7 +172,8 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale); if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - if (s->chroma_y_shift) { + av_assert2(IS_ENCODER || s->chroma_y_shift); + if (!IS_ENCODER || s->chroma_y_shift) { add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale); add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale); } else { @@ -197,7 +187,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], } } #if !IS_ENCODER - else if (is_mpeg12 == DEFINITELY_MPEG12 || (s->codec_id != AV_CODEC_ID_WMV2)) { + else if (is_mpeg12 == DEFINITELY_MPEG12_H261 || lowres_flag || (s->codec_id != AV_CODEC_ID_WMV2)) { add_dct(s, block[0], 0, dest_y , dct_linesize); add_dct(s, block[1], 1, dest_y + block_size, dct_linesize); add_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize); @@ -232,12 +222,12 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], #if !IS_ENCODER /* Only MPEG-4 Simple Studio Profile is supported in > 8-bit mode. TODO: Integrate 10-bit properly into mpegvideo.c so that ER works properly */ - if (is_mpeg12 != DEFINITELY_MPEG12 && CONFIG_MPEG4_DECODER && + if (is_mpeg12 != DEFINITELY_MPEG12_H261 && CONFIG_MPEG4_DECODER && /* s->codec_id == AV_CODEC_ID_MPEG4 && */ s->avctx->bits_per_raw_sample > 8) { ff_mpeg4_decode_studio(s, dest_y, dest_cb, dest_cr, block_size, uvlinesize, dct_linesize, dct_offset); - } else if (!IS_MPEG12(s)) + } else if (!IS_MPEG12_H261(s)) #endif /* !IS_ENCODER */ { /* dct only in intra block */ @@ -288,14 +278,6 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], } } //gray } - } -skip_idct: - if (!readable) { - s->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y, linesize, 16); - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize, 16 >> s->chroma_y_shift); - s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize, 16 >> s->chroma_y_shift); - } #endif /* !IS_ENCODER */ } } diff --git a/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c b/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c index 50fd581a83..872dc8db67 100644 --- a/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c +++ b/src/ExtLib/ffmpeg/libavcodec/msmpeg4.c @@ -41,7 +41,6 @@ #include "mpeg4videodata.h" #include "msmpeg4data.h" #include "msmpeg4_vc1_data.h" -#include "mpegvideodata.h" /* * You can also call this codec: MPEG-4 with a twist! @@ -122,8 +121,7 @@ av_cold void ff_msmpeg4_common_init(MpegEncContext *s) switch(s->msmpeg4_version){ case MSMP4_V1: case MSMP4_V2: - s->y_dc_scale_table= - s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + // Correct *_dc_scale_tables (ff_mpeg1_dc_scale_table) is the default break; case MSMP4_V3: if(s->workaround_bugs){ diff --git a/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c b/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c index 209e1fe1b2..31b17c2839 100644 --- a/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/msmpeg4dec.c @@ -120,7 +120,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; s->mb_skipped = 1; - *mb_type_ptr = MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16; + *mb_type_ptr = MB_TYPE_SKIP | MB_TYPE_FORWARD_MV | MB_TYPE_16x16; return 0; } } @@ -170,7 +170,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv_type = MV_TYPE_16X16; s->mv[0][0][0] = mx; s->mv[0][0][1] = my; - *mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16; + *mb_type_ptr = MB_TYPE_FORWARD_MV | MB_TYPE_16x16; } else { int v; if (s->msmpeg4_version == MSMP4_V2) { @@ -226,7 +226,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; s->mb_skipped = 1; - *mb_type_ptr = MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16; + *mb_type_ptr = MB_TYPE_SKIP | MB_TYPE_FORWARD_MV | MB_TYPE_16x16; return 0; } @@ -265,7 +265,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv_type = MV_TYPE_16X16; s->mv[0][0][0] = mx; s->mv[0][0][1] = my; - *mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16; + *mb_type_ptr = MB_TYPE_FORWARD_MV | MB_TYPE_16x16; } else { ff_dlog(s, "I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0), diff --git a/src/ExtLib/ffmpeg/libavcodec/rv10.c b/src/ExtLib/ffmpeg/libavcodec/rv10.c index 3dcee0a065..753c6c6cb3 100644 --- a/src/ExtLib/ffmpeg/libavcodec/rv10.c +++ b/src/ExtLib/ffmpeg/libavcodec/rv10.c @@ -346,7 +346,6 @@ static av_cold void rv10_init_static(void) rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].sym = 255; rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].len = 18; } - ff_h263_decode_init_vlc(); } static av_cold int rv10_decode_init(AVCodecContext *avctx) @@ -364,16 +363,12 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) avctx->coded_height, 0, avctx)) < 0) return ret; - ret = ff_mpv_decode_init(s, avctx); + ret = ff_h263_decode_init(avctx); if (ret < 0) return ret; - s->out_format = FMT_H263; - - rv->orig_width = - s->width = avctx->coded_width; - rv->orig_height = - s->height = avctx->coded_height; + rv->orig_width = avctx->coded_width; + rv->orig_height = avctx->coded_height; s->h263_long_vectors = ((uint8_t *) avctx->extradata)[3] & 1; rv->sub_id = AV_RB32((uint8_t *) avctx->extradata + 4); @@ -382,7 +377,6 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) minor_ver = RV_GET_MINOR_VER(rv->sub_id); micro_ver = RV_GET_MICRO_VER(rv->sub_id); - s->low_delay = 1; switch (major_ver) { case 1: s->rv10_version = micro_ver ? 3 : 1; @@ -391,11 +385,11 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) case 2: if (minor_ver >= 2) { s->low_delay = 0; - s->avctx->has_b_frames = 1; + avctx->has_b_frames = 1; } break; default: - av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", rv->sub_id); + av_log(avctx, AV_LOG_ERROR, "unknown header %X\n", rv->sub_id); avpriv_request_sample(avctx, "RV1/2 version"); return AVERROR_PATCHWELCOME; } @@ -405,13 +399,6 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) ((uint32_t *) avctx->extradata)[0]); } - avctx->pix_fmt = AV_PIX_FMT_YUV420P; - - if ((ret = ff_mpv_common_init(s)) < 0) - return ret; - - ff_h263dsp_init(&s->h263dsp); - /* init static VLCs */ ff_thread_once(&init_static_once, rv10_init_static); @@ -498,12 +485,6 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, s->rv10_first_dc_coded[0] = 0; s->rv10_first_dc_coded[1] = 0; s->rv10_first_dc_coded[2] = 0; - s->block_wrap[0] = - s->block_wrap[1] = - s->block_wrap[2] = - s->block_wrap[3] = s->b8_stride; - s->block_wrap[4] = - s->block_wrap[5] = s->mb_stride; ff_init_block_index(s); /* decode each macroblock */ diff --git a/src/ExtLib/ffmpeg/libavcodec/rv34.c b/src/ExtLib/ffmpeg/libavcodec/rv34.c index 728e117df4..d94285431e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/rv34.c +++ b/src/ExtLib/ffmpeg/libavcodec/rv34.c @@ -59,16 +59,16 @@ static inline void ZERO8x2(void* dst, int stride) static const int rv34_mb_type_to_lavc[12] = { MB_TYPE_INTRA, MB_TYPE_INTRA16x16 | MB_TYPE_SEPARATE_DC, - MB_TYPE_16x16 | MB_TYPE_L0, - MB_TYPE_8x8 | MB_TYPE_L0, - MB_TYPE_16x16 | MB_TYPE_L0, - MB_TYPE_16x16 | MB_TYPE_L1, + MB_TYPE_16x16 | MB_TYPE_FORWARD_MV, + MB_TYPE_8x8 | MB_TYPE_FORWARD_MV, + MB_TYPE_16x16 | MB_TYPE_FORWARD_MV, + MB_TYPE_16x16 | MB_TYPE_BACKWARD_MV, MB_TYPE_SKIP, MB_TYPE_DIRECT2 | MB_TYPE_16x16, - MB_TYPE_16x8 | MB_TYPE_L0, - MB_TYPE_8x16 | MB_TYPE_L0, - MB_TYPE_16x16 | MB_TYPE_L0L1, - MB_TYPE_16x16 | MB_TYPE_L0 | MB_TYPE_SEPARATE_DC + MB_TYPE_16x8 | MB_TYPE_FORWARD_MV, + MB_TYPE_8x16 | MB_TYPE_FORWARD_MV, + MB_TYPE_16x16 | MB_TYPE_BIDIR_MV, + MB_TYPE_16x16 | MB_TYPE_FORWARD_MV | MB_TYPE_SEPARATE_DC }; @@ -568,7 +568,7 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir) int mx, my; int i, j; MPVWorkPicture *cur_pic = &s->cur_pic; - const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0; + const int mask = dir ? MB_TYPE_BACKWARD_MV : MB_TYPE_FORWARD_MV; int type = cur_pic->mb_type[mb_pos]; if((r->avail_cache[6-1] & type) & mask){ diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1.c b/src/ExtLib/ffmpeg/libavcodec/vc1.c index 987e77fcc7..d263c70be7 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1.c @@ -583,21 +583,23 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex static void rotate_luts(VC1Context *v) { -#define ROTATE(DEF, L, N, C, A) do { \ - if (v->s.pict_type == AV_PICTURE_TYPE_BI || v->s.pict_type == AV_PICTURE_TYPE_B) { \ - C = A; \ - } else { \ + if (v->s.pict_type == AV_PICTURE_TYPE_BI || v->s.pict_type == AV_PICTURE_TYPE_B) { + v->curr_use_ic = &v->aux_use_ic; + v->curr_luty = v->aux_luty; + v->curr_lutuv = v->aux_lutuv; + } else { +#define ROTATE(DEF, L, N, C) do { \ DEF; \ memcpy(&tmp, L , sizeof(tmp)); \ memcpy(L , N , sizeof(tmp)); \ memcpy(N , &tmp, sizeof(tmp)); \ C = N; \ - } \ } while(0) - ROTATE(int tmp, &v->last_use_ic, &v->next_use_ic, v->curr_use_ic, &v->aux_use_ic); - ROTATE(uint8_t tmp[2][256], v->last_luty, v->next_luty, v->curr_luty, v->aux_luty); - ROTATE(uint8_t tmp[2][256], v->last_lutuv, v->next_lutuv, v->curr_lutuv, v->aux_lutuv); + ROTATE(int tmp, &v->last_use_ic, &v->next_use_ic, v->curr_use_ic); + ROTATE(uint8_t tmp[2][256], v->last_luty, v->next_luty, v->curr_luty); + ROTATE(uint8_t tmp[2][256], v->last_lutuv, v->next_lutuv, v->curr_lutuv); + } INIT_LUT(32, 0, v->curr_luty[0], v->curr_lutuv[0], 0); INIT_LUT(32, 0, v->curr_luty[1], v->curr_lutuv[1], 0); diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1_block.c b/src/ExtLib/ffmpeg/libavcodec/vc1_block.c index 640f7329ca..1d622b1a67 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1_block.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1_block.c @@ -2675,14 +2675,12 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) } // do frame decode - s->mb_x = s->mb_y = 0; s->mb_intra = 1; s->first_slice_line = 1; + s->mb_x = 0; s->mb_y = s->start_mb_y; if (s->start_mb_y) { - s->mb_x = 0; - init_block_index(v); - memset(&s->coded_block[s->block_index[0] - s->b8_stride], 0, + memset(&s->coded_block[(2 * s->mb_y - 1) * s->b8_stride - 2], 0, (1 + s->b8_stride) * sizeof(*s->coded_block)); } for (; s->mb_y < s->end_mb_y; s->mb_y++) { diff --git a/src/ExtLib/ffmpeg/libavcodec/version.h b/src/ExtLib/ffmpeg/libavcodec/version.h index 7acb261bb3..37c4c39451 100644 --- a/src/ExtLib/ffmpeg/libavcodec/version.h +++ b/src/ExtLib/ffmpeg/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 7 +#define LIBAVCODEC_VERSION_MINOR 8 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c b/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c index 5c91006169..677467ccc2 100644 --- a/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/wmv2dec.c @@ -112,7 +112,7 @@ static int parse_mb_skip(WMV2DecContext *w) for (mb_y = 0; mb_y < s->mb_height; mb_y++) for (mb_x = 0; mb_x < s->mb_width; mb_x++) mb_type[mb_y * s->mb_stride + mb_x] = - MB_TYPE_16x16 | MB_TYPE_L0; + MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; break; case SKIP_TYPE_MPEG: if (get_bits_left(&s->gb) < s->mb_height * s->mb_width) @@ -120,7 +120,7 @@ static int parse_mb_skip(WMV2DecContext *w) for (mb_y = 0; mb_y < s->mb_height; mb_y++) for (mb_x = 0; mb_x < s->mb_width; mb_x++) mb_type[mb_y * s->mb_stride + mb_x] = - (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0; + (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; break; case SKIP_TYPE_ROW: for (mb_y = 0; mb_y < s->mb_height; mb_y++) { @@ -129,11 +129,11 @@ static int parse_mb_skip(WMV2DecContext *w) if (get_bits1(&s->gb)) { for (mb_x = 0; mb_x < s->mb_width; mb_x++) mb_type[mb_y * s->mb_stride + mb_x] = - MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; } else { for (mb_x = 0; mb_x < s->mb_width; mb_x++) mb_type[mb_y * s->mb_stride + mb_x] = - (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0; + (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; } } break; @@ -144,11 +144,11 @@ static int parse_mb_skip(WMV2DecContext *w) if (get_bits1(&s->gb)) { for (mb_y = 0; mb_y < s->mb_height; mb_y++) mb_type[mb_y * s->mb_stride + mb_x] = - MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; } else { for (mb_y = 0; mb_y < s->mb_height; mb_y++) mb_type[mb_y * s->mb_stride + mb_x] = - (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0; + (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_FORWARD_MV; } } break; diff --git a/src/ExtLib/ffmpeg/libavcodec/x86/me_cmp_init.c b/src/ExtLib/ffmpeg/libavcodec/x86/me_cmp_init.c index bc1051c27e..98b71b1894 100644 --- a/src/ExtLib/ffmpeg/libavcodec/x86/me_cmp_init.c +++ b/src/ExtLib/ffmpeg/libavcodec/x86/me_cmp_init.c @@ -94,7 +94,7 @@ static int nsse16_mmx(MpegEncContext *c, const uint8_t *pix1, const uint8_t *pix int score1, score2; if (c) - score1 = c->mecc.sse[0](c, pix1, pix2, stride, h); + score1 = c->sse_cmp[0](c, pix1, pix2, stride, h); else score1 = ff_sse16_mmx(c, pix1, pix2, stride, h); score2 = ff_hf_noise16_mmx(pix1, stride, h) + ff_hf_noise8_mmx(pix1+8, stride, h) diff --git a/src/ExtLib/ffmpeg/libavutil/ambient_viewing_environment.c b/src/ExtLib/ffmpeg/libavutil/ambient_viewing_environment.c index c47458cfa8..e359727776 100644 --- a/src/ExtLib/ffmpeg/libavutil/ambient_viewing_environment.c +++ b/src/ExtLib/ffmpeg/libavutil/ambient_viewing_environment.c @@ -21,6 +21,13 @@ #include "ambient_viewing_environment.h" #include "mem.h" +static void get_defaults(AVAmbientViewingEnvironment *env) +{ + env->ambient_illuminance = + env->ambient_light_x = + env->ambient_light_y = (AVRational) { 0, 1 }; +} + AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size) { AVAmbientViewingEnvironment *env = @@ -28,6 +35,8 @@ AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size) if (!env) return NULL; + get_defaults(env); + if (size) *size = sizeof(*env); @@ -44,6 +53,7 @@ AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVF return NULL; memset(side_data->data, 0, side_data->size); + get_defaults((AVAmbientViewingEnvironment *)side_data->data); return (AVAmbientViewingEnvironment *)side_data->data; } diff --git a/src/ExtLib/ffmpeg/libavutil/dovi_meta.h b/src/ExtLib/ffmpeg/libavutil/dovi_meta.h index e10332f8d7..e168075a24 100644 --- a/src/ExtLib/ffmpeg/libavutil/dovi_meta.h +++ b/src/ExtLib/ffmpeg/libavutil/dovi_meta.h @@ -91,6 +91,8 @@ typedef struct AVDOVIRpuDataHeader { uint8_t spatial_resampling_filter_flag; uint8_t el_spatial_resampling_filter_flag; uint8_t disable_residual_flag; + uint8_t ext_mapping_idc_0_4; /* extended base layer inverse mapping indicator */ + uint8_t ext_mapping_idc_5_7; /* reserved */ } AVDOVIRpuDataHeader; enum AVDOVIMappingMethod { diff --git a/src/ExtLib/ffmpeg/libavutil/intreadwrite.h b/src/ExtLib/ffmpeg/libavutil/intreadwrite.h index f4c9d94857..547e4786db 100644 --- a/src/ExtLib/ffmpeg/libavutil/intreadwrite.h +++ b/src/ExtLib/ffmpeg/libavutil/intreadwrite.h @@ -64,9 +64,7 @@ typedef union { #include "config.h" -#if ARCH_AVR32 -# include "avr32/intreadwrite.h" -#elif ARCH_MIPS +#if ARCH_MIPS # include "mips/intreadwrite.h" #elif ARCH_PPC # include "ppc/intreadwrite.h" diff --git a/src/ExtLib/ffmpeg/libavutil/mastering_display_metadata.c b/src/ExtLib/ffmpeg/libavutil/mastering_display_metadata.c index ea41f13f9d..dd37ed7d0e 100644 --- a/src/ExtLib/ffmpeg/libavutil/mastering_display_metadata.c +++ b/src/ExtLib/ffmpeg/libavutil/mastering_display_metadata.c @@ -25,9 +25,20 @@ #include "mastering_display_metadata.h" #include "mem.h" +static void get_defaults(AVMasteringDisplayMetadata *mastering) +{ + for (int i = 0; i < 3; i++) + for (int j = 0; j < 2; j++) + mastering->display_primaries[i][j] = (AVRational) { 0, 1 }; + mastering->white_point[0] = + mastering->white_point[1] = + mastering->min_luminance = + mastering->max_luminance = (AVRational) { 0, 1 }; +} + AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void) { - return av_mallocz(sizeof(AVMasteringDisplayMetadata)); + return av_mastering_display_metadata_alloc_size(NULL); } AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc_size(size_t *size) @@ -36,6 +47,8 @@ AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc_size(size_t *siz if (!mastering) return NULL; + get_defaults(mastering); + if (size) *size = sizeof(*mastering); @@ -51,6 +64,7 @@ AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFra return NULL; memset(side_data->data, 0, sizeof(AVMasteringDisplayMetadata)); + get_defaults((AVMasteringDisplayMetadata *)side_data->data); return (AVMasteringDisplayMetadata *)side_data->data; } diff --git a/src/ExtLib/ffmpeg/libavutil/stereo3d.c b/src/ExtLib/ffmpeg/libavutil/stereo3d.c index 7f8a770805..b10423dc48 100644 --- a/src/ExtLib/ffmpeg/libavutil/stereo3d.c +++ b/src/ExtLib/ffmpeg/libavutil/stereo3d.c @@ -26,9 +26,20 @@ #include "mem.h" #include "stereo3d.h" +static void get_defaults(AVStereo3D *stereo) +{ + stereo->horizontal_disparity_adjustment = (AVRational) { 0, 1 }; +} + AVStereo3D *av_stereo3d_alloc(void) { - return av_mallocz(sizeof(AVStereo3D)); + AVStereo3D *stereo = av_mallocz(sizeof(AVStereo3D)); + if (!stereo) + return NULL; + + get_defaults(stereo); + + return stereo; } AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame) @@ -40,6 +51,7 @@ AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame) return NULL; memset(side_data->data, 0, sizeof(AVStereo3D)); + get_defaults((AVStereo3D *)side_data->data); return (AVStereo3D *)side_data->data; } @@ -55,6 +67,18 @@ static const char * const stereo3d_type_names[] = { [AV_STEREO3D_COLUMNS] = "interleaved columns", }; +static const char * const stereo3d_view_names[] = { + [AV_STEREO3D_VIEW_PACKED] = "packed", + [AV_STEREO3D_VIEW_LEFT] = "left", + [AV_STEREO3D_VIEW_RIGHT] = "right", +}; + +static const char * const stereo3d_primary_eye_names[] = { + [AV_PRIMARY_EYE_NONE] = "none", + [AV_PRIMARY_EYE_LEFT] = "left", + [AV_PRIMARY_EYE_RIGHT] = "right", +}; + const char *av_stereo3d_type_name(unsigned int type) { if (type >= FF_ARRAY_ELEMS(stereo3d_type_names)) @@ -74,3 +98,43 @@ int av_stereo3d_from_name(const char *name) return -1; } + +const char *av_stereo3d_view_name(unsigned int view) +{ + if (view >= FF_ARRAY_ELEMS(stereo3d_view_names)) + return "unknown"; + + return stereo3d_view_names[view]; +} + +int av_stereo3d_view_from_name(const char *name) +{ + int i; + + for (i = 0; i < FF_ARRAY_ELEMS(stereo3d_view_names); i++) { + if (av_strstart(name, stereo3d_view_names[i], NULL)) + return i; + } + + return -1; +} + +const char *av_stereo3d_primary_eye_name(unsigned int eye) +{ + if (eye >= FF_ARRAY_ELEMS(stereo3d_primary_eye_names)) + return "unknown"; + + return stereo3d_primary_eye_names[eye]; +} + +int av_stereo3d_primary_eye_from_name(const char *name) +{ + int i; + + for (i = 0; i < FF_ARRAY_ELEMS(stereo3d_primary_eye_names); i++) { + if (av_strstart(name, stereo3d_primary_eye_names[i], NULL)) + return i; + } + + return -1; +} diff --git a/src/ExtLib/ffmpeg/libavutil/stereo3d.h b/src/ExtLib/ffmpeg/libavutil/stereo3d.h index 3aab959b79..00a5c3900e 100644 --- a/src/ExtLib/ffmpeg/libavutil/stereo3d.h +++ b/src/ExtLib/ffmpeg/libavutil/stereo3d.h @@ -158,6 +158,26 @@ enum AVStereo3DView { AV_STEREO3D_VIEW_RIGHT, }; +/** + * List of possible primary eyes. + */ +enum AVStereo3DPrimaryEye { + /** + * Neither eye. + */ + AV_PRIMARY_EYE_NONE, + + /** + * Left eye. + */ + AV_PRIMARY_EYE_LEFT, + + /** + * Right eye + */ + AV_PRIMARY_EYE_RIGHT, +}; + /** * Inverted views, Right/Bottom represents the left view. */ @@ -185,6 +205,28 @@ typedef struct AVStereo3D { * Determines which views are packed. */ enum AVStereo3DView view; + + /** + * Which eye is the primary eye when rendering in 2D. + */ + enum AVStereo3DPrimaryEye primary_eye; + + /** + * The distance between the centres of the lenses of the camera system, + * in micrometers. Zero if unset. + */ + uint32_t baseline; + + /** + * Relative shift of the left and right images, which changes the zero parallax plane. + * Range is -1.0 to 1.0. Zero if unset. + */ + AVRational horizontal_disparity_adjustment; + + /** + * Horizontal field of view in thousanths of a degree. Zero if unset. + */ + uint32_t horizontal_field_of_view; } AVStereo3D; /** @@ -222,6 +264,42 @@ const char *av_stereo3d_type_name(unsigned int type); */ int av_stereo3d_from_name(const char *name); +/** + * Provide a human-readable name of a given stereo3d view. + * + * @param type The input stereo3d view value. + * + * @return The name of the stereo3d view value, or "unknown". + */ +const char *av_stereo3d_view_name(unsigned int view); + +/** + * Get the AVStereo3DView form a human-readable name. + * + * @param name The input string. + * + * @return The AVStereo3DView value, or -1 if not found. + */ +int av_stereo3d_view_from_name(const char *name); + +/** + * Provide a human-readable name of a given stereo3d primary eye. + * + * @param type The input stereo3d primary eye value. + * + * @return The name of the stereo3d primary eye value, or "unknown". + */ +const char *av_stereo3d_primary_eye_name(unsigned int eye); + +/** + * Get the AVStereo3DPrimaryEye form a human-readable name. + * + * @param name The input string. + * + * @return The AVStereo3DPrimaryEye value, or -1 if not found. + */ +int av_stereo3d_primary_eye_from_name(const char *name); + /** * @} */ diff --git a/src/ExtLib/ffmpeg/libavutil/timer.h b/src/ExtLib/ffmpeg/libavutil/timer.h index 6bd6a0c645..9fe6aa1385 100644 --- a/src/ExtLib/ffmpeg/libavutil/timer.h +++ b/src/ExtLib/ffmpeg/libavutil/timer.h @@ -44,7 +44,9 @@ #if CONFIG_MACOS_KPERF #include "macos_kperf.h" -#elif HAVE_MACH_ABSOLUTE_TIME +#endif + +#if HAVE_MACH_ABSOLUTE_TIME #include #elif HAVE_CLOCK_GETTIME #include diff --git a/src/ExtLib/ffmpeg/libavutil/version.h b/src/ExtLib/ffmpeg/libavutil/version.h index 2756f2aa03..78e6431642 100644 --- a/src/ExtLib/ffmpeg/libavutil/version.h +++ b/src/ExtLib/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 22 +#define LIBAVUTIL_VERSION_MINOR 25 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libswscale/swscale_internal.h b/src/ExtLib/ffmpeg/libswscale/swscale_internal.h index 5007dd422f..0818f50c7f 100644 --- a/src/ExtLib/ffmpeg/libswscale/swscale_internal.h +++ b/src/ExtLib/ffmpeg/libswscale/swscale_internal.h @@ -697,7 +697,9 @@ void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4], void ff_updateMMXDitherTables(SwsContext *c, int dstY); av_cold void ff_sws_init_range_convert(SwsContext *c); +av_cold void ff_sws_init_range_convert_aarch64(SwsContext *c); av_cold void ff_sws_init_range_convert_loongarch(SwsContext *c); +av_cold void ff_sws_init_range_convert_x86(SwsContext *c); SwsFunc ff_yuv2rgb_init_x86(SwsContext *c); SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c); diff --git a/src/ExtLib/ffmpeg/libswscale/utils.c b/src/ExtLib/ffmpeg/libswscale/utils.c index 476a24fea5..12dba712c1 100644 --- a/src/ExtLib/ffmpeg/libswscale/utils.c +++ b/src/ExtLib/ffmpeg/libswscale/utils.c @@ -1080,8 +1080,12 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], if (need_reinit) { ff_sws_init_range_convert(c); -#if ARCH_LOONGARCH64 +#if ARCH_AARCH64 + ff_sws_init_range_convert_aarch64(c); +#elif ARCH_LOONGARCH64 ff_sws_init_range_convert_loongarch(c); +#elif ARCH_X86 + ff_sws_init_range_convert_x86(c); #endif } diff --git a/src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb_template.c b/src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb_template.c deleted file mode 100644 index edbacea784..0000000000 --- a/src/ExtLib/ffmpeg/libswscale/x86/rgb2rgb_template.c +++ /dev/null @@ -1,2453 +0,0 @@ -/* - * software RGB to RGB converter - * pluralize by software PAL8 to RGB converter - * software YUV to YUV converter - * software YUV to RGB converter - * Written by Nick Kurshev. - * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at) - * lot of big-endian byte order fixes by Alex Beregszaszi - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include - -#include "libavutil/attributes.h" -#include "libavutil/x86/asm.h" - -#undef PREFETCH -#undef MOVNTQ -#undef EMMS -#undef SFENCE -#undef PAVGB - -#define PREFETCH "prefetchnta" -#define PAVGB "pavgb" -#define MOVNTQ "movntq" -#define SFENCE "sfence" - -#define EMMS "emms" - -#if !COMPILE_TEMPLATE_SSE2 - -static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size) -{ - uint8_t *dest = dst; - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); - mm_end = end - 23; - __asm__ volatile("movq %0, %%mm7"::"m"(mask32a):"memory"); - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "punpckldq 3(%1), %%mm0 \n\t" - "movd 6(%1), %%mm1 \n\t" - "punpckldq 9(%1), %%mm1 \n\t" - "movd 12(%1), %%mm2 \n\t" - "punpckldq 15(%1), %%mm2 \n\t" - "movd 18(%1), %%mm3 \n\t" - "punpckldq 21(%1), %%mm3 \n\t" - "por %%mm7, %%mm0 \n\t" - "por %%mm7, %%mm1 \n\t" - "por %%mm7, %%mm2 \n\t" - "por %%mm7, %%mm3 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - MOVNTQ" %%mm1, 8(%0) \n\t" - MOVNTQ" %%mm2, 16(%0) \n\t" - MOVNTQ" %%mm3, 24(%0)" - :: "r"(dest), "r"(s) - :"memory"); - dest += 32; - s += 24; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - *dest++ = *s++; - *dest++ = *s++; - *dest++ = *s++; - *dest++ = 255; - } -} - -#define STORE_BGR24_MMX \ - "psrlq $8, %%mm2 \n\t" \ - "psrlq $8, %%mm3 \n\t" \ - "psrlq $8, %%mm6 \n\t" \ - "psrlq $8, %%mm7 \n\t" \ - "pand "MANGLE(mask24l)", %%mm0\n\t" \ - "pand "MANGLE(mask24l)", %%mm1\n\t" \ - "pand "MANGLE(mask24l)", %%mm4\n\t" \ - "pand "MANGLE(mask24l)", %%mm5\n\t" \ - "pand "MANGLE(mask24h)", %%mm2\n\t" \ - "pand "MANGLE(mask24h)", %%mm3\n\t" \ - "pand "MANGLE(mask24h)", %%mm6\n\t" \ - "pand "MANGLE(mask24h)", %%mm7\n\t" \ - "por %%mm2, %%mm0 \n\t" \ - "por %%mm3, %%mm1 \n\t" \ - "por %%mm6, %%mm4 \n\t" \ - "por %%mm7, %%mm5 \n\t" \ - \ - "movq %%mm1, %%mm2 \n\t" \ - "movq %%mm4, %%mm3 \n\t" \ - "psllq $48, %%mm2 \n\t" \ - "psllq $32, %%mm3 \n\t" \ - "por %%mm2, %%mm0 \n\t" \ - "psrlq $16, %%mm1 \n\t" \ - "psrlq $32, %%mm4 \n\t" \ - "psllq $16, %%mm5 \n\t" \ - "por %%mm3, %%mm1 \n\t" \ - "por %%mm5, %%mm4 \n\t" \ - \ - MOVNTQ" %%mm0, (%0) \n\t" \ - MOVNTQ" %%mm1, 8(%0) \n\t" \ - MOVNTQ" %%mm4, 16(%0)" - - -static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size) -{ - uint8_t *dest = dst; - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); - mm_end = end - 31; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movq (%1), %%mm0 \n\t" - "movq 8(%1), %%mm1 \n\t" - "movq 16(%1), %%mm4 \n\t" - "movq 24(%1), %%mm5 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm1, %%mm3 \n\t" - "movq %%mm4, %%mm6 \n\t" - "movq %%mm5, %%mm7 \n\t" - STORE_BGR24_MMX - :: "r"(dest), "r"(s) - NAMED_CONSTRAINTS_ADD(mask24l,mask24h) - :"memory"); - dest += 24; - s += 32; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - *dest++ = *s++; - *dest++ = *s++; - *dest++ = *s++; - s++; - } -} - -/* - original by Strepto/Astral - ported to gcc & bugfixed: A'rpi - MMXEXT, 3DNOW optimization by Nick Kurshev - 32-bit C version, and and&add trick by Michael Niedermayer -*/ -static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size) -{ - register const uint8_t* s=src; - register uint8_t* d=dst; - register const uint8_t *end; - const uint8_t *mm_end; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*s)); - __asm__ volatile("movq %0, %%mm4"::"m"(mask15s)); - mm_end = end - 15; - while (s>1)&0x7FE07FE0) | (x&0x001F001F); - s+=4; - d+=4; - } - if (s < end) { - register uint16_t x= *((const uint16_t*)s); - *((uint16_t *)d) = ((x>>1)&0x7FE0) | (x&0x001F); - } -} - -static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - mm_end = end - 15; - __asm__ volatile( - "movq %3, %%mm5 \n\t" - "movq %4, %%mm6 \n\t" - "movq %5, %%mm7 \n\t" - "jmp 2f \n\t" - ".p2align 4 \n\t" - "1: \n\t" - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 4(%1), %%mm3 \n\t" - "punpckldq 8(%1), %%mm0 \n\t" - "punpckldq 12(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm3, %%mm4 \n\t" - "pand %%mm6, %%mm0 \n\t" - "pand %%mm6, %%mm3 \n\t" - "pmaddwd %%mm7, %%mm0 \n\t" - "pmaddwd %%mm7, %%mm3 \n\t" - "pand %%mm5, %%mm1 \n\t" - "pand %%mm5, %%mm4 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "psrld $5, %%mm0 \n\t" - "pslld $11, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - "add $16, %1 \n\t" - "add $8, %0 \n\t" - "2: \n\t" - "cmp %2, %1 \n\t" - " jb 1b \n\t" - : "+r" (d), "+r"(s) - : "r" (mm_end), "m" (mask3216g), "m" (mask3216br), "m" (mul3216) - ); - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register int rgb = *(const uint32_t*)s; s += 4; - *d++ = ((rgb&0xFF)>>3) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>8); - } -} - -static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); - __asm__ volatile( - "movq %0, %%mm7 \n\t" - "movq %1, %%mm6 \n\t" - ::"m"(red_16mask),"m"(green_16mask)); - mm_end = end - 15; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 4(%1), %%mm3 \n\t" - "punpckldq 8(%1), %%mm0 \n\t" - "punpckldq 12(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm3, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "psllq $8, %%mm0 \n\t" - "psllq $8, %%mm3 \n\t" - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm3 \n\t" - "psrlq $5, %%mm1 \n\t" - "psrlq $5, %%mm4 \n\t" - "pand %%mm6, %%mm1 \n\t" - "pand %%mm6, %%mm4 \n\t" - "psrlq $19, %%mm2 \n\t" - "psrlq $19, %%mm5 \n\t" - "pand %2, %%mm2 \n\t" - "pand %2, %%mm5 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm2, %%mm0 \n\t" - "por %%mm5, %%mm3 \n\t" - "psllq $16, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - :: "r"(d),"r"(s),"m"(blue_16mask):"memory"); - d += 4; - s += 16; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register int rgb = *(const uint32_t*)s; s += 4; - *d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19); - } -} - -static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - mm_end = end - 15; - __asm__ volatile( - "movq %3, %%mm5 \n\t" - "movq %4, %%mm6 \n\t" - "movq %5, %%mm7 \n\t" - "jmp 2f \n\t" - ".p2align 4 \n\t" - "1: \n\t" - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 4(%1), %%mm3 \n\t" - "punpckldq 8(%1), %%mm0 \n\t" - "punpckldq 12(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm3, %%mm4 \n\t" - "pand %%mm6, %%mm0 \n\t" - "pand %%mm6, %%mm3 \n\t" - "pmaddwd %%mm7, %%mm0 \n\t" - "pmaddwd %%mm7, %%mm3 \n\t" - "pand %%mm5, %%mm1 \n\t" - "pand %%mm5, %%mm4 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "psrld $6, %%mm0 \n\t" - "pslld $10, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - "add $16, %1 \n\t" - "add $8, %0 \n\t" - "2: \n\t" - "cmp %2, %1 \n\t" - " jb 1b \n\t" - : "+r" (d), "+r"(s) - : "r" (mm_end), "m" (mask3215g), "m" (mask3216br), "m" (mul3215) - ); - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register int rgb = *(const uint32_t*)s; s += 4; - *d++ = ((rgb&0xFF)>>3) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>9); - } -} - -static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); - __asm__ volatile( - "movq %0, %%mm7 \n\t" - "movq %1, %%mm6 \n\t" - ::"m"(red_15mask),"m"(green_15mask)); - mm_end = end - 15; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 4(%1), %%mm3 \n\t" - "punpckldq 8(%1), %%mm0 \n\t" - "punpckldq 12(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm3, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "psllq $7, %%mm0 \n\t" - "psllq $7, %%mm3 \n\t" - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm3 \n\t" - "psrlq $6, %%mm1 \n\t" - "psrlq $6, %%mm4 \n\t" - "pand %%mm6, %%mm1 \n\t" - "pand %%mm6, %%mm4 \n\t" - "psrlq $19, %%mm2 \n\t" - "psrlq $19, %%mm5 \n\t" - "pand %2, %%mm2 \n\t" - "pand %2, %%mm5 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm2, %%mm0 \n\t" - "por %%mm5, %%mm3 \n\t" - "psllq $16, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - ::"r"(d),"r"(s),"m"(blue_15mask):"memory"); - d += 4; - s += 16; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register int rgb = *(const uint32_t*)s; s += 4; - *d++ = ((rgb&0xF8)<<7) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>19); - } -} - -static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); - __asm__ volatile( - "movq %0, %%mm7 \n\t" - "movq %1, %%mm6 \n\t" - ::"m"(red_16mask),"m"(green_16mask)); - mm_end = end - 11; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 3(%1), %%mm3 \n\t" - "punpckldq 6(%1), %%mm0 \n\t" - "punpckldq 9(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm3, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "psrlq $3, %%mm0 \n\t" - "psrlq $3, %%mm3 \n\t" - "pand %2, %%mm0 \n\t" - "pand %2, %%mm3 \n\t" - "psrlq $5, %%mm1 \n\t" - "psrlq $5, %%mm4 \n\t" - "pand %%mm6, %%mm1 \n\t" - "pand %%mm6, %%mm4 \n\t" - "psrlq $8, %%mm2 \n\t" - "psrlq $8, %%mm5 \n\t" - "pand %%mm7, %%mm2 \n\t" - "pand %%mm7, %%mm5 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm2, %%mm0 \n\t" - "por %%mm5, %%mm3 \n\t" - "psllq $16, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - ::"r"(d),"r"(s),"m"(blue_16mask):"memory"); - d += 4; - s += 12; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - const int b = *s++; - const int g = *s++; - const int r = *s++; - *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); - } -} - -static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); - __asm__ volatile( - "movq %0, %%mm7 \n\t" - "movq %1, %%mm6 \n\t" - ::"m"(red_16mask),"m"(green_16mask)); - mm_end = end - 15; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 3(%1), %%mm3 \n\t" - "punpckldq 6(%1), %%mm0 \n\t" - "punpckldq 9(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm3, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "psllq $8, %%mm0 \n\t" - "psllq $8, %%mm3 \n\t" - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm3 \n\t" - "psrlq $5, %%mm1 \n\t" - "psrlq $5, %%mm4 \n\t" - "pand %%mm6, %%mm1 \n\t" - "pand %%mm6, %%mm4 \n\t" - "psrlq $19, %%mm2 \n\t" - "psrlq $19, %%mm5 \n\t" - "pand %2, %%mm2 \n\t" - "pand %2, %%mm5 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm2, %%mm0 \n\t" - "por %%mm5, %%mm3 \n\t" - "psllq $16, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - ::"r"(d),"r"(s),"m"(blue_16mask):"memory"); - d += 4; - s += 12; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - const int r = *s++; - const int g = *s++; - const int b = *s++; - *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); - } -} - -static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); - __asm__ volatile( - "movq %0, %%mm7 \n\t" - "movq %1, %%mm6 \n\t" - ::"m"(red_15mask),"m"(green_15mask)); - mm_end = end - 11; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 3(%1), %%mm3 \n\t" - "punpckldq 6(%1), %%mm0 \n\t" - "punpckldq 9(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm3, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "psrlq $3, %%mm0 \n\t" - "psrlq $3, %%mm3 \n\t" - "pand %2, %%mm0 \n\t" - "pand %2, %%mm3 \n\t" - "psrlq $6, %%mm1 \n\t" - "psrlq $6, %%mm4 \n\t" - "pand %%mm6, %%mm1 \n\t" - "pand %%mm6, %%mm4 \n\t" - "psrlq $9, %%mm2 \n\t" - "psrlq $9, %%mm5 \n\t" - "pand %%mm7, %%mm2 \n\t" - "pand %%mm7, %%mm5 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm2, %%mm0 \n\t" - "por %%mm5, %%mm3 \n\t" - "psllq $16, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - ::"r"(d),"r"(s),"m"(blue_15mask):"memory"); - d += 4; - s += 12; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - const int b = *s++; - const int g = *s++; - const int r = *s++; - *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7); - } -} - -static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint8_t *s = src; - const uint8_t *end; - const uint8_t *mm_end; - uint16_t *d = (uint16_t *)dst; - end = s + src_size; - __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); - __asm__ volatile( - "movq %0, %%mm7 \n\t" - "movq %1, %%mm6 \n\t" - ::"m"(red_15mask),"m"(green_15mask)); - mm_end = end - 15; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movd (%1), %%mm0 \n\t" - "movd 3(%1), %%mm3 \n\t" - "punpckldq 6(%1), %%mm0 \n\t" - "punpckldq 9(%1), %%mm3 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm3, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "psllq $7, %%mm0 \n\t" - "psllq $7, %%mm3 \n\t" - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm3 \n\t" - "psrlq $6, %%mm1 \n\t" - "psrlq $6, %%mm4 \n\t" - "pand %%mm6, %%mm1 \n\t" - "pand %%mm6, %%mm4 \n\t" - "psrlq $19, %%mm2 \n\t" - "psrlq $19, %%mm5 \n\t" - "pand %2, %%mm2 \n\t" - "pand %2, %%mm5 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm2, %%mm0 \n\t" - "por %%mm5, %%mm3 \n\t" - "psllq $16, %%mm3 \n\t" - "por %%mm3, %%mm0 \n\t" - MOVNTQ" %%mm0, (%0) \n\t" - ::"r"(d),"r"(s),"m"(blue_15mask):"memory"); - d += 4; - s += 12; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - const int r = *s++; - const int g = *s++; - const int b = *s++; - *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7); - } -} - -static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint16_t *end; - const uint16_t *mm_end; - uint8_t *d = dst; - const uint16_t *s = (const uint16_t*)src; - end = s + src_size/2; - __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); - mm_end = end - 7; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movq (%1), %%mm0 \n\t" - "movq (%1), %%mm1 \n\t" - "movq (%1), %%mm2 \n\t" - "pand %2, %%mm0 \n\t" - "pand %3, %%mm1 \n\t" - "pand %4, %%mm2 \n\t" - "psllq $5, %%mm0 \n\t" - "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" - "pmulhw "MANGLE(mul15_mid)", %%mm1 \n\t" - "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" - "movq %%mm0, %%mm3 \n\t" - "movq %%mm1, %%mm4 \n\t" - "movq %%mm2, %%mm5 \n\t" - "punpcklwd %5, %%mm0 \n\t" - "punpcklwd %5, %%mm1 \n\t" - "punpcklwd %5, %%mm2 \n\t" - "punpckhwd %5, %%mm3 \n\t" - "punpckhwd %5, %%mm4 \n\t" - "punpckhwd %5, %%mm5 \n\t" - "psllq $8, %%mm1 \n\t" - "psllq $16, %%mm2 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm2, %%mm0 \n\t" - "psllq $8, %%mm4 \n\t" - "psllq $16, %%mm5 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm5, %%mm3 \n\t" - - "movq %%mm0, %%mm6 \n\t" - "movq %%mm3, %%mm7 \n\t" - - "movq 8(%1), %%mm0 \n\t" - "movq 8(%1), %%mm1 \n\t" - "movq 8(%1), %%mm2 \n\t" - "pand %2, %%mm0 \n\t" - "pand %3, %%mm1 \n\t" - "pand %4, %%mm2 \n\t" - "psllq $5, %%mm0 \n\t" - "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" - "pmulhw "MANGLE(mul15_mid)", %%mm1 \n\t" - "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" - "movq %%mm0, %%mm3 \n\t" - "movq %%mm1, %%mm4 \n\t" - "movq %%mm2, %%mm5 \n\t" - "punpcklwd %5, %%mm0 \n\t" - "punpcklwd %5, %%mm1 \n\t" - "punpcklwd %5, %%mm2 \n\t" - "punpckhwd %5, %%mm3 \n\t" - "punpckhwd %5, %%mm4 \n\t" - "punpckhwd %5, %%mm5 \n\t" - "psllq $8, %%mm1 \n\t" - "psllq $16, %%mm2 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm2, %%mm0 \n\t" - "psllq $8, %%mm4 \n\t" - "psllq $16, %%mm5 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm5, %%mm3 \n\t" - - :"=m"(*d) - :"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null) - NAMED_CONSTRAINTS_ADD(mul15_mid,mul15_hi) - :"memory"); - /* borrowed 32 to 24 */ - __asm__ volatile( - "movq %%mm0, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "movq %%mm6, %%mm0 \n\t" - "movq %%mm7, %%mm1 \n\t" - - "movq %%mm4, %%mm6 \n\t" - "movq %%mm5, %%mm7 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm1, %%mm3 \n\t" - - STORE_BGR24_MMX - - :: "r"(d), "m"(*s) - NAMED_CONSTRAINTS_ADD(mask24l,mask24h) - :"memory"); - d += 24; - s += 8; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register uint16_t bgr; - bgr = *s++; - *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); - *d++ = ((bgr&0x3E0)>>2) | ((bgr&0x3E0)>>7); - *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12); - } -} - -static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint16_t *end; - const uint16_t *mm_end; - uint8_t *d = (uint8_t *)dst; - const uint16_t *s = (const uint16_t *)src; - end = s + src_size/2; - __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); - mm_end = end - 7; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movq (%1), %%mm0 \n\t" - "movq (%1), %%mm1 \n\t" - "movq (%1), %%mm2 \n\t" - "pand %2, %%mm0 \n\t" - "pand %3, %%mm1 \n\t" - "pand %4, %%mm2 \n\t" - "psllq $5, %%mm0 \n\t" - "psrlq $1, %%mm2 \n\t" - "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" - "pmulhw "MANGLE(mul16_mid)", %%mm1 \n\t" - "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" - "movq %%mm0, %%mm3 \n\t" - "movq %%mm1, %%mm4 \n\t" - "movq %%mm2, %%mm5 \n\t" - "punpcklwd %5, %%mm0 \n\t" - "punpcklwd %5, %%mm1 \n\t" - "punpcklwd %5, %%mm2 \n\t" - "punpckhwd %5, %%mm3 \n\t" - "punpckhwd %5, %%mm4 \n\t" - "punpckhwd %5, %%mm5 \n\t" - "psllq $8, %%mm1 \n\t" - "psllq $16, %%mm2 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm2, %%mm0 \n\t" - "psllq $8, %%mm4 \n\t" - "psllq $16, %%mm5 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm5, %%mm3 \n\t" - - "movq %%mm0, %%mm6 \n\t" - "movq %%mm3, %%mm7 \n\t" - - "movq 8(%1), %%mm0 \n\t" - "movq 8(%1), %%mm1 \n\t" - "movq 8(%1), %%mm2 \n\t" - "pand %2, %%mm0 \n\t" - "pand %3, %%mm1 \n\t" - "pand %4, %%mm2 \n\t" - "psllq $5, %%mm0 \n\t" - "psrlq $1, %%mm2 \n\t" - "pmulhw "MANGLE(mul15_mid)", %%mm0 \n\t" - "pmulhw "MANGLE(mul16_mid)", %%mm1 \n\t" - "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" - "movq %%mm0, %%mm3 \n\t" - "movq %%mm1, %%mm4 \n\t" - "movq %%mm2, %%mm5 \n\t" - "punpcklwd %5, %%mm0 \n\t" - "punpcklwd %5, %%mm1 \n\t" - "punpcklwd %5, %%mm2 \n\t" - "punpckhwd %5, %%mm3 \n\t" - "punpckhwd %5, %%mm4 \n\t" - "punpckhwd %5, %%mm5 \n\t" - "psllq $8, %%mm1 \n\t" - "psllq $16, %%mm2 \n\t" - "por %%mm1, %%mm0 \n\t" - "por %%mm2, %%mm0 \n\t" - "psllq $8, %%mm4 \n\t" - "psllq $16, %%mm5 \n\t" - "por %%mm4, %%mm3 \n\t" - "por %%mm5, %%mm3 \n\t" - :"=m"(*d) - :"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null) - NAMED_CONSTRAINTS_ADD(mul15_mid,mul16_mid,mul15_hi) - :"memory"); - /* borrowed 32 to 24 */ - __asm__ volatile( - "movq %%mm0, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "movq %%mm6, %%mm0 \n\t" - "movq %%mm7, %%mm1 \n\t" - - "movq %%mm4, %%mm6 \n\t" - "movq %%mm5, %%mm7 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm1, %%mm3 \n\t" - - STORE_BGR24_MMX - - :: "r"(d), "m"(*s) - NAMED_CONSTRAINTS_ADD(mask24l,mask24h) - :"memory"); - d += 24; - s += 8; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register uint16_t bgr; - bgr = *s++; - *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); - *d++ = ((bgr&0x7E0)>>3) | ((bgr&0x7E0)>>9); - *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13); - } -} - -/* - * mm0 = 00 B3 00 B2 00 B1 00 B0 - * mm1 = 00 G3 00 G2 00 G1 00 G0 - * mm2 = 00 R3 00 R2 00 R1 00 R0 - * mm6 = FF FF FF FF FF FF FF FF - * mm7 = 00 00 00 00 00 00 00 00 - */ -#define PACK_RGB32 \ - "packuswb %%mm7, %%mm0 \n\t" /* 00 00 00 00 B3 B2 B1 B0 */ \ - "packuswb %%mm7, %%mm1 \n\t" /* 00 00 00 00 G3 G2 G1 G0 */ \ - "packuswb %%mm7, %%mm2 \n\t" /* 00 00 00 00 R3 R2 R1 R0 */ \ - "punpcklbw %%mm1, %%mm0 \n\t" /* G3 B3 G2 B2 G1 B1 G0 B0 */ \ - "punpcklbw %%mm6, %%mm2 \n\t" /* FF R3 FF R2 FF R1 FF R0 */ \ - "movq %%mm0, %%mm3 \n\t" \ - "punpcklwd %%mm2, %%mm0 \n\t" /* FF R1 G1 B1 FF R0 G0 B0 */ \ - "punpckhwd %%mm2, %%mm3 \n\t" /* FF R3 G3 B3 FF R2 G2 B2 */ \ - MOVNTQ" %%mm0, (%0) \n\t" \ - MOVNTQ" %%mm3, 8(%0) \n\t" \ - -static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint16_t *end; - const uint16_t *mm_end; - uint8_t *d = dst; - const uint16_t *s = (const uint16_t *)src; - end = s + src_size/2; - __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); - __asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory"); - __asm__ volatile("pcmpeqd %%mm6,%%mm6 \n\t":::"memory"); - mm_end = end - 3; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movq (%1), %%mm0 \n\t" - "movq (%1), %%mm1 \n\t" - "movq (%1), %%mm2 \n\t" - "pand %2, %%mm0 \n\t" - "pand %3, %%mm1 \n\t" - "pand %4, %%mm2 \n\t" - "psllq $5, %%mm0 \n\t" - "pmulhw %5, %%mm0 \n\t" - "pmulhw %5, %%mm1 \n\t" - "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" - PACK_RGB32 - ::"r"(d),"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r) ,"m"(mul15_mid) - NAMED_CONSTRAINTS_ADD(mul15_hi) - :"memory"); - d += 16; - s += 4; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register uint16_t bgr; - bgr = *s++; - *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); - *d++ = ((bgr&0x3E0)>>2) | ((bgr&0x3E0)>>7); - *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12); - *d++ = 255; - } -} - -static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size) -{ - const uint16_t *end; - const uint16_t *mm_end; - uint8_t *d = dst; - const uint16_t *s = (const uint16_t*)src; - end = s + src_size/2; - __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); - __asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory"); - __asm__ volatile("pcmpeqd %%mm6,%%mm6 \n\t":::"memory"); - mm_end = end - 3; - while (s < mm_end) { - __asm__ volatile( - PREFETCH" 32(%1) \n\t" - "movq (%1), %%mm0 \n\t" - "movq (%1), %%mm1 \n\t" - "movq (%1), %%mm2 \n\t" - "pand %2, %%mm0 \n\t" - "pand %3, %%mm1 \n\t" - "pand %4, %%mm2 \n\t" - "psllq $5, %%mm0 \n\t" - "psrlq $1, %%mm2 \n\t" - "pmulhw %5, %%mm0 \n\t" - "pmulhw "MANGLE(mul16_mid)", %%mm1 \n\t" - "pmulhw "MANGLE(mul15_hi)", %%mm2 \n\t" - PACK_RGB32 - ::"r"(d),"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mul15_mid) - NAMED_CONSTRAINTS_ADD(mul16_mid,mul15_hi) - :"memory"); - d += 16; - s += 4; - } - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - while (s < end) { - register uint16_t bgr; - bgr = *s++; - *d++ = ((bgr&0x1F)<<3) | ((bgr&0x1F)>>2); - *d++ = ((bgr&0x7E0)>>3) | ((bgr&0x7E0)>>9); - *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13); - *d++ = 255; - } -} - -static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size) -{ - unsigned i; - x86_reg mmx_size= 23 - src_size; - __asm__ volatile ( - "test %%"FF_REG_a", %%"FF_REG_a" \n\t" - "jns 2f \n\t" - "movq "MANGLE(mask24r)", %%mm5 \n\t" - "movq "MANGLE(mask24g)", %%mm6 \n\t" - "movq "MANGLE(mask24b)", %%mm7 \n\t" - ".p2align 4 \n\t" - "1: \n\t" - PREFETCH" 32(%1, %%"FF_REG_a") \n\t" - "movq (%1, %%"FF_REG_a"), %%mm0 \n\t" // BGR BGR BG - "movq (%1, %%"FF_REG_a"), %%mm1 \n\t" // BGR BGR BG - "movq 2(%1, %%"FF_REG_a"), %%mm2 \n\t" // R BGR BGR B - "psllq $16, %%mm0 \n\t" // 00 BGR BGR - "pand %%mm5, %%mm0 \n\t" - "pand %%mm6, %%mm1 \n\t" - "pand %%mm7, %%mm2 \n\t" - "por %%mm0, %%mm1 \n\t" - "por %%mm2, %%mm1 \n\t" - "movq 6(%1, %%"FF_REG_a"), %%mm0 \n\t" // BGR BGR BG - MOVNTQ" %%mm1,(%2, %%"FF_REG_a") \n\t" // RGB RGB RG - "movq 8(%1, %%"FF_REG_a"), %%mm1 \n\t" // R BGR BGR B - "movq 10(%1, %%"FF_REG_a"), %%mm2 \n\t" // GR BGR BGR - "pand %%mm7, %%mm0 \n\t" - "pand %%mm5, %%mm1 \n\t" - "pand %%mm6, %%mm2 \n\t" - "por %%mm0, %%mm1 \n\t" - "por %%mm2, %%mm1 \n\t" - "movq 14(%1, %%"FF_REG_a"), %%mm0 \n\t" // R BGR BGR B - MOVNTQ" %%mm1, 8(%2, %%"FF_REG_a")\n\t" // B RGB RGB R - "movq 16(%1, %%"FF_REG_a"), %%mm1 \n\t" // GR BGR BGR - "movq 18(%1, %%"FF_REG_a"), %%mm2 \n\t" // BGR BGR BG - "pand %%mm6, %%mm0 \n\t" - "pand %%mm7, %%mm1 \n\t" - "pand %%mm5, %%mm2 \n\t" - "por %%mm0, %%mm1 \n\t" - "por %%mm2, %%mm1 \n\t" - MOVNTQ" %%mm1, 16(%2, %%"FF_REG_a") \n\t" - "add $24, %%"FF_REG_a" \n\t" - " js 1b \n\t" - "2: \n\t" - : "+a" (mmx_size) - : "r" (src-mmx_size), "r"(dst-mmx_size) - NAMED_CONSTRAINTS_ADD(mask24r,mask24g,mask24b) - ); - - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); - - if (mmx_size==23) return; //finished, was multiple of 8 - - src+= src_size; - dst+= src_size; - src_size= 23-mmx_size; - src-= src_size; - dst-= src_size; - for (i=0; i>1; - for (y=0; y>1; - for (y=0; y>1; - for (y=0; y>2; - dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; - } - dst[2*srcWidth-1]= src[srcWidth-1]; - - dst+= dstStride; - - for (y=1; y> 2; - dst[dstStride] = (src[0] + 3 * src[srcStride]) >> 2; - } - - for (x=mmxSize-1; x>2; - dst[2*x+dstStride+2]= ( src[x+0] + 3*src[x+srcStride+1])>>2; - dst[2*x+dstStride+1]= ( src[x+1] + 3*src[x+srcStride ])>>2; - dst[2*x +2]= (3*src[x+1] + src[x+srcStride ])>>2; - } - dst[srcWidth*2 -1 ]= (3*src[srcWidth-1] + src[srcWidth-1 + srcStride])>>2; - dst[srcWidth*2 -1 + dstStride]= ( src[srcWidth-1] + 3*src[srcWidth-1 + srcStride])>>2; - - dst+=dstStride*2; - src+=srcStride; - } - - // last line - dst[0]= src[0]; - - for (x=0; x>2; - dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; - } - dst[2*srcWidth-1]= src[srcWidth-1]; - - __asm__ volatile(EMMS" \n\t" - SFENCE" \n\t" - :::"memory"); -} - -/** - * Height should be a multiple of 2 and width should be a multiple of 16. - * (If this is a problem for anyone then tell me, and I will fix it.) - * Chrominance data is only taken from every second line, others are ignored. - * FIXME: Write HQ version. - */ -static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - int width, int height, - int lumStride, int chromStride, int srcStride) -{ - int y; - const x86_reg chromWidth= width>>1; - for (y=0; y>1; - - if (height > 2) { - ff_rgb24toyv12_c(src, ydst, udst, vdst, width, 2, lumStride, chromStride, srcStride, rgb2yuv); - src += 2*srcStride; - ydst += 2*lumStride; - udst += chromStride; - vdst += chromStride; - height -= 2; - } - - for (y=0; y= 16) { - if (!((((intptr_t)src1) | ((intptr_t)src2) | ((intptr_t)dest))&15)) { - __asm__( - "xor %%"FF_REG_a", %%"FF_REG_a" \n\t" - "1: \n\t" - PREFETCH" 64(%1, %%"FF_REG_a") \n\t" - PREFETCH" 64(%2, %%"FF_REG_a") \n\t" - "movdqa (%1, %%"FF_REG_a"), %%xmm0 \n\t" - "movdqa (%1, %%"FF_REG_a"), %%xmm1 \n\t" - "movdqa (%2, %%"FF_REG_a"), %%xmm2 \n\t" - "punpcklbw %%xmm2, %%xmm0 \n\t" - "punpckhbw %%xmm2, %%xmm1 \n\t" - "movntdq %%xmm0, (%0, %%"FF_REG_a", 2) \n\t" - "movntdq %%xmm1, 16(%0, %%"FF_REG_a", 2) \n\t" - "add $16, %%"FF_REG_a" \n\t" - "cmp %3, %%"FF_REG_a" \n\t" - " jb 1b \n\t" - ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15) - : "memory", XMM_CLOBBERS("xmm0", "xmm1", "xmm2",) "%"FF_REG_a - ); - } else - __asm__( - "xor %%"FF_REG_a", %%"FF_REG_a" \n\t" - "1: \n\t" - PREFETCH" 64(%1, %%"FF_REG_a") \n\t" - PREFETCH" 64(%2, %%"FF_REG_a") \n\t" - "movq (%1, %%"FF_REG_a"), %%mm0 \n\t" - "movq 8(%1, %%"FF_REG_a"), %%mm2 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm2, %%mm3 \n\t" - "movq (%2, %%"FF_REG_a"), %%mm4 \n\t" - "movq 8(%2, %%"FF_REG_a"), %%mm5 \n\t" - "punpcklbw %%mm4, %%mm0 \n\t" - "punpckhbw %%mm4, %%mm1 \n\t" - "punpcklbw %%mm5, %%mm2 \n\t" - "punpckhbw %%mm5, %%mm3 \n\t" - MOVNTQ" %%mm0, (%0, %%"FF_REG_a", 2) \n\t" - MOVNTQ" %%mm1, 8(%0, %%"FF_REG_a", 2) \n\t" - MOVNTQ" %%mm2, 16(%0, %%"FF_REG_a", 2) \n\t" - MOVNTQ" %%mm3, 24(%0, %%"FF_REG_a", 2) \n\t" - "add $16, %%"FF_REG_a" \n\t" - "cmp %3, %%"FF_REG_a" \n\t" - " jb 1b \n\t" - ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15) - : "memory", "%"FF_REG_a - ); - - } - for (w= (width&(~15)); w < width; w++) { - dest[2*w+0] = src1[w]; - dest[2*w+1] = src2[w]; - } - dest += dstStride; - src1 += src1Stride; - src2 += src2Stride; - } - __asm__( - EMMS" \n\t" - SFENCE" \n\t" - ::: "memory" - ); -} -#endif /* !COMPILE_TEMPLATE_AVX && COMPILE_TEMPLATE_SSE2 */ - -#if !COMPILE_TEMPLATE_AVX || HAVE_AVX_EXTERNAL -#if COMPILE_TEMPLATE_SSE2 && HAVE_X86ASM -void RENAME(ff_nv12ToUV)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *unused, - const uint8_t *src1, - const uint8_t *src2, - int w, - uint32_t *unused2, - void *opq); -static void RENAME(deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, - int width, int height, int srcStride, - int dst1Stride, int dst2Stride) -{ - int h; - - for (h = 0; h < height; h++) { - RENAME(ff_nv12ToUV)(dst1, dst2, NULL, src, NULL, width, NULL, NULL); - src += srcStride; - dst1 += dst1Stride; - dst2 += dst2Stride; - } - __asm__( - SFENCE" \n\t" - ::: "memory" - ); -} -#endif /* COMPILE_TEMPLATE_SSE2 && HAVE_X86ASM */ -#endif /* !COMPILE_TEMPLATE_AVX || HAVE_AVX_EXTERNAL */ - -#if !COMPILE_TEMPLATE_SSE2 -static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, - uint8_t *dst1, uint8_t *dst2, - int width, int height, - int srcStride1, int srcStride2, - int dstStride1, int dstStride2) -{ - x86_reg x, y; - int w,h; - w=width/2; h=height/2; - __asm__ volatile( - PREFETCH" %0 \n\t" - PREFETCH" %1 \n\t" - ::"m"(*(src1+srcStride1)),"m"(*(src2+srcStride2)):"memory"); - for (y=0;y>1); - uint8_t* d=dst1+dstStride1*y; - x=0; - for (;x>1); - uint8_t* d=dst2+dstStride2*y; - x=0; - for (;x>2); - const uint8_t* vp=src3+srcStride3*(y>>2); - uint8_t* d=dst+dstStride*y; - x=0; - for (;x>1; - dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1; - count++; - } -} - -static void RENAME(extract_odd2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count) -{ - dst0+= count; - dst1+= count; - src += 4*count; - count= - count; - if(count <= -8) { - count += 7; - __asm__ volatile( - "pcmpeqw %%mm7, %%mm7 \n\t" - "psrlw $8, %%mm7 \n\t" - "1: \n\t" - "movq -28(%1, %0, 4), %%mm0 \n\t" - "movq -20(%1, %0, 4), %%mm1 \n\t" - "movq -12(%1, %0, 4), %%mm2 \n\t" - "movq -4(%1, %0, 4), %%mm3 \n\t" - "psrlw $8, %%mm0 \n\t" - "psrlw $8, %%mm1 \n\t" - "psrlw $8, %%mm2 \n\t" - "psrlw $8, %%mm3 \n\t" - "packuswb %%mm1, %%mm0 \n\t" - "packuswb %%mm3, %%mm2 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm2, %%mm3 \n\t" - "psrlw $8, %%mm0 \n\t" - "psrlw $8, %%mm2 \n\t" - "pand %%mm7, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "packuswb %%mm2, %%mm0 \n\t" - "packuswb %%mm3, %%mm1 \n\t" - MOVNTQ" %%mm0,- 7(%3, %0) \n\t" - MOVNTQ" %%mm1,- 7(%2, %0) \n\t" - "add $8, %0 \n\t" - " js 1b \n\t" - : "+r"(count) - : "r"(src), "r"(dst0), "r"(dst1) - ); - count -= 7; - } - src++; - while(count<0) { - dst0[count]= src[4*count+0]; - dst1[count]= src[4*count+2]; - count++; - } -} - -static void RENAME(extract_odd2avg)(const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count) -{ - dst0 += count; - dst1 += count; - src0 += 4*count; - src1 += 4*count; - count= - count; -#ifdef PAVGB - if(count <= -8) { - count += 7; - __asm__ volatile( - "pcmpeqw %%mm7, %%mm7 \n\t" - "psrlw $8, %%mm7 \n\t" - "1: \n\t" - "movq -28(%1, %0, 4), %%mm0 \n\t" - "movq -20(%1, %0, 4), %%mm1 \n\t" - "movq -12(%1, %0, 4), %%mm2 \n\t" - "movq -4(%1, %0, 4), %%mm3 \n\t" - PAVGB" -28(%2, %0, 4), %%mm0 \n\t" - PAVGB" -20(%2, %0, 4), %%mm1 \n\t" - PAVGB" -12(%2, %0, 4), %%mm2 \n\t" - PAVGB" - 4(%2, %0, 4), %%mm3 \n\t" - "psrlw $8, %%mm0 \n\t" - "psrlw $8, %%mm1 \n\t" - "psrlw $8, %%mm2 \n\t" - "psrlw $8, %%mm3 \n\t" - "packuswb %%mm1, %%mm0 \n\t" - "packuswb %%mm3, %%mm2 \n\t" - "movq %%mm0, %%mm1 \n\t" - "movq %%mm2, %%mm3 \n\t" - "psrlw $8, %%mm0 \n\t" - "psrlw $8, %%mm2 \n\t" - "pand %%mm7, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "packuswb %%mm2, %%mm0 \n\t" - "packuswb %%mm3, %%mm1 \n\t" - MOVNTQ" %%mm0,- 7(%4, %0) \n\t" - MOVNTQ" %%mm1,- 7(%3, %0) \n\t" - "add $8, %0 \n\t" - " js 1b \n\t" - : "+r"(count) - : "r"(src0), "r"(src1), "r"(dst0), "r"(dst1) - ); - count -= 7; - } -#endif - src0++; - src1++; - while(count<0) { - dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1; - dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1; - count++; - } -} - -static void RENAME(yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, - int width, int height, - int lumStride, int chromStride, int srcStride) -{ - int y; - const int chromWidth = AV_CEIL_RSHIFT(width, 1); - - for (y=0; ydstBpc <= 14) { \ + if (c->srcRange) { \ + c->lumConvertRange = ff_lumRangeFromJpeg_ ##opt; \ + c->chrConvertRange = ff_chrRangeFromJpeg_ ##opt; \ + } else { \ + c->lumConvertRange = ff_lumRangeToJpeg_ ##opt; \ + c->chrConvertRange = ff_chrRangeToJpeg_ ##opt; \ + } \ + } \ +} while (0) + +#define RANGE_CONVERT_FUNCS_DECL(opt) \ +void ff_lumRangeFromJpeg_ ##opt(int16_t *dst, int width); \ +void ff_chrRangeFromJpeg_ ##opt(int16_t *dstU, int16_t *dstV, int width); \ +void ff_lumRangeToJpeg_ ##opt(int16_t *dst, int width); \ +void ff_chrRangeToJpeg_ ##opt(int16_t *dstU, int16_t *dstV, int width); \ + +RANGE_CONVERT_FUNCS_DECL(sse2); +RANGE_CONVERT_FUNCS_DECL(avx2); + +av_cold void ff_sws_init_range_convert_x86(SwsContext *c) +{ + if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) { + int cpu_flags = av_get_cpu_flags(); + if (EXTERNAL_AVX2_FAST(cpu_flags)) { + RANGE_CONVERT_FUNCS(avx2); + } else if (EXTERNAL_SSE2(cpu_flags)) { + RANGE_CONVERT_FUNCS(sse2); + } + } +} + av_cold void ff_sws_init_swscale_x86(SwsContext *c) { int cpu_flags = av_get_cpu_flags(); @@ -820,4 +853,6 @@ switch(c->dstBpc){ \ } #endif + + ff_sws_init_range_convert_x86(c); } From acaaa895ab2c8f34463cb84b6b92d0d0471cd85c Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 23 Jun 2024 16:42:56 +0300 Subject: [PATCH 021/102] =?UTF-8?q?FFmpeg:=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B8=D0=B9=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ffmpeg/libswscale/x86/range_convert.asm | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 src/ExtLib/ffmpeg/libswscale/x86/range_convert.asm diff --git a/src/ExtLib/ffmpeg/libswscale/x86/range_convert.asm b/src/ExtLib/ffmpeg/libswscale/x86/range_convert.asm new file mode 100644 index 0000000000..97c7525448 --- /dev/null +++ b/src/ExtLib/ffmpeg/libswscale/x86/range_convert.asm @@ -0,0 +1,136 @@ +;****************************************************************************** +;* Copyright (c) 2024 Ramiro Polla +;* +;* This file is part of FFmpeg. +;* +;* FFmpeg is free software; you can redistribute it and/or +;* modify it under the terms of the GNU Lesser General Public +;* License as published by the Free Software Foundation; either +;* version 2.1 of the License, or (at your option) any later version. +;* +;* FFmpeg is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;* Lesser General Public License for more details. +;* +;* You should have received a copy of the GNU Lesser General Public +;* License along with FFmpeg; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "libavutil/x86/x86util.asm" + +SECTION_RODATA + +chr_to_mult: times 4 dw 4663, 0 +chr_to_offset: times 4 dd -9289992 +%define chr_to_shift 12 + +chr_from_mult: times 4 dw 1799, 0 +chr_from_offset: times 4 dd 4081085 +%define chr_from_shift 11 + +lum_to_mult: times 4 dw 19077, 0 +lum_to_offset: times 4 dd -39057361 +%define lum_to_shift 14 + +lum_from_mult: times 4 dw 14071, 0 +lum_from_offset: times 4 dd 33561947 +%define lum_from_shift 14 + +SECTION .text + +; NOTE: there is no need to clamp the input when converting to jpeg range +; (like we do in the C code) because packssdw will saturate the output. + +;----------------------------------------------------------------------------- +; lumConvertRange +; +; void ff_lumRangeToJpeg_(int16_t *dst, int width); +; void ff_lumRangeFromJpeg_(int16_t *dst, int width); +; +;----------------------------------------------------------------------------- + +%macro LUMCONVERTRANGE 4 +cglobal %1, 2, 2, 5, dst, width + shl widthd, 1 + VBROADCASTI128 m2, [%2] + VBROADCASTI128 m3, [%3] + pxor m4, m4 + add dstq, widthq + neg widthq +.loop: + movu m0, [dstq+widthq] + punpckhwd m1, m0, m4 + punpcklwd m0, m4 + pmaddwd m0, m2 + pmaddwd m1, m2 + paddd m0, m3 + paddd m1, m3 + psrad m0, %4 + psrad m1, %4 + packssdw m0, m1 + movu [dstq+widthq], m0 + add widthq, mmsize + jl .loop + RET +%endmacro + +;----------------------------------------------------------------------------- +; chrConvertRange +; +; void ff_chrRangeToJpeg_(int16_t *dstU, int16_t *dstV, int width); +; void ff_chrRangeFromJpeg_(int16_t *dstU, int16_t *dstV, int width); +; +;----------------------------------------------------------------------------- + +%macro CHRCONVERTRANGE 4 +cglobal %1, 3, 3, 7, dstU, dstV, width + shl widthd, 1 + VBROADCASTI128 m4, [%2] + VBROADCASTI128 m5, [%3] + pxor m6, m6 + add dstUq, widthq + add dstVq, widthq + neg widthq +.loop: + movu m0, [dstUq+widthq] + movu m2, [dstVq+widthq] + punpckhwd m1, m0, m6 + punpckhwd m3, m2, m6 + punpcklwd m0, m6 + punpcklwd m2, m6 + pmaddwd m0, m4 + pmaddwd m1, m4 + pmaddwd m2, m4 + pmaddwd m3, m4 + paddd m0, m5 + paddd m1, m5 + paddd m2, m5 + paddd m3, m5 + psrad m0, %4 + psrad m1, %4 + psrad m2, %4 + psrad m3, %4 + packssdw m0, m1 + packssdw m2, m3 + movu [dstUq+widthq], m0 + movu [dstVq+widthq], m2 + add widthq, mmsize + jl .loop + RET +%endmacro + +INIT_XMM sse2 +LUMCONVERTRANGE lumRangeToJpeg, lum_to_mult, lum_to_offset, lum_to_shift +CHRCONVERTRANGE chrRangeToJpeg, chr_to_mult, chr_to_offset, chr_to_shift +LUMCONVERTRANGE lumRangeFromJpeg, lum_from_mult, lum_from_offset, lum_from_shift +CHRCONVERTRANGE chrRangeFromJpeg, chr_from_mult, chr_from_offset, chr_from_shift + +%if HAVE_AVX2_EXTERNAL +INIT_YMM avx2 +LUMCONVERTRANGE lumRangeToJpeg, lum_to_mult, lum_to_offset, lum_to_shift +CHRCONVERTRANGE chrRangeToJpeg, chr_to_mult, chr_to_offset, chr_to_shift +LUMCONVERTRANGE lumRangeFromJpeg, lum_from_mult, lum_from_offset, lum_from_shift +CHRCONVERTRANGE chrRangeFromJpeg, chr_from_mult, chr_from_offset, chr_from_shift +%endif From 66825e404354bc46ffb2473a5f0af74ee00e3fd3 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 24 Jun 2024 09:28:13 +1000 Subject: [PATCH 022/102] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0=20ffmpeg.bat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/ffmpeg.bat | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ExtLib/ffmpeg/ffmpeg.bat b/src/ExtLib/ffmpeg/ffmpeg.bat index a43857007a..fcfb0bd6a4 100644 --- a/src/ExtLib/ffmpeg/ffmpeg.bat +++ b/src/ExtLib/ffmpeg/ffmpeg.bat @@ -1,5 +1,5 @@ @ECHO OFF -REM (C) 2009-2017 see Authors.txt +REM (C) 2009-2024 see Authors.txt REM REM This file is part of MPC-BE. REM @@ -16,6 +16,8 @@ REM REM You should have received a copy of the GNU General Public License REM along with this program. If not, see . +SETLOCAL ENABLEDELAYEDEXPANSION + IF /I "%~1"=="help" GOTO SHOWHELP IF /I "%~1"=="/help" GOTO SHOWHELP IF /I "%~1"=="-help" GOTO SHOWHELP @@ -26,7 +28,7 @@ IF EXIST "%~dp0..\..\..\environments.bat" CALL "%~dp0..\..\..\environments.bat" IF DEFINED MPCBE_MINGW IF DEFINED MPCBE_MSYS GOTO VarOk ECHO ERROR: Please define MPCBE_MINGW and MPCBE_MSYS environment variable(s) -EXIT /B +EXIT /B 1 :VarOk SET PATH=%MPCBE_MSYS%\bin;%MPCBE_MINGW%\bin;%PATH% @@ -49,10 +51,10 @@ IF /I "%BUILDTYPE%" == "rebuild" ( CALL :SubMake clean SET "BUILDTYPE=build" CALL :SubMake - EXIT /B + EXIT /B !ERRORLEVEL! ) ELSE ( CALL :SubMake - EXIT /B + EXIT /B !ERRORLEVEL! ) :SubMake @@ -70,7 +72,7 @@ IF "%BUILDTYPE%" == "clean" ( make.exe -f ffmpeg.mak %BUILDTYPE% -j%JOBS% %BIT% %DEBUG% ENDLOCAL -EXIT /B +EXIT /B %ERRORLEVEL% :SHOWHELP TITLE "%~nx0 %1" From 6bb6b8062bec28c197a03713a5f2a3e2ab59771e Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 24 Jun 2024 11:06:37 +1000 Subject: [PATCH 023/102] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0=20build.bat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.bat | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/build.bat b/build.bat index e1d6345506..9b2f26519a 100644 --- a/build.bat +++ b/build.bat @@ -37,6 +37,7 @@ SET ARGZI=0 SET ARGPDB=0 SET INPUT=0 SET ARGSIGN=0 +SET "Wait=True" IF /I "%ARG%" == "?" GOTO ShowHelp @@ -66,6 +67,7 @@ FOR %%A IN (%ARG%) DO ( IF /I "%%A" == "Zip" SET "ZIP=True" & SET /A ARGZI+=1 & SET /A ARGCL+=1 & SET /A ARGM+=1 IF /I "%%A" == "PDB" SET "PDB=True" & SET /A ARGPDB+=1 IF /I "%%A" == "Sign" SET "SIGN=True" & SET /A ARGSIGN+=1 + IF /I "%%A" == "NoWait" SET "Wait=False" ) REM pre-build checks @@ -77,7 +79,9 @@ IF EXIST "environments.bat" CALL "environments.bat" IF NOT DEFINED MPCBE_MINGW GOTO MissingVar IF NOT DEFINED MPCBE_MSYS GOTO MissingVar -FOR %%X IN (%*) DO SET /A INPUT+=1 +FOR %%X IN (%*) DO ( + IF /I "%%X" NEQ "NoWait" SET /A INPUT+=1 +) SET /A VALID=%ARGB%+%ARGPL%+%ARGC%+%ARGBC%+%ARGPA%+%ARGIN%+%ARGZI%+%ARGSIGN%+%ARGCOMP%+%ARGPDB% IF %VALID% NEQ %INPUT% GOTO UnsupportedSwitch @@ -145,6 +149,7 @@ CD /D %~dp0 IF /I "%CONFIG%" == "Filters" ( CALL :SubFilters Win32 + IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%ZIP%" == "True" CALL :SubCreatePackages Filters Win32 GOTO x64 ) @@ -152,16 +157,21 @@ IF /I "%CONFIG%" == "Filters" ( IF /I "%CONFIG%" == "Resources" CALL :SubResources Win32 && GOTO x64 CALL :SubMPCBE Win32 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%CONFIG%" == "Main" GOTO x64 CALL :SubResources Win32 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%INSTALLER%" == "True" CALL :SubCreateInstaller Win32 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%ZIP%" == "True" CALL :SubCreatePackages MPC-BE Win32 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%CONFIG%" == "All" ( CALL :SubFilters Win32 + IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%ZIP%" == "True" CALL :SubCreatePackages Filters Win32 ) @@ -174,6 +184,7 @@ CD /D %~dp0 IF /I "%CONFIG%" == "Filters" ( CALL :SubFilters x64 + IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%ZIP%" == "True" CALL :SubCreatePackages Filters x64 GOTO END ) @@ -181,16 +192,21 @@ IF /I "%CONFIG%" == "Filters" ( IF /I "%CONFIG%" == "Resources" CALL :SubResources x64 && GOTO END CALL :SubMPCBE x64 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%CONFIG%" == "Main" GOTO End CALL :SubResources x64 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%INSTALLER%" == "True" CALL :SubCreateInstaller x64 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%ZIP%" == "True" CALL :SubCreatePackages MPC-BE x64 +IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%CONFIG%" == "All" ( CALL :SubFilters x64 + IF !ERRORLEVEL! NEQ 0 EXIT /B !ERRORLEVEL! IF /I "%ZIP%" == "True" CALL :SubCreatePackages Filters x64 ) @@ -210,6 +226,7 @@ MSBuild.exe mpc-be.sln %MSBUILD_SWITCHES%^ /flp2:LogFile=%LOG_DIR%\filters_warnings_%BUILDCFG%_%1.log;warningsonly;Verbosity=diagnostic IF %ERRORLEVEL% NEQ 0 ( CALL :SubMsg "ERROR" "mpc-be.sln %BUILDCFG% Filter %1 - Compilation failed!" + EXIT /B %ERRORLEVEL% ) ELSE ( CALL :SubMsg "INFO" "mpc-be.sln %BUILDCFG% Filter %1 compiled successfully" ) @@ -234,6 +251,7 @@ MSBuild.exe mpc-be.sln %MSBUILD_SWITCHES%^ /flp2:LogFile=%LOG_DIR%\mpc-be_warnings_%BUILDCFG%_%1.log;warningsonly;Verbosity=diagnostic IF %ERRORLEVEL% NEQ 0 ( CALL :SubMsg "ERROR" "mpc-be.sln %BUILDCFG% %1 - Compilation failed!" + EXIT /B %ERRORLEVEL% ) ELSE ( CALL :SubMsg "INFO" "mpc-be.sln %BUILDCFG% %1 compiled successfully" ) @@ -245,6 +263,7 @@ MSBuild.exe mpciconlib.sln %MSBUILD_SWITCHES%^ /flp2:LogFile=%LOG_DIR%\mpciconlib_warnings_%BUILDCFG%_%1.log;warningsonly;Verbosity=diagnostic IF %ERRORLEVEL% NEQ 0 ( CALL :SubMsg "ERROR" "mpciconlib.sln %BUILDCFG% %1 - Compilation failed!" + EXIT /B %ERRORLEVEL% ) ELSE ( CALL :SubMsg "INFO" "mpciconlib.sln %BUILDCFG% %1 compiled successfully" ) @@ -265,6 +284,7 @@ MSBuild.exe MPCBEShellExt.sln %MSBUILD_SWITCHES%^ /target:%BUILDTYPE% /property:Configuration=%BUILDCFG%;Platform=Win32 IF %ERRORLEVEL% NEQ 0 ( CALL :SubMsg "ERROR" "MPCBEShellExt.sln %BUILDCFG% Win32 - Compilation failed!" + EXIT /B %ERRORLEVEL% ) ELSE ( CALL :SubMsg "INFO" "MPCBEShellExt.sln %BUILDCFG% Win32 compiled successfully" ) @@ -278,6 +298,7 @@ MSBuild.exe MPCBEShellExt.sln %MSBUILD_SWITCHES%^ /target:%BUILDTYPE% /property:Configuration=%BUILDCFG%;Platform=x64 IF %ERRORLEVEL% NEQ 0 ( CALL :SubMsg "ERROR" "MPCBEShellExt.sln %BUILDCFG% x64 - Compilation failed!" + EXIT /B %ERRORLEVEL% ) ELSE ( CALL :SubMsg "INFO" "MPCBEShellExt.sln %BUILDCFG% x64 compiled successfully" ) @@ -303,7 +324,10 @@ FOR %%A IN ("Armenian" "Basque" "Belarusian" "Catalan" "Chinese Simplified" TITLE Compiling mpcresources - %%~A^|%1... MSBuild.exe mpcresources.sln %MSBUILD_SWITCHES%^ /target:%BUILDTYPE% /property:Configuration="Release %%~A";Platform=%1 - IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Compilation failed!" + IF %ERRORLEVEL% NEQ 0 ( + CALL :SubMsg "ERROR" "Compilation failed!" + EXIT /B %ERRORLEVEL% + ) ) IF /I "%1" == "Win32" ( @@ -355,7 +379,10 @@ IF NOT DEFINED InnoSetupPath ( TITLE Compiling %1 installer... "%InnoSetupPath%\iscc.exe" /Q /O"%BIN%" "distrib\mpc-be_setup.iss" %ISDefs% %ISDefsSign% -IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Compilation failed!" +IF %ERRORLEVEL% NEQ 0 ( + CALL :SubMsg "ERROR" "Compilation failed!" + EXIT /B %ERRORLEVEL% +) CALL :SubMsg "INFO" "%1 installer successfully built" CALL :SubGetVersion @@ -444,7 +471,10 @@ IF /I "%NAME%" == "MPC-BE" ( TITLE Creating archive %ZIP_NAME%.7z... START "7z" /B /WAIT "%SEVENZIP%" a -t7z "%PackagesOut%\%MPCBE_VER%\%ZIP_NAME%.7z" "%PCKG_NAME%"^ -m0=lzma -mx9 -mmt -ms=on -IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Unable to create %ZIP_NAME%.7z!" +IF %ERRORLEVEL% NEQ 0 ( + CALL :SubMsg "ERROR" "Unable to create %ZIP_NAME%.7z!" + EXIT /B %ERRORLEVEL% +) CALL :SubMsg "INFO" "%ZIP_NAME%.7z successfully created" IF EXIST "%PCKG_NAME%" RD /Q /S "%PCKG_NAME%" @@ -587,6 +617,7 @@ ECHO "build.bat %*" ECHO. ECHO Run "%~nx0 help" for details about the commandline switches. CALL :SubMsg "ERROR" "Compilation failed!" +EXIT /B 1 :SubInnoSetupPath SET InnoSetupPath=%* @@ -607,10 +638,12 @@ IF /I "%~1" == "ERROR" ( ) ECHO ------------------------------ & ECHO. IF /I "%~1" == "ERROR" ( - ECHO Press any key to close this window... - PAUSE >NUL + IF /I "%Wait%" == "True" ( + ECHO Press any key to close this window... + PAUSE >NUL + ) ENDLOCAL - EXIT + EXIT /B 1 ) ELSE ( EXIT /B ) From ab351179fa1a92802d4b12d0578c8f227f7c7cd8 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 24 Jun 2024 11:56:30 +1000 Subject: [PATCH 024/102] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0=20.github/workflows/main.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f69fadabb9..c9650dc144 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,12 +42,12 @@ jobs: - name: Clean run: | - .\\build.bat Clean All + .\\build.bat Clean All NoWait shell: pwsh - name: Build MPC-BE run: | - .\\build.bat Build Packages + .\\build.bat Build Packages NoWait shell: pwsh - name: Upload Installer x64 From dbc1c57cdf07a9856e61eeccca3005c12d5724a3 Mon Sep 17 00:00:00 2001 From: v0lt Date: Mon, 24 Jun 2024 17:25:48 +0300 Subject: [PATCH 025/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20Changelog.Rus.txt=20=D0=B8=20Changelog.txt?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 4 ++++ docs/Changelog.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index d1d32e07ef..c168b72b61 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -2,6 +2,10 @@ 1.7.2.x dev ============================= +Плеер +Улучшена поддержка перемещения окна свойств файла между дисплеями с разным масштабированием текста. +Исправлено запоминания позиции некоторых DVD-Video. + Обновлен румынский перевод (автор Andrei Miloiu). Обновлен корейский перевод (автор Hackjjang). Обновлен японский перевод (автор tsubasanouta). diff --git a/docs/Changelog.txt b/docs/Changelog.txt index f8d4bf1718..b3e93030e7 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -2,6 +2,10 @@ 1.7.2.x dev ============================= +Player +Improved support for moving the file properties window between displays with different text scaling. +Fixed remembering the position of some DVD-Videos. + Updated Romanian translation (by Andrei Miloiu). Updated Korean translation (by Hackjjang). Updated Japanese translation (by tsubasanouta). From 51b4493c6838b3ef77d2973034f3efb516bccc51 Mon Sep 17 00:00:00 2001 From: v0lt Date: Tue, 25 Jun 2024 17:02:21 +0300 Subject: [PATCH 026/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20VVdeC=20v2.3.0-24-gad8f4bb.=20=D0=A3=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=BE=20=D0=BF=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D1=86?= =?UTF-8?q?=D0=B5=D1=81=D1=81=D0=BE=D1=80=D0=B0=D1=85=20=D0=B1=D0=B5=D0=B7?= =?UTF-8?q?=20SSE4.1.=20MPCVideoDec:=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=B8?= =?UTF-8?q?=D0=B4=D0=B5=D0=BE=20VVC=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D1=83=D0=B5=D0=BC=20"libvvdec"=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B2=D1=81=D0=B5=D1=85=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B2=20CPU?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- src/ExtLib/vvdec.vcxproj | 2 -- src/ExtLib/vvdec.vcxproj.filters | 18 ++++++------------ src/ExtLib/vvdec/vvdec | 2 +- .../transform/MPCVideoDec/MPCVideoDec.cpp | 7 +------ 6 files changed, 10 insertions(+), 23 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index c168b72b61..fe5e7159f6 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -12,7 +12,7 @@ Обновлены библиотеки: ffmpeg git-n7.1-dev-1509-g0c0e7ec81e; - vvdec git-v2.3.0-20-gc26979f. + vvdec git-v2.3.0-24-gad8f4bb. 1.7.2 - 2024-06-07 diff --git a/docs/Changelog.txt b/docs/Changelog.txt index b3e93030e7..03a36d8fef 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -12,7 +12,7 @@ Updated Japanese translation (by tsubasanouta). Updated libraries: ffmpeg git-n7.1-dev-1509-g0c0e7ec81e; - vvdec git-v2.3.0-20-gc26979f. + vvdec git-v2.3.0-24-gad8f4bb. 1.7.2 - 2024-06-07 diff --git a/src/ExtLib/vvdec.vcxproj b/src/ExtLib/vvdec.vcxproj index 2562468db3..f1a989c345 100644 --- a/src/ExtLib/vvdec.vcxproj +++ b/src/ExtLib/vvdec.vcxproj @@ -202,7 +202,6 @@ - @@ -283,7 +282,6 @@ - {A5B58721-0F63-4410-9598-880EBDA78C53} diff --git a/src/ExtLib/vvdec.vcxproj.filters b/src/ExtLib/vvdec.vcxproj.filters index 832a80be7a..2aea1ad304 100644 --- a/src/ExtLib/vvdec.vcxproj.filters +++ b/src/ExtLib/vvdec.vcxproj.filters @@ -135,12 +135,6 @@ Source Files - - Header Files - - - Header Files - Source Files\simd @@ -219,9 +213,6 @@ Source Files - - Source Files - Source Files @@ -297,6 +288,12 @@ Source Files\simd + + Source Files + + + Source Files + @@ -518,9 +515,6 @@ Header Files - - Header Files - Header Files diff --git a/src/ExtLib/vvdec/vvdec b/src/ExtLib/vvdec/vvdec index c26979fac0..ad8f4bb7d6 160000 --- a/src/ExtLib/vvdec/vvdec +++ b/src/ExtLib/vvdec/vvdec @@ -1 +1 @@ -Subproject commit c26979fac06cf0405da7c901b7826ed517444f95 +Subproject commit ad8f4bb7d6271b5fe6b3ab0a5e64114dec1af5d4 diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp index f58a0c822b..245ab90bd0 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp @@ -2108,12 +2108,7 @@ HRESULT CMPCVideoDecFilter::InitDecoder(const CMediaType* pmt) if (m_CodecId == AV_CODEC_ID_AV1 && (m_bUseDXVA || m_bUseD3D11 || m_bUseD3D11cb || m_bUseD3D12cb || m_bUseNVDEC)) { m_pAVCodec = avcodec_find_decoder_by_name("av1"); } else if (m_CodecId == AV_CODEC_ID_VVC) { - if (CPUInfo::HaveSSE4()) { - // VVdeC crashes on older CPUs. need more info... - m_pAVCodec = avcodec_find_decoder_by_name("libvvdec"); - } else { - m_pAVCodec = avcodec_find_decoder_by_name("vvc"); - } + m_pAVCodec = avcodec_find_decoder_by_name("libvvdec"); } else { m_pAVCodec = avcodec_find_decoder(m_CodecId); } From 70640d8bbb97f21852290526ecb7a9a7669b3324 Mon Sep 17 00:00:00 2001 From: v0lt Date: Tue, 25 Jun 2024 21:25:27 +0300 Subject: [PATCH 027/102] =?UTF-8?q?FFmpeg:=20=D0=BE=D1=82=D0=BA=D0=BB?= =?UTF-8?q?=D1=8E=D1=87=D0=B0=D0=B5=D0=BC=20ff=5Fvvc=5Fdecoder=20=D0=B8=20?= =?UTF-8?q?ff=5Fvvc=5Fparser,=20=D1=82.=D0=BA.=20=D0=BD=D0=B5=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D1=8E=D1=82=D1=81?= =?UTF-8?q?=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/config_components.h | 4 ++-- src/ExtLib/ffmpeg/libavcodec/codec_list.c | 1 - src/ExtLib/ffmpeg/libavcodec/parser_list.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ExtLib/ffmpeg/config_components.h b/src/ExtLib/ffmpeg/config_components.h index 2d3c7b2e66..8ece991952 100644 --- a/src/ExtLib/ffmpeg/config_components.h +++ b/src/ExtLib/ffmpeg/config_components.h @@ -310,7 +310,7 @@ #define CONFIG_VP9_V4L2M2M_DECODER 0 #define CONFIG_VQA_DECODER 0 #define CONFIG_VQC_DECODER 0 -#define CONFIG_VVC_DECODER 1 +#define CONFIG_VVC_DECODER 0 #define CONFIG_WBMP_DECODER 0 #define CONFIG_WEBP_DECODER 0 #define CONFIG_WCMV_DECODER 0 @@ -1008,7 +1008,7 @@ #define CONFIG_VP3_PARSER 1 #define CONFIG_VP8_PARSER 0 #define CONFIG_VP9_PARSER 0 -#define CONFIG_VVC_PARSER 1 +#define CONFIG_VVC_PARSER 0 #define CONFIG_WEBP_PARSER 0 #define CONFIG_XBM_PARSER 0 #define CONFIG_XMA_PARSER 0 diff --git a/src/ExtLib/ffmpeg/libavcodec/codec_list.c b/src/ExtLib/ffmpeg/libavcodec/codec_list.c index 94fad01ba3..25036a07be 100644 --- a/src/ExtLib/ffmpeg/libavcodec/codec_list.c +++ b/src/ExtLib/ffmpeg/libavcodec/codec_list.c @@ -80,7 +80,6 @@ static const FFCodec * const codec_list[] = { &ff_vp7_decoder, &ff_vp8_decoder, &ff_vp9_decoder, - &ff_vvc_decoder, &ff_wmv1_decoder, &ff_wmv2_decoder, &ff_wmv3_decoder, diff --git a/src/ExtLib/ffmpeg/libavcodec/parser_list.c b/src/ExtLib/ffmpeg/libavcodec/parser_list.c index a9ea54cc0a..b0dabf6c04 100644 --- a/src/ExtLib/ffmpeg/libavcodec/parser_list.c +++ b/src/ExtLib/ffmpeg/libavcodec/parser_list.c @@ -19,6 +19,5 @@ static const AVCodecParser * const parser_list[] = { &ff_vp3_parser, &ff_vp8_parser, &ff_vp9_parser, - &ff_vvc_parser, NULL }; From 250cc958317acb386a63e7f0d36bc9ddd8fa37e0 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Wed, 26 Jun 2024 17:30:13 +1000 Subject: [PATCH 028/102] =?UTF-8?q?MPCVideoDec.cpp=20-=20=D1=82.=D0=BA.=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B8=D0=BB=D0=B8=20=D0=B2?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BD=D0=BD=D1=8B=D0=B9=20vvc=20?= =?UTF-8?q?=D0=B4=D0=B5=D0=BA=D0=BE=D0=B4=D0=B5=D1=80=20=D0=B2=20ffmpeg=20?= =?UTF-8?q?=D1=82=D0=BE=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BD=D1=83=D0=B6=D0=BD=D0=BE=20=D1=83=D0=BA=D0=B0=D0=B7=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BA=D0=BE=D0=BD=D0=BA=D1=80=D0=B5?= =?UTF-8?q?=D1=82=D0=BD=D0=BE=20=D0=B8=D0=BC=D1=8F=20=D0=B4=D0=B5=D0=BA?= =?UTF-8?q?=D0=BE=D0=B4=D0=B5=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20VVC=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=B4=D0=B5=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/transform/MPCVideoDec/MPCVideoDec.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp index 245ab90bd0..dad0855796 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp @@ -2107,8 +2107,6 @@ HRESULT CMPCVideoDecFilter::InitDecoder(const CMediaType* pmt) if (m_CodecId == AV_CODEC_ID_AV1 && (m_bUseDXVA || m_bUseD3D11 || m_bUseD3D11cb || m_bUseD3D12cb || m_bUseNVDEC)) { m_pAVCodec = avcodec_find_decoder_by_name("av1"); - } else if (m_CodecId == AV_CODEC_ID_VVC) { - m_pAVCodec = avcodec_find_decoder_by_name("libvvdec"); } else { m_pAVCodec = avcodec_find_decoder(m_CodecId); } From 641eddc02a62878e6c0ae4a720224356f3a8d3d3 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Fri, 28 Jun 2024 16:11:36 +1000 Subject: [PATCH 029/102] =?UTF-8?q?=D0=9D=D0=B0=20=D0=B1=D1=83=D0=B4=D1=83?= =?UTF-8?q?=D1=89=D0=B5=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/H264Nalu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DSUtil/H264Nalu.h b/src/DSUtil/H264Nalu.h index 97b23defb3..4aa0ec9c01 100644 --- a/src/DSUtil/H264Nalu.h +++ b/src/DSUtil/H264Nalu.h @@ -48,7 +48,9 @@ enum NALU_TYPE { NALU_TYPE_HEVC_SPS = 33, NALU_TYPE_HEVC_PPS = 34, NALU_TYPE_HEVC_AUD = 35, + NALU_TYPE_HEVC_EOSEQ = 36, NALU_TYPE_HEVC_SEI_PREFIX = 39, + NALU_TYPE_HEVC_UNSPEC62 = 62, // VVC NALU_TYPE_VVC_TRAIL = 0, NALU_TYPE_VVC_STSA = 1, From d34637d98012ac07ce5f4323fdccf91dcdd4d9ff Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Fri, 28 Jun 2024 17:24:22 +1000 Subject: [PATCH 030/102] =?UTF-8?q?MpegSplitter=20-=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=81=D0=BF=D0=B5=D1=86?= =?UTF-8?q?=D0=B8=D0=B0=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20=D0=B4=D0=BE=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9,?= =?UTF-8?q?=20=D0=B2=D1=82=D0=BE=D1=80=D0=BE=D0=B9,=20=D0=B2=D0=B8=D0=B4?= =?UTF-8?q?=D0=B5=D0=BE-=D0=B4=D0=BE=D1=80=D0=BE=D0=B6=D0=BA=D0=B8=20HEVC?= =?UTF-8?q?=20Dolby=20Vision.=20=D0=92=20=D1=80=D0=B5=D0=B7=D1=83=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D0=B0=D1=82=D0=B5=20=D0=BD=D0=B0=20=D0=B2=D1=8B?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=D0=B5=20=D0=B1=D1=83=D0=B4=D0=B5=D1=82=201?= =?UTF-8?q?=20=D0=B2=D0=B8=D0=B4=D0=B5=D0=BE-=D0=B4=D0=BE=D1=80=D0=BE?= =?UTF-8?q?=D0=B6=D0=BA=D0=B0=20=D0=BD=D0=BE=20=D1=83=D0=B6=D0=B5=20=D1=81?= =?UTF-8?q?=20Dolby=20Vision=20RPU=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=BC?= =?UTF-8?q?=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parser/MpegSplitter/MpegSplitter.cpp | 40 +++++++++++++++++-- .../parser/MpegSplitter/MpegSplitter.h | 5 +++ .../parser/MpegSplitter/MpegSplitterFile.cpp | 23 ++++++++++- .../parser/MpegSplitter/MpegSplitterFile.h | 1 + 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 54a316bc75..8d5cc1ef9f 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -741,6 +741,29 @@ HRESULT CMpegSplitterFilter::DeliverPacket(std::unique_ptr p) return __super::DeliverPacket(std::move(p)); } + return S_OK; + } else if (m_bHandleDVStream) { + if (TrackNumber == m_dwMasterDVTrackNumber) { + m_MasterDVStreamPacket = std::move(p); + } else if (TrackNumber == m_dwSecondaryDVTrackNumber && m_MasterDVStreamPacket) { + if (p->rtStart == m_MasterDVStreamPacket->rtStart) { + CH265Nalu Nalu; + Nalu.SetBuffer(p->data(), p->size()); + while (Nalu.ReadNext()) { + auto nalu_type = Nalu.GetType(); + if (nalu_type == NALU_TYPE_HEVC_UNSPEC62) { + // Dolby Vision RPU + // TODO - check for NALU_TYPE_HEVC_EOSEQ + m_MasterDVStreamPacket->AppendData(Nalu.GetNALBuffer(), Nalu.GetLength()); + } + } + + return __super::DeliverPacket(std::move(m_MasterDVStreamPacket)); + } + } else { + return __super::DeliverPacket(std::move(p)); + } + return S_OK; } @@ -860,7 +883,7 @@ HRESULT CMpegSplitterFilter::DemuxNextPacket(const REFERENCE_TIME rtStartOffset) if (h.payload && ISVALIDPID(h.pid)) { const DWORD TrackNumber = h.pid; - if (GetOutputPin(TrackNumber) || TrackNumber == m_dwMVCExtensionTrackNumber) { + if (GetOutputPin(TrackNumber) || TrackNumber == m_dwMVCExtensionTrackNumber || TrackNumber == m_dwSecondaryDVTrackNumber) { const __int64 pos = m_pFile->GetPos(); CMpegSplitterFile::peshdr peshdr; if (h.payloadstart @@ -1034,14 +1057,16 @@ void CMpegSplitterFilter::HandleStream(CMpegSplitterFile::stream& s, CString fNa if (SUCCEEDED(CreateAVCfromH264(&mt))) { s.mts.push_back(mt); } - } - - if (mt.subtype == MEDIASUBTYPE_AMVC) { + } else if (mt.subtype == MEDIASUBTYPE_AMVC) { s.mts.push_back(mt); s.mt.subtype = MEDIASUBTYPE_H264; if (SUCCEEDED(CreateAVCfromH264(&mt))) { s.mts.push_back(mt); } + } else if (s.codec == CMpegSplitterFile::stream_codec::HEVC_DV_SECONDARY) { + m_bHandleDVStream = TRUE; + m_dwMasterDVTrackNumber = m_pFile->m_streams[CMpegSplitterFile::stream_type::video].front(); + m_dwSecondaryDVTrackNumber = s; } s.mts.push_back(s.mt); @@ -1257,6 +1282,13 @@ HRESULT CMpegSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) } } + auto& streams = m_pFile->m_streams[CMpegSplitterFile::stream_type::video]; + if (streams.size() == 2 && streams.back().codec == CMpegSplitterFile::stream_codec::HEVC_DV_SECONDARY) { + // Remove Dolby Vision stream from streams list + auto it = streams.begin(); ++it; + streams.erase(it); + } + for (int type = CMpegSplitterFile::stream_type::video; type <= CMpegSplitterFile::stream_type::subpic; type++) { int stream_idx = 0; diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.h b/src/filters/parser/MpegSplitter/MpegSplitter.h index 8d1533fa41..d0d46b3908 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.h +++ b/src/filters/parser/MpegSplitter/MpegSplitter.h @@ -75,6 +75,11 @@ class __declspec(uuid("DC257063-045F-4BE2-BD5B-E12279C464F0")) DWORD m_dwMasterH264TrackNumber = DWORD_MAX; DWORD m_dwMVCExtensionTrackNumber = DWORD_MAX; + BOOL m_bHandleDVStream = FALSE; + DWORD m_dwMasterDVTrackNumber = DWORD_MAX; + DWORD m_dwSecondaryDVTrackNumber = DWORD_MAX; + std::unique_ptr m_MasterDVStreamPacket; + std::vector m_sps; HRESULT CreateOutputs(IAsyncReader* pAsyncReader); diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp index a0d147a26a..f6f561692c 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp @@ -924,7 +924,9 @@ DWORD CMpegSplitterFile::AddStream(const WORD pid, BYTE pesid, const BYTE ext_id return s; } - if (m_ClipInfo.IsHdmv() && !m_ClipInfo.FindStream(s.pid)) { + constexpr WORD DV_SECONDARY_STREAM_PID_START = 4117; + + if (m_ClipInfo.IsHdmv() && s.pid < DV_SECONDARY_STREAM_PID_START && !m_ClipInfo.FindStream(s.pid)) { return s; } @@ -1026,7 +1028,24 @@ DWORD CMpegSplitterFile::AddStream(const WORD pid, BYTE pesid, const BYTE ext_id Seek(start); auto& hevc = hevc_streams[s]; if (!m_streams[stream_type::video].Find(s) && Read(hevc.h, len, hevc.pData, &s.mt)) { - s.codec = stream_codec::HEVC; + bool bIsDVStream = false; + if (s.pid >= DV_SECONDARY_STREAM_PID_START && m_streams[stream_type::video].size() == 1 && m_streams[stream_type::video].front().codec == stream_codec::HEVC) { + CH265Nalu Nalu; + Nalu.SetBuffer(hevc.pData.data(), hevc.pData.size()); + while (Nalu.ReadNext()) { + auto nalu_type = Nalu.GetType(); + if (nalu_type == NALU_TYPE_HEVC_UNSPEC62) { + // Dolby Vision RPU + bIsDVStream = true; + break; + } + } + + if (!bIsDVStream && hevc.pData.size() < MEGABYTE) { + return s; + } + } + s.codec = bIsDVStream ? stream_codec::HEVC_DV_SECONDARY : stream_codec::HEVC; type = stream_type::video; } } diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.h b/src/filters/parser/MpegSplitter/MpegSplitterFile.h index 17aecb2a43..2124434773 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.h +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.h @@ -192,6 +192,7 @@ class CMpegSplitterFile : public CBaseSplitterFileEx H264, MVC, HEVC, + HEVC_DV_SECONDARY, MPEG, VC1, OPUS, From b04c671cbf663db3cd4860d26c787b6c7749740c Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Fri, 28 Jun 2024 17:27:11 +1000 Subject: [PATCH 031/102] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/parser/MpegSplitter/MpegSplitter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 8d5cc1ef9f..4216fb725b 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -755,6 +755,7 @@ HRESULT CMpegSplitterFilter::DeliverPacket(std::unique_ptr p) // Dolby Vision RPU // TODO - check for NALU_TYPE_HEVC_EOSEQ m_MasterDVStreamPacket->AppendData(Nalu.GetNALBuffer(), Nalu.GetLength()); + break; } } From 2e1b74c168e329f20990c6d5442ef03fbc9c1a15 Mon Sep 17 00:00:00 2001 From: v0lt Date: Fri, 28 Jun 2024 20:08:11 +0300 Subject: [PATCH 032/102] =?UTF-8?q?MPCVideoDec:=20=D0=BA=D0=BE=D1=81=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=B8=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transform/MPCVideoDec/FormatConverter.cpp | 74 ++++++++--------- .../transform/MPCVideoDec/FormatConverter.h | 28 +++---- .../transform/MPCVideoDec/MPCVideoDec.cpp | 42 ---------- .../transform/MPCVideoDec/MPCVideoDec.h | 79 +++++++++---------- 4 files changed, 83 insertions(+), 140 deletions(-) diff --git a/src/filters/transform/MPCVideoDec/FormatConverter.cpp b/src/filters/transform/MPCVideoDec/FormatConverter.cpp index d4af65a955..c074f9bdfc 100644 --- a/src/filters/transform/MPCVideoDec/FormatConverter.cpp +++ b/src/filters/transform/MPCVideoDec/FormatConverter.cpp @@ -178,30 +178,18 @@ MPCPixFmtType GetPixFmtType(AVPixelFormat av_pix_fmt) // CFormatConverter CFormatConverter::CFormatConverter() - : m_pSwsContext(nullptr) - , m_out_pixfmt(PixFmt_None) - , m_dstRGBRange(0) - , m_dstStride(0) - , m_planeHeight(0) - , m_OutHeight(0) - , m_nAlignedBufferSize(0) - , m_pAlignedBuffer(nullptr) - , m_nCPUFlag(0) - , m_RequiredAlignment(0) - , m_NumThreads(1) - , pConvertFn(nullptr) { ASSERT(PixFmt_count == std::size(s_sw_formats)); - m_FProps.avpixfmt = AV_PIX_FMT_NONE; - m_FProps.width = 0; - m_FProps.height = 0; - m_FProps.lumabits = 0; - m_FProps.pftype = PFType_unspecified; - m_FProps.colorspace = AVCOL_SPC_UNSPECIFIED; - m_FProps.colorrange = AVCOL_RANGE_UNSPECIFIED; + m_FProps.avpixfmt = AV_PIX_FMT_NONE; + m_FProps.width = 0; + m_FProps.height = 0; + m_FProps.lumabits = 0; + m_FProps.pftype = PFType_unspecified; + m_FProps.colorspace = AVCOL_SPC_UNSPECIFIED; + m_FProps.colorrange = AVCOL_RANGE_UNSPECIFIED; - m_NumThreads = std::clamp(CPUInfo::GetProcessorNumber() / 2, 1uL, 8uL); + m_NumThreads = std::clamp(CPUInfo::GetProcessorNumber() / 2, 1uL, 8uL); } CFormatConverter::~CFormatConverter() @@ -275,60 +263,60 @@ void CFormatConverter::UpdateSWSContext() void CFormatConverter::SetConvertFunc() { - pConvertFn = &CFormatConverter::ConvertGeneric; + m_pConvertFn = &CFormatConverter::ConvertGeneric; m_RequiredAlignment = 16; switch (m_out_pixfmt) { case PixFmt_AYUV: if (m_FProps.pftype == PFType_YUV444Px) { - pConvertFn = &CFormatConverter::convert_yuv444_ayuv_dither_le; + m_pConvertFn = &CFormatConverter::convert_yuv444_ayuv_dither_le; } break; case PixFmt_P010: case PixFmt_P016: if (m_FProps.pftype == PFType_YUV420Px) { - pConvertFn = &CFormatConverter::convert_yuv420_px1x_le; + m_pConvertFn = &CFormatConverter::convert_yuv420_px1x_le; } break; case PixFmt_Y410: if (m_FProps.pftype == PFType_YUV444Px && m_FProps.lumabits <= 10) { - pConvertFn = &CFormatConverter::convert_yuv444_y410; + m_pConvertFn = &CFormatConverter::convert_yuv444_y410; } break; case PixFmt_P210: case PixFmt_P216: if (m_FProps.pftype == PFType_YUV422Px) { - pConvertFn = &CFormatConverter::convert_yuv420_px1x_le; + m_pConvertFn = &CFormatConverter::convert_yuv420_px1x_le; } break; case PixFmt_YUY2: if (m_FProps.pftype == PFType_YUV422Px) { - pConvertFn = &CFormatConverter::convert_yuv422_yuy2_uyvy_dither_le; + m_pConvertFn = &CFormatConverter::convert_yuv422_yuy2_uyvy_dither_le; m_RequiredAlignment = 8; } else if (m_FProps.pftype == PFType_YUV420 || (m_FProps.pftype == PFType_YUV420Px && m_FProps.lumabits <= 14) || m_FProps.pftype == PFType_NV12) { - pConvertFn = &CFormatConverter::convert_yuv420_yuy2; + m_pConvertFn = &CFormatConverter::convert_yuv420_yuy2; m_RequiredAlignment = 8; } break; case PixFmt_NV12: if (m_FProps.pftype == PFType_NV12) { - pConvertFn = &CFormatConverter::plane_copy_sse2; + m_pConvertFn = &CFormatConverter::plane_copy_sse2; break; } else if (m_FProps.pftype == PFType_YUV420) { - pConvertFn = &CFormatConverter::convert_yuv420_nv12; + m_pConvertFn = &CFormatConverter::convert_yuv420_nv12; m_RequiredAlignment = 32; } case PixFmt_YV12: if (m_FProps.pftype == PFType_YUV420Px) { - pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; + m_pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; m_RequiredAlignment = 32; } else if (m_FProps.pftype == PFType_NV12) { - pConvertFn = &CFormatConverter::convert_nv12_yv12; + m_pConvertFn = &CFormatConverter::convert_nv12_yv12; m_RequiredAlignment = 32; } else if (m_FProps.pftype == PFType_P01x) { - pConvertFn = &CFormatConverter::convert_p010_nv12_sse2; + m_pConvertFn = &CFormatConverter::convert_p010_nv12_sse2; } #if (0) // disabled because not increase performance else if (m_FProps.pftype == PFType_YUV420) { @@ -338,7 +326,7 @@ void CFormatConverter::SetConvertFunc() break; case PixFmt_YV16: if (m_FProps.pftype == PFType_YUV422Px) { - pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; + m_pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; m_RequiredAlignment = 32; } #if (0) // disabled because not increase performance @@ -349,10 +337,10 @@ void CFormatConverter::SetConvertFunc() break; case PixFmt_YV24: if (m_FProps.pftype == PFType_YUV444Px) { - pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; + m_pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; m_RequiredAlignment = 32; } else if (m_FProps.pftype == PFType_YUV444) { - pConvertFn = &CFormatConverter::convert_yuv_yv; + m_pConvertFn = &CFormatConverter::convert_yuv_yv; m_RequiredAlignment = 0; } break; @@ -366,7 +354,7 @@ void CFormatConverter::SetConvertFunc() case PFType_YUV444Px: case PFType_NV12: case PFType_P01x: - pConvertFn = &CFormatConverter::convert_yuv_rgb; + m_pConvertFn = &CFormatConverter::convert_yuv_rgb; m_RequiredAlignment = 4; } break; @@ -375,18 +363,18 @@ void CFormatConverter::SetConvertFunc() if (CPUInfo::HaveSSE4()) { if (m_FProps.pftype == PFType_NV12) { if (m_out_pixfmt == PixFmt_NV12) { - pConvertFn = &CFormatConverter::plane_copy_direct_sse4; + m_pConvertFn = &CFormatConverter::plane_copy_direct_sse4; } else if (m_out_pixfmt == PixFmt_YV12) { - pConvertFn = &CFormatConverter::convert_nv12_yv12_direct_sse4; + m_pConvertFn = &CFormatConverter::convert_nv12_yv12_direct_sse4; } } else if (m_FProps.pftype == PFType_P01x) { if (m_out_pixfmt == PixFmt_P010 || m_out_pixfmt == PixFmt_P016) { - pConvertFn = &CFormatConverter::plane_copy_direct_sse4; + m_pConvertFn = &CFormatConverter::plane_copy_direct_sse4; } else if (m_out_pixfmt == PixFmt_NV12) { - pConvertFn = &CFormatConverter::convert_p010_nv12_direct_sse4; + m_pConvertFn = &CFormatConverter::convert_p010_nv12_direct_sse4; } } } @@ -435,7 +423,7 @@ bool CFormatConverter::Converting(BYTE* dst, AVFrame* pFrame) Cleanup(); } - if (!pConvertFn) { + if (!m_pConvertFn) { SetConvertFunc(); } @@ -472,7 +460,7 @@ bool CFormatConverter::Converting(BYTE* dst, AVFrame* pFrame) srcStride[i] = pFrame->linesize[i]; } - (this->*pConvertFn)(pFrame->data, srcStride, dstArray, m_FProps.width, m_FProps.height, dstStrideArray); + (this->*m_pConvertFn)(pFrame->data, srcStride, dstArray, m_FProps.width, m_FProps.height, dstStrideArray); if (out != dst) { int line = 0; @@ -521,7 +509,7 @@ void CFormatConverter::Cleanup() m_rgbCoeffs = nullptr; } - pConvertFn = nullptr; + m_pConvertFn = nullptr; } bool CFormatConverter::FormatChanged(AVPixelFormat* fmt1, AVPixelFormat* fmt2) diff --git a/src/filters/transform/MPCVideoDec/FormatConverter.h b/src/filters/transform/MPCVideoDec/FormatConverter.h index 589f3cc9ce..4eb85f9c93 100644 --- a/src/filters/transform/MPCVideoDec/FormatConverter.h +++ b/src/filters/transform/MPCVideoDec/FormatConverter.h @@ -1,5 +1,5 @@ /* - * (C) 2014-2021 see Authors.txt + * (C) 2014-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -109,25 +109,25 @@ class CFormatConverter #define CONV_FUNC_PARAMS const uint8_t* const src[4], const ptrdiff_t srcStride[4], uint8_t* dst[], int width, int height, const ptrdiff_t dstStride[] protected: - SwsContext* m_pSwsContext; - FrameProps m_FProps; + SwsContext* m_pSwsContext = nullptr; + FrameProps m_FProps; - MPCPixelFormat m_out_pixfmt; + MPCPixelFormat m_out_pixfmt = PixFmt_None; - int m_dstRGBRange; + int m_dstRGBRange = 0; - int m_dstStride; - int m_planeHeight; - int m_OutHeight; + int m_dstStride = 0; + int m_planeHeight = 0; + int m_OutHeight = 0; - size_t m_nAlignedBufferSize; - uint8_t* m_pAlignedBuffer; + size_t m_nAlignedBufferSize = 0; + uint8_t* m_pAlignedBuffer = nullptr; - int m_nCPUFlag; + int m_nCPUFlag = 0; - unsigned m_RequiredAlignment; + unsigned m_RequiredAlignment = 0; - int m_NumThreads; + int m_NumThreads = 1; bool InitSWSContext(); void UpdateSWSContext(); @@ -146,7 +146,7 @@ class CFormatConverter // Conversion function pointer typedef HRESULT (CFormatConverter::*ConverterFn)(CONV_FUNC_PARAMS); - ConverterFn pConvertFn; + ConverterFn m_pConvertFn = nullptr; // from LAV Filters HRESULT ConvertGeneric(CONV_FUNC_PARAMS); diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp index dad0855796..d9599d73ad 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp @@ -1053,47 +1053,9 @@ BOOL CALLBACK EnumFindProcessWnd (HWND hwnd, LPARAM lParam) CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr) : CBaseVideoFilter(L"MPC - Video decoder", lpunk, phr, __uuidof(this)) - , m_nThreadNumber(0) , m_nDiscardMode(AVDISCARD_DEFAULT) - , m_nScanType(SCAN_AUTO) - , m_nARMode(2) , m_nHwDecoder(SysVersion::IsWin8orLater() ? HWDec_D3D11 : HWDec_DXVA2) - , m_nDXVACheckCompatibility(1) - , m_nDXVA_SD(0) - , m_nSwRGBLevels(0) - , m_pAVCodec(nullptr) - , m_pAVCtx(nullptr) - , m_pFrame(nullptr) - , m_pParser(nullptr) , m_CodecId(AV_CODEC_ID_NONE) - , m_bCalculateStopTime(false) - , m_bReorderBFrame(false) - , m_nBFramePos(0) - , m_bWaitKeyFrame(false) - , m_DXVADecoderGUID(GUID_NULL) - , m_nActiveCodecs(CODECS_ALL & ~CODEC_H264_MVC) - , m_rtAvrTimePerFrame(0) - , m_rtLastStart(INVALID_TIME) - , m_rtLastStop(0) - , m_rtStartCache(INVALID_TIME) - , m_bDXVACompatible(true) - , m_nARX(0) - , m_nARY(0) - , m_bUseDXVA(true) - , m_bUseD3D11(true) - , m_bUseFFmpeg(true) - , m_pDXVADecoder(nullptr) - , m_hDevice(INVALID_HANDLE_VALUE) - , m_bWaitingForKeyFrame(TRUE) - , m_bRVDropBFrameTimings(FALSE) - , m_dwSYNC(0) - , m_dwSYNC2(0) - , m_bDecodingStart(FALSE) - , m_dRate(1.0) - , m_pMSDKDecoder(nullptr) - , m_iMvcOutputMode(MVC_OUTPUT_Auto) - , m_bMvcSwapLR(false) - , m_MVC_Base_View_R_flag(FALSE) , m_dxva_pix_fmt(AV_PIX_FMT_NONE) , m_HWPixFmt(AV_PIX_FMT_NONE) { @@ -1128,10 +1090,6 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr) } } - memset(&m_DDPixelFormat, 0, sizeof(m_DDPixelFormat)); - memset(&m_VideoFilters, false, sizeof(m_VideoFilters)); - m_VideoFilters[VDEC_UNCOMPRESSED] = true; - #ifdef REGISTER_FILTER CRegKey key; WCHAR buff[256]; diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.h b/src/filters/transform/MPCVideoDec/MPCVideoDec.h index 24ff242b78..e0c23eb185 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.h +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.h @@ -57,54 +57,54 @@ class __declspec(uuid("008BAC12-FBAF-497b-9670-BC6F6FBAE2C4")) CCritSec m_csInitDec; CCritSec m_csProps; // === Persistants parameters (registry) - int m_nThreadNumber; - MPC_SCAN_TYPE m_nScanType; - int m_nARMode; + int m_nThreadNumber = 0; + MPC_SCAN_TYPE m_nScanType = SCAN_AUTO; + int m_nARMode = 2; int m_nDiscardMode; MPCHwDecoder m_nHwDecoder; MPC_ADAPTER_ID m_HwAdapter = {}; bool m_bHwCodecs[HWCodec_count]; - int m_nDXVACheckCompatibility; - int m_nDXVA_SD; + int m_nDXVACheckCompatibility = 1; + int m_nDXVA_SD = 0; bool m_fPixFmts[PixFmt_count]; - int m_nSwRGBLevels; + int m_nSwRGBLevels = 0; // - bool m_VideoFilters[VDEC_COUNT]; + bool m_VideoFilters[VDEC_COUNT] = { true, false, false, }; bool m_bEnableHwDecoding = true; // internal (not saved) - bool m_bDXVACompatible; - unsigned __int64 m_nActiveCodecs; + bool m_bDXVACompatible = true; + unsigned __int64 m_nActiveCodecs = CODECS_ALL & ~CODEC_H264_MVC; // === FFMpeg variables - const AVCodec* m_pAVCodec; - AVCodecContext* m_pAVCtx; - AVCodecParserContext* m_pParser; - AVFrame* m_pFrame; + const AVCodec* m_pAVCodec = nullptr; + AVCodecContext* m_pAVCtx = nullptr; + AVCodecParserContext* m_pParser = nullptr; + AVFrame* m_pFrame = nullptr; enum AVCodecID m_CodecId; - REFERENCE_TIME m_rtAvrTimePerFrame; - bool m_bCalculateStopTime; + REFERENCE_TIME m_rtAvrTimePerFrame = 0; + bool m_bCalculateStopTime = false; BYTE* m_pFFBuffer = nullptr; unsigned int m_nFFBufferSize = 0; - bool m_bReorderBFrame; + bool m_bReorderBFrame = false; struct Timings { REFERENCE_TIME rtStart; REFERENCE_TIME rtStop; } m_tBFrameDelay[2]; - int m_nBFramePos; + int m_nBFramePos = 0; - bool m_bWaitKeyFrame; + bool m_bWaitKeyFrame = false; - int m_nARX, m_nARY; + int m_nARX = 0, m_nARY = 0; - REFERENCE_TIME m_rtLastStart; // rtStart for last delivered frame - REFERENCE_TIME m_rtLastStop; // rtStop for last delivered frame - double m_dRate; + REFERENCE_TIME m_rtLastStart = INVALID_TIME; // rtStart for last delivered frame + REFERENCE_TIME m_rtLastStop = 0; // rtStop for last delivered frame + double m_dRate = 1.0; - bool m_bUseFFmpeg; - bool m_bUseDXVA; - bool m_bUseD3D11; + bool m_bUseFFmpeg = true; + bool m_bUseDXVA = true; + bool m_bUseD3D11 = true; CFormatConverter m_FormatConverter; CSize m_pOutSize; // Picture size on output pin @@ -117,8 +117,8 @@ class __declspec(uuid("008BAC12-FBAF-497b-9670-BC6F6FBAE2C4")) // === common variables std::vector m_VideoOutputFormats; - CDXVA2Decoder* m_pDXVADecoder; - GUID m_DXVADecoderGUID; + CDXVA2Decoder* m_pDXVADecoder = nullptr; + GUID m_DXVADecoderGUID = GUID_NULL; D3DFORMAT m_DXVASurfaceFormat = D3DFMT_UNKNOWN; UINT m_nPCIVendor; @@ -126,14 +126,11 @@ class __declspec(uuid("008BAC12-FBAF-497b-9670-BC6F6FBAE2C4")) UINT64 m_VideoDriverVersion; CString m_strDeviceDescription; - // === DXVA1 variables - DDPIXELFORMAT m_DDPixelFormat; - // === DXVA2 variables CComPtr m_pDeviceManager; CComPtr m_pDecoderService; DXVA2_ConfigPictureDecode m_DXVA2Config; - HANDLE m_hDevice; + HANDLE m_hDevice = INVALID_HANDLE_VALUE; DXVA2_VideoDesc m_VideoDesc; BOOL m_bFailDXVA2Decode = FALSE; @@ -141,27 +138,27 @@ class __declspec(uuid("008BAC12-FBAF-497b-9670-BC6F6FBAE2C4")) bool m_bReinit = false; - BOOL m_bWaitingForKeyFrame; - BOOL m_bRVDropBFrameTimings; + BOOL m_bWaitingForKeyFrame = TRUE; + BOOL m_bRVDropBFrameTimings = FALSE; - REFERENCE_TIME m_rtStartCache; + REFERENCE_TIME m_rtStartCache = INVALID_TIME; - DWORD m_dwSYNC; - DWORD m_dwSYNC2; + DWORD m_dwSYNC = 0; + DWORD m_dwSYNC2 = 0; CMediaType m_pCurrentMediaType; DXVA2_ExtendedFormat m_inputDxvaExtFormat = {}; - BOOL m_bDecodingStart; + BOOL m_bDecodingStart = FALSE; BOOL m_bDecoderAcceptFormat = FALSE; bool m_bHighBitdepth = false; - CMSDKDecoder* m_pMSDKDecoder; - int m_iMvcOutputMode; - bool m_bMvcSwapLR; + CMSDKDecoder* m_pMSDKDecoder = nullptr; + int m_iMvcOutputMode = MVC_OUTPUT_Auto; + bool m_bMvcSwapLR = false; - BOOL m_MVC_Base_View_R_flag; + BOOL m_MVC_Base_View_R_flag = FALSE; CLSID m_OutputFilterClsid = GUID_NULL; From bd2af517d640ef3c27caf9f62a46e9e5291dcf54 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 29 Jun 2024 08:54:03 +0300 Subject: [PATCH 033/102] =?UTF-8?q?FFmpeg:=20=D0=A3=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=BF=D0=B5=D1=87=D0=B0=D1=82=D0=BA=D0=B0?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/libavcodec/bsf_list.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ExtLib/ffmpeg/libavcodec/bsf_list.c b/src/ExtLib/ffmpeg/libavcodec/bsf_list.c index 6576b3b530..9dd35110b7 100644 --- a/src/ExtLib/ffmpeg/libavcodec/bsf_list.c +++ b/src/ExtLib/ffmpeg/libavcodec/bsf_list.c @@ -6,7 +6,5 @@ static const FFBitStreamFilter * const bitstream_filters[] = { &ff_vp9_superframe_split_bsf, &ff_vvc_metadata_bsf, &ff_vvc_mp4toannexb_bsf, - &ff_vvc_metadata_bsf, - &ff_vvc_mp4toannexb_bsf, NULL }; From 585a8144cc101ce0e4a9a1e353082f2167f74773 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 29 Jun 2024 09:17:24 +0300 Subject: [PATCH 034/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20ffmpeg=20n7.1-dev-1585-g0b330d8642.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 4 +- docs/Changelog.txt | 4 +- src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c | 7 +- .../ffmpeg/libavcodec/aac/aacdec_usac.c | 122 ++- src/ExtLib/ffmpeg/libavcodec/aacsbr.h | 11 + .../ffmpeg/libavcodec/aacsbr_template.c | 232 ++++- src/ExtLib/ffmpeg/libavcodec/cbs_h264.h | 20 + src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c | 34 +- .../libavcodec/cbs_h264_syntax_template.c | 34 + src/ExtLib/ffmpeg/libavcodec/cbs_h266.h | 18 +- .../libavcodec/cbs_h266_syntax_template.c | 36 +- src/ExtLib/ffmpeg/libavcodec/cbs_sei.h | 30 + .../libavcodec/cbs_sei_syntax_template.c | 62 ++ src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/mjpegdec.c | 3 +- src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c | 12 +- src/ExtLib/ffmpeg/libavcodec/sbr.h | 32 +- src/ExtLib/ffmpeg/libavcodec/version.h | 2 +- src/ExtLib/ffmpeg/libavcodec/vvc.h | 3 + src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c | 19 +- src/ExtLib/ffmpeg/libavcodec/vvc/ctu.h | 9 +- src/ExtLib/ffmpeg/libavcodec/vvc/dec.c | 16 +- src/ExtLib/ffmpeg/libavcodec/vvc/dec.h | 9 +- src/ExtLib/ffmpeg/libavcodec/vvc/filter.c | 931 +++++++++--------- src/ExtLib/ffmpeg/libavcodec/vvc/inter.c | 7 - src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c | 21 +- src/ExtLib/ffmpeg/libavcodec/vvc/mvs.h | 4 +- src/ExtLib/ffmpeg/libavcodec/vvc/ps.c | 45 + src/ExtLib/ffmpeg/libavcodec/vvc/ps.h | 6 + src/ExtLib/ffmpeg/libavcodec/vvc/refs.c | 2 +- src/ExtLib/ffmpeg/libavcodec/vvc/thread.c | 9 +- .../ffmpeg/libavcodec/x86/vvc/vvc_alf.asm | 85 +- src/ExtLib/ffmpeg/libavutil/executor.c | 28 +- src/ExtLib/ffmpeg/libavutil/executor.h | 2 +- src/ExtLib/ffmpeg/libavutil/stereo3d.c | 11 + src/ExtLib/ffmpeg/libavutil/stereo3d.h | 22 +- src/ExtLib/ffmpeg/libavutil/version.h | 2 +- src/ExtLib/ffmpeg/libswscale/output.c | 18 +- src/ExtLib/ffmpeg/libswscale/yuv2rgb.c | 813 +++++++-------- 39 files changed, 1600 insertions(+), 1127 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index fe5e7159f6..0feccd8a0b 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -11,8 +11,8 @@ Обновлен японский перевод (автор tsubasanouta). Обновлены библиотеки: - ffmpeg git-n7.1-dev-1509-g0c0e7ec81e; - vvdec git-v2.3.0-24-gad8f4bb. + ffmpeg n7.1-dev-1585-g0b330d8642; + vvdec v2.3.0-24-gad8f4bb. 1.7.2 - 2024-06-07 diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 03a36d8fef..6986ee93fb 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -11,8 +11,8 @@ Updated Korean translation (by Hackjjang). Updated Japanese translation (by tsubasanouta). Updated libraries: - ffmpeg git-n7.1-dev-1509-g0c0e7ec81e; - vvdec git-v2.3.0-24-gad8f4bb. + ffmpeg n7.1-dev-1585-g0b330d8642; + vvdec v2.3.0-24-gad8f4bb. 1.7.2 - 2024-06-07 diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c index 796edd2ab5..91a3268889 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c @@ -99,7 +99,7 @@ static void parse_qn(GetBitContext *gb, int *qn, int nk_mode, int no_qn) static int parse_codebook_idx(GetBitContext *gb, uint32_t *kv, int nk_mode, int no_qn) { - int idx, n, nk; + int n, nk; int qn[2]; parse_qn(gb, qn, nk_mode, no_qn); @@ -114,7 +114,7 @@ static int parse_codebook_idx(GetBitContext *gb, uint32_t *kv, } } - idx = get_bits(gb, 4*n); + skip_bits(gb, 4*n); if (nk > 0) for (int i = 0; i < 8; i++) @@ -145,7 +145,6 @@ int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac, int k; const uint8_t *mod; int first_ldp_flag; - int first_tcx_flag; ce->ldp.acelp_core_mode = get_bits(gb, 3); ce->ldp.lpd_mode = get_bits(gb, 5); @@ -157,7 +156,6 @@ int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac, mod = ff_aac_lpd_mode_tab[ce->ldp.lpd_mode]; first_ldp_flag = !ce->ldp.core_mode_last; - first_tcx_flag = 1; if (first_ldp_flag) ce->ldp.last_lpd_mode = -1; /* last_ldp_mode is a **STATEFUL** value */ @@ -179,7 +177,6 @@ int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac, // parse_tcx_coding(); ce->ldp.last_lpd_mode = mod[k]; k += (1 << (mod[k] - 1)); - first_tcx_flag = 0; } } diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c index e5504117d0..4856c1786b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c @@ -23,6 +23,8 @@ #include "aacdec_lpd.h" #include "aacdec_ac.h" +#include "libavcodec/aacsbr.h" + #include "libavcodec/aactab.h" #include "libavutil/mem.h" #include "libavcodec/mpeg4audio.h" @@ -145,7 +147,8 @@ static int decode_loudness_set(AACDecContext *ac, AACUSACConfig *usac, return 0; } -static void decode_usac_sbr_data(AACUsacElemConfig *e, GetBitContext *gb) +static int decode_usac_sbr_data(AACDecContext *ac, + AACUsacElemConfig *e, GetBitContext *gb) { uint8_t header_extra1; uint8_t header_extra2; @@ -153,6 +156,10 @@ static void decode_usac_sbr_data(AACUsacElemConfig *e, GetBitContext *gb) e->sbr.harmonic_sbr = get_bits1(gb); /* harmonicSBR */ e->sbr.bs_intertes = get_bits1(gb); /* bs_interTes */ e->sbr.bs_pvc = get_bits1(gb); /* bs_pvc */ + if (e->sbr.harmonic_sbr || e->sbr.bs_intertes || e->sbr.bs_pvc) { + avpriv_report_missing_feature(ac->avctx, "AAC USAC eSBR"); + return AVERROR_PATCHWELCOME; + } e->sbr.dflt.start_freq = get_bits(gb, 4); /* dflt_start_freq */ e->sbr.dflt.stop_freq = get_bits(gb, 4); /* dflt_stop_freq */ @@ -179,6 +186,8 @@ static void decode_usac_sbr_data(AACUsacElemConfig *e, GetBitContext *gb) e->sbr.dflt.interpol_freq = get_bits1(gb); /* dflt_interpol_freq */ e->sbr.dflt.smoothing_mode = get_bits1(gb); /* dflt_smoothing_mode */ } + + return 0; } static void decode_usac_element_core(AACUsacElemConfig *e, @@ -190,13 +199,17 @@ static void decode_usac_element_core(AACUsacElemConfig *e, e->sbr.ratio = sbr_ratio; } -static void decode_usac_element_pair(AACUsacElemConfig *e, GetBitContext *gb) +static int decode_usac_element_pair(AACDecContext *ac, + AACUsacElemConfig *e, GetBitContext *gb) { e->stereo_config_index = 0; if (e->sbr.ratio) { - decode_usac_sbr_data(e, gb); + int ret = decode_usac_sbr_data(ac, e, gb); + if (ret < 0) + return ret; e->stereo_config_index = get_bits(gb, 2); } + if (e->stereo_config_index) { e->mps.freq_res = get_bits(gb, 3); /* bsFreqRes */ e->mps.fixed_gain = get_bits(gb, 3); /* bsFixedGainDMX */ @@ -216,6 +229,8 @@ static void decode_usac_element_pair(AACUsacElemConfig *e, GetBitContext *gb) if (e->mps.temp_shape_config == 2) e->mps.env_quant_mode = get_bits1(gb); /* bsEnvQuantMode */ } + + return 0; } static int decode_usac_extension(AACDecContext *ac, AACUsacElemConfig *e, @@ -294,6 +309,9 @@ int ff_aac_usac_reset_state(AACDecContext *ac, OutputConfiguration *oc) AACUsacStereo *us = &che->us; memset(us, 0, sizeof(*us)); + if (e->sbr.ratio) + ff_aac_sbr_config_usac(ac, che, e); + for (int j = 0; j < ch; j++) { SingleChannelElement *sce = &che->ch[ch]; AACUsacElemData *ue = &sce->ue; @@ -320,6 +338,7 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, uint8_t freq_idx; uint8_t channel_config_idx; int nb_channels = 0; + int ratio_mult, ratio_dec; int samplerate; int sbr_ratio; MPEG4AudioConfig *m4ac = &oc->m4ac; @@ -329,6 +348,9 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, int map_pos_set = 0; uint8_t layout_map[MAX_ELEM_ID*4][3] = { 0 }; + if (!ac) + return AVERROR_PATCHWELCOME; + memset(usac, 0, sizeof(*usac)); freq_idx = get_bits(gb, 5); /* usacSamplingFrequencyIndex */ @@ -340,8 +362,6 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, return AVERROR(EINVAL); } - m4ac->sample_rate = avctx->sample_rate = samplerate; - usac->core_sbr_frame_len_idx = get_bits(gb, 3); /* coreSbrFrameLengthIndex */ m4ac->frame_length_short = usac->core_sbr_frame_len_idx == 0 || usac->core_sbr_frame_len_idx == 2; @@ -354,7 +374,26 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, usac->core_sbr_frame_len_idx == 4 ? 1 : 0; + if (sbr_ratio == 2) { + ratio_mult = 8; + ratio_dec = 3; + } else if (sbr_ratio == 3) { + ratio_mult = 2; + ratio_dec = 1; + } else if (sbr_ratio == 4) { + ratio_mult = 4; + ratio_dec = 1; + } else { + ratio_mult = 1; + ratio_dec = 1; + } + + avctx->sample_rate = samplerate; + m4ac->ext_sample_rate = samplerate; + m4ac->sample_rate = (samplerate * ratio_dec) / ratio_mult; + m4ac->sampling_index = ff_aac_sample_rate_idx(m4ac->sample_rate); + m4ac->sbr = sbr_ratio > 0; channel_config_idx = get_bits(gb, 5); /* channelConfigurationIndex */ if (!channel_config_idx) { @@ -426,8 +465,11 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, case ID_USAC_SCE: /* SCE */ /* UsacCoreConfig */ decode_usac_element_core(e, gb, sbr_ratio); - if (e->sbr.ratio > 0) - decode_usac_sbr_data(e, gb); + if (e->sbr.ratio > 0) { + ret = decode_usac_sbr_data(ac, e, gb); + if (ret < 0) + return ret; + } layout_map[map_count][0] = TYPE_SCE; layout_map[map_count][1] = elem_id[0]++; if (!map_pos_set) @@ -437,7 +479,9 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, case ID_USAC_CPE: /* UsacChannelPairElementConf */ /* UsacCoreConfig */ decode_usac_element_core(e, gb, sbr_ratio); - decode_usac_element_pair(e, gb); + ret = decode_usac_element_pair(ac, e, gb); + if (ret < 0) + return ret; layout_map[map_count][0] = TYPE_CPE; layout_map[map_count][1] = elem_id[1]++; if (!map_pos_set) @@ -1307,13 +1351,14 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac, int ret; int arith_reset_flag; AACUsacStereo *us = &che->us; + int core_nb_channels = nb_channels; /* Local symbols */ uint8_t global_gain; us->common_window = 0; - for (int ch = 0; ch < nb_channels; ch++) { + for (int ch = 0; ch < core_nb_channels; ch++) { SingleChannelElement *sce = &che->ch[ch]; AACUsacElemData *ue = &sce->ue; @@ -1323,13 +1368,16 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac, ue->core_mode = get_bits1(gb); } - if (nb_channels == 2) { + if (nb_channels > 1 && ec->stereo_config_index == 1) + core_nb_channels = 1; + + if (core_nb_channels == 2) { ret = decode_usac_stereo_info(ac, usac, ec, che, gb, indep_flag); if (ret) return ret; } - for (int ch = 0; ch < nb_channels; ch++) { + for (int ch = 0; ch < core_nb_channels; ch++) { SingleChannelElement *sce = &che->ch[ch]; IndividualChannelStream *ics = &sce->ics; AACUsacElemData *ue = &sce->ue; @@ -1341,7 +1389,7 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac, continue; } - if ((nb_channels == 1) || + if ((core_nb_channels == 1) || (che->ch[0].ue.core_mode != che->ch[1].ue.core_mode)) ue->tns_data_present = get_bits1(gb); @@ -1424,7 +1472,29 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac, } } - spectrum_decode(ac, usac, che, nb_channels); + if (ec->sbr.ratio) { + int sbr_ch = nb_channels; + if (nb_channels == 2 && + !(ec->stereo_config_index == 0 || ec->stereo_config_index == 3)) + sbr_ch = 1; + + ret = ff_aac_sbr_decode_usac_data(ac, che, ec, gb, sbr_ch, indep_flag); + if (ret < 0) + return ret; + + if (ec->stereo_config_index) { + avpriv_report_missing_feature(ac->avctx, "AAC USAC Mps212"); + return AVERROR_PATCHWELCOME; + } + } + + spectrum_decode(ac, usac, che, core_nb_channels); + + if (ac->oc[1].m4ac.sbr > 0) { + ac->proc.sbr_apply(ac, che, nb_channels == 2 ? TYPE_CPE : TYPE_SCE, + che->ch[0].output, + che->ch[1].output); + } return 0; } @@ -1591,9 +1661,29 @@ int ff_aac_usac_decode_frame(AVCodecContext *avctx, AACDecContext *ac, int indep_flag, samples = 0; int audio_found = 0; int elem_id[3 /* SCE, CPE, LFE */] = { 0, 0, 0 }; - AVFrame *frame = ac->frame; + int ratio_mult, ratio_dec; + AACUSACConfig *usac = &ac->oc[1].usac; + int sbr_ratio = usac->core_sbr_frame_len_idx == 2 ? 2 : + usac->core_sbr_frame_len_idx == 3 ? 3 : + usac->core_sbr_frame_len_idx == 4 ? 1 : + 0; + + if (sbr_ratio == 2) { + ratio_mult = 8; + ratio_dec = 3; + } else if (sbr_ratio == 3) { + ratio_mult = 2; + ratio_dec = 1; + } else if (sbr_ratio == 4) { + ratio_mult = 4; + ratio_dec = 1; + } else { + ratio_mult = 1; + ratio_dec = 1; + } + ff_aac_output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags, ac->oc[1].status, 0); @@ -1660,8 +1750,10 @@ int ff_aac_usac_decode_frame(AVCodecContext *avctx, AACDecContext *ac, if (audio_found) samples = ac->oc[1].m4ac.frame_length_short ? 768 : 1024; + samples = (samples * ratio_mult) / ratio_dec; + if (ac->oc[1].status && audio_found) { - avctx->sample_rate = ac->oc[1].m4ac.sample_rate; + avctx->sample_rate = ac->oc[1].m4ac.ext_sample_rate; avctx->frame_size = samples; ac->oc[1].status = OC_LOCKED; } diff --git a/src/ExtLib/ffmpeg/libavcodec/aacsbr.h b/src/ExtLib/ffmpeg/libavcodec/aacsbr.h index b83e18a7f9..cae9aeb78a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aacsbr.h +++ b/src/ExtLib/ffmpeg/libavcodec/aacsbr.h @@ -88,6 +88,17 @@ int ff_aac_sbr_decode_extension(AACDecContext *ac, ChannelElement *che, int ff_aac_sbr_decode_extension_fixed(AACDecContext *ac, ChannelElement *che, GetBitContext *gb, int crc, int cnt, int id_aac); +/** Due to channel allocation not being known upon SBR parameter transmission, + * supply the parameters separately. + * Functionally identical to ff_aac_sbr_decode_extension() */ +int ff_aac_sbr_config_usac(AACDecContext *ac, ChannelElement *che, + AACUsacElemConfig *ue); + +/** Decode frame SBR data, USAC. */ +int ff_aac_sbr_decode_usac_data(AACDecContext *ac, ChannelElement *che, + AACUsacElemConfig *ue, GetBitContext *gb, + int sbr_ch, int indep_flag); + /** Apply one SBR element to one AAC element. */ void ff_aac_sbr_apply(AACDecContext *ac, ChannelElement *che, int id_aac, void /* float */ *L, void /* float */ *R); diff --git a/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c b/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c index 420312d207..8bda251213 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c @@ -57,6 +57,7 @@ av_cold void AAC_RENAME(ff_aac_sbr_init)(void) /** Places SBR in pure upsampling mode. */ static void sbr_turnoff(SpectralBandReplication *sbr) { sbr->start = 0; + sbr->usac = 0; sbr->ready_for_dequant = 0; // Init defults used in pure upsampling mode sbr->kx[1] = 32; //Typo in spec, kx' inits to 32 @@ -184,7 +185,8 @@ static void sbr_make_f_tablelim(SpectralBandReplication *sbr) } } -static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext *gb) +static unsigned int read_sbr_header(SpectralBandReplication *sbr, + GetBitContext *gb, int is_usac) { unsigned int cnt = get_bits_count(gb); uint8_t bs_header_extra_1; @@ -194,15 +196,20 @@ static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext sbr->start = 1; sbr->ready_for_dequant = 0; + sbr->usac = is_usac; // Save last spectrum parameters variables to compare to new ones memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters)); - sbr->bs_amp_res_header = get_bits1(gb); + if (!is_usac) + sbr->bs_amp_res_header = get_bits1(gb); + sbr->spectrum_params.bs_start_freq = get_bits(gb, 4); sbr->spectrum_params.bs_stop_freq = get_bits(gb, 4); - sbr->spectrum_params.bs_xover_band = get_bits(gb, 3); - skip_bits(gb, 2); // bs_reserved + + if (!is_usac) + sbr->spectrum_params.bs_xover_band = get_bits(gb, 3); + skip_bits(gb, 2); // bs_reserved bs_header_extra_1 = get_bits1(gb); bs_header_extra_2 = get_bits1(gb); @@ -645,7 +652,7 @@ static int read_sbr_grid(AACDecContext *ac, SpectralBandReplication *sbr, switch (bs_frame_class = get_bits(gb, 2)) { case FIXFIX: bs_num_env = 1 << get_bits(gb, 2); - if (bs_num_env > 4) { + if (bs_num_env > (sbr->usac ? 8 : 5)) { av_log(ac->avctx, AV_LOG_ERROR, "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n", bs_num_env); @@ -793,10 +800,26 @@ static void copy_sbr_grid(SBRData *dst, const SBRData *src) { /// Read how the envelope and noise floor data is delta coded static void read_sbr_dtdf(SpectralBandReplication *sbr, GetBitContext *gb, - SBRData *ch_data) + SBRData *ch_data, int indep_flag) { - get_bits1_vector(gb, ch_data->bs_df_env, ch_data->bs_num_env); - get_bits1_vector(gb, ch_data->bs_df_noise, ch_data->bs_num_noise); + if (sbr->usac) { + if (indep_flag) { + ch_data->bs_df_env[0] = 0; + get_bits1_vector(gb, &ch_data->bs_df_env[1], ch_data->bs_num_env - 1); + } else { + get_bits1_vector(gb, ch_data->bs_df_env, ch_data->bs_num_env); + } + + if (indep_flag) { + ch_data->bs_df_noise[0] = 0; + get_bits1_vector(gb, &ch_data->bs_df_noise[1], ch_data->bs_num_noise - 1); + } else { + get_bits1_vector(gb, ch_data->bs_df_noise, ch_data->bs_num_noise); + } + } else { + get_bits1_vector(gb, ch_data->bs_df_env, ch_data->bs_num_env); + get_bits1_vector(gb, ch_data->bs_df_noise, ch_data->bs_num_noise); + } } /// Read inverse filtering data @@ -811,7 +834,7 @@ static void read_sbr_invf(SpectralBandReplication *sbr, GetBitContext *gb, } static int read_sbr_envelope(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, - SBRData *ch_data, int ch) + SBRData *ch_data, int ch) { int bits; int i, j, k; @@ -881,6 +904,13 @@ static int read_sbr_envelope(AACDecContext *ac, SpectralBandReplication *sbr, Ge } } } + if (sbr->usac) { + if (sbr->inter_tes) { + ch_data->temp_shape[i] = get_bits(gb, 1); + if (ch_data->temp_shape[i]) + ch_data->temp_shape_mode[i] = get_bits(gb, 2); + } + } } //assign 0th elements of env_facs_q from last elements @@ -975,7 +1005,7 @@ static int read_sbr_single_channel_element(AACDecContext *ac, if (read_sbr_grid(ac, sbr, gb, &sbr->data[0])) return -1; - read_sbr_dtdf(sbr, gb, &sbr->data[0]); + read_sbr_dtdf(sbr, gb, &sbr->data[0], 0); read_sbr_invf(sbr, gb, &sbr->data[0]); if((ret = read_sbr_envelope(ac, sbr, gb, &sbr->data[0], 0)) < 0) return ret; @@ -1001,8 +1031,8 @@ static int read_sbr_channel_pair_element(AACDecContext *ac, if (read_sbr_grid(ac, sbr, gb, &sbr->data[0])) return -1; copy_sbr_grid(&sbr->data[1], &sbr->data[0]); - read_sbr_dtdf(sbr, gb, &sbr->data[0]); - read_sbr_dtdf(sbr, gb, &sbr->data[1]); + read_sbr_dtdf(sbr, gb, &sbr->data[0], 0); + read_sbr_dtdf(sbr, gb, &sbr->data[1], 0); read_sbr_invf(sbr, gb, &sbr->data[0]); memcpy(sbr->data[1].bs_invf_mode[1], sbr->data[1].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0])); memcpy(sbr->data[1].bs_invf_mode[0], sbr->data[0].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0])); @@ -1018,8 +1048,8 @@ static int read_sbr_channel_pair_element(AACDecContext *ac, if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]) || read_sbr_grid(ac, sbr, gb, &sbr->data[1])) return -1; - read_sbr_dtdf(sbr, gb, &sbr->data[0]); - read_sbr_dtdf(sbr, gb, &sbr->data[1]); + read_sbr_dtdf(sbr, gb, &sbr->data[0], 0); + read_sbr_dtdf(sbr, gb, &sbr->data[1], 0); read_sbr_invf(sbr, gb, &sbr->data[0]); read_sbr_invf(sbr, gb, &sbr->data[1]); if((ret = read_sbr_envelope(ac, sbr, gb, &sbr->data[0], 0)) < 0) @@ -1134,7 +1164,7 @@ int AAC_RENAME(ff_aac_sbr_decode_extension)(AACDecContext *ac, ChannelElement *c num_sbr_bits++; if (get_bits1(gb)) // bs_header_flag - num_sbr_bits += read_sbr_header(sbr, gb); + num_sbr_bits += read_sbr_header(sbr, gb, 0); if (sbr->reset) sbr_reset(ac, sbr); @@ -1153,6 +1183,178 @@ int AAC_RENAME(ff_aac_sbr_decode_extension)(AACDecContext *ac, ChannelElement *c return cnt; } +#if !USE_FIXED +static void copy_usac_default_header(SpectralBandReplication *sbr, + AACUsacElemConfig *ue) +{ + sbr->inter_tes = ue->sbr.bs_intertes; + + sbr->spectrum_params.bs_start_freq = ue->sbr.dflt.start_freq; + sbr->spectrum_params.bs_stop_freq = ue->sbr.dflt.stop_freq; + + sbr->spectrum_params.bs_freq_scale = ue->sbr.dflt.freq_scale; + sbr->spectrum_params.bs_alter_scale = ue->sbr.dflt.alter_scale; + sbr->spectrum_params.bs_noise_bands = ue->sbr.dflt.noise_bands; + + sbr->bs_limiter_bands = ue->sbr.dflt.limiter_bands; + sbr->bs_limiter_gains = ue->sbr.dflt.limiter_gains; + sbr->bs_interpol_freq = ue->sbr.dflt.interpol_freq; + sbr->bs_smoothing_mode = ue->sbr.dflt.smoothing_mode; +} + +int ff_aac_sbr_config_usac(AACDecContext *ac, ChannelElement *che, + AACUsacElemConfig *ue) +{ + SpectralBandReplication *sbr = get_sbr(che); + sbr_turnoff(sbr); + return 0; +} + +int ff_aac_sbr_decode_usac_data(AACDecContext *ac, ChannelElement *che, + AACUsacElemConfig *ue, GetBitContext *gb, + int sbr_ch, int indep_flag) +{ + int ret; + SpectralBandReplication *sbr = get_sbr(che); + int info_present = 1; + int header_present = 1; + + sbr->reset = 0; + sbr->usac = 1; + + sbr->sample_rate = ac->oc[1].m4ac.ext_sample_rate; + sbr->id_aac = sbr_ch == 2 ? TYPE_CPE : TYPE_SCE; + + if (!indep_flag) { + info_present = get_bits1(gb); + if (info_present) + header_present = get_bits1(gb); + else + header_present = 0; + } + + if (info_present) { + /* SbrInfo() */ + sbr->bs_amp_res_header = get_bits1(gb); + sbr->spectrum_params.bs_xover_band = get_bits(gb, 4); + sbr->bs_sbr_preprocessing = get_bits1(gb); + /* if (bs_pvc) ... */ + } + + if (header_present) { + if (get_bits1(gb)) { + int old_bs_limiter_bands = sbr->bs_limiter_bands; + SpectrumParameters old_spectrum_params; + memcpy(&old_spectrum_params, &sbr->spectrum_params, + sizeof(SpectrumParameters)); + + copy_usac_default_header(sbr, ue); + // Check if spectrum parameters changed + if (memcmp(&old_spectrum_params, &sbr->spectrum_params, + sizeof(SpectrumParameters))) + sbr->reset = 1; + + if (sbr->bs_limiter_bands != old_bs_limiter_bands && !sbr->reset) + sbr_make_f_tablelim(sbr); + } else { + read_sbr_header(sbr, gb, 1); + } + + sbr->start = 1; + } + + //Save some state from the previous frame. + sbr->kx[0] = sbr->kx[1]; + sbr->m[0] = sbr->m[1]; + sbr->kx_and_m_pushed = 1; + + if (sbr->reset) + sbr_reset(ac, sbr); + + sbr->ready_for_dequant = 1; + + int start = get_bits_count(gb); + + if (sbr_ch == 1) { /* sbr_single_channel_element */ + /* if (harmonicSBR) ... */ + + if (read_sbr_grid(ac, sbr, gb, &sbr->data[0])) + return -1; + + read_sbr_dtdf(sbr, gb, &sbr->data[0], indep_flag); + read_sbr_invf(sbr, gb, &sbr->data[0]); + + if ((ret = read_sbr_envelope(ac, sbr, gb, &sbr->data[0], 0)) < 0) + return ret; + + if ((ret = read_sbr_noise(ac, sbr, gb, &sbr->data[0], 0)) < 0) + return ret; + + if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]); + } else if (get_bits1(gb)) { /* bs_coupling == 1 */ + /* if (harmonicSBR) ... */ + + if (read_sbr_grid(ac, sbr, gb, &sbr->data[0])) + return -1; + copy_sbr_grid(&sbr->data[1], &sbr->data[0]); + + read_sbr_dtdf(sbr, gb, &sbr->data[0], indep_flag); + read_sbr_dtdf(sbr, gb, &sbr->data[1], indep_flag); + + read_sbr_invf(sbr, gb, &sbr->data[0]); + memcpy(sbr->data[1].bs_invf_mode[1], sbr->data[1].bs_invf_mode[0], + sizeof(sbr->data[1].bs_invf_mode[0])); + memcpy(sbr->data[1].bs_invf_mode[0], sbr->data[0].bs_invf_mode[0], + sizeof(sbr->data[1].bs_invf_mode[0])); + + if ((ret = read_sbr_envelope(ac, sbr, gb, &sbr->data[0], 0)) < 0) + return ret; + if ((ret = read_sbr_noise(ac, sbr, gb, &sbr->data[0], 0)) < 0) + return ret; + + if ((ret = read_sbr_envelope(ac, sbr, gb, &sbr->data[1], 1)) < 0) + return ret; + if ((ret = read_sbr_noise(ac, sbr, gb, &sbr->data[1], 1)) < 0) + return ret; + + if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]); + if ((sbr->data[1].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[1].bs_add_harmonic, sbr->n[1]); + } else { /* bs_coupling == 0 */ + /* if (harmonicSBR) ... */ + if (read_sbr_grid(ac, sbr, gb, &sbr->data[0])) + return -1; + if (read_sbr_grid(ac, sbr, gb, &sbr->data[1])) + return -1; + + read_sbr_dtdf(sbr, gb, &sbr->data[0], indep_flag); + read_sbr_dtdf(sbr, gb, &sbr->data[1], indep_flag); + + read_sbr_invf(sbr, gb, &sbr->data[0]); + read_sbr_invf(sbr, gb, &sbr->data[1]); + + if ((ret = read_sbr_envelope(ac, sbr, gb, &sbr->data[0], 0)) < 0) + return ret; + if ((ret = read_sbr_envelope(ac, sbr, gb, &sbr->data[1], 1)) < 0) + return ret; + + if ((ret = read_sbr_noise(ac, sbr, gb, &sbr->data[0], 0)) < 0) + return ret; + if ((ret = read_sbr_noise(ac, sbr, gb, &sbr->data[1], 1)) < 0) + return ret; + + if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]); + if ((sbr->data[1].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[1].bs_add_harmonic, sbr->n[1]); + } + + return 0; +} +#endif + /** * Analysis QMF Bank (14496-3 sp04 p206) * diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h264.h b/src/ExtLib/ffmpeg/libavcodec/cbs_h264.h index db91231337..3763f2492b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h264.h +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h264.h @@ -293,6 +293,26 @@ typedef struct H264RawFilmGrainCharacteristics { uint8_t film_grain_characteristics_repetition_period; } H264RawFilmGrainCharacteristics; +typedef struct H264RawSEIFramePackingArrangement { + uint32_t frame_packing_arrangement_id; + uint8_t frame_packing_arrangement_cancel_flag; + uint8_t frame_packing_arrangement_type; + uint8_t quincunx_sampling_flag; + uint8_t content_interpretation_type; + uint8_t spatial_flipping_flag; + uint8_t frame0_flipped_flag; + uint8_t field_views_flag; + uint8_t current_frame_is_frame0_flag; + uint8_t frame0_self_contained_flag; + uint8_t frame1_self_contained_flag; + uint8_t frame0_grid_position_x; + uint8_t frame0_grid_position_y; + uint8_t frame1_grid_position_x; + uint8_t frame1_grid_position_y; + uint16_t frame_packing_arrangement_repetition_period; + uint8_t frame_packing_arrangement_extension_flag; +} H264RawSEIFramePackingArrangement; + typedef struct H264RawSEIDisplayOrientation { uint8_t display_orientation_cancel_flag; uint8_t hor_flip; diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c index e2389f124e..5ec781ddab 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c @@ -2128,6 +2128,18 @@ static const SEIMessageTypeDescriptor cbs_sei_common_types[] = { sizeof(SEIRawUserDataUnregistered), SEI_MESSAGE_RW(sei, user_data_unregistered), }, + { + SEI_TYPE_FRAME_PACKING_ARRANGEMENT, + 1, 0, + sizeof(SEIRawFramePackingArrangement), + SEI_MESSAGE_RW(sei, frame_packing_arrangement), + }, + { + SEI_TYPE_DECODED_PICTURE_HASH, + 0, 1, + sizeof(SEIRawDecodedPictureHash), + SEI_MESSAGE_RW(sei, decoded_picture_hash), + }, { SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME, 1, 0, @@ -2186,6 +2198,12 @@ static const SEIMessageTypeDescriptor cbs_sei_h264_types[] = { sizeof(H264RawFilmGrainCharacteristics), SEI_MESSAGE_RW(h264, film_grain_characteristics), }, + { + SEI_TYPE_FRAME_PACKING_ARRANGEMENT, + 1, 0, + sizeof(H264RawSEIFramePackingArrangement), + SEI_MESSAGE_RW(h264, sei_frame_packing_arrangement), + }, { SEI_TYPE_DISPLAY_ORIENTATION, 1, 0, @@ -2260,12 +2278,6 @@ static const SEIMessageTypeDescriptor cbs_sei_h265_types[] = { }; static const SEIMessageTypeDescriptor cbs_sei_h266_types[] = { - { - SEI_TYPE_DECODED_PICTURE_HASH, - 0, 1, - sizeof(H266RawSEIDecodedPictureHash), - SEI_MESSAGE_RW(h266, sei_decoded_picture_hash), - }, SEI_MESSAGE_TYPE_END }; @@ -2275,11 +2287,6 @@ const SEIMessageTypeDescriptor *ff_cbs_sei_find_type(CodedBitstreamContext *ctx, const SEIMessageTypeDescriptor *codec_list; int i; - for (i = 0; cbs_sei_common_types[i].type >= 0; i++) { - if (cbs_sei_common_types[i].type == payload_type) - return &cbs_sei_common_types[i]; - } - switch (ctx->codec->codec_id) { case AV_CODEC_ID_H264: codec_list = cbs_sei_h264_types; @@ -2299,5 +2306,10 @@ const SEIMessageTypeDescriptor *ff_cbs_sei_find_type(CodedBitstreamContext *ctx, return &codec_list[i]; } + for (i = 0; cbs_sei_common_types[i].type >= 0; i++) { + if (cbs_sei_common_types[i].type == payload_type) + return &cbs_sei_common_types[i]; + } + return NULL; } diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h264_syntax_template.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h264_syntax_template.c index 4d2d303722..9d0386c24d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h264_syntax_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h264_syntax_template.c @@ -801,6 +801,40 @@ SEI_FUNC(film_grain_characteristics, (CodedBitstreamContext *ctx, RWContext *rw, return 0; } +SEI_FUNC(sei_frame_packing_arrangement, (CodedBitstreamContext *ctx, RWContext *rw, + H264RawSEIFramePackingArrangement *current, + SEIMessageState *sei)) +{ + int err; + + HEADER("Frame Packing Arrangement"); + + ue(frame_packing_arrangement_id, 0, MAX_UINT_BITS(31)); + flag(frame_packing_arrangement_cancel_flag); + if (!current->frame_packing_arrangement_cancel_flag) { + u(7, frame_packing_arrangement_type, 0, 7); + flag(quincunx_sampling_flag); + u(6, content_interpretation_type, 0, 2); + flag(spatial_flipping_flag); + flag(frame0_flipped_flag); + flag(field_views_flag); + flag(current_frame_is_frame0_flag); + flag(frame0_self_contained_flag); + flag(frame1_self_contained_flag); + if (!current->quincunx_sampling_flag && current->frame_packing_arrangement_type != 5) { + ub(4, frame0_grid_position_x); + ub(4, frame0_grid_position_y); + ub(4, frame1_grid_position_x); + ub(4, frame1_grid_position_y); + } + fixed(8, frame_packing_arrangement_reserved_byte, 0); + ue(frame_packing_arrangement_repetition_period, 0, 16384); + } + flag(frame_packing_arrangement_extension_flag); + + return 0; +} + SEI_FUNC(sei_display_orientation, (CodedBitstreamContext *ctx, RWContext *rw, H264RawSEIDisplayOrientation *current, SEIMessageState *sei)) diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h266.h b/src/ExtLib/ffmpeg/libavcodec/cbs_h266.h index 21b9a4196c..d24a8e9313 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h266.h +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h266.h @@ -464,9 +464,9 @@ typedef struct H266RawSPS { uint8_t sps_virtual_boundaries_enabled_flag; uint8_t sps_virtual_boundaries_present_flag; uint8_t sps_num_ver_virtual_boundaries; - uint16_t sps_virtual_boundary_pos_x_minus1[3]; + uint16_t sps_virtual_boundary_pos_x_minus1[VVC_MAX_VBS]; uint8_t sps_num_hor_virtual_boundaries; - uint16_t sps_virtual_boundary_pos_y_minus1[3]; + uint16_t sps_virtual_boundary_pos_y_minus1[VVC_MAX_VBS]; uint8_t sps_timing_hrd_params_present_flag; uint8_t sps_sublayer_cpb_params_present_flag; @@ -703,9 +703,9 @@ typedef struct H266RawPictureHeader { uint8_t ph_virtual_boundaries_present_flag; uint8_t ph_num_ver_virtual_boundaries; - uint16_t ph_virtual_boundary_pos_x_minus1[3]; + uint16_t ph_virtual_boundary_pos_x_minus1[VVC_MAX_VBS]; uint8_t ph_num_hor_virtual_boundaries; - uint16_t ph_virtual_boundary_pos_y_minus1[3]; + uint16_t ph_virtual_boundary_pos_y_minus1[VVC_MAX_VBS]; uint8_t ph_pic_output_flag; H266RefPicLists ph_ref_pic_lists; @@ -848,16 +848,6 @@ typedef struct H266RawSlice { int data_bit_start; } H266RawSlice; -typedef struct H266RawSEIDecodedPictureHash { - uint8_t dph_sei_hash_type; - uint8_t dph_sei_single_component_flag; - uint8_t dph_sei_picture_md5[3][16]; - uint16_t dph_sei_picture_crc[3]; - uint32_t dph_sei_picture_checksum[3]; - - uint8_t dph_sei_reserved_zero_7bits; -} H266RawSEIDecodedPictureHash; - typedef struct H266RawSEI { H266RawNALUnitHeader nal_unit_header; SEIRawMessageList message_list; diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c index 53c4b60b0d..9c37996947 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h266_syntax_template.c @@ -1562,13 +1562,13 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, flag(sps_virtual_boundaries_present_flag); if (current->sps_virtual_boundaries_present_flag) { ue(sps_num_ver_virtual_boundaries, - 0, current->sps_pic_width_max_in_luma_samples <= 8 ? 0 : 3); + 0, current->sps_pic_width_max_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS); for (i = 0; i < current->sps_num_ver_virtual_boundaries; i++) ues(sps_virtual_boundary_pos_x_minus1[i], 0, (current->sps_pic_width_max_in_luma_samples + 7) / 8 - 2, 1, i); ue(sps_num_hor_virtual_boundaries, - 0, current->sps_pic_height_max_in_luma_samples <= 8 ? 0 : 3); + 0, current->sps_pic_height_max_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS); for (i = 0; i < current->sps_num_hor_virtual_boundaries; i++) ues(sps_virtual_boundary_pos_y_minus1[i], 0, (current->sps_pic_height_max_in_luma_samples + 7) / @@ -2714,13 +2714,13 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, flag(ph_virtual_boundaries_present_flag); if (current->ph_virtual_boundaries_present_flag) { ue(ph_num_ver_virtual_boundaries, - 0, pps->pps_pic_width_in_luma_samples <= 8 ? 0 : 3); + 0, pps->pps_pic_width_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS); for (i = 0; i < current->ph_num_ver_virtual_boundaries; i++) { ues(ph_virtual_boundary_pos_x_minus1[i], 0, (pps->pps_pic_width_in_luma_samples + 7) / 8 - 2, 1, i); } ue(ph_num_hor_virtual_boundaries, - 0, pps->pps_pic_height_in_luma_samples <= 8 ? 0 : 3); + 0, pps->pps_pic_height_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS); for (i = 0; i < current->ph_num_hor_virtual_boundaries; i++) { ues(ph_virtual_boundary_pos_y_minus1[i], 0, (pps->pps_pic_height_in_luma_samples + 7) / 8 - 2, 1, i); @@ -3442,34 +3442,6 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, return 0; } -SEI_FUNC(sei_decoded_picture_hash, (CodedBitstreamContext *ctx, - RWContext *rw, - H266RawSEIDecodedPictureHash *current, - SEIMessageState *unused)) -{ - int err, c_idx, i; - - HEADER("Decoded Picture Hash"); - - u(8, dph_sei_hash_type, 0, 2); - flag(dph_sei_single_component_flag); - ub(7, dph_sei_reserved_zero_7bits); - - for (c_idx = 0; c_idx < (current->dph_sei_single_component_flag ? 1 : 3); - c_idx++) { - if (current->dph_sei_hash_type == 0) { - for (i = 0; i < 16; i++) - us(8, dph_sei_picture_md5[c_idx][i], 0x00, 0xff, 2, c_idx, i); - } else if (current->dph_sei_hash_type == 1) { - us(16, dph_sei_picture_crc[c_idx], 0x0000, 0xffff, 1, c_idx); - } else if (current->dph_sei_hash_type == 2) { - us(32, dph_sei_picture_checksum[c_idx], 0x00000000, 0xffffffff, 1, - c_idx); - } - } - return 0; -} - static int FUNC(sei) (CodedBitstreamContext *ctx, RWContext *rw, H266RawSEI *current, int prefix) { diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_sei.h b/src/ExtLib/ffmpeg/libavcodec/cbs_sei.h index ec7cdb62f0..15ef3415ab 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_sei.h +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_sei.h @@ -43,6 +43,36 @@ typedef struct SEIRawUserDataUnregistered { size_t data_length; } SEIRawUserDataUnregistered; +typedef struct SEIRawFramePackingArrangement { + uint32_t fp_arrangement_id; + uint8_t fp_arrangement_cancel_flag; + uint8_t fp_arrangement_type; + uint8_t fp_quincunx_sampling_flag; + uint8_t fp_content_interpretation_type; + uint8_t fp_spatial_flipping_flag; + uint8_t fp_frame0_flipped_flag; + uint8_t fp_field_views_flag; + uint8_t fp_current_frame_is_frame0_flag; + uint8_t fp_frame0_self_contained_flag; + uint8_t fp_frame1_self_contained_flag; + uint8_t fp_frame0_grid_position_x; + uint8_t fp_frame0_grid_position_y; + uint8_t fp_frame1_grid_position_x; + uint8_t fp_frame1_grid_position_y; + uint8_t fp_arrangement_persistence_flag; + uint8_t fp_upsampled_aspect_ratio_flag; +} SEIRawFramePackingArrangement; + +typedef struct SEIRawDecodedPictureHash { + uint8_t dph_sei_hash_type; + uint8_t dph_sei_single_component_flag; + uint8_t dph_sei_picture_md5[3][16]; + uint16_t dph_sei_picture_crc[3]; + uint32_t dph_sei_picture_checksum[3]; + + uint8_t dph_sei_reserved_zero_7bits; +} SEIRawDecodedPictureHash; + typedef struct SEIRawMasteringDisplayColourVolume { uint16_t display_primaries_x[3]; uint16_t display_primaries_y[3]; diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_sei_syntax_template.c b/src/ExtLib/ffmpeg/libavcodec/cbs_sei_syntax_template.c index 81448ef3f2..0205bb47aa 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_sei_syntax_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_sei_syntax_template.c @@ -94,6 +94,68 @@ SEI_FUNC(user_data_unregistered, (CodedBitstreamContext *ctx, RWContext *rw, return 0; } +SEI_FUNC(frame_packing_arrangement, (CodedBitstreamContext *ctx, RWContext *rw, + SEIRawFramePackingArrangement *current, + SEIMessageState *unused)) +{ + int err; + + HEADER("Frame Packing Arrangement"); + + ue(fp_arrangement_id, 0, MAX_UINT_BITS(31)); + flag(fp_arrangement_cancel_flag); + if (!current->fp_arrangement_cancel_flag) { + u(7, fp_arrangement_type, 3, 5); + flag(fp_quincunx_sampling_flag); + u(6, fp_content_interpretation_type, 0, 2); + flag(fp_spatial_flipping_flag); + flag(fp_frame0_flipped_flag); + flag(fp_field_views_flag); + flag(fp_current_frame_is_frame0_flag); + flag(fp_frame0_self_contained_flag); + flag(fp_frame1_self_contained_flag); + if (!current->fp_quincunx_sampling_flag && current->fp_arrangement_type != 5) { + ub(4, fp_frame0_grid_position_x); + ub(4, fp_frame0_grid_position_y); + ub(4, fp_frame1_grid_position_x); + ub(4, fp_frame1_grid_position_y); + } + fixed(8, fp_arrangement_reserved_byte, 0); + flag(fp_arrangement_persistence_flag); + } + flag(fp_upsampled_aspect_ratio_flag); + + return 0; +} + +SEI_FUNC(decoded_picture_hash, (CodedBitstreamContext *ctx, + RWContext *rw, + SEIRawDecodedPictureHash *current, + SEIMessageState *unused)) +{ + int err, c_idx, i; + + HEADER("Decoded Picture Hash"); + + u(8, dph_sei_hash_type, 0, 2); + flag(dph_sei_single_component_flag); + ub(7, dph_sei_reserved_zero_7bits); + + for (c_idx = 0; c_idx < (current->dph_sei_single_component_flag ? 1 : 3); + c_idx++) { + if (current->dph_sei_hash_type == 0) { + for (i = 0; i < 16; i++) + us(8, dph_sei_picture_md5[c_idx][i], 0x00, 0xff, 2, c_idx, i); + } else if (current->dph_sei_hash_type == 1) { + us(16, dph_sei_picture_crc[c_idx], 0x0000, 0xffff, 1, c_idx); + } else if (current->dph_sei_hash_type == 2) { + us(32, dph_sei_picture_checksum[c_idx], 0x00000000, 0xffffffff, 1, + c_idx); + } + } + return 0; +} + SEI_FUNC(mastering_display_colour_volume, (CodedBitstreamContext *ctx, RWContext *rw, SEIRawMasteringDisplayColourVolume *current, diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c index 8cafdcf5e6..c025800206 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c @@ -420,7 +420,7 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, if ((hdr->rpu_format & 0x700) == 0) { int bl_bit_depth_minus8 = get_ue_golomb_31(gb); - int el_bit_depth_minus8 = get_ue_golomb_31(gb); + int el_bit_depth_minus8 = get_ue_golomb_long(gb); int vdr_bit_depth_minus8 = get_ue_golomb_31(gb); int reserved_zero_3bits; /* ext_mapping_idc is in the upper 8 bits of el_bit_depth_minus8 */ diff --git a/src/ExtLib/ffmpeg/libavcodec/mjpegdec.c b/src/ExtLib/ffmpeg/libavcodec/mjpegdec.c index 1481a7f285..7daec649bc 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mjpegdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mjpegdec.c @@ -843,9 +843,8 @@ static int decode_block(MJpegDecodeContext *s, int16_t *block, int component, return AVERROR_INVALIDDATA; } val = val * (unsigned)quant_matrix[0] + s->last_dc[component]; - val = av_clip_int16(val); s->last_dc[component] = val; - block[0] = val; + block[0] = av_clip_int16(val); /* AC coefs */ i = 0; {OPEN_READER(re, &s->gb); diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c index 33383a5913..74946aeaab 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c @@ -73,7 +73,7 @@ typedef struct Mpeg1Context { MpegEncContext mpeg_enc_ctx; int repeat_field; /* true if we must repeat the field */ AVPanScan pan_scan; /* some temporary storage for the panscan */ - AVStereo3D stereo3d; + enum AVStereo3DType stereo3d_type; int has_stereo3d; AVBufferRef *a53_buf_ref; enum Mpeg2ClosedCaptionsFormat cc_format; @@ -1349,7 +1349,7 @@ static int mpeg_field_start(Mpeg1Context *s1, const uint8_t *buf, int buf_size) if (!stereo) return AVERROR(ENOMEM); - *stereo = s1->stereo3d; + stereo->type = s1->stereo3d_type; s1->has_stereo3d = 0; } @@ -2148,16 +2148,16 @@ static void mpeg_decode_user_data(AVCodecContext *avctx, switch (S3D_video_format_type) { case 0x03: - s1->stereo3d.type = AV_STEREO3D_SIDEBYSIDE; + s1->stereo3d_type = AV_STEREO3D_SIDEBYSIDE; break; case 0x04: - s1->stereo3d.type = AV_STEREO3D_TOPBOTTOM; + s1->stereo3d_type = AV_STEREO3D_TOPBOTTOM; break; case 0x08: - s1->stereo3d.type = AV_STEREO3D_2D; + s1->stereo3d_type = AV_STEREO3D_2D; break; case 0x23: - s1->stereo3d.type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX; + s1->stereo3d_type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX; break; } } diff --git a/src/ExtLib/ffmpeg/libavcodec/sbr.h b/src/ExtLib/ffmpeg/libavcodec/sbr.h index bc9ffab127..2bee1dce41 100644 --- a/src/ExtLib/ffmpeg/libavcodec/sbr.h +++ b/src/ExtLib/ffmpeg/libavcodec/sbr.h @@ -68,9 +68,9 @@ typedef struct SBRData { unsigned bs_frame_class; unsigned bs_add_harmonic_flag; AAC_SIGNE bs_num_env; - uint8_t bs_freq_res[7]; + uint8_t bs_freq_res[9]; AAC_SIGNE bs_num_noise; - uint8_t bs_df_env[5]; + uint8_t bs_df_env[9]; uint8_t bs_df_noise[2]; uint8_t bs_invf_mode[2][5]; uint8_t bs_add_harmonic[48]; @@ -95,21 +95,24 @@ typedef struct SBRData { DECLARE_ALIGNED(16, INTFLOAT, Y)[2][38][64][2]; DECLARE_ALIGNED(16, AAC_FLOAT, g_temp)[42][48]; AAC_FLOAT q_temp[42][48]; - uint8_t s_indexmapped[8][48]; + uint8_t s_indexmapped[9][48]; ///Envelope scalefactors - uint8_t env_facs_q[6][48]; - AAC_FLOAT env_facs[6][48]; + uint8_t env_facs_q[9][48]; + AAC_FLOAT env_facs[9][48]; ///Noise scalefactors uint8_t noise_facs_q[3][5]; AAC_FLOAT noise_facs[3][5]; ///Envelope time borders - uint8_t t_env[8]; + uint8_t t_env[9]; ///Envelope time border of the last envelope of the previous frame uint8_t t_env_num_env_old; ///Noise time borders uint8_t t_q[3]; unsigned f_indexnoise; unsigned f_indexsine; + //inter_tes (USAC) + uint8_t temp_shape[6]; + uint8_t temp_shape_mode[6]; /** @} */ } SBRData; @@ -142,9 +145,12 @@ struct SpectralBandReplication { int start; int ready_for_dequant; int id_aac; + int usac; + int inter_tes; // USAC-only int reset; SpectrumParameters spectrum_params; int bs_amp_res_header; + int bs_sbr_preprocessing; // USAC-only /** * @name Variables associated with bs_header_extra_2 * @{ @@ -196,18 +202,18 @@ struct SpectralBandReplication { ///First coefficient used to filter the subband signals DECLARE_ALIGNED(16, INTFLOAT, alpha1)[64][2]; ///Dequantized envelope scalefactors, remapped - AAC_FLOAT e_origmapped[7][48]; + AAC_FLOAT e_origmapped[8][48]; ///Dequantized noise scalefactors, remapped - AAC_FLOAT q_mapped[7][48]; + AAC_FLOAT q_mapped[8][48]; ///Sinusoidal presence, remapped - uint8_t s_mapped[7][48]; + uint8_t s_mapped[8][48]; ///Estimated envelope - AAC_FLOAT e_curr[7][48]; + AAC_FLOAT e_curr[8][48]; ///Amplitude adjusted noise scalefactors - AAC_FLOAT q_m[7][48]; + AAC_FLOAT q_m[8][48]; ///Sinusoidal levels - AAC_FLOAT s_m[7][48]; - AAC_FLOAT gain[7][48]; + AAC_FLOAT s_m[8][48]; + AAC_FLOAT gain[8][48]; DECLARE_ALIGNED(32, INTFLOAT, qmf_filter_scratch)[5][64]; AVTXContext *mdct_ana; av_tx_fn mdct_ana_fn; diff --git a/src/ExtLib/ffmpeg/libavcodec/version.h b/src/ExtLib/ffmpeg/libavcodec/version.h index 37c4c39451..230d5fa13e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/version.h +++ b/src/ExtLib/ffmpeg/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 8 +#define LIBAVCODEC_VERSION_MINOR 9 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc.h b/src/ExtLib/ffmpeg/libavcodec/vvc.h index c4cec1eb8f..92639779c1 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc.h +++ b/src/ExtLib/ffmpeg/libavcodec/vvc.h @@ -151,6 +151,9 @@ enum { // get near that, though, so set a lower limit here with the maximum // possible value for 8K video (at most 135 32x32 Ctb rows). VVC_MAX_ENTRY_POINTS = VVC_MAX_TILE_COLUMNS * 135, + + // {sps, ph}_num_{ver, hor}_virtual_boundaries should in [0, 3] + VVC_MAX_VBS = 3, }; #endif /* AVCODEC_VVC_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c index ce79f14288..bd0be2d821 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c @@ -1444,20 +1444,25 @@ static void merge_data_block(VVCLocalContext *lc) } } -static void merge_data_ibc(VVCLocalContext *lc) +static int merge_data_ibc(VVCLocalContext *lc) { const VVCFrameContext* fc = lc->fc; const VVCSPS* sps = fc->ps.sps; MotionInfo *mi = &lc->cu->pu.mi; int merge_idx = 0; + int ret; mi->pred_flag = PF_IBC; if (sps->max_num_ibc_merge_cand > 1) merge_idx = ff_vvc_merge_idx(lc); - ff_vvc_luma_mv_merge_ibc(lc, merge_idx, &mi->mv[L0][0]); + ret = ff_vvc_luma_mv_merge_ibc(lc, merge_idx, &mi->mv[L0][0]); + if (ret) + return ret; ff_vvc_store_mv(lc, mi); + + return 0; } static int hls_merge_data(VVCLocalContext *lc) @@ -1466,11 +1471,14 @@ static int hls_merge_data(VVCLocalContext *lc) const VVCPH *ph = &fc->ps.ph; const CodingUnit *cu = lc->cu; PredictionUnit *pu = &lc->cu->pu; + int ret; pu->merge_gpm_flag = 0; pu->mi.num_sb_x = pu->mi.num_sb_y = 1; if (cu->pred_mode == MODE_IBC) { - merge_data_ibc(lc); + ret = merge_data_ibc(lc); + if (ret) + return ret; } else { if (ph->max_num_subblock_merge_cand > 0 && cu->cb_width >= 8 && cu->cb_height >= 8) pu->merge_subblock_flag = ff_vvc_merge_subblock_flag(lc); @@ -1596,6 +1604,7 @@ static int mvp_data_ibc(VVCLocalContext *lc) int mvp_l0_flag = 0; int amvr_shift = 4; Mv *mv = &mi->mv[L0][0]; + int ret; mi->pred_flag = PF_IBC; mi->num_sb_x = 1; @@ -1607,7 +1616,9 @@ static int mvp_data_ibc(VVCLocalContext *lc) if (sps->r->sps_amvr_enabled_flag && (mv->x || mv->y)) amvr_shift = ff_vvc_amvr_shift(lc, pu->inter_affine_flag, cu->pred_mode, 1); - ff_vvc_mvp_ibc(lc, mvp_l0_flag, amvr_shift, mv); + ret = ff_vvc_mvp_ibc(lc, mvp_l0_flag, amvr_shift, mv); + if (ret) + return ret; ff_vvc_store_mv(lc, mi); return 0; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.h b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.h index a987328d81..d5c3e8d96f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.h +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.h @@ -461,10 +461,15 @@ typedef struct ALFParams { uint8_t ctb_filt_set_idx_y; ///< AlfCtbFiltSetIdxY uint8_t alf_ctb_filter_alt_idx[2]; ///< alf_ctb_filter_alt_idx[] uint8_t ctb_cc_idc[2]; ///< alf_ctb_cc_cb_idc, alf_ctb_cc_cr_idc - - uint8_t applied[3]; } ALFParams; +typedef struct VVCRect { + int l; // left + int t; // top + int r; // right + int b; // bottom +} VVCRect; + /** * parse a CTU * @param lc local context for CTU diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c b/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c index 9a50ce2222..c9f25696b4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c @@ -191,14 +191,12 @@ static void bs_tl_init(TabList *l, VVCFrameContext *fc) tl_init(l, 1, changed); - for (int i = 0; i < VVC_MAX_SAMPLE_ARRAYS; i++) { - TL_ADD(horizontal_bs[i], bs_count); - TL_ADD(vertical_bs[i], bs_count); + for (int i = 0; i < 2; i++) { + for (int j = 0; j < VVC_MAX_SAMPLE_ARRAYS; j++) + TL_ADD(bs[i][j], bs_count); + TL_ADD(max_len_p[i], bs_count); + TL_ADD(max_len_q[i], bs_count); } - TL_ADD(horizontal_q, bs_count); - TL_ADD(horizontal_p, bs_count); - TL_ADD(vertical_p, bs_count); - TL_ADD(vertical_q, bs_count); } static void pixel_buffer_nz_tl_init(TabList *l, VVCFrameContext *fc) @@ -1028,7 +1026,7 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx) static AVOnce init_static_once = AV_ONCE_INIT; const int cpu_count = av_cpu_count(); const int delayed = FFMIN(cpu_count, VVC_MAX_DELAYED_FRAMES); - const int thread_count = avctx->thread_count ? avctx->thread_count : delayed; + int thread_count = avctx->thread_count ? avctx->thread_count : delayed; int ret; s->avctx = avctx; @@ -1055,6 +1053,8 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx) return ret; } + if (thread_count == 1) + thread_count = 0; s->executor = ff_vvc_executor_alloc(s, thread_count); if (!s->executor) return AVERROR(ENOMEM); diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/dec.h b/src/ExtLib/ffmpeg/libavcodec/vvc/dec.h index 1e0b76f283..a8492f1398 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/dec.h +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/dec.h @@ -178,12 +178,9 @@ typedef struct VVCFrameContext { uint8_t *tb_height[2]; uint8_t *pcmf[2]; - uint8_t *horizontal_bs[VVC_MAX_SAMPLE_ARRAYS]; - uint8_t *vertical_bs[VVC_MAX_SAMPLE_ARRAYS]; - uint8_t *horizontal_p; ///< horizontal maxFilterLengthPs for luma - uint8_t *horizontal_q; ///< horizontal maxFilterLengthQs for luma - uint8_t *vertical_p; ///< vertical maxFilterLengthPs for luma - uint8_t *vertical_q; ///< vertical maxFilterLengthQs for luma + uint8_t *bs[2][VVC_MAX_SAMPLE_ARRAYS]; ///< horizontal, vertical boundary filtering strength + uint8_t *max_len_p[2]; ///< horizontal, vertical maxFilterLengthPs for luma + uint8_t *max_len_q[2]; ///< horizontal, vertical maxFilterLengthQs for luma uint8_t *sao_pixel_buffer_h[VVC_MAX_SAMPLE_ARRAYS]; uint8_t *sao_pixel_buffer_v[VVC_MAX_SAMPLE_ARRAYS]; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/filter.c b/src/ExtLib/ffmpeg/libavcodec/vvc/filter.c index 7844d34eac..7ffcb29f47 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/filter.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/filter.c @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/frame.h" +#include "libavutil/imgutils.h" #include "ctu.h" #include "data.h" @@ -34,6 +35,10 @@ #define DEFAULT_INTRA_TC_OFFSET 2 +#define POS(c_idx, x, y) \ + &fc->frame->data[c_idx][((y) >> fc->ps.sps->vshift[c_idx]) * fc->frame->linesize[c_idx] + \ + (((x) >> fc->ps.sps->hshift[c_idx]) << fc->ps.sps->pixel_shift)] + //Table 43 Derivation of threshold variables beta' and tc' from input Q static const uint16_t tctable[66] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -51,6 +56,32 @@ static const uint8_t betatable[64] = { 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, }; +// One vertical and one horizontal virtual boundary in a CTU at most. The CTU will be divided into 4 subblocks. +#define MAX_VBBS 4 + +static int get_virtual_boundary(const VVCFrameContext *fc, const int ctu_pos, const int vertical) +{ + const VVCSPS *sps = fc->ps.sps; + const VVCPH *ph = &fc->ps.ph; + const uint16_t *vbs = vertical ? ph->vb_pos_x : ph->vb_pos_y; + const uint8_t nb_vbs = vertical ? ph->num_ver_vbs : ph->num_hor_vbs; + const int pos = ctu_pos << sps->ctb_log2_size_y; + + if (sps->r->sps_virtual_boundaries_enabled_flag) { + for (int i = 0; i < nb_vbs; i++) { + const int o = vbs[i] - pos; + if (o >= 0 && o < sps->ctb_size_y) + return vbs[i]; + } + } + return 0; +} + +static int is_virtual_boundary(const VVCFrameContext *fc, const int pos, const int vertical) +{ + return get_virtual_boundary(fc, pos >> fc->ps.sps->ctb_log2_size_y, vertical) == pos; +} + static int get_qPc(const VVCFrameContext *fc, const int x0, const int y0, const int chroma) { const int x = x0 >> MIN_TU_LOG2; @@ -135,7 +166,7 @@ static void sao_copy_ctb_to_hv(VVCLocalContext *lc, const int rx, const int ry, const int ctb_size_v = ctb_size_y >> fc->ps.sps->vshift[c_idx]; const int width = FFMIN(ctb_size_h, (fc->ps.pps->width >> fc->ps.sps->hshift[c_idx]) - x); const int height = FFMIN(ctb_size_v, (fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]) - y); - const uint8_t *src = &fc->frame->data[c_idx][y * src_stride + (x << fc->ps.sps->pixel_shift)]; + const uint8_t *src = POS(c_idx, x0, y0); copy_ctb_to_hv(fc, src, src_stride, x, y, width, height, c_idx, rx, ry, top); } } @@ -151,154 +182,192 @@ void ff_vvc_sao_copy_ctb_to_hv(VVCLocalContext *lc, const int rx, const int ry, sao_copy_ctb_to_hv(lc, rx, ry, 0); } -void ff_vvc_sao_filter(VVCLocalContext *lc, int x, int y) +static int sao_can_cross_slices(const VVCFrameContext *fc, const int rx, const int ry, const int dx, const int dy) +{ + const uint8_t lfase = fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag; + + return lfase || CTB(fc->tab.slice_idx, rx, ry) == CTB(fc->tab.slice_idx, rx + dx, ry + dy); +} + +static void sao_get_edges(uint8_t vert_edge[2], uint8_t horiz_edge[2], uint8_t diag_edge[4], int *restore, + const VVCLocalContext *lc, const int edges[4], const int rx, const int ry) +{ + const VVCFrameContext *fc = lc->fc; + const VVCSPS *sps = fc->ps.sps; + const H266RawSPS *rsps = sps->r; + const VVCPPS *pps = fc->ps.pps; + const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; + const uint8_t lfase = fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag; + const uint8_t no_tile_filter = pps->r->num_tiles_in_pic > 1 && !pps->r->pps_loop_filter_across_tiles_enabled_flag; + const uint8_t no_subpic_filter = rsps->sps_num_subpics_minus1 && !rsps->sps_loop_filter_across_subpic_enabled_flag[subpic_idx]; + uint8_t lf_edge[] = { 0, 0, 0, 0 }; + + *restore = no_subpic_filter || no_tile_filter || !lfase || rsps->sps_virtual_boundaries_enabled_flag; + + if (!*restore) + return; + + if (!edges[LEFT]) { + lf_edge[LEFT] = no_tile_filter && pps->ctb_to_col_bd[rx] == rx; + lf_edge[LEFT] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_x[subpic_idx] == rx; + lf_edge[LEFT] |= is_virtual_boundary(fc, rx << sps->ctb_log2_size_y, 1); + vert_edge[0] = !sao_can_cross_slices(fc, rx, ry, -1, 0) || lf_edge[LEFT]; + } + if (!edges[RIGHT]) { + lf_edge[RIGHT] = no_tile_filter && pps->ctb_to_col_bd[rx] != pps->ctb_to_col_bd[rx + 1]; + lf_edge[RIGHT] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_x[subpic_idx] + rsps->sps_subpic_width_minus1[subpic_idx] == rx; + lf_edge[RIGHT] |= is_virtual_boundary(fc, (rx + 1) << sps->ctb_log2_size_y, 1); + vert_edge[1] = !sao_can_cross_slices(fc, rx, ry, 1, 0) || lf_edge[RIGHT]; + } + if (!edges[TOP]) { + lf_edge[TOP] = no_tile_filter && pps->ctb_to_row_bd[ry] == ry; + lf_edge[TOP] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_y[subpic_idx] == ry; + lf_edge[TOP] |= is_virtual_boundary(fc, ry << sps->ctb_log2_size_y, 0); + horiz_edge[0] = !sao_can_cross_slices(fc, rx, ry, 0, -1) || lf_edge[TOP]; + } + if (!edges[BOTTOM]) { + lf_edge[BOTTOM] = no_tile_filter && pps->ctb_to_row_bd[ry] != pps->ctb_to_row_bd[ry + 1]; + lf_edge[BOTTOM] |= no_subpic_filter && rsps->sps_subpic_ctu_top_left_y[subpic_idx] + rsps->sps_subpic_height_minus1[subpic_idx] == ry; + lf_edge[BOTTOM] |= is_virtual_boundary(fc, (ry + 1) << sps->ctb_log2_size_y, 0); + horiz_edge[1] = !sao_can_cross_slices(fc, rx, ry, 0, 1) || lf_edge[BOTTOM]; + } + + if (!edges[LEFT] && !edges[TOP]) + diag_edge[0] = !sao_can_cross_slices(fc, rx, ry, -1, -1) || lf_edge[LEFT] || lf_edge[TOP]; + + if (!edges[TOP] && !edges[RIGHT]) + diag_edge[1] = !sao_can_cross_slices(fc, rx, ry, 1, -1) || lf_edge[RIGHT] || lf_edge[TOP]; + + if (!edges[RIGHT] && !edges[BOTTOM]) + diag_edge[2] = !sao_can_cross_slices(fc, rx, ry, 1, 1) || lf_edge[RIGHT] || lf_edge[BOTTOM]; + + if (!edges[LEFT] && !edges[BOTTOM]) + diag_edge[3] = !sao_can_cross_slices(fc, rx, ry, -1, 1) || lf_edge[LEFT] || lf_edge[BOTTOM]; +} + +static void sao_copy_hor(uint8_t *dst, const ptrdiff_t dst_stride, + const uint8_t *src, const ptrdiff_t src_stride, const int width, const int edges[4], const int ps) +{ + const int left = 1 - edges[LEFT]; + const int right = 1 - edges[RIGHT]; + int pos = 0; + + src -= left << ps; + dst -= left << ps; + + if (left) { + copy_pixel(dst, src, ps); + pos += (1 << ps); + } + memcpy(dst + pos, src + pos, width << ps); + if (right) { + pos += width << ps; + copy_pixel(dst + pos, src + pos, ps); + } +} + +static void sao_extends_edges(uint8_t *dst, const ptrdiff_t dst_stride, + const uint8_t *src, const ptrdiff_t src_stride, const int width, const int height, + const VVCFrameContext *fc, const int x0, const int y0, const int rx, const int ry, const int edges[4], const int c_idx) +{ + const uint8_t *sao_h = fc->tab.sao_pixel_buffer_h[c_idx]; + const uint8_t *sao_v = fc->tab.sao_pixel_buffer_v[c_idx]; + const int x = x0 >> fc->ps.sps->hshift[c_idx]; + const int y = y0 >> fc->ps.sps->vshift[c_idx]; + const int w = fc->ps.pps->width >> fc->ps.sps->hshift[c_idx]; + const int h = fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]; + const int ps = fc->ps.sps->pixel_shift; + + if (!edges[TOP]) + sao_copy_hor(dst - dst_stride, dst_stride, sao_h + (((2 * ry - 1) * w + x) << ps), src_stride, width, edges, ps); + + if (!edges[BOTTOM]) + sao_copy_hor(dst + height * dst_stride, dst_stride, sao_h + (((2 * ry + 2) * w + x) << ps), src_stride, width, edges, ps); + + if (!edges[LEFT]) + copy_vert(dst - (1 << ps), sao_v + (((2 * rx - 1) * h + y) << ps), ps, height, dst_stride, 1 << ps); + + if (!edges[RIGHT]) + copy_vert(dst + (width << ps), sao_v + (((2 * rx + 2) * h + y) << ps), ps, height, dst_stride, 1 << ps); + + copy_ctb(dst, src, width << ps, height, dst_stride, src_stride); +} + +static void sao_restore_vb(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, + const int width, const int height, const int vb_pos, const int ps, const int vertical) +{ + int w = 2; + int h = (vertical ? height : width); + int dx = vb_pos - 1; + int dy = 0; + + if (!vertical) { + FFSWAP(int, w, h); + FFSWAP(int, dx, dy); + } + dst += dy * dst_stride +(dx << ps); + src += dy * src_stride +(dx << ps); + + av_image_copy_plane(dst, dst_stride, src, src_stride, w << ps, h); +} + +void ff_vvc_sao_filter(VVCLocalContext *lc, int x0, int y0) { VVCFrameContext *fc = lc->fc; - const int ctb_size_y = fc->ps.sps->ctb_size_y; - static const uint8_t sao_tab[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 }; - int c_idx; - const int rx = x >> fc->ps.sps->ctb_log2_size_y; - const int ry = y >> fc->ps.sps->ctb_log2_size_y; - int edges[4] = { !rx, !ry, rx == fc->ps.pps->ctb_width - 1, ry == fc->ps.pps->ctb_height - 1 }; + const VVCSPS *sps = fc->ps.sps; + const int rx = x0 >> sps->ctb_log2_size_y; + const int ry = y0 >> sps->ctb_log2_size_y; + const int edges[4] = { !rx, !ry, rx == fc->ps.pps->ctb_width - 1, ry == fc->ps.pps->ctb_height - 1 }; const SAOParams *sao = &CTB(fc->tab.sao, rx, ry); // flags indicating unfilterable edges - uint8_t vert_edge[] = { 0, 0 }; - uint8_t horiz_edge[] = { 0, 0 }; - uint8_t diag_edge[] = { 0, 0, 0, 0 }; - uint8_t tile_edge[] = { 0, 0, 0, 0 }; - uint8_t subpic_edge[] = { 0, 0, 0, 0 }; - const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; - const uint8_t lfase = fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag; - const uint8_t no_tile_filter = fc->ps.pps->r->num_tiles_in_pic > 1 && - !fc->ps.pps->r->pps_loop_filter_across_tiles_enabled_flag; - const uint8_t no_subpic_filter = fc->ps.sps->r->sps_num_subpics_minus1 && - !fc->ps.sps->r->sps_loop_filter_across_subpic_enabled_flag[subpic_idx]; - const uint8_t restore = no_subpic_filter || no_tile_filter || !lfase; - - if (restore) { - if (!edges[LEFT]) { - tile_edge[LEFT] = no_tile_filter && fc->ps.pps->ctb_to_col_bd[rx] == rx; - subpic_edge[LEFT] = no_subpic_filter && fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] == rx; - vert_edge[0] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx - 1, ry)) || tile_edge[LEFT] || subpic_edge[LEFT]; - } - if (!edges[RIGHT]) { - tile_edge[RIGHT] = no_tile_filter && fc->ps.pps->ctb_to_col_bd[rx] != fc->ps.pps->ctb_to_col_bd[rx + 1]; - subpic_edge[RIGHT] = no_subpic_filter && - fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx; - vert_edge[1] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry)) || tile_edge[RIGHT] || subpic_edge[RIGHT]; - } - if (!edges[TOP]) { - tile_edge[TOP] = no_tile_filter && fc->ps.pps->ctb_to_row_bd[ry] == ry; - subpic_edge[TOP] = no_subpic_filter && fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] == ry; - horiz_edge[0] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry - 1)) || tile_edge[TOP] || subpic_edge[TOP]; - } - if (!edges[BOTTOM]) { - tile_edge[BOTTOM] = no_tile_filter && fc->ps.pps->ctb_to_row_bd[ry] != fc->ps.pps->ctb_to_row_bd[ry + 1]; - subpic_edge[BOTTOM] = no_subpic_filter && - fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry; - horiz_edge[1] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1)) || tile_edge[BOTTOM] || subpic_edge[BOTTOM]; - } - if (!edges[LEFT] && !edges[TOP]) { - diag_edge[0] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx - 1, ry - 1)) || - tile_edge[LEFT] || tile_edge[TOP] || subpic_edge[LEFT] || subpic_edge[TOP]; - } - if (!edges[TOP] && !edges[RIGHT]) { - diag_edge[1] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry - 1)) || - tile_edge[RIGHT] || tile_edge[TOP] || subpic_edge[TOP] || subpic_edge[RIGHT]; - } - if (!edges[RIGHT] && !edges[BOTTOM]) { - diag_edge[2] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry + 1)) || - tile_edge[RIGHT] || tile_edge[BOTTOM] || subpic_edge[RIGHT] || subpic_edge[BOTTOM]; - } - if (!edges[LEFT] && !edges[BOTTOM]) { - diag_edge[3] = (!lfase && CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx - 1, ry + 1)) || - tile_edge[LEFT] || tile_edge[BOTTOM] || subpic_edge[LEFT] || subpic_edge[BOTTOM]; - } + uint8_t vert_edge[] = { 0, 0 }; + uint8_t horiz_edge[] = { 0, 0 }; + uint8_t diag_edge[] = { 0, 0, 0, 0 }; + int restore, vb_x = 0, vb_y = 0;; + + if (sps->r->sps_virtual_boundaries_enabled_flag) { + vb_x = get_virtual_boundary(fc, rx, 1); + vb_y = get_virtual_boundary(fc, ry, 0); } - for (c_idx = 0; c_idx < (fc->ps.sps->r->sps_chroma_format_idc ? 3 : 1); c_idx++) { - int x0 = x >> fc->ps.sps->hshift[c_idx]; - int y0 = y >> fc->ps.sps->vshift[c_idx]; - ptrdiff_t src_stride = fc->frame->linesize[c_idx]; - int ctb_size_h = ctb_size_y >> fc->ps.sps->hshift[c_idx]; - int ctb_size_v = ctb_size_y >> fc->ps.sps->vshift[c_idx]; - int width = FFMIN(ctb_size_h, (fc->ps.pps->width >> fc->ps.sps->hshift[c_idx]) - x0); - int height = FFMIN(ctb_size_v, (fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]) - y0); - int tab = sao_tab[(FFALIGN(width, 8) >> 3) - 1]; - uint8_t *src = &fc->frame->data[c_idx][y0 * src_stride + (x0 << fc->ps.sps->pixel_shift)]; - ptrdiff_t dst_stride; - uint8_t *dst; + sao_get_edges(vert_edge, horiz_edge, diag_edge, &restore, lc, edges, rx, ry); + + for (int c_idx = 0; c_idx < (sps->r->sps_chroma_format_idc ? 3 : 1); c_idx++) { + static const uint8_t sao_tab[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8 }; + const ptrdiff_t src_stride = fc->frame->linesize[c_idx]; + uint8_t *src = POS(c_idx, x0, y0); + const int hs = sps->hshift[c_idx]; + const int vs = sps->vshift[c_idx]; + const int ps = sps->pixel_shift; + const int width = FFMIN(sps->ctb_size_y, fc->ps.pps->width - x0) >> hs; + const int height = FFMIN(sps->ctb_size_y, fc->ps.pps->height - y0) >> vs; + const int tab = sao_tab[(FFALIGN(width, 8) >> 3) - 1]; + const int sao_eo_class = sao->eo_class[c_idx]; switch (sao->type_idx[c_idx]) { - case SAO_BAND: - fc->vvcdsp.sao.band_filter[tab](src, src, src_stride, src_stride, - sao->offset_val[c_idx], sao->band_position[c_idx], width, height); - break; - case SAO_EDGE: - { - const int w = fc->ps.pps->width >> fc->ps.sps->hshift[c_idx]; - const int h = fc->ps.pps->height >> fc->ps.sps->vshift[c_idx]; - const int sh = fc->ps.sps->pixel_shift; - - dst_stride = 2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE; - dst = lc->sao_buffer + dst_stride + AV_INPUT_BUFFER_PADDING_SIZE; - - if (!edges[TOP]) { - const int left = 1 - edges[LEFT]; - const int right = 1 - edges[RIGHT]; - const uint8_t *src1; - uint8_t *dst1; - int pos = 0; - - dst1 = dst - dst_stride - (left << sh); - src1 = fc->tab.sao_pixel_buffer_h[c_idx] + (((2 * ry - 1) * w + x0 - left) << sh); - if (left) { - copy_pixel(dst1, src1, sh); - pos += (1 << sh); - } - memcpy(dst1 + pos, src1 + pos, width << sh); - if (right) { - pos += width << sh; - copy_pixel(dst1 + pos, src1 + pos, sh); - } + case SAO_BAND: + fc->vvcdsp.sao.band_filter[tab](src, src, src_stride, src_stride, + sao->offset_val[c_idx], sao->band_position[c_idx], width, height); + break; + case SAO_EDGE: + { + const ptrdiff_t dst_stride = 2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE; + uint8_t *dst = lc->sao_buffer + dst_stride + AV_INPUT_BUFFER_PADDING_SIZE; + + sao_extends_edges(dst, dst_stride, src, src_stride, width, height, fc, x0, y0, rx, ry, edges, c_idx); + + fc->vvcdsp.sao.edge_filter[tab](src, dst, src_stride, sao->offset_val[c_idx], + sao->eo_class[c_idx], width, height); + fc->vvcdsp.sao.edge_restore[restore](src, dst, src_stride, dst_stride, + sao, edges, width, height, c_idx, vert_edge, horiz_edge, diag_edge); + + if (vb_x > x0 && sao_eo_class != SAO_EO_VERT) + sao_restore_vb(src, src_stride, dst, dst_stride, width, height, (vb_x - x0) >> hs, ps, 1); + if (vb_y > y0 && sao_eo_class != SAO_EO_HORIZ) + sao_restore_vb(src, src_stride, dst, dst_stride, width, height, (vb_y - y0) >> vs, ps, 0); + + break; } - if (!edges[BOTTOM]) { - const int left = 1 - edges[LEFT]; - const int right = 1 - edges[RIGHT]; - const uint8_t *src1; - uint8_t *dst1; - int pos = 0; - - dst1 = dst + height * dst_stride - (left << sh); - src1 = fc->tab.sao_pixel_buffer_h[c_idx] + (((2 * ry + 2) * w + x0 - left) << sh); - if (left) { - copy_pixel(dst1, src1, sh); - pos += (1 << sh); - } - memcpy(dst1 + pos, src1 + pos, width << sh); - if (right) { - pos += width << sh; - copy_pixel(dst1 + pos, src1 + pos, sh); - } - } - if (!edges[LEFT]) { - copy_vert(dst - (1 << sh), - fc->tab.sao_pixel_buffer_v[c_idx] + (((2 * rx - 1) * h + y0) << sh), - sh, height, dst_stride, 1 << sh); - } - if (!edges[RIGHT]) { - copy_vert(dst + (width << sh), - fc->tab.sao_pixel_buffer_v[c_idx] + (((2 * rx + 2) * h + y0) << sh), - sh, height, dst_stride, 1 << sh); - } - - copy_ctb(dst, src, width << sh, height, dst_stride, src_stride); - fc->vvcdsp.sao.edge_filter[tab](src, dst, src_stride, sao->offset_val[c_idx], - sao->eo_class[c_idx], width, height); - fc->vvcdsp.sao.edge_restore[restore](src, dst, src_stride, dst_stride, - sao, edges, width, height, c_idx, vert_edge, horiz_edge, diag_edge); - break; - } } } } @@ -406,30 +475,41 @@ static void derive_max_filter_length_luma(const VVCFrameContext *fc, const int q *max_len_p = FFMIN(5, *max_len_p); } -static void vvc_deblock_subblock_bs_vertical(const VVCLocalContext *lc, - const int cb_x, const int cb_y, const int x0, const int y0, const int width, const int height) +static void vvc_deblock_subblock_bs(const VVCLocalContext *lc, + const int cb, int x0, int y0, int width, int height, const int vertical) { const VVCFrameContext *fc = lc->fc; const MvField *tab_mvf = fc->tab.mvf; const RefPicList *rpl = lc->sc->rpl; - const int min_pu_width = fc->ps.pps->min_pu_width; + int stridea = fc->ps.pps->min_pu_width; + int strideb = 1; const int log2_min_pu_size = MIN_PU_LOG2; + if (!vertical) { + FFSWAP(int, x0, y0); + FFSWAP(int, width, height); + FFSWAP(int, stridea, strideb); + } + // bs for TU internal vertical PU boundaries - for (int j = 0; j < height; j += 4) { - const int y_pu = (y0 + j) >> log2_min_pu_size; - - for (int i = 8 - ((x0 - cb_x) % 8); i < width; i += 8) { - const int xp_pu = (x0 + i - 1) >> log2_min_pu_size; - const int xq_pu = (x0 + i) >> log2_min_pu_size; - const MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; - const MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; - const int x = x0 + i; - const int y = y0 + j; - const int bs = boundary_strength(lc, curr, left, rpl); + for (int i = 8 - ((x0 - cb) % 8); i < width; i += 8) { + const int is_vb = is_virtual_boundary(fc, x0 + i, vertical); + const int xp_pu = (x0 + i - 1) >> log2_min_pu_size; + const int xq_pu = (x0 + i) >> log2_min_pu_size; + + for (int j = 0; j < height; j += 4) { + const int y_pu = (y0 + j) >> log2_min_pu_size; + const MvField *mvf_p = &tab_mvf[y_pu * stridea + xp_pu * strideb]; + const MvField *mvf_q = &tab_mvf[y_pu * stridea + xq_pu * strideb]; + const int bs = is_vb ? 0 : boundary_strength(lc, mvf_q, mvf_p, rpl); + int x = x0 + i; + int y = y0 + j; uint8_t max_len_p = 0, max_len_q = 0; - TAB_BS(fc->tab.vertical_bs[LUMA], x, y) = bs; + if (!vertical) + FFSWAP(int, x, y); + + TAB_BS(fc->tab.bs[vertical][LUMA], x, y) = bs; if (i == 4 || i == width - 4) max_len_p = max_len_q = 1; @@ -438,48 +518,8 @@ static void vvc_deblock_subblock_bs_vertical(const VVCLocalContext *lc, else max_len_p = max_len_q = 3; - TAB_MAX_LEN(fc->tab.vertical_p, x, y) = max_len_p; - TAB_MAX_LEN(fc->tab.vertical_q, x, y) = max_len_q; - } - } -} - -static void vvc_deblock_subblock_bs_horizontal(const VVCLocalContext *lc, - const int cb_x, const int cb_y, const int x0, const int y0, const int width, const int height) -{ - const VVCFrameContext *fc = lc->fc; - const MvField* tab_mvf = fc->tab.mvf; - const RefPicList* rpl = lc->sc->rpl; - const int min_pu_width = fc->ps.pps->min_pu_width; - const int log2_min_pu_size = MIN_PU_LOG2; - - // bs for TU internal horizontal PU boundaries - for (int j = 8 - ((y0 - cb_y) % 8); j < height; j += 8) { - int yp_pu = (y0 + j - 1) >> log2_min_pu_size; - int yq_pu = (y0 + j) >> log2_min_pu_size; - - for (int i = 0; i < width; i += 4) { - const int x_pu = (x0 + i) >> log2_min_pu_size; - const MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; - const MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; - const int x = x0 + i; - const int y = y0 + j; - const int bs = boundary_strength(lc, curr, top, rpl); - uint8_t max_len_p = 0, max_len_q = 0; - - TAB_BS(fc->tab.horizontal_bs[LUMA], x, y) = bs; - - //fixme: - //edgeTbFlags[ x − sbW ][ y ] is equal to 1 - //edgeTbFlags[ x + sbW ][ y ] is equal to 1 - if (j == 4 || j == height - 4) - max_len_p = max_len_q = 1; - else if (j == 8 || j == height - 8) - max_len_p = max_len_q = 2; - else - max_len_p = max_len_q = 3; - TAB_MAX_LEN(fc->tab.horizontal_p, x, y) = max_len_p; - TAB_MAX_LEN(fc->tab.horizontal_q, x, y) = max_len_q; + TAB_MAX_LEN(fc->tab.max_len_p[vertical], x, y) = max_len_p; + TAB_MAX_LEN(fc->tab.max_len_q[vertical], x, y) = max_len_q; } } } @@ -565,142 +605,78 @@ static int deblock_is_boundary(const VVCLocalContext *lc, const int boundary, return boundary; } -static void vvc_deblock_bs_luma_vertical(const VVCLocalContext *lc, - const int x0, const int y0, const int width, const int height, const int rs) +static void vvc_deblock_bs_luma(const VVCLocalContext *lc, + const int x0, const int y0, const int width, const int height, const int rs, const int vertical) { const VVCFrameContext *fc = lc->fc; const MvField *tab_mvf = fc->tab.mvf; + const int mask = LUMA_GRID - 1; const int log2_min_pu_size = MIN_PU_LOG2; const int min_pu_width = fc->ps.pps->min_pu_width; const int min_cb_log2 = fc->ps.sps->min_cb_log2_size_y; const int min_cb_width = fc->ps.pps->min_cb_width; - const int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width + - (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA; - int boundary_left; - int has_vertical_sb = 0; - + const int pos = vertical ? x0 : y0; const int off_q = (y0 >> min_cb_log2) * min_cb_width + (x0 >> min_cb_log2); - const int cb_x = fc->tab.cb_pos_x[LUMA][off_q]; - const int cb_y = fc->tab.cb_pos_y[LUMA][off_q]; - const int cb_width = fc->tab.cb_width[LUMA][off_q]; - const int off_x = cb_x - x0; - - if (!is_intra) { - if (fc->tab.msf[off_q] || fc->tab.iaf[off_q]) - has_vertical_sb = cb_width > 8; - } - - // bs for vertical TU boundaries - boundary_left = deblock_is_boundary(lc, x0 > 0 && !(x0 & 3), x0, rs, 1); - - if (boundary_left) { - const RefPicList *rpl_left = - (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ? ff_vvc_get_ref_list(fc, fc->ref, x0 - 1, y0) : lc->sc->rpl; - for (int i = 0; i < height; i += 4) { - uint8_t max_len_p, max_len_q; - const int bs = deblock_bs(lc, x0 - 1, y0 + i, x0, y0 + i, rpl_left, 0, off_x, has_vertical_sb); - - TAB_BS(fc->tab.vertical_bs[LUMA], x0, (y0 + i)) = bs; - - derive_max_filter_length_luma(fc, x0, y0 + i, is_intra, has_vertical_sb, 1, &max_len_p, &max_len_q); - TAB_MAX_LEN(fc->tab.vertical_p, x0, y0 + i) = max_len_p; - TAB_MAX_LEN(fc->tab.vertical_q, x0, y0 + i) = max_len_q; - } - } - - if (!is_intra) { - if (fc->tab.msf[off_q] || fc->tab.iaf[off_q]) - vvc_deblock_subblock_bs_vertical(lc, cb_x, cb_y, x0, y0, width, height); - } -} - -static void vvc_deblock_bs_luma_horizontal(const VVCLocalContext *lc, - const int x0, const int y0, const int width, const int height, const int rs) -{ - const VVCFrameContext *fc = lc->fc; - const MvField *tab_mvf = fc->tab.mvf; - const int log2_min_pu_size = MIN_PU_LOG2; - const int min_pu_width = fc->ps.pps->min_pu_width; - const int min_cb_log2 = fc->ps.sps->min_cb_log2_size_y; - const int min_cb_width = fc->ps.pps->min_cb_width; - const int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width + - (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA; - int boundary_upper; - int has_horizontal_sb = 0; - - const int off_q = (y0 >> min_cb_log2) * min_cb_width + (x0 >> min_cb_log2); - const int cb_x = fc->tab.cb_pos_x[LUMA][off_q]; - const int cb_y = fc->tab.cb_pos_y[LUMA][off_q]; - const int cb_height = fc->tab.cb_height[LUMA][off_q]; - const int off_y = y0 - cb_y; - - if (!is_intra) { - if (fc->tab.msf[off_q] || fc->tab.iaf[off_q]) - has_horizontal_sb = cb_height > 8; - } - - boundary_upper = deblock_is_boundary(lc, y0 > 0 && !(y0 & 3), y0, rs, 0); - - if (boundary_upper) { - const RefPicList *rpl_top = - (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ? ff_vvc_get_ref_list(fc, fc->ref, x0, y0 - 1) : lc->sc->rpl; - - for (int i = 0; i < width; i += 4) { + const int cb = (vertical ? fc->tab.cb_pos_x : fc->tab.cb_pos_y )[LUMA][off_q]; + const int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width + + (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA; + + if (deblock_is_boundary(lc, pos > 0 && !(pos & mask), pos, rs, vertical)) { + const int is_vb = is_virtual_boundary(fc, pos, vertical); + const int size = vertical ? height : width; + const int off = cb - pos; + const int cb_size = (vertical ? fc->tab.cb_width : fc->tab.cb_height)[LUMA][off_q]; + const int has_sb = !is_intra && (fc->tab.msf[off_q] || fc->tab.iaf[off_q]) && cb_size > 8; + const int flag = vertical ? BOUNDARY_LEFT_SLICE : BOUNDARY_UPPER_SLICE; + const RefPicList *rpl_p = + (lc->boundary_flags & flag) ? ff_vvc_get_ref_list(fc, fc->ref, x0 - vertical, y0 - !vertical) : lc->sc->rpl; + + for (int i = 0; i < size; i += 4) { + const int x = x0 + i * !vertical; + const int y = y0 + i * vertical; uint8_t max_len_p, max_len_q; - const int bs = deblock_bs(lc, x0 + i, y0 - 1, x0 + i, y0, rpl_top, 0, off_y, has_horizontal_sb); + const int bs = is_vb ? 0 : deblock_bs(lc, x - vertical, y - !vertical, x, y, rpl_p, LUMA, off, has_sb); - TAB_BS(fc->tab.horizontal_bs[LUMA], x0 + i, y0) = bs; + TAB_BS(fc->tab.bs[vertical][LUMA], x, y) = bs; - derive_max_filter_length_luma(fc, x0 + i, y0, is_intra, has_horizontal_sb, 0, &max_len_p, &max_len_q); - TAB_MAX_LEN(fc->tab.horizontal_p, x0 + i, y0) = max_len_p; - TAB_MAX_LEN(fc->tab.horizontal_q, x0 + i, y0) = max_len_q; + derive_max_filter_length_luma(fc, x, y, is_intra, has_sb, vertical, &max_len_p, &max_len_q); + TAB_MAX_LEN(fc->tab.max_len_p[vertical], x, y) = max_len_p; + TAB_MAX_LEN(fc->tab.max_len_q[vertical], x, y) = max_len_q; } } if (!is_intra) { if (fc->tab.msf[off_q] || fc->tab.iaf[off_q]) - vvc_deblock_subblock_bs_horizontal(lc, cb_x, cb_y, x0, y0, width, height); + vvc_deblock_subblock_bs(lc, cb, x0, y0, width, height, vertical); } } -static void vvc_deblock_bs_chroma_vertical(const VVCLocalContext *lc, - const int x0, const int y0, const int width, const int height, const int rs) +static void vvc_deblock_bs_chroma(const VVCLocalContext *lc, + const int x0, const int y0, const int width, const int height, const int rs, const int vertical) { const VVCFrameContext *fc = lc->fc; - const int boundary_left = deblock_is_boundary(lc, - x0 > 0 && !(x0 & ((CHROMA_GRID << fc->ps.sps->hshift[CHROMA]) - 1)), x0, rs, 1); + const int shift = (vertical ? fc->ps.sps->hshift : fc->ps.sps->vshift)[CHROMA]; + const int mask = (CHROMA_GRID << shift) - 1; + const int pos = vertical ? x0 : y0; - if (boundary_left) { - for (int i = 0; i < height; i += 2) { - for (int c_idx = CB; c_idx <= CR; c_idx++) { - const int bs = deblock_bs(lc, x0 - 1, y0 + i, x0, y0 + i, NULL, c_idx, 0, 0); + if (deblock_is_boundary(lc, pos > 0 && !(pos & mask), pos, rs, vertical)) { + const int is_vb = is_virtual_boundary(fc, pos, vertical); + const int size = vertical ? height : width; - TAB_BS(fc->tab.vertical_bs[c_idx], x0, (y0 + i)) = bs; - } - } - } -} + for (int c_idx = CB; c_idx <= CR; c_idx++) { + for (int i = 0; i < size; i += 2) { + const int x = x0 + i * !vertical; + const int y = y0 + i * vertical; + const int bs = is_vb ? 0 : deblock_bs(lc, x - vertical, y - !vertical, x, y, NULL, c_idx, 0, 0); -static void vvc_deblock_bs_chroma_horizontal(const VVCLocalContext *lc, - const int x0, const int y0, const int width, const int height, const int rs) -{ - const VVCFrameContext *fc = lc->fc; - const int boundary_upper = deblock_is_boundary(lc, - y0 > 0 && !(y0 & ((CHROMA_GRID << fc->ps.sps->vshift[CHROMA]) - 1)), y0, rs, 0); - - if (boundary_upper) { - for (int i = 0; i < width; i += 2) { - for (int c_idx = CB; c_idx <= CR; c_idx++) { - const int bs = deblock_bs(lc, x0 + i, y0 - 1, x0 + i, y0, NULL, c_idx, 0, 0); - - TAB_BS(fc->tab.horizontal_bs[c_idx], x0 + i, y0) = bs; + TAB_BS(fc->tab.bs[vertical][c_idx], x, y) = bs; } } } } typedef void (*deblock_bs_fn)(const VVCLocalContext *lc, const int x0, const int y0, - const int width, const int height, const int rs); + const int width, const int height, const int rs, const int vertical); static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0, const int rs, const int vertical) { @@ -710,9 +686,8 @@ static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0 const int ctb_size = sps->ctb_size_y; const int x_end = FFMIN(x0 + ctb_size, pps->width) >> MIN_TU_LOG2; const int y_end = FFMIN(y0 + ctb_size, pps->height) >> MIN_TU_LOG2; - deblock_bs_fn deblock_bs[2][2] = { - { vvc_deblock_bs_luma_horizontal, vvc_deblock_bs_chroma_horizontal }, - { vvc_deblock_bs_luma_vertical, vvc_deblock_bs_chroma_vertical } + deblock_bs_fn deblock_bs[] = { + vvc_deblock_bs_luma, vvc_deblock_bs_chroma }; for (int is_chroma = 0; is_chroma <= 1; is_chroma++) { @@ -722,8 +697,8 @@ static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0 for (int x = x0 >> MIN_TU_LOG2; x < x_end; x++) { const int off = y * fc->ps.pps->min_tu_width + x; if ((fc->tab.tb_pos_x0[is_chroma][off] >> MIN_TU_LOG2) == x && (fc->tab.tb_pos_y0[is_chroma][off] >> MIN_TU_LOG2) == y) { - deblock_bs[vertical][is_chroma](lc, x << MIN_TU_LOG2, y << MIN_TU_LOG2, - fc->tab.tb_width[is_chroma][off] << hs, fc->tab.tb_height[is_chroma][off] << vs, rs); + deblock_bs[is_chroma](lc, x << MIN_TU_LOG2, y << MIN_TU_LOG2, + fc->tab.tb_width[is_chroma][off] << hs, fc->tab.tb_height[is_chroma][off] << vs, rs, vertical); } } } @@ -734,10 +709,8 @@ static void vvc_deblock_bs(const VVCLocalContext *lc, const int x0, const int y0 static void max_filter_length_luma(const VVCFrameContext *fc, const int qx, const int qy, const int vertical, uint8_t *max_len_p, uint8_t *max_len_q) { - const uint8_t *tab_len_p = vertical ? fc->tab.vertical_p : fc->tab.horizontal_p; - const uint8_t *tab_len_q = vertical ? fc->tab.vertical_q : fc->tab.horizontal_q; - *max_len_p = TAB_MAX_LEN(tab_len_p, qx, qy); - *max_len_q = TAB_MAX_LEN(tab_len_q, qx, qy); + *max_len_p = TAB_MAX_LEN(fc->tab.max_len_p[vertical], qx, qy); + *max_len_q = TAB_MAX_LEN(fc->tab.max_len_q[vertical], qx, qy); } //part of 8.8.3.3 Derivation process of transform block boundary @@ -807,144 +780,79 @@ static int get_qp(const VVCFrameContext *fc, const uint8_t *src, const int x, co return get_qp_c(fc, x, y, c_idx, vertical); } -void ff_vvc_deblock_vertical(const VVCLocalContext *lc, const int x0, const int y0, const int rs) +static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs, const int vertical) { - VVCFrameContext *fc = lc->fc; - const VVCSPS *sps = fc->ps.sps; - const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1; - uint8_t *src; - int x, y, qp; + VVCFrameContext *fc = lc->fc; + const VVCSPS *sps = fc->ps.sps; + const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1; + const int ctb_size = fc->ps.sps->ctb_size_y; + const DBParams *params = fc->tab.deblock + rs; + int x_end = FFMIN(x0 + ctb_size, fc->ps.pps->width); + int y_end = FFMIN(y0 + ctb_size, fc->ps.pps->height); //not use this yet, may needed by plt. - const uint8_t no_p[4] = { 0 }; - const uint8_t no_q[4] = { 0 } ; + const uint8_t no_p[4] = { 0 }; + const uint8_t no_q[4] = { 0 } ; - const int ctb_log2_size_y = fc->ps.sps->ctb_log2_size_y; - int x_end, y_end; - const int ctb_size = 1 << ctb_log2_size_y; - const DBParams *params = fc->tab.deblock + rs; - - vvc_deblock_bs(lc, x0, y0, rs, 1); + vvc_deblock_bs(lc, x0, y0, rs, vertical); - x_end = x0 + ctb_size; - if (x_end > fc->ps.pps->width) - x_end = fc->ps.pps->width; - y_end = y0 + ctb_size; - if (y_end > fc->ps.pps->height) - y_end = fc->ps.pps->height; + if (!vertical) { + FFSWAP(int, x_end, y_end); + FFSWAP(int, x0, y0); + } for (int c_idx = 0; c_idx < c_end; c_idx++) { - const int hs = sps->hshift[c_idx]; - const int vs = sps->vshift[c_idx]; + const int hs = (vertical ? sps->hshift : sps->vshift)[c_idx]; + const int vs = (vertical ? sps->vshift : sps->hshift)[c_idx]; const int grid = c_idx ? (CHROMA_GRID << hs) : LUMA_GRID; const int tc_offset = params->tc_offset[c_idx]; const int beta_offset = params->beta_offset[c_idx]; + const int src_stride = fc->frame->linesize[c_idx]; - for (y = y0; y < y_end; y += (DEBLOCK_STEP << vs)) { - for (x = x0 ? x0 : grid; x < x_end; x += grid) { - int32_t bs[4], beta[4], tc[4], all_zero_bs = 1; + for (int y = y0; y < y_end; y += (DEBLOCK_STEP << vs)) { + for (int x = x0 ? x0 : grid; x < x_end; x += grid) { + const uint8_t horizontal_ctu_edge = !vertical && !(x % ctb_size); + int32_t bs[4], beta[4], tc[4] = { 0 }, all_zero_bs = 1; uint8_t max_len_p[4], max_len_q[4]; for (int i = 0; i < DEBLOCK_STEP >> (2 - vs); i++) { - const int dy = i << 2; - bs[i] = (y + dy < y_end) ? TAB_BS(fc->tab.vertical_bs[c_idx], x, y + dy) : 0; - if (bs[i]) { - src = &fc->frame->data[c_idx][((y + dy) >> vs) * fc->frame->linesize[c_idx] + ((x >> hs) << fc->ps.sps->pixel_shift)]; - qp = get_qp(fc, src, x, y + dy, c_idx, 1); + int tx = x; + int ty = y + (i << 2); + const int end = ty >= y_end; - beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)]; + if (!vertical) + FFSWAP(int, tx, ty); - max_filter_length(fc, x, y + dy, c_idx, 1, 0, bs[i], &max_len_p[i], &max_len_q[i]); + bs[i] = end ? 0 : TAB_BS(fc->tab.bs[vertical][c_idx], tx, ty); + if (bs[i]) { + const int qp = get_qp(fc, POS(c_idx, tx, ty), tx, ty, c_idx, vertical); + beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)]; + tc[i] = TC_CALC(qp, bs[i]) ; + max_filter_length(fc, tx, ty, c_idx, vertical, horizontal_ctu_edge, bs[i], &max_len_p[i], &max_len_q[i]); all_zero_bs = 0; } - tc[i] = bs[i] ? TC_CALC(qp, bs[i]) : 0; } if (!all_zero_bs) { - src = &fc->frame->data[c_idx][(y >> vs) * fc->frame->linesize[c_idx] + ((x >> hs) << fc->ps.sps->pixel_shift)]; - if (!c_idx) { - fc->vvcdsp.lf.filter_luma[1](src, fc->frame->linesize[c_idx], - beta, tc, no_p, no_q, max_len_p, max_len_q, 0); - } else { - fc->vvcdsp.lf.filter_chroma[1](src, fc->frame->linesize[c_idx], - beta, tc, no_p, no_q, max_len_p, max_len_q, vs); - } + uint8_t *src = vertical ? POS(c_idx, x, y) : POS(c_idx, y, x); + if (!c_idx) + fc->vvcdsp.lf.filter_luma[vertical](src, src_stride, beta, tc, no_p, no_q, max_len_p, max_len_q, horizontal_ctu_edge); + else + fc->vvcdsp.lf.filter_chroma[vertical](src, src_stride, beta, tc, no_p, no_q, max_len_p, max_len_q, vs); } } } } } -void ff_vvc_deblock_horizontal(const VVCLocalContext *lc, const int x0, const int y0, const int rs) +void ff_vvc_deblock_vertical(const VVCLocalContext *lc, const int x0, const int y0, const int rs) { - VVCFrameContext *fc = lc->fc; - const VVCSPS *sps = fc->ps.sps; - const int c_end = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1; - uint8_t* src; - int x, y, qp; - - //not use this yet, may needed by plt. - const uint8_t no_p[4] = { 0 }; - const uint8_t no_q[4] = { 0 } ; - - const int ctb_log2_size_y = fc->ps.sps->ctb_log2_size_y; - int x_end, y_end; - const int ctb_size = 1 << ctb_log2_size_y; - const DBParams *params = fc->tab.deblock + rs; - - vvc_deblock_bs(lc, x0, y0, rs, 0); - - x_end = x0 + ctb_size; - if (x_end > fc->ps.pps->width) - x_end = fc->ps.pps->width; - y_end = y0 + ctb_size; - if (y_end > fc->ps.pps->height) - y_end = fc->ps.pps->height; - - for (int c_idx = 0; c_idx < c_end; c_idx++) { - const int hs = sps->hshift[c_idx]; - const int vs = sps->vshift[c_idx]; - const int grid = c_idx ? (CHROMA_GRID << vs) : LUMA_GRID; - const int beta_offset = params->beta_offset[c_idx]; - const int tc_offset = params->tc_offset[c_idx]; - - for (y = y0; y < y_end; y += grid) { - const uint8_t horizontal_ctu_edge = !(y % fc->ps.sps->ctb_size_y); - if (!y) - continue; - - for (x = x0 ? x0: 0; x < x_end; x += (DEBLOCK_STEP << hs)) { - int32_t bs[4], beta[4], tc[4], all_zero_bs = 1; - uint8_t max_len_p[4], max_len_q[4]; - - for (int i = 0; i < DEBLOCK_STEP >> (2 - hs); i++) { - const int dx = i << 2; - - bs[i] = (x + dx < x_end) ? TAB_BS(fc->tab.horizontal_bs[c_idx], x + dx, y) : 0; - if (bs[i]) { - src = &fc->frame->data[c_idx][(y >> vs) * fc->frame->linesize[c_idx] + (((x + dx)>> hs) << fc->ps.sps->pixel_shift)]; - qp = get_qp(fc, src, x + dx, y, c_idx, 0); - - beta[i] = betatable[av_clip(qp + beta_offset, 0, MAX_QP)]; + vvc_deblock(lc, x0, y0, rs, 1); +} - max_filter_length(fc, x + dx, y, c_idx, 0, horizontal_ctu_edge, bs[i], &max_len_p[i], &max_len_q[i]); - all_zero_bs = 0; - } - tc[i] = bs[i] ? TC_CALC(qp, bs[i]) : 0; - } - if (!all_zero_bs) { - src = &fc->frame->data[c_idx][(y >> vs) * fc->frame->linesize[c_idx] + ((x >> hs) << fc->ps.sps->pixel_shift)]; - if (!c_idx) { - fc->vvcdsp.lf.filter_luma[0](src, fc->frame->linesize[c_idx], - beta, tc, no_p, no_q, max_len_p, max_len_q, horizontal_ctu_edge); - } else { - fc->vvcdsp.lf.filter_chroma[0](src, fc->frame->linesize[c_idx], - beta, tc, no_p, no_q, max_len_p, max_len_q, hs); - } - } - } - } - } +void ff_vvc_deblock_horizontal(const VVCLocalContext *lc, const int x0, const int y0, const int rs) +{ + vvc_deblock(lc, x0, y0, rs, 0); } static void alf_copy_border(uint8_t *dst, const uint8_t *src, @@ -1085,7 +993,7 @@ static void alf_prepare_buffer(VVCFrameContext *fc, uint8_t *_dst, const uint8_t #define ALF_MAX_FILTER_SIZE (ALF_MAX_BLOCKS_IN_CTU * ALF_NUM_COEFF_LUMA) static void alf_get_coeff_and_clip(VVCLocalContext *lc, int16_t *coeff, int16_t *clip, - const uint8_t *src, ptrdiff_t src_stride, int width, int height, int vb_pos, ALFParams *alf) + const uint8_t *src, ptrdiff_t src_stride, int width, int height, int vb_pos, const ALFParams *alf) { const VVCFrameContext *fc = lc->fc; const H266RawSliceHeader *rsh = lc->sc->sh.r; @@ -1116,7 +1024,7 @@ static void alf_get_coeff_and_clip(VVCLocalContext *lc, int16_t *coeff, int16_t static void alf_filter_luma(VVCLocalContext *lc, uint8_t *dst, const uint8_t *src, const ptrdiff_t dst_stride, const ptrdiff_t src_stride, const int x0, const int y0, - const int width, const int height, const int _vb_pos, ALFParams *alf) + const int width, const int height, const int _vb_pos, const ALFParams *alf) { const VVCFrameContext *fc = lc->fc; int vb_pos = _vb_pos - y0; @@ -1140,7 +1048,7 @@ static int alf_clip_from_idx(const VVCFrameContext *fc, const int idx) static void alf_filter_chroma(VVCLocalContext *lc, uint8_t *dst, const uint8_t *src, const ptrdiff_t dst_stride, const ptrdiff_t src_stride, const int c_idx, - const int width, const int height, const int vb_pos, ALFParams *alf) + const int width, const int height, const int vb_pos, const ALFParams *alf) { VVCFrameContext *fc = lc->fc; const H266RawSliceHeader *rsh = lc->sc->sh.r; @@ -1157,7 +1065,7 @@ static void alf_filter_chroma(VVCLocalContext *lc, uint8_t *dst, const uint8_t * static void alf_filter_cc(VVCLocalContext *lc, uint8_t *dst, const uint8_t *luma, const ptrdiff_t dst_stride, const ptrdiff_t luma_stride, const int c_idx, - const int width, const int height, const int hs, const int vs, const int vb_pos, ALFParams *alf) + const int width, const int height, const int hs, const int vs, const int vb_pos, const ALFParams *alf) { const VVCFrameContext *fc = lc->fc; const H266RawSliceHeader *rsh = lc->sc->sh.r; @@ -1178,7 +1086,6 @@ void ff_vvc_alf_copy_ctu_to_hv(VVCLocalContext* lc, const int x0, const int y0) const int rx = x0 >> fc->ps.sps->ctb_log2_size_y; const int ry = y0 >> fc->ps.sps->ctb_log2_size_y; const int ctb_size_y = fc->ps.sps->ctb_size_y; - const int ps = fc->ps.sps->pixel_shift; const int c_end = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1; for (int c_idx = 0; c_idx < c_end; c_idx++) { @@ -1190,85 +1097,143 @@ void ff_vvc_alf_copy_ctu_to_hv(VVCLocalContext* lc, const int x0, const int y0) const int height = FFMIN(fc->ps.pps->height - y0, ctb_size_y) >> vs; const int src_stride = fc->frame->linesize[c_idx]; - uint8_t* src = &fc->frame->data[c_idx][y * src_stride + (x << ps)]; + uint8_t *src = POS(c_idx, x0, y0); alf_copy_ctb_to_hv(fc, src, src_stride, x, y, width, height, rx, ry, c_idx); } } -void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0) +static void alf_get_edges(const VVCLocalContext *lc, int edges[MAX_EDGES], const int rx, const int ry) { - VVCFrameContext *fc = lc->fc; - const VVCSPS *sps = fc->ps.sps; - const VVCPPS *pps = fc->ps.pps; - const int rx = x0 >> fc->ps.sps->ctb_log2_size_y; - const int ry = y0 >> fc->ps.sps->ctb_log2_size_y; - const int ctb_size_y = fc->ps.sps->ctb_size_y; - const int ps = fc->ps.sps->pixel_shift; - const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps; - const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps); - const int c_end = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1; - const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; - ALFParams *alf = &CTB(fc->tab.alf, rx, ry); - int edges[MAX_EDGES] = { rx == 0, ry == 0, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 }; + VVCFrameContext *fc = lc->fc; + const VVCSPS *sps = fc->ps.sps; + const VVCPPS *pps = fc->ps.pps; + const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; + + // we can't use |= instead of || in this function; |= is not a shortcut operator if (!pps->r->pps_loop_filter_across_tiles_enabled_flag) { - edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_TILE); - edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_TILE); - edges[RIGHT] = edges[RIGHT] || pps->ctb_to_col_bd[rx] != pps->ctb_to_col_bd[rx + 1]; + edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_TILE); + edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_TILE); + edges[RIGHT] = edges[RIGHT] || pps->ctb_to_col_bd[rx] != pps->ctb_to_col_bd[rx + 1]; edges[BOTTOM] = edges[BOTTOM] || pps->ctb_to_row_bd[ry] != pps->ctb_to_row_bd[ry + 1]; } if (!pps->r->pps_loop_filter_across_slices_enabled_flag) { - edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SLICE); - edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SLICE); - edges[RIGHT] = edges[RIGHT] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry); + edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SLICE); + edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SLICE); + edges[RIGHT] = edges[RIGHT] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx + 1, ry); edges[BOTTOM] = edges[BOTTOM] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1); } if (!sps->r->sps_loop_filter_across_subpic_enabled_flag[subpic_idx]) { - edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SUBPIC); - edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SUBPIC); - edges[RIGHT] = edges[RIGHT] || fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx; + edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SUBPIC); + edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SUBPIC); + edges[RIGHT] = edges[RIGHT] || fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx; edges[BOTTOM] = edges[BOTTOM] || fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry; } - for (int c_idx = 0; c_idx < c_end; c_idx++) { - const int hs = fc->ps.sps->hshift[c_idx]; - const int vs = fc->ps.sps->vshift[c_idx]; - const int ctb_size_h = ctb_size_y >> hs; - const int ctb_size_v = ctb_size_y >> vs; - const int x = x0 >> hs; - const int y = y0 >> vs; - const int pic_width = fc->ps.pps->width >> hs; - const int pic_height = fc->ps.pps->height >> vs; - const int width = FFMIN(pic_width - x, ctb_size_h); - const int height = FFMIN(pic_height - y, ctb_size_v); - const int src_stride = fc->frame->linesize[c_idx]; - uint8_t *src = &fc->frame->data[c_idx][y * src_stride + (x << ps)]; - uint8_t *padded; + if (sps->r->sps_virtual_boundaries_enabled_flag) { + edges[LEFT] = edges[LEFT] || is_virtual_boundary(fc, rx << sps->ctb_log2_size_y, 1); + edges[TOP] = edges[TOP] || is_virtual_boundary(fc, ry << sps->ctb_log2_size_y, 0); + edges[RIGHT] = edges[RIGHT] || is_virtual_boundary(fc, (rx + 1) << sps->ctb_log2_size_y, 1); + edges[BOTTOM] = edges[BOTTOM] || is_virtual_boundary(fc, (ry + 1) << sps->ctb_log2_size_y, 0); + } +} - if (alf->ctb_flag[c_idx] || (!c_idx && (alf->ctb_cc_idc[0] || alf->ctb_cc_idc[1]))) { - padded = (c_idx ? lc->alf_buffer_chroma : lc->alf_buffer_luma) + padded_offset; - alf_prepare_buffer(fc, padded, src, x, y, rx, ry, width, height, - padded_stride, src_stride, c_idx, edges); - } - if (alf->ctb_flag[c_idx]) { - if (!c_idx) { - alf_filter_luma(lc, src, padded, src_stride, padded_stride, x, y, - width, height, y + ctb_size_v - ALF_VB_POS_ABOVE_LUMA, alf); - } else { - alf_filter_chroma(lc, src, padded, src_stride, padded_stride, c_idx, - width, height, ctb_size_v - ALF_VB_POS_ABOVE_CHROMA, alf); - } +static void alf_init_subblock(VVCRect *sb, int sb_edges[MAX_EDGES], const VVCRect *b, const int edges[MAX_EDGES]) +{ + *sb = *b; + memcpy(sb_edges, edges, sizeof(int) * MAX_EDGES); +} + +static void alf_get_subblock(VVCRect *sb, int edges[MAX_EDGES], const int bx, const int by, const int vb_pos[2], const int has_vb[2]) +{ + int *pos[] = { &sb->l, &sb->t, &sb->r, &sb->b }; + + for (int vertical = 0; vertical <= 1; vertical++) { + if (has_vb[vertical]) { + const int c = vertical ? (bx ? LEFT : RIGHT) : (by ? TOP : BOTTOM); + *pos[c] = vb_pos[vertical]; + edges[c] = 1; } - if (c_idx && alf->ctb_cc_idc[c_idx - 1]) { - padded = lc->alf_buffer_luma + padded_offset; - alf_filter_cc(lc, src, padded, src_stride, padded_stride, c_idx, - width, height, hs, vs, (ctb_size_v << vs) - ALF_VB_POS_ABOVE_LUMA, alf); + } +} + +static void alf_get_subblocks(const VVCLocalContext *lc, VVCRect sbs[MAX_VBBS], int sb_edges[MAX_VBBS][MAX_EDGES], int *nb_sbs, + const int x0, const int y0, const int rx, const int ry) +{ + VVCFrameContext *fc = lc->fc; + const VVCSPS *sps = fc->ps.sps; + const VVCPPS *pps = fc->ps.pps; + const int ctu_size_y = sps->ctb_size_y; + const int vb_pos[] = { get_virtual_boundary(fc, ry, 0), get_virtual_boundary(fc, rx, 1) }; + const int has_vb[] = { vb_pos[0] > y0, vb_pos[1] > x0 }; + const VVCRect b = { x0, y0, FFMIN(x0 + ctu_size_y, pps->width), FFMIN(y0 + ctu_size_y, pps->height) }; + int edges[MAX_EDGES] = { !rx, !ry, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 }; + int i = 0; + + alf_get_edges(lc, edges, rx, ry); + + for (int by = 0; by <= has_vb[0]; by++) { + for (int bx = 0; bx <= has_vb[1]; bx++, i++) { + alf_init_subblock(sbs + i, sb_edges[i], &b, edges); + alf_get_subblock(sbs + i, sb_edges[i], bx, by, vb_pos, has_vb); } + } + *nb_sbs = i; +} - alf->applied[c_idx] = 1; +void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0) +{ + VVCFrameContext *fc = lc->fc; + const VVCSPS *sps = fc->ps.sps; + const int rx = x0 >> sps->ctb_log2_size_y; + const int ry = y0 >> sps->ctb_log2_size_y; + const int ps = sps->pixel_shift; + const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps; + const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps); + const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1; + const int ctu_end = y0 + sps->ctb_size_y; + const ALFParams *alf = &CTB(fc->tab.alf, rx, ry); + int sb_edges[MAX_VBBS][MAX_EDGES], nb_sbs; + VVCRect sbs[MAX_VBBS]; + + alf_get_subblocks(lc, sbs, sb_edges, &nb_sbs, x0, y0, rx, ry); + + for (int i = 0; i < nb_sbs; i++) { + const VVCRect *sb = sbs + i; + for (int c_idx = 0; c_idx < c_end; c_idx++) { + const int hs = fc->ps.sps->hshift[c_idx]; + const int vs = fc->ps.sps->vshift[c_idx]; + const int x = sb->l >> hs; + const int y = sb->t >> vs; + const int width = (sb->r - sb->l) >> hs; + const int height = (sb->b - sb->t) >> vs; + const int src_stride = fc->frame->linesize[c_idx]; + uint8_t *src = POS(c_idx, sb->l, sb->t); + uint8_t *padded; + + if (alf->ctb_flag[c_idx] || (!c_idx && (alf->ctb_cc_idc[0] || alf->ctb_cc_idc[1]))) { + padded = (c_idx ? lc->alf_buffer_chroma : lc->alf_buffer_luma) + padded_offset; + alf_prepare_buffer(fc, padded, src, x, y, rx, ry, width, height, + padded_stride, src_stride, c_idx, sb_edges[i]); + } + if (alf->ctb_flag[c_idx]) { + if (!c_idx) { + alf_filter_luma(lc, src, padded, src_stride, padded_stride, x, y, + width, height, ctu_end - ALF_VB_POS_ABOVE_LUMA, alf); + } else { + alf_filter_chroma(lc, src, padded, src_stride, padded_stride, c_idx, + width, height, ((ctu_end - sb->t) >> vs) - ALF_VB_POS_ABOVE_CHROMA, alf); + } + } + if (c_idx && alf->ctb_cc_idc[c_idx - 1]) { + padded = lc->alf_buffer_luma + padded_offset; + alf_filter_cc(lc, src, padded, src_stride, padded_stride, c_idx, + width, height, hs, vs, ctu_end - sb->t - ALF_VB_POS_ABOVE_LUMA, alf); + } + } } } @@ -1280,7 +1245,7 @@ void ff_vvc_lmcs_filter(const VVCLocalContext *lc, const int x, const int y) const int ctb_size = fc->ps.sps->ctb_size_y; const int width = FFMIN(fc->ps.pps->width - x, ctb_size); const int height = FFMIN(fc->ps.pps->height - y, ctb_size); - uint8_t *data = fc->frame->data[LUMA] + y * fc->frame->linesize[LUMA] + (x << fc->ps.sps->pixel_shift); + uint8_t *data = POS(LUMA, x, y); if (sc->sh.r->sh_lmcs_used_flag) fc->vvcdsp.lmcs.filter(data, fc->frame->linesize[LUMA], width, height, &fc->ps.lmcs.inv_lut); } diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c b/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c index 344a0a8c13..9578fd8de4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/inter.c @@ -30,13 +30,6 @@ #define PROF_TEMP_OFFSET (MAX_PB_SIZE + 32) static const int bcw_w_lut[] = {4, 5, 3, 10, -2}; -typedef struct VVCRect { - int l; // left - int t; // top - int r; // right - int b; // bottom -} VVCRect; - static void subpic_get_rect(VVCRect *r, const VVCFrame *src_frame, const int subpic_idx, const int is_chroma) { const VVCSPS *sps = src_frame->sps; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c b/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c index 42564b3e6f..1788a7150b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.c @@ -1695,17 +1695,34 @@ static void ibc_merge_candidates(VVCLocalContext *lc, const int merge_idx, Mv *m memset(mv, 0, sizeof(*mv)); } -void ff_vvc_mvp_ibc(VVCLocalContext *lc, const int mvp_l0_flag, const int amvr_shift, Mv *mv) +static int ibc_check_mv(VVCLocalContext *lc, Mv *mv) +{ + const VVCFrameContext *fc = lc->fc; + const VVCSPS *sps = lc->fc->ps.sps; + const CodingUnit *cu = lc->cu; + const Mv *bv = &cu->pu.mi.mv[L0][0]; + + if (sps->ctb_size_y < ((cu->y0 + (bv->y >> 4)) & (sps->ctb_size_y - 1)) + cu->cb_height) { + av_log(fc->log_ctx, AV_LOG_ERROR, "IBC region spans multiple CTBs.\n"); + return AVERROR_INVALIDDATA; + } + + return 0; +} + +int ff_vvc_mvp_ibc(VVCLocalContext *lc, const int mvp_l0_flag, const int amvr_shift, Mv *mv) { LOCAL_ALIGNED_8(Mv, mvp, [1]); ibc_merge_candidates(lc, mvp_l0_flag, mvp); ibc_add_mvp(mv, mvp, amvr_shift); + return ibc_check_mv(lc, mv); } -void ff_vvc_luma_mv_merge_ibc(VVCLocalContext *lc, const int merge_idx, Mv *mv) +int ff_vvc_luma_mv_merge_ibc(VVCLocalContext *lc, const int merge_idx, Mv *mv) { ibc_merge_candidates(lc, merge_idx, mv); + return ibc_check_mv(lc, mv); } static int affine_mvp_constructed_cp(NeighbourContext *ctx, diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.h b/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.h index 3f0c8b08e9..b2242b2a4d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.h +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/mvs.h @@ -30,9 +30,9 @@ void ff_vvc_clip_mv(Mv *mv); void ff_vvc_mv_scale(Mv *dst, const Mv *src, int td, int tb); void ff_vvc_luma_mv_merge_mode(VVCLocalContext *lc, int merge_idx, int ciip_flag, MvField *mv); void ff_vvc_luma_mv_merge_gpm(VVCLocalContext *lc, const int merge_gpm_idx[2], MvField *mv); -void ff_vvc_luma_mv_merge_ibc(VVCLocalContext *lc, int merge_idx, Mv *mv); +int ff_vvc_luma_mv_merge_ibc(VVCLocalContext *lc, int merge_idx, Mv *mv); void ff_vvc_mvp(VVCLocalContext *lc, const int *mvp_lx_flag, const int amvr_shift, MotionInfo *mi); -void ff_vvc_mvp_ibc(VVCLocalContext *lc, int mvp_l0_flag, int amvr_shift, Mv *mv); +int ff_vvc_mvp_ibc(VVCLocalContext *lc, int mvp_l0_flag, int amvr_shift, Mv *mv); void ff_vvc_sb_mv_merge_mode(VVCLocalContext *lc, int merge_subblock_idx, PredictionUnit *pu); void ff_vvc_affine_mvp(VVCLocalContext *lc, const int *mvp_lx_flag, const int amvr_shift, MotionInfo* mi); void ff_vvc_store_sb_mvs(const VVCLocalContext *lc, PredictionUnit *pu); diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c b/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c index 92368eafc2..58496c9fba 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ps.c @@ -796,8 +796,49 @@ static int ph_max_num_subblock_merge_cand(const H266RawSPS *sps, const H266RawPi return sps->sps_sbtmvp_enabled_flag && ph->ph_temporal_mvp_enabled_flag; } +static int ph_vb_pos(uint16_t *vbs, uint8_t *num_vbs, const uint16_t *pos_minus_1, const uint8_t num_pos, uint16_t max, const int ctb_size_y) +{ + max = FF_CEIL_RSHIFT(max, 3) - 2; + for (int i = 0; i < num_pos; i++) { + if (pos_minus_1[i] > max) + return AVERROR_INVALIDDATA; + + vbs[i] = (pos_minus_1[i] + 1) << 3; + + // The distance between any two vertical virtual boundaries shall be greater than or equal to CtbSizeY luma samples + if (i && vbs[i] < vbs[i - 1] + ctb_size_y) + return AVERROR_INVALIDDATA; + } + *num_vbs = num_pos; + + return 0; +} + +#define VBF(f) (sps->sps_virtual_boundaries_present_flag ? sps->sps_##f : ph->r->ph_##f) +#define VBFS(c, d) VBF(virtual_boundary_pos_##c##_minus1), VBF(num_##d##_virtual_boundaries) + +static int ph_vb(VVCPH *ph, const H266RawSPS *sps, const H266RawPPS *pps) +{ + const int ctb_size_y = 1 << (sps->sps_log2_ctu_size_minus5 + 5); + int ret; + + if (!sps->sps_virtual_boundaries_enabled_flag) + return 0; + + ret = ph_vb_pos(ph->vb_pos_x, &ph->num_ver_vbs, VBFS(x, ver), pps->pps_pic_width_in_luma_samples, ctb_size_y); + if (ret < 0) + return ret; + + ret = ph_vb_pos(ph->vb_pos_y, &ph->num_hor_vbs, VBFS(y, hor), pps->pps_pic_height_in_luma_samples, ctb_size_y); + if (ret < 0) + return ret; + + return 0; +} + static int ph_derive(VVCPH *ph, const H266RawSPS *sps, const H266RawPPS *pps, const int poc_tid0, const int is_clvss) { + int ret; ph->max_num_subblock_merge_cand = ph_max_num_subblock_merge_cand(sps, ph->r); ph->poc = ph_compute_poc(ph->r, sps, poc_tid0, is_clvss); @@ -805,6 +846,10 @@ static int ph_derive(VVCPH *ph, const H266RawSPS *sps, const H266RawPPS *pps, co if (pps->pps_wp_info_in_ph_flag) pred_weight_table(&ph->pwt, &ph->r->ph_pred_weight_table); + ret = ph_vb(ph, sps, pps); + if (ret < 0) + return ret; + return 0; } diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ps.h b/src/ExtLib/ffmpeg/libavcodec/vvc/ps.h index 6656a06320..9203e2c57f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ps.h +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ps.h @@ -151,6 +151,12 @@ typedef struct VVCPH { //derived values uint32_t max_num_subblock_merge_cand; ///< MaxNumSubblockMergeCand int32_t poc; ///< PicOrderCntVal + + uint8_t num_ver_vbs; ///< NumVerVirtualBoundaries + uint16_t vb_pos_x[VVC_MAX_VBS]; ///< VirtualBoundaryPosX + uint8_t num_hor_vbs; ///< NumHorVirtualBoundaries + uint16_t vb_pos_y[VVC_MAX_VBS]; ///< VirtualBoundaryPosY + PredWeightTable pwt; } VVCPH; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c b/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c index 8b7ba639a3..26a5b0b34c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c @@ -191,7 +191,7 @@ int ff_vvc_set_new_ref(VVCContext *s, VVCFrameContext *fc, AVFrame **frame) fc->ref = ref; if (s->no_output_before_recovery_flag && (IS_RASL(s) || !GDR_IS_RECOVERED(s))) - ref->flags = 0; + ref->flags = VVC_FRAME_FLAG_SHORT_REF; else if (ph->r->ph_pic_output_flag) ref->flags = VVC_FRAME_FLAG_OUTPUT; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c b/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c index 8777d380bf..0cacb1f51c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c @@ -443,8 +443,11 @@ static int run_inter(VVCContext *s, VVCLocalContext *lc, VVCTask *t) { VVCFrameContext *fc = lc->fc; const CTU *ctu = fc->tab.ctus + t->rs; + int ret; - ff_vvc_predict_inter(lc, t->rs); + ret = ff_vvc_predict_inter(lc, t->rs); + if (ret < 0) + return ret; if (ctu->has_dmvr) report_frame_progress(fc, t->ry, VVC_PROGRESS_MV); @@ -454,9 +457,7 @@ static int run_inter(VVCContext *s, VVCLocalContext *lc, VVCTask *t) static int run_recon(VVCContext *s, VVCLocalContext *lc, VVCTask *t) { - ff_vvc_reconstruct(lc, t->rs, t->rx, t->ry); - - return 0; + return ff_vvc_reconstruct(lc, t->rs, t->rx, t->ry); } static int run_lmcs(VVCContext *s, VVCLocalContext *lc, VVCTask *t) diff --git a/src/ExtLib/ffmpeg/libavcodec/x86/vvc/vvc_alf.asm b/src/ExtLib/ffmpeg/libavcodec/x86/vvc/vvc_alf.asm index b35dd9b0e9..f69a69f05f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/x86/vvc/vvc_alf.asm +++ b/src/ExtLib/ffmpeg/libavcodec/x86/vvc/vvc_alf.asm @@ -324,18 +324,69 @@ SECTION .text %endif %endmacro -; STORE_PIXELS(dst, src) -%macro STORE_PIXELS 2 +; STORE_PIXELS_W16(dst, src) +%macro STORE_PIXELS_W16 2 %if ps == 2 - movu %1, m%2 + movu [%1], m%2 %else + movu [%1], xm%2 + %endif +%endmacro + +%macro STORE_PIXELS_W8 2 + %if ps == 2 + movu [%1], xm%2 + %else + movq [%1], xm%2 + %endif +%endmacro + +; STORE_PIXELS_W4(dst, src, offset) +%macro STORE_PIXELS_W4 3 + %if ps == 2 + movq [%1 + %3 * ps], xm%2 + %else + movd [%1 + %3], xm%2 + %endif +%endmacro + +%macro STORE_PIXELS_W8LE 3 + cmp %3, 8 + jl .w4 + STORE_PIXELS_W8 %1, %2 + cmp %3, 12 + %if ps == 2 + vpermq m%2, m%2, q0302 + %else + vpermq m%2, m%2, q0101 + %endif + jl .end + STORE_PIXELS_W4 %1, %2, 8 + jmp .end +.w4: + STORE_PIXELS_W4 %1, %2, 0 +.end: +%endmacro + +; STORE_PIXELS(dst, src, width) +%macro STORE_PIXELS 3 + %if ps == 1 packuswb m%2, m%2 vpermq m%2, m%2, 0x8 - movu %1, xm%2 + %endif + + %ifidn %3, 16 + STORE_PIXELS_W16 %1, %2 + %else + %if LUMA + STORE_PIXELS_W8 %1, %2 + %else + STORE_PIXELS_W8LE %1, %2, %3 + %endif %endif %endmacro -%macro FILTER_16x4 0 +%macro FILTER_16x4 1 %if LUMA push clipq push strideq @@ -362,7 +413,7 @@ SECTION .text ; clip to pixel CLIPW m0, m14, m15 - STORE_PIXELS [dstq], 0 + STORE_PIXELS dstq, 0, %1 lea srcq, [srcq + src_strideq] lea dstq, [dstq + dst_strideq] @@ -399,7 +450,7 @@ SECTION .text ; const uint8_t *src, ptrdiff_t src_stride, const ptrdiff_t width, cosnt ptr_diff_t height, ; const int16_t *filter, const int16_t *clip, ptrdiff_t stride, ptrdiff_t vb_pos, ptrdiff_t pixel_max); ; ****************************** -cglobal vvc_alf_filter_%2_%1bpc, 11, 15, 16, 0-0x28, dst, dst_stride, src, src_stride, width, height, filter, clip, stride, vb_pos, pixel_max, \ +cglobal vvc_alf_filter_%2_%1bpc, 11, 15, 16, 0-0x30, dst, dst_stride, src, src_stride, width, height, filter, clip, stride, vb_pos, pixel_max, \ offset, x, s5, s6 %define ps (%1 / 8) ; pixel size movd xm15, pixel_maxd @@ -409,18 +460,32 @@ cglobal vvc_alf_filter_%2_%1bpc, 11, 15, 16, 0-0x28, dst, dst_stride, src, src_s .loop: push srcq push dstq + push widthq xor xq, xq .loop_w: + cmp widthq, 16 + jl .loop_w_end + LOAD_PARAMS - FILTER_16x4 + FILTER_16x4 16 add srcq, 16 * ps add dstq, 16 * ps add xq, 16 - cmp xq, widthq - jl .loop_w + sub widthq, 16 + jmp .loop_w + +.loop_w_end: + cmp widthq, 0 + je .w_end + + LOAD_PARAMS + FILTER_16x4 widthq + +.w_end: + pop widthq pop dstq pop srcq lea srcq, [srcq + 4 * src_strideq] diff --git a/src/ExtLib/ffmpeg/libavutil/executor.c b/src/ExtLib/ffmpeg/libavutil/executor.c index 26691fe157..fb20104b58 100644 --- a/src/ExtLib/ffmpeg/libavutil/executor.c +++ b/src/ExtLib/ffmpeg/libavutil/executor.c @@ -82,9 +82,11 @@ static int run_one_task(AVExecutor *e, void *lc) /* nothing */; if (*prev) { AVTask *t = remove_task(prev, *prev); - ff_mutex_unlock(&e->lock); + if (e->thread_count > 0) + ff_mutex_unlock(&e->lock); cb->run(t, lc, cb->user_data); - ff_mutex_lock(&e->lock); + if (e->thread_count > 0) + ff_mutex_lock(&e->lock); return 1; } return 0; @@ -146,14 +148,17 @@ AVExecutor* av_executor_alloc(const AVTaskCallbacks *cb, int thread_count) return NULL; e->cb = *cb; - e->local_contexts = av_calloc(thread_count, e->cb.local_context_size); + e->local_contexts = av_calloc(FFMAX(thread_count, 1), e->cb.local_context_size); if (!e->local_contexts) goto free_executor; - e->threads = av_calloc(thread_count, sizeof(*e->threads)); + e->threads = av_calloc(FFMAX(thread_count, 1), sizeof(*e->threads)); if (!e->threads) goto free_executor; + if (!thread_count) + return e; + has_lock = !ff_mutex_init(&e->lock, NULL); has_cond = !ff_cond_init(&e->cond, NULL); @@ -175,9 +180,12 @@ AVExecutor* av_executor_alloc(const AVTaskCallbacks *cb, int thread_count) void av_executor_free(AVExecutor **executor) { + int thread_count; + if (!executor || !*executor) return; - executor_free(*executor, 1, 1); + thread_count = (*executor)->thread_count; + executor_free(*executor, thread_count, thread_count); *executor = NULL; } @@ -195,9 +203,9 @@ void av_executor_execute(AVExecutor *e, AVTask *t) ff_cond_signal(&e->cond); ff_mutex_unlock(&e->lock); -#if !HAVE_THREADS - // We are running in a single-threaded environment, so we must handle all tasks ourselves - while (run_one_task(e, e->local_contexts)) - /* nothing */; -#endif + if (!e->thread_count || !HAVE_THREADS) { + // We are running in a single-threaded environment, so we must handle all tasks ourselves + while (run_one_task(e, e->local_contexts)) + /* nothing */; + } } diff --git a/src/ExtLib/ffmpeg/libavutil/executor.h b/src/ExtLib/ffmpeg/libavutil/executor.h index c602bcb613..0eb21c10c8 100644 --- a/src/ExtLib/ffmpeg/libavutil/executor.h +++ b/src/ExtLib/ffmpeg/libavutil/executor.h @@ -46,7 +46,7 @@ typedef struct AVTaskCallbacks { /** * Alloc executor * @param callbacks callback structure for executor - * @param thread_count worker thread number + * @param thread_count worker thread number, 0 for run on caller's thread directly * @return return the executor */ AVExecutor* av_executor_alloc(const AVTaskCallbacks *callbacks, int thread_count); diff --git a/src/ExtLib/ffmpeg/libavutil/stereo3d.c b/src/ExtLib/ffmpeg/libavutil/stereo3d.c index b10423dc48..d5728178a8 100644 --- a/src/ExtLib/ffmpeg/libavutil/stereo3d.c +++ b/src/ExtLib/ffmpeg/libavutil/stereo3d.c @@ -29,9 +29,15 @@ static void get_defaults(AVStereo3D *stereo) { stereo->horizontal_disparity_adjustment = (AVRational) { 0, 1 }; + stereo->horizontal_field_of_view = (AVRational) { 0, 1 }; } AVStereo3D *av_stereo3d_alloc(void) +{ + return av_stereo3d_alloc_size(NULL); +} + +AVStereo3D *av_stereo3d_alloc_size(size_t *size) { AVStereo3D *stereo = av_mallocz(sizeof(AVStereo3D)); if (!stereo) @@ -39,6 +45,9 @@ AVStereo3D *av_stereo3d_alloc(void) get_defaults(stereo); + if (size) + *size = sizeof(*stereo); + return stereo; } @@ -65,12 +74,14 @@ static const char * const stereo3d_type_names[] = { [AV_STEREO3D_SIDEBYSIDE_QUINCUNX] = "side by side (quincunx subsampling)", [AV_STEREO3D_LINES] = "interleaved lines", [AV_STEREO3D_COLUMNS] = "interleaved columns", + [AV_STEREO3D_UNSPEC] = "unspecified", }; static const char * const stereo3d_view_names[] = { [AV_STEREO3D_VIEW_PACKED] = "packed", [AV_STEREO3D_VIEW_LEFT] = "left", [AV_STEREO3D_VIEW_RIGHT] = "right", + [AV_STEREO3D_VIEW_UNSPEC] = "unspecified", }; static const char * const stereo3d_primary_eye_names[] = { diff --git a/src/ExtLib/ffmpeg/libavutil/stereo3d.h b/src/ExtLib/ffmpeg/libavutil/stereo3d.h index 00a5c3900e..c0a4ab3f2d 100644 --- a/src/ExtLib/ffmpeg/libavutil/stereo3d.h +++ b/src/ExtLib/ffmpeg/libavutil/stereo3d.h @@ -136,6 +136,11 @@ enum AVStereo3DType { * @endcode */ AV_STEREO3D_COLUMNS, + + /** + * Video is stereoscopic but the packing is unspecified. + */ + AV_STEREO3D_UNSPEC, }; /** @@ -156,6 +161,11 @@ enum AVStereo3DView { * Frame contains only the right view. */ AV_STEREO3D_VIEW_RIGHT, + + /** + * Content is unspecified. + */ + AV_STEREO3D_VIEW_UNSPEC, }; /** @@ -224,9 +234,9 @@ typedef struct AVStereo3D { AVRational horizontal_disparity_adjustment; /** - * Horizontal field of view in thousanths of a degree. Zero if unset. + * Horizontal field of view, in degrees. Zero if unset. */ - uint32_t horizontal_field_of_view; + AVRational horizontal_field_of_view; } AVStereo3D; /** @@ -237,6 +247,14 @@ typedef struct AVStereo3D { */ AVStereo3D *av_stereo3d_alloc(void); +/** + * Allocate an AVStereo3D structure and set its fields to default values. + * The resulting struct can be freed using av_freep(). + * + * @return An AVStereo3D filled with default values or NULL on failure. + */ +AVStereo3D *av_stereo3d_alloc_size(size_t *size); + /** * Allocate a complete AVFrameSideData and add it to the frame. * diff --git a/src/ExtLib/ffmpeg/libavutil/version.h b/src/ExtLib/ffmpeg/libavutil/version.h index 78e6431642..a8962734e7 100644 --- a/src/ExtLib/ffmpeg/libavutil/version.h +++ b/src/ExtLib/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 25 +#define LIBAVUTIL_VERSION_MINOR 27 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libswscale/output.c b/src/ExtLib/ffmpeg/libswscale/output.c index b234f9c6b9..0e6181b3e0 100644 --- a/src/ExtLib/ffmpeg/libswscale/output.c +++ b/src/ExtLib/ffmpeg/libswscale/output.c @@ -1221,8 +1221,8 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0, Y2 += (1 << 13) - (1 << 29); if (hasAlpha) { - A1 = abuf0[i * 2 ] << 11; - A2 = abuf0[i * 2 + 1] << 11; + A1 = abuf0[i * 2 ] * (1 << 11); + A2 = abuf0[i * 2 + 1] * (1 << 11); A1 += 1 << 13; A2 += 1 << 13; @@ -1267,8 +1267,8 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0, Y2 += (1 << 13) - (1 << 29); if (hasAlpha) { - A1 = abuf0[i * 2 ] << 11; - A2 = abuf0[i * 2 + 1] << 11; + A1 = abuf0[i * 2 ] * (1 << 11); + A2 = abuf0[i * 2 + 1] * (1 << 11); A1 += 1 << 13; A2 += 1 << 13; @@ -1439,7 +1439,7 @@ yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0, Y += (1 << 13) - (1 << 29); if (hasAlpha) { - A = abuf0[i] << 11; + A = abuf0[i] * (1 << 11); A += 1 << 13; } @@ -1472,7 +1472,7 @@ yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0, Y += (1 << 13) - (1 << 29); if (hasAlpha) { - A = abuf0[i] << 11; + A = abuf0[i] * (1 << 11); A += 1 << 13; } @@ -1925,9 +1925,9 @@ static av_always_inline void yuv2rgb_write_full(SwsContext *c, Y -= c->yuv2rgb_y_offset; Y *= c->yuv2rgb_y_coeff; Y += 1 << 21; - R = (unsigned)Y + V*c->yuv2rgb_v2r_coeff; - G = (unsigned)Y + V*c->yuv2rgb_v2g_coeff + U*c->yuv2rgb_u2g_coeff; - B = (unsigned)Y + U*c->yuv2rgb_u2b_coeff; + R = (unsigned)Y + V*(unsigned)c->yuv2rgb_v2r_coeff; + G = (unsigned)Y + V*(unsigned)c->yuv2rgb_v2g_coeff + U*(unsigned)c->yuv2rgb_u2g_coeff; + B = (unsigned)Y + U*(unsigned)c->yuv2rgb_u2b_coeff; if ((R | G | B) & 0xC0000000) { R = av_clip_uintp2(R, 30); G = av_clip_uintp2(G, 30); diff --git a/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c b/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c index c1d6236f37..977eb3a7dd 100644 --- a/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c +++ b/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c @@ -65,20 +65,20 @@ const int *sws_getCoefficients(int colorspace) return ff_yuv2rgb_coeffs[colorspace]; } -#define LOADCHROMA(i) \ +#define LOADCHROMA(pu, pv, i) \ U = pu[i]; \ V = pv[i]; \ r = (void *)c->table_rV[V+YUVRGB_TABLE_HEADROOM]; \ g = (void *)(c->table_gU[U+YUVRGB_TABLE_HEADROOM] + c->table_gV[V+YUVRGB_TABLE_HEADROOM]); \ b = (void *)c->table_bU[U+YUVRGB_TABLE_HEADROOM]; -#define PUTRGB(dst, src, i) \ +#define PUTRGB(dst, src, asrc, i, abase) \ Y = src[2 * i]; \ dst[2 * i] = r[Y] + g[Y] + b[Y]; \ Y = src[2 * i + 1]; \ dst[2 * i + 1] = r[Y] + g[Y] + b[Y]; -#define PUTRGB24(dst, src, i) \ +#define PUTRGB24(dst, src, asrc, i, abase) \ Y = src[2 * i]; \ dst[6 * i + 0] = r[Y]; \ dst[6 * i + 1] = g[Y]; \ @@ -88,7 +88,7 @@ const int *sws_getCoefficients(int colorspace) dst[6 * i + 4] = g[Y]; \ dst[6 * i + 5] = b[Y]; -#define PUTBGR24(dst, src, i) \ +#define PUTBGR24(dst, src, asrc, i, abase) \ Y = src[2 * i]; \ dst[6 * i + 0] = b[Y]; \ dst[6 * i + 1] = g[Y]; \ @@ -98,13 +98,13 @@ const int *sws_getCoefficients(int colorspace) dst[6 * i + 4] = g[Y]; \ dst[6 * i + 5] = r[Y]; -#define PUTRGBA(dst, ysrc, asrc, i, s) \ +#define PUTRGBA(dst, ysrc, asrc, i, abase) \ Y = ysrc[2 * i]; \ - dst[2 * i] = r[Y] + g[Y] + b[Y] + (asrc[2 * i] << s); \ + dst[2 * i] = r[Y] + g[Y] + b[Y] + (asrc[2 * i] << abase); \ Y = ysrc[2 * i + 1]; \ - dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << s); + dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << abase); -#define PUTRGB48(dst, src, i) \ +#define PUTRGB48(dst, src, asrc, i, abase) \ Y = src[ 2 * i]; \ dst[12 * i + 0] = dst[12 * i + 1] = r[Y]; \ dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \ @@ -114,7 +114,7 @@ const int *sws_getCoefficients(int colorspace) dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \ dst[12 * i + 10] = dst[12 * i + 11] = b[Y]; -#define PUTBGR48(dst, src, i) \ +#define PUTBGR48(dst, src, asrc, i, abase) \ Y = src[2 * i]; \ dst[12 * i + 0] = dst[12 * i + 1] = b[Y]; \ dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \ @@ -124,17 +124,13 @@ const int *sws_getCoefficients(int colorspace) dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \ dst[12 * i + 10] = dst[12 * i + 11] = r[Y]; -#define YUV2RGBFUNC(func_name, dst_type, alpha) \ +#define YUV2RGBFUNC(func_name, dst_type, alpha, yuv422) \ static int func_name(SwsContext *c, const uint8_t *src[], \ int srcStride[], int srcSliceY, int srcSliceH, \ uint8_t *dst[], int dstStride[]) \ { \ int y; \ \ - if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) { \ - srcStride[1] *= 2; \ - srcStride[2] *= 2; \ - } \ for (y = 0; y < srcSliceH; y += 2) { \ int yd = y + srcSliceY; \ dst_type *dst_1 = \ @@ -144,10 +140,15 @@ const int *sws_getCoefficients(int colorspace) dst_type av_unused *r, *g, *b; \ const uint8_t *py_1 = src[0] + y * srcStride[0]; \ const uint8_t *py_2 = py_1 + srcStride[0]; \ - const uint8_t av_unused *pu = src[1] + (y >> 1) * srcStride[1]; \ - const uint8_t av_unused *pv = src[2] + (y >> 1) * srcStride[2]; \ + const uint8_t av_unused *pu_1 = src[1] + (y >> !yuv422) * srcStride[1]; \ + const uint8_t av_unused *pv_1 = src[2] + (y >> !yuv422) * srcStride[2]; \ + const uint8_t av_unused *pu_2, *pv_2; \ const uint8_t av_unused *pa_1, *pa_2; \ unsigned int h_size = c->dstW >> 3; \ + if (yuv422) { \ + pu_2 = pu_1 + srcStride[1]; \ + pv_2 = pv_1 + srcStride[2]; \ + } \ if (alpha) { \ pa_1 = src[3] + y * srcStride[3]; \ pa_2 = pa_1 + srcStride[3]; \ @@ -155,11 +156,19 @@ const int *sws_getCoefficients(int colorspace) while (h_size--) { \ int av_unused U, V, Y; \ -#define ENDYUV2RGBLINE(dst_delta, ss) \ - pu += 4 >> ss; \ - pv += 4 >> ss; \ +#define ENDYUV2RGBLINE(dst_delta, ss, alpha, yuv422) \ + pu_1 += 4 >> ss; \ + pv_1 += 4 >> ss; \ + if (yuv422) { \ + pu_2 += 4 >> ss; \ + pv_2 += 4 >> ss; \ + } \ py_1 += 8 >> ss; \ py_2 += 8 >> ss; \ + if (alpha) { \ + pa_1 += 8 >> ss; \ + pa_2 += 8 >> ss; \ + } \ dst_1 += dst_delta >> ss; \ dst_2 += dst_delta >> ss; \ } \ @@ -172,240 +181,173 @@ const int *sws_getCoefficients(int colorspace) return srcSliceH; \ } -#define CLOSEYUV2RGBFUNC(dst_delta) \ - ENDYUV2RGBLINE(dst_delta, 0) \ +#define YUV420FUNC(func_name, dst_type, alpha, abase, PUTFUNC, dst_delta) \ + YUV2RGBFUNC(func_name, dst_type, alpha, 0) \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, pa_1, 0, abase); \ + PUTFUNC(dst_2, py_2, pa_2, 0, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_2, py_2, pa_2, 1, abase); \ + PUTFUNC(dst_1, py_1, pa_1, 1, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 2); \ + PUTFUNC(dst_1, py_1, pa_1, 2, abase); \ + PUTFUNC(dst_2, py_2, pa_2, 2, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 3); \ + PUTFUNC(dst_2, py_2, pa_2, 3, abase); \ + PUTFUNC(dst_1, py_1, pa_1, 3, abase); \ + ENDYUV2RGBLINE(dst_delta, 0, alpha, 0) \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, pa_1, 0, abase); \ + PUTFUNC(dst_2, py_2, pa_2, 0, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_2, py_2, pa_2, 1, abase); \ + PUTFUNC(dst_1, py_1, pa_1, 1, abase); \ + ENDYUV2RGBLINE(dst_delta, 1, alpha, 0) \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, pa_1, 0, abase); \ + PUTFUNC(dst_2, py_2, pa_2, 0, abase); \ ENDYUV2RGBFUNC() -YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0) - LOADCHROMA(0); - PUTRGB48(dst_1, py_1, 0); - PUTRGB48(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTRGB48(dst_2, py_2, 1); - PUTRGB48(dst_1, py_1, 1); - - LOADCHROMA(2); - PUTRGB48(dst_1, py_1, 2); - PUTRGB48(dst_2, py_2, 2); - - LOADCHROMA(3); - PUTRGB48(dst_2, py_2, 3); - PUTRGB48(dst_1, py_1, 3); -ENDYUV2RGBLINE(48, 0) - LOADCHROMA(0); - PUTRGB48(dst_1, py_1, 0); - PUTRGB48(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTRGB48(dst_2, py_2, 1); - PUTRGB48(dst_1, py_1, 1); -ENDYUV2RGBLINE(48, 1) - LOADCHROMA(0); - PUTRGB48(dst_1, py_1, 0); - PUTRGB48(dst_2, py_2, 0); -ENDYUV2RGBFUNC() - -YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0) - LOADCHROMA(0); - PUTBGR48(dst_1, py_1, 0); - PUTBGR48(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTBGR48(dst_2, py_2, 1); - PUTBGR48(dst_1, py_1, 1); - - LOADCHROMA(2); - PUTBGR48(dst_1, py_1, 2); - PUTBGR48(dst_2, py_2, 2); - - LOADCHROMA(3); - PUTBGR48(dst_2, py_2, 3); - PUTBGR48(dst_1, py_1, 3); -ENDYUV2RGBLINE(48, 0) - LOADCHROMA(0); - PUTBGR48(dst_1, py_1, 0); - PUTBGR48(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTBGR48(dst_2, py_2, 1); - PUTBGR48(dst_1, py_1, 1); -ENDYUV2RGBLINE(48, 1) - LOADCHROMA(0); - PUTBGR48(dst_1, py_1, 0); - PUTBGR48(dst_2, py_2, 0); -ENDYUV2RGBFUNC() - -YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) - LOADCHROMA(0); - PUTRGB(dst_1, py_1, 0); - PUTRGB(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTRGB(dst_2, py_2, 1); - PUTRGB(dst_1, py_1, 1); - - LOADCHROMA(2); - PUTRGB(dst_1, py_1, 2); - PUTRGB(dst_2, py_2, 2); - - LOADCHROMA(3); - PUTRGB(dst_2, py_2, 3); - PUTRGB(dst_1, py_1, 3); -ENDYUV2RGBLINE(8, 0) - LOADCHROMA(0); - PUTRGB(dst_1, py_1, 0); - PUTRGB(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTRGB(dst_2, py_2, 1); - PUTRGB(dst_1, py_1, 1); -ENDYUV2RGBLINE(8, 1) - LOADCHROMA(0); - PUTRGB(dst_1, py_1, 0); - PUTRGB(dst_2, py_2, 0); -ENDYUV2RGBFUNC() - -#if HAVE_BIGENDIAN -YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) -#else -YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) -#endif - LOADCHROMA(0); - PUTRGBA(dst_1, py_1, pa_1, 0, 24); - PUTRGBA(dst_2, py_2, pa_2, 0, 24); - - LOADCHROMA(1); - PUTRGBA(dst_2, py_2, pa_2, 1, 24); - PUTRGBA(dst_1, py_1, pa_1, 1, 24); - - LOADCHROMA(2); - PUTRGBA(dst_1, py_1, pa_1, 2, 24); - PUTRGBA(dst_2, py_2, pa_2, 2, 24); - - LOADCHROMA(3); - PUTRGBA(dst_2, py_2, pa_2, 3, 24); - PUTRGBA(dst_1, py_1, pa_1, 3, 24); - pa_1 += 8; - pa_2 += 8; -ENDYUV2RGBLINE(8, 0) - LOADCHROMA(0); - PUTRGBA(dst_1, py_1, pa_1, 0, 24); - PUTRGBA(dst_2, py_2, pa_2, 0, 24); - - LOADCHROMA(1); - PUTRGBA(dst_2, py_2, pa_2, 1, 24); - PUTRGBA(dst_1, py_1, pa_1, 1, 24); - pa_1 += 4; - pa_2 += 4; -ENDYUV2RGBLINE(8, 1) - LOADCHROMA(0); - PUTRGBA(dst_1, py_1, pa_1, 0, 24); - PUTRGBA(dst_2, py_2, pa_2, 0, 24); -ENDYUV2RGBFUNC() - -#if HAVE_BIGENDIAN -YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) -#else -YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) -#endif - LOADCHROMA(0); - PUTRGBA(dst_1, py_1, pa_1, 0, 0); - PUTRGBA(dst_2, py_2, pa_2, 0, 0); - - LOADCHROMA(1); - PUTRGBA(dst_2, py_2, pa_2, 1, 0); - PUTRGBA(dst_1, py_1, pa_1, 1, 0); - - LOADCHROMA(2); - PUTRGBA(dst_1, py_1, pa_1, 2, 0); - PUTRGBA(dst_2, py_2, pa_2, 2, 0); - - LOADCHROMA(3); - PUTRGBA(dst_2, py_2, pa_2, 3, 0); - PUTRGBA(dst_1, py_1, pa_1, 3, 0); - pa_1 += 8; - pa_2 += 8; -ENDYUV2RGBLINE(8, 0) - LOADCHROMA(0); - PUTRGBA(dst_1, py_1, pa_1, 0, 0); - PUTRGBA(dst_2, py_2, pa_2, 0, 0); - - LOADCHROMA(1); - PUTRGBA(dst_2, py_2, pa_2, 1, 0); - PUTRGBA(dst_1, py_1, pa_1, 1, 0); - pa_1 += 4; - pa_2 += 4; -ENDYUV2RGBLINE(8, 1) - LOADCHROMA(0); - PUTRGBA(dst_1, py_1, pa_1, 0, 0); - PUTRGBA(dst_2, py_2, pa_2, 0, 0); -ENDYUV2RGBFUNC() +#define YUV422FUNC(func_name, dst_type, alpha, abase, PUTFUNC, dst_delta) \ + YUV2RGBFUNC(func_name, dst_type, alpha, 1) \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, pa_1, 0, abase); \ + \ + LOADCHROMA(pu_2, pv_2, 0); \ + PUTFUNC(dst_2, py_2, pa_2, 0, abase); \ + \ + LOADCHROMA(pu_2, pv_2, 1); \ + PUTFUNC(dst_2, py_2, pa_2, 1, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_1, py_1, pa_1, 1, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 2); \ + PUTFUNC(dst_1, py_1, pa_1, 2, abase); \ + \ + LOADCHROMA(pu_2, pv_2, 2); \ + PUTFUNC(dst_2, py_2, pa_2, 2, abase); \ + \ + LOADCHROMA(pu_2, pv_2, 3); \ + PUTFUNC(dst_2, py_2, pa_2, 3, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 3); \ + PUTFUNC(dst_1, py_1, pa_1, 3, abase); \ + ENDYUV2RGBLINE(dst_delta, 0, alpha, 1) \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, pa_1, 0, abase); \ + \ + LOADCHROMA(pu_2, pv_2, 0); \ + PUTFUNC(dst_2, py_2, pa_2, 0, abase); \ + \ + LOADCHROMA(pu_2, pv_2, 1); \ + PUTFUNC(dst_2, py_2, pa_2, 1, abase); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_1, py_1, pa_1, 1, abase); \ + ENDYUV2RGBLINE(dst_delta, 1, alpha, 1) \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, pa_1, 0, abase); \ + \ + LOADCHROMA(pu_2, pv_2, 0); \ + PUTFUNC(dst_2, py_2, pa_2, 0, abase); \ + ENDYUV2RGBFUNC() -YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) - LOADCHROMA(0); - PUTRGB24(dst_1, py_1, 0); - PUTRGB24(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTRGB24(dst_2, py_2, 1); - PUTRGB24(dst_1, py_1, 1); - - LOADCHROMA(2); - PUTRGB24(dst_1, py_1, 2); - PUTRGB24(dst_2, py_2, 2); - - LOADCHROMA(3); - PUTRGB24(dst_2, py_2, 3); - PUTRGB24(dst_1, py_1, 3); -ENDYUV2RGBLINE(24, 0) - LOADCHROMA(0); - PUTRGB24(dst_1, py_1, 0); - PUTRGB24(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTRGB24(dst_2, py_2, 1); - PUTRGB24(dst_1, py_1, 1); -ENDYUV2RGBLINE(24, 1) - LOADCHROMA(0); - PUTRGB24(dst_1, py_1, 0); - PUTRGB24(dst_2, py_2, 0); -ENDYUV2RGBFUNC() +#define YUV420FUNC_DITHER(func_name, dst_type, LOADDITHER, PUTFUNC, dst_delta) \ + YUV2RGBFUNC(func_name, dst_type, 0, 0) \ + LOADDITHER \ + \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, 0, 0); \ + PUTFUNC(dst_2, py_2, 0, 0 + 8); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_2, py_2, 1, 2 + 8); \ + PUTFUNC(dst_1, py_1, 1, 2); \ + \ + LOADCHROMA(pu_1, pv_1, 2); \ + PUTFUNC(dst_1, py_1, 2, 4); \ + PUTFUNC(dst_2, py_2, 2, 4 + 8); \ + \ + LOADCHROMA(pu_1, pv_1, 3); \ + PUTFUNC(dst_2, py_2, 3, 6 + 8); \ + PUTFUNC(dst_1, py_1, 3, 6); \ + ENDYUV2RGBLINE(dst_delta, 0, 0, 0) \ + LOADDITHER \ + \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, 0, 0); \ + PUTFUNC(dst_2, py_2, 0, 0 + 8); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_2, py_2, 1, 2 + 8); \ + PUTFUNC(dst_1, py_1, 1, 2); \ + ENDYUV2RGBLINE(dst_delta, 1, 0, 0) \ + LOADDITHER \ + \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, 0, 0); \ + PUTFUNC(dst_2, py_2, 0, 0 + 8); \ + ENDYUV2RGBFUNC() -// only trivial mods from yuv2rgb_c_24_rgb -YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0) - LOADCHROMA(0); - PUTBGR24(dst_1, py_1, 0); - PUTBGR24(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTBGR24(dst_2, py_2, 1); - PUTBGR24(dst_1, py_1, 1); - - LOADCHROMA(2); - PUTBGR24(dst_1, py_1, 2); - PUTBGR24(dst_2, py_2, 2); - - LOADCHROMA(3); - PUTBGR24(dst_2, py_2, 3); - PUTBGR24(dst_1, py_1, 3); -ENDYUV2RGBLINE(24, 0) - LOADCHROMA(0); - PUTBGR24(dst_1, py_1, 0); - PUTBGR24(dst_2, py_2, 0); - - LOADCHROMA(1); - PUTBGR24(dst_2, py_2, 1); - PUTBGR24(dst_1, py_1, 1); -ENDYUV2RGBLINE(24, 1) - LOADCHROMA(0); - PUTBGR24(dst_1, py_1, 0); - PUTBGR24(dst_2, py_2, 0); -ENDYUV2RGBFUNC() +#define YUV422FUNC_DITHER(func_name, dst_type, LOADDITHER, PUTFUNC, dst_delta) \ + YUV2RGBFUNC(func_name, dst_type, 0, 1) \ + LOADDITHER \ + \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, 0, 0); \ + \ + LOADCHROMA(pu_2, pv_2, 0); \ + PUTFUNC(dst_2, py_2, 0, 0 + 8); \ + \ + LOADCHROMA(pu_2, pv_2, 1); \ + PUTFUNC(dst_2, py_2, 1, 2 + 8); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_1, py_1, 1, 2); \ + \ + LOADCHROMA(pu_1, pv_1, 2); \ + PUTFUNC(dst_1, py_1, 2, 4); \ + \ + LOADCHROMA(pu_2, pv_2, 2); \ + PUTFUNC(dst_2, py_2, 2, 4 + 8); \ + \ + LOADCHROMA(pu_2, pv_2, 3); \ + PUTFUNC(dst_2, py_2, 3, 6 + 8); \ + \ + LOADCHROMA(pu_1, pv_1, 3); \ + PUTFUNC(dst_1, py_1, 3, 6); \ + ENDYUV2RGBLINE(dst_delta, 0, 0, 1) \ + LOADDITHER \ + \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, 0, 0); \ + \ + LOADCHROMA(pu_2, pv_2, 0); \ + PUTFUNC(dst_2, py_2, 0, 0 + 8); \ + \ + LOADCHROMA(pu_2, pv_2, 1); \ + PUTFUNC(dst_2, py_2, 1, 2 + 8); \ + \ + LOADCHROMA(pu_1, pv_1, 1); \ + PUTFUNC(dst_1, py_1, 1, 2); \ + ENDYUV2RGBLINE(dst_delta, 1, 0, 1) \ + LOADDITHER \ + \ + LOADCHROMA(pu_1, pv_1, 0); \ + PUTFUNC(dst_1, py_1, 0, 0); \ + \ + LOADCHROMA(pu_2, pv_2, 0); \ + PUTFUNC(dst_2, py_2, 0, 0 + 8); \ + ENDYUV2RGBFUNC() -YUV2RGBFUNC(yuv2rgb_c_16_ordered_dither, uint16_t, 0) - const uint8_t *d16 = ff_dither_2x2_8[y & 1]; - const uint8_t *e16 = ff_dither_2x2_4[y & 1]; +#define LOADDITHER16 \ + const uint8_t *d16 = ff_dither_2x2_8[y & 1]; \ + const uint8_t *e16 = ff_dither_2x2_4[y & 1]; \ const uint8_t *f16 = ff_dither_2x2_8[(y & 1)^1]; #define PUTRGB16(dst, src, i, o) \ @@ -417,25 +359,9 @@ YUV2RGBFUNC(yuv2rgb_c_16_ordered_dither, uint16_t, 0) dst[2 * i + 1] = r[Y + d16[1 + o]] + \ g[Y + e16[1 + o]] + \ b[Y + f16[1 + o]]; - LOADCHROMA(0); - PUTRGB16(dst_1, py_1, 0, 0); - PUTRGB16(dst_2, py_2, 0, 0 + 8); - LOADCHROMA(1); - PUTRGB16(dst_2, py_2, 1, 2 + 8); - PUTRGB16(dst_1, py_1, 1, 2); - - LOADCHROMA(2); - PUTRGB16(dst_1, py_1, 2, 4); - PUTRGB16(dst_2, py_2, 2, 4 + 8); - - LOADCHROMA(3); - PUTRGB16(dst_2, py_2, 3, 6 + 8); - PUTRGB16(dst_1, py_1, 3, 6); -CLOSEYUV2RGBFUNC(8) - -YUV2RGBFUNC(yuv2rgb_c_15_ordered_dither, uint16_t, 0) - const uint8_t *d16 = ff_dither_2x2_8[y & 1]; +#define LOADDITHER15 \ + const uint8_t *d16 = ff_dither_2x2_8[y & 1]; \ const uint8_t *e16 = ff_dither_2x2_8[(y & 1)^1]; #define PUTRGB15(dst, src, i, o) \ @@ -447,25 +373,8 @@ YUV2RGBFUNC(yuv2rgb_c_15_ordered_dither, uint16_t, 0) dst[2 * i + 1] = r[Y + d16[1 + o]] + \ g[Y + d16[0 + o]] + \ b[Y + e16[1 + o]]; - LOADCHROMA(0); - PUTRGB15(dst_1, py_1, 0, 0); - PUTRGB15(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB15(dst_2, py_2, 1, 2 + 8); - PUTRGB15(dst_1, py_1, 1, 2); - - LOADCHROMA(2); - PUTRGB15(dst_1, py_1, 2, 4); - PUTRGB15(dst_2, py_2, 2, 4 + 8); - - LOADCHROMA(3); - PUTRGB15(dst_2, py_2, 3, 6 + 8); - PUTRGB15(dst_1, py_1, 3, 6); -CLOSEYUV2RGBFUNC(8) -// r, g, b, dst_1, dst_2 -YUV2RGBFUNC(yuv2rgb_c_12_ordered_dither, uint16_t, 0) +#define LOADDITHER12 \ const uint8_t *d16 = ff_dither_4x4_16[y & 3]; #define PUTRGB12(dst, src, i, o) \ @@ -478,26 +387,8 @@ YUV2RGBFUNC(yuv2rgb_c_12_ordered_dither, uint16_t, 0) g[Y + d16[1 + o]] + \ b[Y + d16[1 + o]]; - LOADCHROMA(0); - PUTRGB12(dst_1, py_1, 0, 0); - PUTRGB12(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB12(dst_2, py_2, 1, 2 + 8); - PUTRGB12(dst_1, py_1, 1, 2); - - LOADCHROMA(2); - PUTRGB12(dst_1, py_1, 2, 4); - PUTRGB12(dst_2, py_2, 2, 4 + 8); - - LOADCHROMA(3); - PUTRGB12(dst_2, py_2, 3, 6 + 8); - PUTRGB12(dst_1, py_1, 3, 6); -CLOSEYUV2RGBFUNC(8) - -// r, g, b, dst_1, dst_2 -YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0) - const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; +#define LOADDITHER8 \ + const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; \ const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; #define PUTRGB8(dst, src, i, o) \ @@ -510,46 +401,9 @@ YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0) g[Y + d32[1 + o]] + \ b[Y + d64[1 + o]]; - LOADCHROMA(0); - PUTRGB8(dst_1, py_1, 0, 0); - PUTRGB8(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB8(dst_2, py_2, 1, 2 + 8); - PUTRGB8(dst_1, py_1, 1, 2); - - LOADCHROMA(2); - PUTRGB8(dst_1, py_1, 2, 4); - PUTRGB8(dst_2, py_2, 2, 4 + 8); - - LOADCHROMA(3); - PUTRGB8(dst_2, py_2, 3, 6 + 8); - PUTRGB8(dst_1, py_1, 3, 6); - -ENDYUV2RGBLINE(8, 0) - const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; - const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; - LOADCHROMA(0); - PUTRGB8(dst_1, py_1, 0, 0); - PUTRGB8(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB8(dst_2, py_2, 1, 2 + 8); - PUTRGB8(dst_1, py_1, 1, 2); - -ENDYUV2RGBLINE(8, 1) - const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; - const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; - LOADCHROMA(0); - PUTRGB8(dst_1, py_1, 0, 0); - PUTRGB8(dst_2, py_2, 0, 0 + 8); - -ENDYUV2RGBFUNC() - - -YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0) - const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; - const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; +#define LOADDITHER4D \ + const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; \ + const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; \ int acc; #define PUTRGB4D(dst, src, i, o) \ @@ -563,45 +417,8 @@ YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0) b[Y + d128[1 + o]]) << 4; \ dst[i] = acc; - LOADCHROMA(0); - PUTRGB4D(dst_1, py_1, 0, 0); - PUTRGB4D(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB4D(dst_2, py_2, 1, 2 + 8); - PUTRGB4D(dst_1, py_1, 1, 2); - - LOADCHROMA(2); - PUTRGB4D(dst_1, py_1, 2, 4); - PUTRGB4D(dst_2, py_2, 2, 4 + 8); - - LOADCHROMA(3); - PUTRGB4D(dst_2, py_2, 3, 6 + 8); - PUTRGB4D(dst_1, py_1, 3, 6); - -ENDYUV2RGBLINE(4, 0) - const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; - const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; - int acc; - LOADCHROMA(0); - PUTRGB4D(dst_1, py_1, 0, 0); - PUTRGB4D(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB4D(dst_2, py_2, 1, 2 + 8); - PUTRGB4D(dst_1, py_1, 1, 2); - -ENDYUV2RGBLINE(4, 1) - const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; - const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; - int acc; - LOADCHROMA(0); - PUTRGB4D(dst_1, py_1, 0, 0); - PUTRGB4D(dst_2, py_2, 0, 0 + 8); -ENDYUV2RGBFUNC() - -YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0) - const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; +#define LOADDITHER4DB \ + const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; \ const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; #define PUTRGB4DB(dst, src, i, o) \ @@ -614,40 +431,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0) g[Y + d64[1 + o]] + \ b[Y + d128[1 + o]]; - LOADCHROMA(0); - PUTRGB4DB(dst_1, py_1, 0, 0); - PUTRGB4DB(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB4DB(dst_2, py_2, 1, 2 + 8); - PUTRGB4DB(dst_1, py_1, 1, 2); - - LOADCHROMA(2); - PUTRGB4DB(dst_1, py_1, 2, 4); - PUTRGB4DB(dst_2, py_2, 2, 4 + 8); - - LOADCHROMA(3); - PUTRGB4DB(dst_2, py_2, 3, 6 + 8); - PUTRGB4DB(dst_1, py_1, 3, 6); -ENDYUV2RGBLINE(8, 0) - const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; - const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; - LOADCHROMA(0); - PUTRGB4DB(dst_1, py_1, 0, 0); - PUTRGB4DB(dst_2, py_2, 0, 0 + 8); - - LOADCHROMA(1); - PUTRGB4DB(dst_2, py_2, 1, 2 + 8); - PUTRGB4DB(dst_1, py_1, 1, 2); -ENDYUV2RGBLINE(8, 1) - const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; - const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; - LOADCHROMA(0); - PUTRGB4DB(dst_1, py_1, 0, 0); - PUTRGB4DB(dst_2, py_2, 0, 0 + 8); -ENDYUV2RGBFUNC() - -YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0) +YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0, 0) const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; char out_1 = 0, out_2 = 0; g = c->table_gU[128 + YUVRGB_TABLE_HEADROOM] + c->table_gV[128 + YUVRGB_TABLE_HEADROOM]; @@ -672,7 +456,82 @@ YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0) dst_1[0] = out_1; dst_2[0] = out_2; -CLOSEYUV2RGBFUNC(1) + + py_1 += 8; + py_2 += 8; + dst_1 += 1; + dst_2 += 1; + } + if (c->dstW & 7) { + int av_unused Y, U, V; + int pixels_left = c->dstW & 7; + const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; + char out_1 = 0, out_2 = 0; + g = c->table_gU[128 + YUVRGB_TABLE_HEADROOM] + c->table_gV[128 + YUVRGB_TABLE_HEADROOM]; + +#define PUTRGB1_OR00(out, src, i, o) \ + if (pixels_left) { \ + PUTRGB1(out, src, i, o) \ + pixels_left--; \ + } else { \ + out <<= 2; \ + } + + PUTRGB1_OR00(out_1, py_1, 0, 0); + PUTRGB1_OR00(out_2, py_2, 0, 0 + 8); + + PUTRGB1_OR00(out_2, py_2, 1, 2 + 8); + PUTRGB1_OR00(out_1, py_1, 1, 2); + + PUTRGB1_OR00(out_1, py_1, 2, 4); + PUTRGB1_OR00(out_2, py_2, 2, 4 + 8); + + PUTRGB1_OR00(out_2, py_2, 3, 6 + 8); + PUTRGB1_OR00(out_1, py_1, 3, 6); + + dst_1[0] = out_1; + dst_2[0] = out_2; +ENDYUV2RGBFUNC() + +// YUV420 +YUV420FUNC(yuv2rgb_c_48, uint8_t, 0, 0, PUTRGB48, 48) +YUV420FUNC(yuv2rgb_c_bgr48, uint8_t, 0, 0, PUTBGR48, 48) +YUV420FUNC(yuv2rgb_c_32, uint32_t, 0, 0, PUTRGB, 8) +#if HAVE_BIGENDIAN +YUV420FUNC(yuva2argb_c, uint32_t, 1, 24, PUTRGBA, 8) +YUV420FUNC(yuva2rgba_c, uint32_t, 1, 0, PUTRGBA, 8) +#else +YUV420FUNC(yuva2rgba_c, uint32_t, 1, 24, PUTRGBA, 8) +YUV420FUNC(yuva2argb_c, uint32_t, 1, 0, PUTRGBA, 8) +#endif +YUV420FUNC(yuv2rgb_c_24_rgb, uint8_t, 0, 0, PUTRGB24, 24) +YUV420FUNC(yuv2rgb_c_24_bgr, uint8_t, 0, 0, PUTBGR24, 24) +YUV420FUNC_DITHER(yuv2rgb_c_16_ordered_dither, uint16_t, LOADDITHER16, PUTRGB16, 8) +YUV420FUNC_DITHER(yuv2rgb_c_15_ordered_dither, uint16_t, LOADDITHER15, PUTRGB15, 8) +YUV420FUNC_DITHER(yuv2rgb_c_12_ordered_dither, uint16_t, LOADDITHER12, PUTRGB12, 8) +YUV420FUNC_DITHER(yuv2rgb_c_8_ordered_dither, uint8_t, LOADDITHER8, PUTRGB8, 8) +YUV420FUNC_DITHER(yuv2rgb_c_4_ordered_dither, uint8_t, LOADDITHER4D, PUTRGB4D, 4) +YUV420FUNC_DITHER(yuv2rgb_c_4b_ordered_dither, uint8_t, LOADDITHER4DB, PUTRGB4DB, 8) + +// YUV422 +YUV422FUNC(yuv422p_rgb48_c, uint8_t, 0, 0, PUTRGB48, 48) +YUV422FUNC(yuv422p_bgr48_c, uint8_t, 0, 0, PUTBGR48, 48) +YUV422FUNC(yuv422p_rgb32_c, uint32_t, 0, 0, PUTRGB, 8) +#if HAVE_BIGENDIAN +YUV422FUNC(yuva422p_argb_c, uint32_t, 1, 24, PUTRGBA, 8) +YUV422FUNC(yuva422p_rgba_c, uint32_t, 1, 0, PUTRGBA, 8) +#else +YUV422FUNC(yuva422p_rgba_c, uint32_t, 1, 24, PUTRGBA, 8) +YUV422FUNC(yuva422p_argb_c, uint32_t, 1, 0, PUTRGBA, 8) +#endif +YUV422FUNC(yuv422p_rgb24_c, uint8_t, 0, 0, PUTRGB24, 24) +YUV422FUNC(yuv422p_bgr24_c, uint8_t, 0, 0, PUTBGR24, 24) +YUV422FUNC_DITHER(yuv422p_bgr16, uint16_t, LOADDITHER16, PUTRGB16, 8) +YUV422FUNC_DITHER(yuv422p_bgr15, uint16_t, LOADDITHER15, PUTRGB15, 8) +YUV422FUNC_DITHER(yuv422p_bgr12, uint16_t, LOADDITHER12, PUTRGB12, 8) +YUV422FUNC_DITHER(yuv422p_bgr8, uint8_t, LOADDITHER8, PUTRGB8, 8) +YUV422FUNC_DITHER(yuv422p_bgr4, uint8_t, LOADDITHER4D, PUTRGB4D, 4) +YUV422FUNC_DITHER(yuv422p_bgr4_byte, uint8_t, LOADDITHER4DB, PUTRGB4DB, 8) SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) { @@ -693,44 +552,86 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) "No accelerated colorspace conversion found from %s to %s.\n", av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat)); - switch (c->dstFormat) { - case AV_PIX_FMT_BGR48BE: - case AV_PIX_FMT_BGR48LE: - return yuv2rgb_c_bgr48; - case AV_PIX_FMT_RGB48BE: - case AV_PIX_FMT_RGB48LE: - return yuv2rgb_c_48; - case AV_PIX_FMT_ARGB: - case AV_PIX_FMT_ABGR: - if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) - return yuva2argb_c; - case AV_PIX_FMT_RGBA: - case AV_PIX_FMT_BGRA: - return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32; - case AV_PIX_FMT_RGB24: - return yuv2rgb_c_24_rgb; - case AV_PIX_FMT_BGR24: - return yuv2rgb_c_24_bgr; - case AV_PIX_FMT_RGB565: - case AV_PIX_FMT_BGR565: - return yuv2rgb_c_16_ordered_dither; - case AV_PIX_FMT_RGB555: - case AV_PIX_FMT_BGR555: - return yuv2rgb_c_15_ordered_dither; - case AV_PIX_FMT_RGB444: - case AV_PIX_FMT_BGR444: - return yuv2rgb_c_12_ordered_dither; - case AV_PIX_FMT_RGB8: - case AV_PIX_FMT_BGR8: - return yuv2rgb_c_8_ordered_dither; - case AV_PIX_FMT_RGB4: - case AV_PIX_FMT_BGR4: - return yuv2rgb_c_4_ordered_dither; - case AV_PIX_FMT_RGB4_BYTE: - case AV_PIX_FMT_BGR4_BYTE: - return yuv2rgb_c_4b_ordered_dither; - case AV_PIX_FMT_MONOBLACK: - return yuv2rgb_c_1_ordered_dither; + if (c->srcFormat == AV_PIX_FMT_YUV422P) { + switch (c->dstFormat) { + case AV_PIX_FMT_BGR48BE: + case AV_PIX_FMT_BGR48LE: + return yuv422p_bgr48_c; + case AV_PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48LE: + return yuv422p_rgb48_c; + case AV_PIX_FMT_ARGB: + case AV_PIX_FMT_ABGR: + if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) + return yuva422p_argb_c; + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_BGRA: + return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva422p_rgba_c : yuv422p_rgb32_c; + case AV_PIX_FMT_RGB24: + return yuv422p_rgb24_c; + case AV_PIX_FMT_BGR24: + return yuv422p_bgr24_c; + case AV_PIX_FMT_RGB565: + case AV_PIX_FMT_BGR565: + return yuv422p_bgr16; + case AV_PIX_FMT_RGB555: + case AV_PIX_FMT_BGR555: + return yuv422p_bgr15; + case AV_PIX_FMT_RGB444: + case AV_PIX_FMT_BGR444: + return yuv422p_bgr12; + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + return yuv422p_bgr8; + case AV_PIX_FMT_RGB4: + case AV_PIX_FMT_BGR4: + return yuv422p_bgr4; + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: + return yuv422p_bgr4_byte; + case AV_PIX_FMT_MONOBLACK: + return yuv2rgb_c_1_ordered_dither; + } + } else { + switch (c->dstFormat) { + case AV_PIX_FMT_BGR48BE: + case AV_PIX_FMT_BGR48LE: + return yuv2rgb_c_bgr48; + case AV_PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48LE: + return yuv2rgb_c_48; + case AV_PIX_FMT_ARGB: + case AV_PIX_FMT_ABGR: + if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) + return yuva2argb_c; + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_BGRA: + return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32; + case AV_PIX_FMT_RGB24: + return yuv2rgb_c_24_rgb; + case AV_PIX_FMT_BGR24: + return yuv2rgb_c_24_bgr; + case AV_PIX_FMT_RGB565: + case AV_PIX_FMT_BGR565: + return yuv2rgb_c_16_ordered_dither; + case AV_PIX_FMT_RGB555: + case AV_PIX_FMT_BGR555: + return yuv2rgb_c_15_ordered_dither; + case AV_PIX_FMT_RGB444: + case AV_PIX_FMT_BGR444: + return yuv2rgb_c_12_ordered_dither; + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + return yuv2rgb_c_8_ordered_dither; + case AV_PIX_FMT_RGB4: + case AV_PIX_FMT_BGR4: + return yuv2rgb_c_4_ordered_dither; + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: + return yuv2rgb_c_4b_ordered_dither; + case AV_PIX_FMT_MONOBLACK: + return yuv2rgb_c_1_ordered_dither; + } } return NULL; } From 32b011dbc9db9d8611cc68d4695834dda5f9635a Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 29 Jun 2024 12:35:50 +0300 Subject: [PATCH 035/102] =?UTF-8?q?MPCVideoDec:=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BF=D1=80=D0=B5=D0=BE?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?P010=20=D0=B2=20YV12.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/transform/MPCVideoDec/FormatConverter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/filters/transform/MPCVideoDec/FormatConverter.cpp b/src/filters/transform/MPCVideoDec/FormatConverter.cpp index c074f9bdfc..2b22c26c18 100644 --- a/src/filters/transform/MPCVideoDec/FormatConverter.cpp +++ b/src/filters/transform/MPCVideoDec/FormatConverter.cpp @@ -315,8 +315,6 @@ void CFormatConverter::SetConvertFunc() } else if (m_FProps.pftype == PFType_NV12) { m_pConvertFn = &CFormatConverter::convert_nv12_yv12; m_RequiredAlignment = 32; - } else if (m_FProps.pftype == PFType_P01x) { - m_pConvertFn = &CFormatConverter::convert_p010_nv12_sse2; } #if (0) // disabled because not increase performance else if (m_FProps.pftype == PFType_YUV420) { From 8924f84ff2acd03299598535ad8a3289a4b40101 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 29 Jun 2024 12:52:49 +0300 Subject: [PATCH 036/102] =?UTF-8?q?MPCVideoDec:=20=D0=BD=D0=B5=D0=BC=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D1=83=D1=81=D0=BA=D0=BE=D1=80=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BF=D1=80=D0=B5=D0=BE=D0=B1=D1=80=D0=B0=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20P010=20=D0=B2=20NV12=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81=D0=BE?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=20=D0=B1=D0=B5=D0=B7=20SSE4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transform/MPCVideoDec/FormatConverter.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/filters/transform/MPCVideoDec/FormatConverter.cpp b/src/filters/transform/MPCVideoDec/FormatConverter.cpp index 2b22c26c18..648142f5a7 100644 --- a/src/filters/transform/MPCVideoDec/FormatConverter.cpp +++ b/src/filters/transform/MPCVideoDec/FormatConverter.cpp @@ -293,7 +293,8 @@ void CFormatConverter::SetConvertFunc() if (m_FProps.pftype == PFType_YUV422Px) { m_pConvertFn = &CFormatConverter::convert_yuv422_yuy2_uyvy_dither_le; m_RequiredAlignment = 8; - } else if (m_FProps.pftype == PFType_YUV420 + } + else if (m_FProps.pftype == PFType_YUV420 || (m_FProps.pftype == PFType_YUV420Px && m_FProps.lumabits <= 14) || m_FProps.pftype == PFType_NV12) { m_pConvertFn = &CFormatConverter::convert_yuv420_yuy2; @@ -304,15 +305,20 @@ void CFormatConverter::SetConvertFunc() if (m_FProps.pftype == PFType_NV12) { m_pConvertFn = &CFormatConverter::plane_copy_sse2; break; - } else if (m_FProps.pftype == PFType_YUV420) { + } + else if (m_FProps.pftype == PFType_YUV420) { m_pConvertFn = &CFormatConverter::convert_yuv420_nv12; m_RequiredAlignment = 32; } + else if (m_FProps.pftype == PFType_P01x) { + m_pConvertFn = &CFormatConverter::convert_p010_nv12_sse2; + } case PixFmt_YV12: if (m_FProps.pftype == PFType_YUV420Px) { m_pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; m_RequiredAlignment = 32; - } else if (m_FProps.pftype == PFType_NV12) { + } + else if (m_FProps.pftype == PFType_NV12) { m_pConvertFn = &CFormatConverter::convert_nv12_yv12; m_RequiredAlignment = 32; } @@ -337,7 +343,8 @@ void CFormatConverter::SetConvertFunc() if (m_FProps.pftype == PFType_YUV444Px) { m_pConvertFn = &CFormatConverter::convert_yuv_yv_nv12_dither_le; m_RequiredAlignment = 32; - } else if (m_FProps.pftype == PFType_YUV444) { + } + else if (m_FProps.pftype == PFType_YUV444) { m_pConvertFn = &CFormatConverter::convert_yuv_yv; m_RequiredAlignment = 0; } From b404e0ba530254a51683b8d22d3489f27b21caf0 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 29 Jun 2024 21:37:09 +0300 Subject: [PATCH 037/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20Changelog.Rus.txt=20=D0=B8=20Changelog.txt?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 8 ++++++++ docs/Changelog.txt | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 0feccd8a0b..83e8ab6855 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -2,6 +2,14 @@ 1.7.2.x dev ============================= +MpegSplitter +Улучшена поддержка Dolby Vision Profile 7. + +MPCVideoDec +Теперь декодер VVdeC используется для видео VVC на процессорах без поддержки SSE4.1. +Исправлено преобразование P010 в YV12. +Оптимизировано преобразование P010 в NV12 для процессоров без SSE4. + Плеер Улучшена поддержка перемещения окна свойств файла между дисплеями с разным масштабированием текста. Исправлено запоминания позиции некоторых DVD-Video. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 6986ee93fb..3ca19c5ff0 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -2,6 +2,14 @@ 1.7.2.x dev ============================= +MpegSplitter +Improved support for Dolby Vision Profile 7. + +MPCVideoDec +The VVdeC decoder is now used for VVC video on processors without SSE4.1 support. +Fixed P010 to YV12 conversion. +Optimized P010 to NV12 conversion for processors without SSE4. + Player Improved support for moving the file properties window between displays with different text scaling. Fixed remembering the position of some DVD-Videos. From b1e477529dec8cc3f79e6c307aa2731c48b46bfb Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 1 Jul 2024 08:28:07 +1000 Subject: [PATCH 038/102] =?UTF-8?q?MPCVideoDec=20-=20=D0=BE=D0=BF=D1=82?= =?UTF-8?q?=D0=B8=D0=BC=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D1=8B=20NVDEC.=20MPCVideoDec=20-=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B0=D1=8F=20=D0=BE=D0=BF?= =?UTF-8?q?=D1=82=D0=B8=D0=BC=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20D3D11/D3D12=20Copy-back.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transform/MPCVideoDec/MPCVideoDec.cpp | 101 +++++++++--------- .../transform/MPCVideoDec/MPCVideoDec.h | 1 + 2 files changed, 52 insertions(+), 50 deletions(-) diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp index d9599d73ad..4372c7b57f 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.cpp @@ -1738,6 +1738,7 @@ void CMPCVideoDecFilter::CleanupFFmpeg() av_buffer_unref(&m_HWDeviceCtx); av_frame_free(&m_pFrame); + av_frame_free(&m_pHWFrame); m_FormatConverter.Cleanup(); @@ -2183,6 +2184,8 @@ HRESULT CMPCVideoDecFilter::InitDecoder(const CMediaType* pmt) m_pFrame = av_frame_alloc(); CheckPointer(m_pFrame, E_POINTER); + m_pHWFrame = av_frame_alloc(); + CheckPointer(m_pHWFrame, E_POINTER); BITMAPINFOHEADER *pBMI = nullptr; bool bInterlacedFieldPerSample = false; @@ -3419,8 +3422,6 @@ HRESULT CMPCVideoDecFilter::FillAVPacket(AVPacket *avpkt, const BYTE *buffer, in HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtStartIn, REFERENCE_TIME rtStopIn, BOOL bPreroll/* = FALSE*/) { -#define CLEAR_AND_CONTINUE { av_frame_unref(m_pFrame); av_frame_free(&hw_frame); continue; } - if (avpkt) { if (m_bWaitingForKeyFrame) { if (m_CodecId == AV_CODEC_ID_MPEG2VIDEO) { @@ -3482,21 +3483,14 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta } for (;;) { - AVFrame* hw_frame = (m_HWPixFmt != AV_PIX_FMT_NONE) ? av_frame_alloc() : nullptr; + auto frame = (m_HWPixFmt == AV_PIX_FMT_NONE) ? m_pFrame : m_pHWFrame; - if (m_HWPixFmt == AV_PIX_FMT_NONE) { - ret = avcodec_receive_frame(m_pAVCtx, m_pFrame); - } else { - ret = avcodec_receive_frame(m_pAVCtx, hw_frame); - } + ret = avcodec_receive_frame(m_pAVCtx, frame); if (ret < 0 && ret != AVERROR(EAGAIN)) { - av_frame_unref(m_pFrame); - av_frame_free(&hw_frame); + av_frame_unref(frame); return S_FALSE; } - auto frame = (m_HWPixFmt == AV_PIX_FMT_NONE) ? m_pFrame : hw_frame; - if (m_bWaitKeyFrame) { if (m_bWaitingForKeyFrame && ret >= 0) { if (frame->flags & AV_FRAME_FLAG_KEY) { @@ -3509,30 +3503,30 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta } if (ret < 0 || !frame->data[0]) { - av_frame_unref(m_pFrame); - av_frame_free(&hw_frame); + av_frame_unref(frame); break; } if (m_HWPixFmt != AV_PIX_FMT_NONE) { - if (hw_frame->format != m_HWPixFmt) { + if (m_pHWFrame->format != m_HWPixFmt) { DXVAState::ClearState(); m_HWPixFmt = AV_PIX_FMT_NONE; m_bUseD3D11cb = m_bUseD3D12cb = m_bUseNVDEC = false; - m_pFrame->format = hw_frame->format; - m_pFrame->width = hw_frame->width; - m_pFrame->height = hw_frame->height; + m_pFrame->format = m_pHWFrame->format; + m_pFrame->width = m_pHWFrame->width; + m_pFrame->height = m_pHWFrame->height; av_frame_get_buffer(m_pFrame, 32); - ret = av_frame_copy(m_pFrame, hw_frame); + ret = av_frame_copy(m_pFrame, m_pHWFrame); } if (ret < 0) { - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } - av_frame_copy_props(m_pFrame, hw_frame); + av_frame_copy_props(m_pFrame, m_pHWFrame); - if (hw_frame->format == m_HWPixFmt && !DXVAState::GetState()) { + if (m_pHWFrame->format == m_HWPixFmt && !DXVAState::GetState()) { CString codec; switch (m_CodecId) { case AV_CODEC_ID_AV1: codec = L"AV1"; break; @@ -3544,7 +3538,7 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta case AV_CODEC_ID_VP9: codec = L"VP9"; break; } - auto frames_ctx = (AVHWFramesContext*)hw_frame->hw_frames_ctx->data; + auto frames_ctx = reinterpret_cast(m_pHWFrame->hw_frames_ctx->data); CString description = m_bUseD3D11cb ? L"D3D11 Copy-back" : (m_bUseD3D12cb ? L"D3D12 Copy-back" : L"NVDEC"); if (!codec.IsEmpty()) { @@ -3616,10 +3610,12 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta if (UseDXVA2()) { hr = m_pDXVADecoder->DeliverFrame(); - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } else if (UseD3D11()) { hr = m_pD3D11Decoder->DeliverFrame(); - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } GetFrameTimeStamp(m_pFrame, rtStartIn, rtStopIn); @@ -3632,7 +3628,8 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta UpdateFrameTime(rtStartIn, rtStopIn); if (bPreroll || rtStartIn < 0) { - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } CComPtr pOut; @@ -3644,16 +3641,17 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta FixFrameSize(m_pAVCtx, w, h); if (FAILED(hr = GetDeliveryBuffer(w, h, &pOut, GetFrameDuration(), &dxvaExtFormat)) || FAILED(hr = pOut->GetPointer(&pDataOut))) { - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } - if (hw_frame && hw_frame->hw_frames_ctx) { - auto frames_ctx = (AVHWFramesContext*)hw_frame->hw_frames_ctx->data; + if (m_HWPixFmt != AV_PIX_FMT_NONE && m_pHWFrame->hw_frames_ctx) { + auto frames_ctx = (AVHWFramesContext*)m_pHWFrame->hw_frames_ctx->data; if (frames_ctx->format == AV_PIX_FMT_D3D11) { auto device_hwctx = reinterpret_cast(frames_ctx->device_ctx->hwctx); - auto texture = reinterpret_cast(hw_frame->data[0]); - auto index = reinterpret_cast(hw_frame->data[1]); + auto texture = reinterpret_cast(m_pHWFrame->data[0]); + auto index = reinterpret_cast(m_pHWFrame->data[1]); D3D11_TEXTURE2D_DESC inputTexDesc = {}; texture->GetDesc(&inputTexDesc); @@ -3676,8 +3674,9 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; hr = device_hwctx->device->CreateTexture2D(&texDesc, nullptr, &m_pStagingD3D11Texture2D); if (FAILED(hr)) { - DLog(L"CMPCVideoDecFilter::DecodeInternal() : ID3D11Device::CreateTexture2D() failed : %s", HR2Str(hr)); - CLEAR_AND_CONTINUE; + DLog(L"CMPCVideoDecFilter::DecodeInternal() : ID3D11Device::CreateTexture2D() failed : %s", HR2Str(hr));\ + av_frame_unref(frame); + continue; } } @@ -3689,7 +3688,8 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta hr = device_hwctx->device_context->Map(m_pStagingD3D11Texture2D, 0, D3D11_MAP_READ, 0, &mappedResource); if (FAILED(hr)) { DLog(L"CMPCVideoDecFilter::DecodeInternal() : ID3D11DeviceContext::Map() failed : %s", HR2Str(hr)); - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } int codedbytes = 1; @@ -3716,8 +3716,8 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta av_image_fill_pointers(m_pFrame->data, frames_ctx->sw_format, texDesc.Height, reinterpret_cast(mappedResource.pData), m_pFrame->linesize); m_pFrame->format = frames_ctx->sw_format; - m_pFrame->width = hw_frame->width; - m_pFrame->height = hw_frame->height; + m_pFrame->width = m_pHWFrame->width; + m_pFrame->height = m_pHWFrame->height; m_FormatConverter.Converting(pDataOut, m_pFrame); @@ -3726,13 +3726,14 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta device_hwctx->unlock(device_hwctx->lock_ctx); } else if (frames_ctx->format == AV_PIX_FMT_D3D12) { - ret = d3d12va_direct_copy(hw_frame, m_pFrame, pDataOut, + ret = d3d12va_direct_copy(m_pHWFrame, m_pFrame, pDataOut, +[](void* ptr, AVFrame* frame, uint8_t* data) { auto pFilter = static_cast(ptr); pFilter->m_FormatConverter.Converting(data, frame); }, this); if (ret < 0) { - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } } else if (frames_ctx->format == AV_PIX_FMT_CUDA && m_FormatConverter.DirectCopyPossible(frames_ctx->sw_format)) { @@ -3743,7 +3744,8 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta auto cuStatus = cuda_fns->cuCtxPushCurrent(cuda_hwctx->cuda_ctx); if (cuStatus != CUDA_SUCCESS) { DLog(L"CMPCVideoDecFilter::DecodeInternal() : Cuda cuCtxPushCurrent() failed"); - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } int linesize[4] = {}; av_image_fill_linesizes(linesize, frames_ctx->sw_format, m_FormatConverter.GetDstStride()); @@ -3752,7 +3754,7 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta av_pix_fmt_get_chroma_sub_sample(frames_ctx->sw_format, &h_shift, &v_shift); uint8_t* hwdata[4]; - memcpy(hwdata, hw_frame->data, sizeof(hwdata)); // copy 4 pointers from 8 (AV_NUM_DATA_POINTERS) + memcpy(hwdata, m_pHWFrame->data, sizeof(hwdata)); // copy 4 pointers from 8 (AV_NUM_DATA_POINTERS) if (m_FormatConverter.GetOutPixFormat() == PixFmt_YV24) { std::swap(hwdata[1], hwdata[2]); // swap UV when YUV444P to YV24 } @@ -3761,10 +3763,10 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta for (size_t i = 0; i < std::size(hwdata) && hwdata[i]; i++) { CUDA_MEMCPY2D cpy = {}; - cpy.srcPitch = hw_frame->linesize[i]; + cpy.srcPitch = m_pHWFrame->linesize[i]; cpy.dstPitch = linesize[i]; cpy.WidthInBytes = std::min(cpy.srcPitch, cpy.dstPitch); - cpy.Height = hw_frame->height >> ((i == 0 || i == 3) ? 0 : v_shift); + cpy.Height = m_pHWFrame->height >> ((i == 0 || i == 3) ? 0 : v_shift); cpy.srcMemoryType = CU_MEMORYTYPE_DEVICE; cpy.srcDevice = reinterpret_cast(hwdata[i]); @@ -3777,20 +3779,22 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta break; } - offset += linesize[i] * (hw_frame->height >> (i ? v_shift : 0)); + offset += linesize[i] * (m_pHWFrame->height >> (i ? v_shift : 0)); } if (cuStatus != CUDA_SUCCESS) { DLog(L"CMPCVideoDecFilter::DecodeInternal() : Cuda cuMemcpy2DAsync() failed"); - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } cuda_fns->cuStreamSynchronize(cuda_hwctx->stream); cuda_fns->cuCtxPopCurrent(nullptr); } else { - ret = av_hwframe_transfer_data(m_pFrame, hw_frame, 0); + ret = av_hwframe_transfer_data(m_pFrame, m_pHWFrame, 0); if (ret < 0) { - CLEAR_AND_CONTINUE; + av_frame_unref(frame); + continue; } m_FormatConverter.Converting(pDataOut, m_pFrame); } @@ -3833,15 +3837,12 @@ HRESULT CMPCVideoDecFilter::DecodeInternal(AVPacket *avpkt, REFERENCE_TIME rtSta hr = m_pOutput->Deliver(pOut); - av_frame_unref(m_pFrame); - av_frame_free(&hw_frame); + av_frame_unref(frame); m_bDecoderAcceptFormat = TRUE; } return S_OK; - -#undef CLEAR_AND_CONTINUE } HRESULT CMPCVideoDecFilter::ParseInternal(const BYTE *buffer, int buflen, REFERENCE_TIME rtStartIn, REFERENCE_TIME rtStopIn, BOOL bPreroll) diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.h b/src/filters/transform/MPCVideoDec/MPCVideoDec.h index e0c23eb185..ddfae84de4 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.h +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.h @@ -80,6 +80,7 @@ class __declspec(uuid("008BAC12-FBAF-497b-9670-BC6F6FBAE2C4")) AVCodecContext* m_pAVCtx = nullptr; AVCodecParserContext* m_pParser = nullptr; AVFrame* m_pFrame = nullptr; + AVFrame* m_pHWFrame = nullptr; enum AVCodecID m_CodecId; REFERENCE_TIME m_rtAvrTimePerFrame = 0; bool m_bCalculateStopTime = false; From 46f50f4ef273f0fd50751f960a03a7f51f30c051 Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 4 Jul 2024 07:00:56 +0300 Subject: [PATCH 039/102] =?UTF-8?q?UnlockResource=20=D0=B8=20FreeResource?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D0=BD=D1=83=D0=B6=D0=BD=D1=8B,=20=D1=82.?= =?UTF-8?q?=D0=BA.=20=D1=81=D0=BE=D0=B3=D0=BB=D0=B0=D1=81=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BD=D0=B8=D1=87=D0=B5=D0=B3=D0=BE=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=B4=D0=B5=D0=BB=D0=B0=D1=8E=D1=82.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/PPageFileMediaInfo.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/apps/mplayerc/PPageFileMediaInfo.cpp b/src/apps/mplayerc/PPageFileMediaInfo.cpp index 432ebbcc92..562d6f1cde 100644 --- a/src/apps/mplayerc/PPageFileMediaInfo.cpp +++ b/src/apps/mplayerc/PPageFileMediaInfo.cpp @@ -56,9 +56,6 @@ static String mi_get_lang_file() delete [] wstr; } } - - UnlockResource(lRes); - FreeResource(lRes); } FreeLibrary(mpcres); } From 9daefb29de70d2d018927c8b20875f5834ae9e05 Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 4 Jul 2024 20:14:01 +0300 Subject: [PATCH 040/102] =?UTF-8?q?=D0=92=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20?= =?UTF-8?q?=D1=83=D1=81=D1=82=D0=B0=D1=80=D0=B5=D0=B2=D1=88=D0=B8=D1=85=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9=20CryptoAPI=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B2=D1=8B=D1=87=D0=B8=D1=81=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20SHA-1=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D1=83=D0=B5=D0=BC=20=D1=80=D0=B5=D0=BA=D0=BE=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B4=D1=83=D0=B5=D0=BC=D1=8B=D0=B9=20Cryptography=20API?= =?UTF-8?q?:=20Next=20Generation=20(CNG).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/TorrentInfo.cpp | 53 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/src/apps/mplayerc/TorrentInfo.cpp b/src/apps/mplayerc/TorrentInfo.cpp index 3657f3f698..aed60ff508 100644 --- a/src/apps/mplayerc/TorrentInfo.cpp +++ b/src/apps/mplayerc/TorrentInfo.cpp @@ -22,7 +22,8 @@ #include "stdafx.h" #include "TorrentInfo.h" #include -#include +#include // for calc SHA-1 +#include // for NT_SUCCESS() struct bt_node { enum data_type { @@ -267,36 +268,32 @@ const std::wstring CTorrentInfo::CalcInfoHash() const return std::wstring(); } - unsigned char infoHash[20 /* SHA1 hash lenght*/] = {}; - //Calculate SHA1 info hash - HCRYPTPROV crypt_prov = NULL; - HCRYPTHASH crypt_hash = NULL; - DWORD sz = std::size(infoHash); - const BOOL ret = - CryptAcquireContextW(&crypt_prov, nullptr, nullptr, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) && - CryptCreateHash(crypt_prov, CALG_SHA1, 0, 0, &crypt_hash) && - CryptHashData(crypt_hash, &m_data[info->offset], static_cast(info->length), 0) && - CryptGetHashParam(crypt_hash, HP_HASHVAL, infoHash, &sz, 0); - if (crypt_hash) { - CryptDestroyHash(crypt_hash); - } - if (crypt_prov) { - CryptReleaseContext(crypt_prov, 0); - } - - if (!ret) { - return std::wstring(); - } - - std::wstring hashCode; - for (const auto& hash : infoHash) { - wchar_t d[3]; - swprintf_s(d, L"%02x", hash); - hashCode += d; + std::wstring infoHash; + + BCRYPT_ALG_HANDLE hAlg = nullptr; + if (NT_SUCCESS(::BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_SHA1_ALGORITHM, nullptr, 0))) { + BCRYPT_HASH_HANDLE hHash = nullptr; + // As of Windows 7 the hash handle will manage its own object buffer when + // pbHashObject is nullptr and cbHashObject is 0. + if (NT_SUCCESS(::BCryptCreateHash(hAlg, &hHash, nullptr, 0, nullptr, 0, 0))) { + // BCryptHashData promises not to modify pbInput. + if (NT_SUCCESS(::BCryptHashData(hHash, (PUCHAR)&m_data[info->offset], info->length, 0))) { + UCHAR hash[20] = {}; + if (NT_SUCCESS(::BCryptFinishHash(hHash, hash, std::size(hash), 0))) { + for (const auto& b : hash) { + wchar_t d[3]; + swprintf_s(d, L"%02x", b); + infoHash += d; + } + } + } + ::BCryptDestroyHash(hHash); + } + ::BCryptCloseAlgorithmProvider(hAlg, 0); } - return hashCode; + return infoHash; } void CTorrentInfo::GetAnnounceList(const bt_node* nodeAnnounce, std::list& list) const From b97c2c3a6f47723c37de972b759df5ae1ecc2c40 Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 4 Jul 2024 20:48:26 +0300 Subject: [PATCH 041/102] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=20=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=BA=D0=BE=D0=BC=D0=B5=D0=BD=D0=B4=D1=83?= =?UTF-8?q?=D0=B5=D0=BC=D1=8B=D0=B9=20const=20=D0=B4=D0=BB=D1=8F=20=D0=B2?= =?UTF-8?q?=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=B5=D0=BC=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BA=D1=80=D1=83=D0=BF=D0=BD=D1=8B=D1=85=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE=D0=B2.=20https://isocpp.gi?= =?UTF-8?q?thub.io/CppCoreGuidelines/CppCoreGuidelines#Rf-return-const?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/TorrentInfo.cpp | 6 +++--- src/apps/mplayerc/TorrentInfo.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/mplayerc/TorrentInfo.cpp b/src/apps/mplayerc/TorrentInfo.cpp index aed60ff508..5ea2abcb79 100644 --- a/src/apps/mplayerc/TorrentInfo.cpp +++ b/src/apps/mplayerc/TorrentInfo.cpp @@ -120,7 +120,7 @@ const bool CTorrentInfo::Read(const wchar_t* fileName) return true; } -const std::wstring CTorrentInfo::Magnet() const +std::wstring CTorrentInfo::Magnet() const { std::wstring magnet; @@ -223,7 +223,7 @@ const __int64 CTorrentInfo::ReadInteger() return _atoi64(num.c_str()); } -const std::string CTorrentInfo::ReadString() +std::string CTorrentInfo::ReadString() { std::string len; while (m_offset < m_data.size() && m_data[m_offset] != ':') { @@ -261,7 +261,7 @@ const bt_node* CTorrentInfo::Search(const char* nodeName, const bt_node* nodePar return nullptr; } -const std::wstring CTorrentInfo::CalcInfoHash() const +std::wstring CTorrentInfo::CalcInfoHash() const { auto info = Search("info", m_root); if (!info || info->type != bt_node::dt_dictionary) { diff --git a/src/apps/mplayerc/TorrentInfo.h b/src/apps/mplayerc/TorrentInfo.h index d063e8d0d0..c0df77349b 100644 --- a/src/apps/mplayerc/TorrentInfo.h +++ b/src/apps/mplayerc/TorrentInfo.h @@ -1,5 +1,5 @@ /* - * (C) 2019 see Authors.txt + * (C) 2019-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -30,15 +30,15 @@ class CTorrentInfo ~CTorrentInfo(); const bool Read(const wchar_t* fileName); - const std::wstring Magnet() const; + std::wstring Magnet() const; private: bt_node* Decode(); const __int64 ReadInteger(); - const std::string ReadString(); + std::string ReadString(); const bt_node* Search(const char* nodeName, const bt_node* nodeParent) const; - const std::wstring CalcInfoHash() const; + std::wstring CalcInfoHash() const; void GetAnnounceList(const bt_node* nodeAnnounce, std::list& list) const; private: From 05b7d8e9e347aad78f21a398e20feef8e33b872e Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 4 Jul 2024 20:50:56 +0300 Subject: [PATCH 042/102] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20=D1=81=D0=B1=D0=BE?= =?UTF-8?q?=D1=80=D0=BA=D0=B8=20=D0=B8=D0=BD=D1=81=D1=82=D0=B0=D0=BB=D0=BB?= =?UTF-8?q?=D1=8F=D1=82=D0=BE=D1=80=D0=B0=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=D0=B8=D0=BC=20Inno=20Setup=206.3.1=20=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=BD=D0=BE=D0=B2=D0=B5=D0=B5.=20=D0=A3=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20Korean.isl,=20=D1=82.=D0=BA.=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B2=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B5=20Inno=20Setup.=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20ChineseSimplified.isl.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distrib/Languages/ChineseSimplified.isl | 26 +- distrib/Languages/Korean.isl | 390 ------------------------ distrib/mpc-be_setup.iss | 4 +- docs/Compilation.txt | 2 +- 4 files changed, 16 insertions(+), 406 deletions(-) delete mode 100644 distrib/Languages/Korean.isl diff --git a/distrib/Languages/ChineseSimplified.isl b/distrib/Languages/ChineseSimplified.isl index df711d51d9..1d1b7c0693 100644 --- a/distrib/Languages/ChineseSimplified.isl +++ b/distrib/Languages/ChineseSimplified.isl @@ -26,11 +26,11 @@ LanguageID=$0804 LanguageCodePage=936 ; If the language you are translating to requires special font faces or ; sizes, uncomment any of the following entries and change them accordingly. -;DialogFontName= +DialogFontName=Microsoft YaHei UI ;DialogFontSize=8 -;WelcomeFontName=Verdana +WelcomeFontName=Microsoft YaHei UI ;WelcomeFontSize=12 -;TitleFontName=Arial +TitleFontName=Microsoft YaHei UI ;TitleFontSize=29 ;CopyrightFontName=Arial ;CopyrightFontSize=8 @@ -61,11 +61,11 @@ SetupFileCorrupt=安装文件已损坏。请获取程序的新副本。 SetupFileCorruptOrWrongVer=安装文件已损坏,或是与这个安装程序的版本不兼容。请修正这个问题或获取新的程序副本。 InvalidParameter=无效的命令行参数:%n%n%1 SetupAlreadyRunning=安装程序正在运行。 -WindowsVersionNotSupported=这个程序不支持当前计算机运行的Windows版本。 +WindowsVersionNotSupported=这个程序不支持当前计算机运行的 Windows 版本。 WindowsServicePackRequired=这个程序需要 %1 服务包 %2 或更高。 NotOnThisPlatform=这个程序将不能运行于 %1。 OnlyOnThisPlatform=这个程序必须运行于 %1。 -OnlyOnTheseArchitectures=这个程序只能在为下列处理器结构设计的Windows版本中进行安装:%n%n%1 +OnlyOnTheseArchitectures=这个程序只能在为下列处理器架构的 Windows 版本中进行安装:%n%n%1 WinVersionTooLowError=这个程序需要 %1 版本 %2 或更高。 WinVersionTooHighError=这个程序不能安装于 %1 版本 %2 或更高。 AdminPrivilegesRequired=在安装这个程序时您必须以管理员身份登录。 @@ -80,8 +80,8 @@ PrivilegesRequiredOverrideText1=%1 可以为所有用户安装(需要管理员 PrivilegesRequiredOverrideText2=%1 只能为您安装,或为所有用户安装(需要管理员权限)。 PrivilegesRequiredOverrideAllUsers=为所有用户安装(&A) PrivilegesRequiredOverrideAllUsersRecommended=为所有用户安装(&A) (建议选项) -PrivilegesRequiredOverrideCurrentUser=只为我安装(&M) -PrivilegesRequiredOverrideCurrentUserRecommended=只为我安装(&M) (建议选项) +PrivilegesRequiredOverrideCurrentUser=仅为我安装(&M) +PrivilegesRequiredOverrideCurrentUserRecommended=仅为我安装(&M) (建议选项) ; *** 其它错误 ErrorCreatingDir=安装程序不能创建目录“%1”。 @@ -89,12 +89,12 @@ ErrorTooManyFilesInDir=不能在目录“%1”中创建文件,因为里面的 ; *** 安装程序公共消息 ExitSetupTitle=退出安装程序 -ExitSetupMessage=安装程序还未完成安装。如果您现在退出,程序将不能安装。%n%n您可以以后再运行安装程序完成安装。%n%n现在退出安装程序吗? +ExitSetupMessage=安装程序尚未完成安装。如果您现在退出,程序将不能安装。%n%n您可以以后再运行安装程序完成安装。%n%n现在退出安装程序吗? AboutSetupMenuItem=关于安装程序(&A)... AboutSetupTitle=关于安装程序 AboutSetupMessage=%1 版本 %2%n%3%n%n%1 主页:%n%4 AboutSetupNote= -TranslatorNote= +TranslatorNote=Translated by Zhenghan Yang. ; *** 按钮 ButtonBack=< 上一步(&B) @@ -138,7 +138,7 @@ WizardLicense=许可协议 LicenseLabel=继续安装前请阅读下列重要信息。 LicenseLabel3=请仔细阅读下列许可协议。您在继续安装前必须同意这些协议条款。 LicenseAccepted=我同意此协议(&A) -LicenseNotAccepted=我不同意此协议(&D) +LicenseNotAccepted=我拒绝此协议(&D) ; *** “信息”向导页 WizardInfoBefore=信息 @@ -204,7 +204,7 @@ SelectStartMenuFolderLabel3=安装程序现在将在下列开始菜单文件夹 SelectStartMenuFolderBrowseLabel=点击“下一步”继续。如果您想选择其它文件夹,点击“浏览”。 MustEnterGroupName=您必须输入一个文件夹名。 GroupNameTooLong=文件夹名或路径太长。 -InvalidGroupName=文件夹名是无效的。 +InvalidGroupName=文件夹名无效。 BadGroupName=文件夹名不能包含下列任何字符:%n%n%1 NoProgramGroupCheck2=不创建开始菜单文件夹(&D) @@ -228,9 +228,9 @@ ErrorDownloadAborted=下载已中止 ErrorDownloadFailed=下载失败:%1 %2 ErrorDownloadSizeFailed=获取下载大小失败:%1 %2 ErrorFileHash1=校验文件哈希失败:%1 -ErrorFileHash2=无效的文件哈希:预期 %1,实际 %2 +ErrorFileHash2=无效的文件哈希:预期为 %1,实际为 %2 ErrorProgress=无效的进度:%1,总共%2 -ErrorFileSize=文件大小错误:预期 %1,实际 %2 +ErrorFileSize=文件大小错误:预期为 %1,实际为 %2 ; *** “正在准备安装”向导页 WizardPreparing=正在准备安装 diff --git a/distrib/Languages/Korean.isl b/distrib/Languages/Korean.isl deleted file mode 100644 index 840cbf8332..0000000000 --- a/distrib/Languages/Korean.isl +++ /dev/null @@ -1,390 +0,0 @@ -; *** Inno Setup version 6.1.0+ Korean messages *** - -; ▒ 6.2.2+ Translator: VenusGirl (venusgirl@outlook.com) -; ▒ 6.2.0+ Translator: Logan.Hwang (logan.hwang@blueant.kr) -; ▒ 6.0.3+ Translator: SungDong Kim (acroedit@gmail.com) -; ▒ 5.5.3+ Translator: Domddol (domddol@gmail.com) -; ▒ Contributors: Hansoo KIM (iryna7@gmail.com), Woong-Jae An (a183393@hanmail.net) -; ▒ 이 번역은 한국어 맞춤법을 준수합니다. -; -; 이 파일의 사용자 제공 번역을 다운로드하려면 다음으로 이동하십시오: -; https://jrsoftware.org/files/istrans/ - -; 참고: 이 텍스트를 번역할 때는 InnoSetup 메시지에 -; 마침표가 자동으로 추가되므로 아직 없는 메시지의 끝에 -; 마침표(.)를 추가하지 마십시오 (마침표를 추가하면 -; 두 개의 마침표가 표시됩니다). - -[LangOptions] -; 다음 세 항목은 매우 중요합니다. 도움말 파일의 -; '[LangOptions] 섹션' 항목을 읽고 이해하십시오. -LanguageName=한국어 -LanguageID=$0412 -LanguageCodePage=949 -; 번역할 언어가 특수 글꼴 또는 크기를 필요로 하는 경우 -; 다음 항목 중 하나를 주석 해제하고 적절하게 변경하십시오. -;DialogFontName= -;DialogFontSize=8 -;WelcomeFontName=Verdana -;WelcomeFontSize=12 -;TitleFontName=Arial -;TitleFontSize=29 -;CopyrightFontName=Arial -;CopyrightFontSize=8 - -[Messages] - -; *** Application titles -SetupAppTitle=설치 -SetupWindowTitle=%1 설치 -UninstallAppTitle=제거 -UninstallAppFullTitle=%1 제거 - -; *** Misc. common -InformationTitle=정보 -ConfirmTitle=확인 -ErrorTitle=오류 - -; *** SetupLdr messages -SetupLdrStartupMessage=%1을(를) 설치합니다, 계속하시겠습니까? -LdrCannotCreateTemp=임시 파일을 만들 수 없습니다. 설치가 중단되었습니다. -LdrCannotExecTemp=임시 디렉터리에서 파일을 실행할 수 없습니다. 설치가 중단되었습니다. -HelpTextNote= - -; *** Startup error messages -LastErrorMessage=%1.%n%n오류 %2: %3 -SetupFileMissing=%1 파일이 설치 디렉터리에 없습니다. 문제를 해결하거나 프로그램의 새 사본을 구하십시오. -SetupFileCorrupt=설치 파일이 손상되었습니다. 프로그램의 새 사본을 구하십시오. -SetupFileCorruptOrWrongVer=설치 파일이 손상되었거나 이 버전의 설치 프로그램과 호환되지 않습니다. 문제를 해결하거나 프로그램의 새 복사본을 구하십시오. -InvalidParameter=명령줄에 잘못된 매개변수가 전달되었습니다:%n%n%1 -SetupAlreadyRunning=설치가 이미 실행 중입니다. -WindowsVersionNotSupported=이 프로그램은 컴퓨터에서 실행 중인 Windows 버전을 지원하지 않습니다. -WindowsServicePackRequired=이 프로그램을 사용하려면 %1 서비스 팩 %2 이상이 필요합니다. -NotOnThisPlatform=이 프로그램은 %1에서 실행되지 않습니다. -OnlyOnThisPlatform=이 프로그램은 %1에서 실행되어야 합니다. -OnlyOnTheseArchitectures=이 프로그램은 다음 프로세서 아키텍처용으로 설계된 Windows 버전에만 설치할 수 있습니다:%n%n%1 -WinVersionTooLowError=이 프로그램에는 %1 버전 %2 이상이 필요합니다. -WinVersionTooHighError=%1 버전 %2 이상에 이 프로그램을 설치할 수 없습니다. -AdminPrivilegesRequired=이 프로그램을 설치할 때 관리자로 로그인해야 합니다. -PowerUserPrivilegesRequired=이 프로그램을 설치할 때 관리자 또는 Power Users 그룹의 구성원으로 로그인해야 합니다. -SetupAppRunningError=설치에서 %1이(가) 현재 실행 중임을 감지했습니다.%n%n지금 모든 인스턴스를 닫은 다음 확인을 클릭하여 계속하거나 취소를 클릭하여 종료하십시오. -UninstallAppRunningError=제거에서 %1이(가) 현재 실행 중임을 감지했습니다.%n%n지금 모든 인스턴스를 닫은 다음 확인을 클릭하여 계속하거나 취소를 클릭하여 종료하십시오. - -; *** Startup questions -PrivilegesRequiredOverrideTitle=설치 모드 선택 -PrivilegesRequiredOverrideInstruction=설치 모드를 선택해 주십시오 -PrivilegesRequiredOverrideText1=%1은 모든 사용자 (관리자 권한 필요) 또는 사용자용으로 설치합니다. -PrivilegesRequiredOverrideText2=%1은 현재 사용자 또는 모든 사용자 (관리자 권한 필요)용으로 설치합니다. -PrivilegesRequiredOverrideAllUsers=모든 사용자용으로 설치(&A) -PrivilegesRequiredOverrideAllUsersRecommended=모든 사용자용으로 설치 (추천)(&A) -PrivilegesRequiredOverrideCurrentUser=현재 사용자용으로 설치(&M) -PrivilegesRequiredOverrideCurrentUserRecommended=현재 사용자용으로 설치 (추천)(&M) - -; *** Misc. errors -ErrorCreatingDir=설치 프로그램에서 "%1" 디렉터리를 만들지 못했습니다. -ErrorTooManyFilesInDir="%1" 디렉터리에 파일이 너무 많아서 파일을 만들 수 없습니다 - -; *** Setup common messages -ExitSetupTitle=설치 종료 -ExitSetupMessage=설치가 완료되지 않았습니다. 지금 종료하면 프로그램이 설치되지 않습니다.%n%n설치를 다시 실행하여 설치를 완료할 수 있습니다.%n%n설치를 종료하시겠습니까? -AboutSetupMenuItem=설치 정보(&A)... -AboutSetupTitle=설치 정보 -AboutSetupMessage=%1 버전 %2%n%3%n%n%1 홈 페이지:%n%4 -AboutSetupNote= -TranslatorNote= - -; *** Buttons -ButtonBack=< 뒤로(&B) -ButtonNext=다음(&N) > -ButtonInstall=설치(&I) -ButtonOK=확인 -ButtonCancel=취소 -ButtonYes=예(&Y) -ButtonYesToAll=모두 예(&A) -ButtonNo=아니오(&N) -ButtonNoToAll=모두 아니오(&O) -ButtonFinish=종료(&F) -ButtonBrowse=찾아보기(&B)... -ButtonWizardBrowse=찾아보기(&R)... -ButtonNewFolder=새 폴더 만들기(&M) - -; *** "Select Language" dialog messages -SelectLanguageTitle=설치 언어 선택 -SelectLanguageLabel=설치 중에 사용할 언어를 선택하십시오. - -; *** Common wizard text -ClickNext=다음을 클릭하여 계속하거나 취소를 클릭하여 설치를 종료합니다. -BeveledLabel= -BrowseDialogTitle=폴더 찾아보기 -BrowseDialogLabel=아래 목록에서 폴더를 선택한 후 확인을 클릭하십시오. -NewFolderName=새 폴더 - -; *** "Welcome" wizard page -WelcomeLabel1=[name] 설치 마법사에 오신 것을 환영합니다 -WelcomeLabel2=컴퓨터에 [name/ver]가 설치됩니다.%n%n계속하기 전에 다른 모든 응용 프로그램을 닫는 것이 좋습니다. - -; *** "Password" wizard page -WizardPassword=암호 -PasswordLabel1=이 설치는 암호로 보호됩니다. -PasswordLabel3=암호를 입력한 후 다음을 클릭하여 계속하십시오. 암호는 대소문자를 구분합니다. -PasswordEditLabel=암호(&P): -IncorrectPassword=입력한 암호가 올바르지 않습니다. 다시 시도하십시오. - -; *** "License Agreement" wizard page -WizardLicense=사용권 계약 -LicenseLabel=계속하기 전에 다음 중요한 정보를 읽어보십시오. -LicenseLabel3=다음 사용권 계약을 읽어보십시오. 설치를 계속하기 전에 이 계약 조건에 동의해야 합니다. -LicenseAccepted=동의합니다(&A) -LicenseNotAccepted=동의하지 않습니다(&D) - -; *** "Information" wizard pages -WizardInfoBefore=정보 -InfoBeforeLabel=계속하기 전에 다음 중요한 정보를 읽어보십시오. -InfoBeforeClickLabel=설치를 계속할 준비가 되었으면 다음을 클릭합니다. -WizardInfoAfter=정보 -InfoAfterLabel=계속하기 전에 다음 중요한 정보를 읽어보십시오. -InfoAfterClickLabel=설치를 계속할 준비가 되었으면 다음을 클릭합니다. - -; *** "User Information" wizard page -WizardUserInfo=사용자 정보 -UserInfoDesc=사용자 정보를 입력하십시오. -UserInfoName=사용자 이름(&U): -UserInfoOrg=조직(&O): -UserInfoSerial=일련 번호:(&S): -UserInfoNameRequired=이름을 입력해야 합니다. - -; *** "Select Destination Location" wizard page -WizardSelectDir=대상 위치 선택 -SelectDirDesc=[name]을(를) 어디에 설치하시겠습니까? -SelectDirLabel3=다음 폴더에 [name]을(를) 설치합니다. -SelectDirBrowseLabel=계속하려면 다음을 클릭합니다. 다른 폴더를 선택하려면 찾아보기를 클릭합니다. -DiskSpaceGBLabel=이 프로그램은 최소 [gb] GB의 디스크 여유 공간이 필요합니다. -DiskSpaceMBLabel=이 프로그램은 최소 [mb] MB의 디스크 여유 공간이 필요합니다. -CannotInstallToNetworkDrive=네트워크 드라이브에 설치할 수 없습니다. -CannotInstallToUNCPath=UNC 경로에 설치할 수 없습니다. -InvalidPath=드라이브 문자를 포함한 전체 경로를 입력해야 합니다. 예:%n%nC:\APP%n%n 또는 UNC 경로 형식:%n%n\\server\share -InvalidDrive=선택한 드라이브 또는 UNC 공유가 존재하지 않거나 액세스할 수 없습니다, 다른 경로를 선택하십시오. -DiskSpaceWarningTitle=디스크 공간이 부족합니다 -DiskSpaceWarning=설치 시 최소 %1 KB 디스크 공간이 필요하지만, 선택한 드라이브의 여유 공간은 %2 KB 밖에 없습니다.%n%n그래도 계속하시겠습니까? -DirNameTooLong=폴더 이름 또는 경로가 너무 깁니다. -InvalidDirName=폴더 이름이 유효하지 않습니다. -BadDirName32=폴더 이름은 다음 문자를 포함할 수 없습니다:%n%n%1 -DirExistsTitle=폴더가 존재합니다 -DirExists=폴더 %n%n%1%n%n이(가) 이미 존재합니다, 그래도 해당 폴더에 설치하시겠습니까? -DirDoesntExistTitle=폴더가 존재하지 않습니다 -DirDoesntExist=폴더 %n%n%1%n%n이(가) 존재하지 않습니다, 폴더를 만드시겠습니까? - -; *** "Select Components" wizard page -WizardSelectComponents=구성 요소 선택 -SelectComponentsDesc=어떤 구성 요소를 설치해야 합니까? -SelectComponentsLabel2=설치할 구성 요소를 선택하고 설치하지 않을 구성 요소를 지웁니다. 계속할 준비가 되면 다음을 클릭합니다. -FullInstallation=모두 설치 -; 가능하면 'Compact'를 'Minimal'로 번역하지 마십시오 (귀하의 언어로 '최소'를 의미합니다). -CompactInstallation=최소 설치 -CustomInstallation=사용자 지정 설치 -NoUninstallWarningTitle=구성 요소가 존재합니다 -NoUninstallWarning=다음 구성 요소가 컴퓨터에 이미 설치되어 있습니다: %n%n%1%n%n이러한 구성 요소를 선택해도 제거되지 않습니다.%n%n계속하시겠습니까? -ComponentSize1=%1 KB -ComponentSize2=%1 MB -ComponentsDiskSpaceGBLabel=현재 선택은 최소 [gb] GB의 디스크 여유 공간이 필요합니다. -ComponentsDiskSpaceMBLabel=현재 선택은 최소 [mb] MB의 디스크 여유 공간이 필요합니다. - -; *** "Select Additional Tasks" wizard page -WizardSelectTasks=추가 작업 선택 -SelectTasksDesc=어떤 추가 작업을 수행해야 합니까? -SelectTasksLabel2=[name]을(를) 설치하는 동안 수행할 추가 작업을 선택하고 다음을 클릭합니다. - -; *** "Select Start Menu Folder" wizard page -WizardSelectProgramGroup=시작 메뉴 폴더 선택 -SelectStartMenuFolderDesc=프로그램의 바로가기를 어디에 설치하시겠습니까? -SelectStartMenuFolderLabel3=설치는 다음 시작 메뉴 폴더에 프로그램 바로가기를 만듭니다. -SelectStartMenuFolderBrowseLabel=계속하려면 다음을 클릭합니다. 다른 폴더를 선택하려면 찾아보기를 클릭합니다. -MustEnterGroupName=폴더 이름을 입력하십시오. -GroupNameTooLong=폴더 이름 또는 경로가 너무 깁니다. -InvalidGroupName=폴더 이름이 유효하지 않습니다. -BadGroupName=폴더 이름은 다음 문자를 포함할 수 없습니다:%n%n%1 -NoProgramGroupCheck2=시작 메뉴 폴더를 만들지 않음(&D) - -; *** "Ready to Install" wizard page -WizardReady=설치 준비 완료 -ReadyLabel1=[name]을(를) 컴퓨터에 설치할 준비가 되었습니다. -ReadyLabel2a=설치를 클릭하여 설치를 계속하거나 설정을 검토하거나 변경하려면 뒤로를 클릭합니다. -ReadyLabel2b=설치를 클릭하여 설치를 계속합니다. -ReadyMemoUserInfo=사용자 정보: -ReadyMemoDir=대상 위치: -ReadyMemoType=설치 유형: -ReadyMemoComponents=선택한 구성 요소: -ReadyMemoGroup=시작 메뉴 폴더: -ReadyMemoTasks=추가 작업: - -; *** TDownloadWizardPage wizard page and DownloadTemporaryFile -DownloadingLabel=추가 파일 다운로드 중... -ButtonStopDownload=다운로드 중지(&S) -StopDownload=다운로드를 중지하시겠습니까? -ErrorDownloadAborted=다운로드가 중지되었습니다 -ErrorDownloadFailed=다운로드에 실패했습니다: %1 %2 -ErrorDownloadSizeFailed=크기를 가져오지 못했습니다: %1 %2 -ErrorFileHash1=파일 해시에 실패했습니다: %1 -ErrorFileHash2=잘못된 파일 해시: 예상 %1, 찾음 %2 -ErrorProgress=잘못된 진행 상황: %1 / %2 -ErrorFileSize=잘못된 파일 크기: 예상 %1, 찾음 %2 - -; *** "Preparing to Install" wizard page -WizardPreparing=설치 준비 중 -PreparingDesc=컴퓨터에 [name] 설치를 준비하는 중입니다. -PreviousInstallNotCompleted=이전 프로그램의 설치/제거가 완료되지 않았습니다. 설치를 완료하려면 컴퓨터를 다시 시작해야 합니다.%n%n컴퓨터를 재시작한 후 설치를 다시 실행하여 [name] 설치를 완료하십시오. -CannotContinue=설치를 계속할 수 없습니다. 종료하려면 취소를 클릭하십시오. -ApplicationsFound=다음 응용 프로그램에서 설치 프로그램에서 업데이트해야 하는 파일을 사용하고 있습니다. 이러한 응용 프로그램을 자동으로 닫도록 허용하는 것이 좋습니다. -ApplicationsFound2=다음 응용 프로그램에서 설치 프로그램에서 업데이트해야 하는 파일을 사용하고 있습니다. 이러한 응용 프로그램을 자동으로 닫도록 허용하는 것이 좋습니다. 설치가 완료되면 응용 프로그램을 다시 시작하려고 시도합니다. -CloseApplications=응용 프로그램 자동 닫기(&A) -DontCloseApplications=응용 프로그램을 닫지 않음(&D) -ErrorCloseApplications=모든 응용 프로그램을 자동으로 닫지 못했습니다. 계속하기 전에 설치 프로그램에서 업데이트해야 하는 파일을 사용하여 모든 응용 프로그램을 닫는 것이 좋습니다. -PrepareToInstallNeedsRestart=컴퓨터를 다시 시작해야 합니다. 컴퓨터를 다시 시작한 후 설치를 다시 실행하여 [name] 설치를 완료하십시오.%n%n지금 다시 시작하시겠습니까? - -; *** "Installing" wizard page -WizardInstalling=설치 중 -InstallingLabel=컴퓨터에 [name]을(를) 설치하는 동안 잠시 기다려 주십시오. - -; *** "Setup Completed" wizard page -FinishedHeadingLabel=[name] 설치 마법사 완료 -FinishedLabelNoIcons=컴퓨터에 [name] 설치를 완료했습니다. -FinishedLabel=컴퓨터에 [name] 설치를 완료했습니다. 설치된 바로가기를 선택하여 응용 프로그램을 시작할 수 있습니다. -ClickFinish=설치를 종료하려면 마침을 클릭하십시오. -FinishedRestartLabel=[name] 설치를 완료하려면 컴퓨터를 다시 시작해야 합니다. 지금 다시 시작하시겠습니까? -FinishedRestartMessage=[name] 설치를 완료하려면 컴퓨터를 다시 시작해야 합니다.%n%n지금 다시 시작하시겠습니까? -ShowReadmeCheck=예, README 파일을 보고 싶습니다. -YesRadio=예, 지금 컴퓨터를 다시 시작합니다(&Y) -NoRadio=아니오, 나중에 컴퓨터를 다시 시작하겠습니다(&N) -; 예를 들어 'Run MyProg.exe'로 사용됩니다' -RunEntryExec=%1 실행 -; 예를 들어 'Readme.txt 보기'로 사용됩니다' -RunEntryShellExec=%1 보기 - -; *** "Setup Needs the Next Disk" stuff -ChangeDiskTitle=설치에 다음 디스크가 필요합니다 -SelectDiskLabel2=디스크 %1을(를) 삽입하고 확인을 클릭하십시오.%n%n이 디스크의 파일을 아래에 표시된 폴더 이외의 폴더에서 찾을 수 있으면 올바른 경로를 입력하거나 찾아보기를 클릭하십시오. -PathLabel=경로(&P): -FileNotInDir2="%1" 파일을 "%2"에서 찾을 수 없습니다. 올바른 디스크를 넣거나 다른 폴더를 선택하십시오. -SelectDirectoryLabel=다음 디스크의 위치를 지정하십시오. - -; *** Installation phase messages -SetupAborted=설치가 완료되지 않았습니다.%n%n문제를 해결한 후 설치를 다시 실행하십시오. -AbortRetryIgnoreSelectAction=작업 선택 -AbortRetryIgnoreRetry=재시도(&T) -AbortRetryIgnoreIgnore=오류를 무시하고 진행(&I) -AbortRetryIgnoreCancel=설치 취소 - -; *** Installation status messages -StatusClosingApplications=응용 프로그램을 닫는 중... -StatusCreateDirs=디렉터리를 만드는 중... -StatusExtractFiles=파일을 추출하는 중... -StatusCreateIcons=바로가기를 만드는 중... -StatusCreateIniEntries=INI 항목을 만드는 중... -StatusCreateRegistryEntries=레지스트리 항목을 만드는 중... -StatusRegisterFiles=파일을 등록하는 중... -StatusSavingUninstall=제거 정보를 저장하는 중... -StatusRunProgram=설치를 완료하는 중... -StatusRestartingApplications=응용 프로그램을 다시 시작하는 중... -StatusRollback=변경 내용을 롤백하는 중... - -; *** Misc. errors -ErrorInternal2=내부 오류: %1 -ErrorFunctionFailedNoCode=%1 실패 -ErrorFunctionFailed=%1 실패; 코드 %2 -ErrorFunctionFailedWithMessage=%1 실패, 코드: %2.%n%3 -ErrorExecutingProgram=파일 실행 오류:%n%1 - -; *** Registry errors -ErrorRegOpenKey=레지스트리 키 열기 오류:%n%1\%2 -ErrorRegCreateKey=레지스트리 키 생성 오류:%n%1\%2 -ErrorRegWriteKey=레지스트리 키 쓰기 오류:%n%1\%2 - -; *** INI errors -ErrorIniEntry="%1" 파일에 INI 항목 만들기 오류입니다. - -; *** File copying errors -FileAbortRetryIgnoreSkipNotRecommended=이 파일 건너뛰기 (추천하지 않음)(&S) -FileAbortRetryIgnoreIgnoreNotRecommended=오류를 무시하고 계속 (추천하지 않음)(&I) -SourceIsCorrupted=원본 파일이 손상되었습니다 -SourceDoesntExist=원본 파일 "%1"이(가) 없습니다 -ExistingFileReadOnly2=읽기 전용으로 표시되어 있으므로 기존 파일을 교체할 수 없습니다. -ExistingFileReadOnlyRetry=읽기 전용 속성을 제거하고 다시 시도(&R) -ExistingFileReadOnlyKeepExisting=기존 파일 유지(&K) -ErrorReadingExistingDest=기존 파일을 읽는 동안 오류 발생: -FileExistsSelectAction=작업 선택 -FileExists2=파일이 이미 존재합니다. -FileExistsOverwriteExisting=기존 파일 덮어쓰기(&O) -FileExistsKeepExisting=기존 파일 유지(&K) -FileExistsOverwriteOrKeepAll=다음 충돌에 대해 이 작업 수행(&D) -ExistingFileNewerSelectAction=작업 선택 -ExistingFileNewer2=설치 프로그램에서 설치하려는 파일보다 기존 파일이 더 최신입니다. -ExistingFileNewerOverwriteExisting=기존 파일 덮어쓰기(&O) -ExistingFileNewerKeepExisting=기존 파일 유지 (추천)(&K) -ExistingFileNewerOverwriteOrKeepAll=다음 충돌에 대해 이 작업 수행(&D) -ErrorChangingAttr=기존 파일의 속성을 변경하는 동안 오류 발생: -ErrorCreatingTemp=대상 디렉터리에 파일을 만드는 동안 오류 발생: -ErrorReadingSource=원본 파일을 읽는 동안 오류 발생: -ErrorCopying=파일을 복사하는 동안 오류 발생: -ErrorReplacingExistingFile=기존 파일을 교체하는 동안 오류 발생: -ErrorRestartReplace=RestartReplace 실패: -ErrorRenamingTemp=대상 디렉터리 내의 파일 이름을 바꾸는 동안 오류 발생: -ErrorRegisterServer=DLL/OCX를 등록할 수 없습니다: %1 -ErrorRegSvr32Failed=종료 코드 %1로 인해 RegSvr32가 실패했습니다 -ErrorRegisterTypeLib=유형 라이브러리를 등록할 수 없습니다: %1 - -; *** Uninstall display name markings -; 예를 들어 '내 프로그램'으로 사용됩니다 (32비트)' -UninstallDisplayNameMark=%1 (%2)비트 -; 예를 들어 '내 프로그램'으로 사용됩니다 (32비트, 모든 사용자)' -UninstallDisplayNameMarks=%1 (%2, %3) -UninstallDisplayNameMark32Bit=32비트 -UninstallDisplayNameMark64Bit=64비트 -UninstallDisplayNameMarkAllUsers=모든 사용자 -UninstallDisplayNameMarkCurrentUser=현재 사용자 - -; *** Post-installation errors -ErrorOpeningReadme=README 파일을 여는 동안 오류가 발생했습니다. -ErrorRestartingComputer=컴퓨터를 다시 시작하지 못했습니다. 이 작업을 수동으로 수행하십시오. - -; *** Uninstaller messages -UninstallNotFound="%1" 파일이 없습니다. 제거할 수 없습니다. -UninstallOpenError="%1" 파일을 열 수 없습니다. 제거할 수 없습니다 -UninstallUnsupportedVer="%1" 제거 로그 파일이 현재 버전의 제거 프로그램에서 인식할 수 없는 형식입니다. 제거할 수 없습니다 -UninstallUnknownEntry=제거 로그에 알 수 없는 항목 (%1)이 있습니다 -ConfirmUninstall=%1 및 해당 구성 요소를 모두 제거하시겠습니까? -UninstallOnlyOnWin64=이 설치는 64비트 Windows에서만 제거할 수 있습니다. -OnlyAdminCanUninstall=이 설치는 관리자 권한이 있는 사용자만 제거할 수 있습니다. -UninstallStatusLabel=%1이(가) 컴퓨터에서 제거되는 동안 기다려 주십시오. -UninstalledAll=%1이(가) 컴퓨터에서 성공적으로 제거되었습니다. -UninstalledMost=%1 제거가 완료되었습니다.%n%n일부 요소를 제거할 수 없습니다. 수동으로 제거할 수 있습니다. -UninstalledAndNeedsRestart=%1 제거를 완료하려면 컴퓨터를 다시 시작해야 합니다.%n%n지금 다시 시작하시겠습니까? -UninstallDataCorrupted="%1" 파일이 손상되었습니다. 제거할 수 없습니다. - -; *** Uninstallation phase messages -ConfirmDeleteSharedFileTitle=공유 파일을 제거하시겠습니까? -ConfirmDeleteSharedFile2=시스템에 다음 공유 파일이 더 이상 어떤 프로그램에서도 사용되지 않는 것으로 표시됩니다. 제거에서 이 공유 파일을 제거하시겠습니까?%n%n이 파일을 계속 사용하고 있고 파일이 제거된 프로그램이 있으면 해당 프로그램이 제대로 작동하지 않을 수 있습니다. 확실하지 않은 경우 아니요를 선택합니다. 파일을 시스템에 남겨두어도 아무런 해가 되지 않습니다. -SharedFileNameLabel=파일 이름: -SharedFileLocationLabel=위치: -WizardUninstalling=제거 상태 -StatusUninstalling=%1을(를) 제거하는 중... - -; *** Shutdown block reasons -ShutdownBlockReasonInstallingApp=%1을(를) 설치하는 중입니다. -ShutdownBlockReasonUninstallingApp=%1을(를) 제거하는 중입니다. - -; 아래 사용자 지정 메시지는 설치 프로그램 자체에서 사용하지 않지만 -; 스크립트에서 사용할 경우 해당 메시지를 번역할 수 있습니다. - -[CustomMessages] - -NameAndVersion=%1 버전 %2 -AdditionalIcons=바로가기 추가: -CreateDesktopIcon=바탕화면에 바로가기 만들기(&D) -CreateQuickLaunchIcon=빠른 실행 아이콘 만들기(&Q) -ProgramOnTheWeb=%1 웹페이지 -UninstallProgram=LaunchProgram=%1 실행 -AssocFileExtension=%1을 %2 파일 확장자에 연결 -AssocingFileExtension=%1을 %2 파일 확장자와 연결하는 중... -AutoStartProgramGroupDescription=시작: -AutoStartProgram=%1 자동 시작 -AddonHostProgramNotFound=%1을(를) 선택한 폴더에서 찾을 수 없습니다.%n%n계속하시겠습니까? diff --git a/distrib/mpc-be_setup.iss b/distrib/mpc-be_setup.iss index 4426df329e..6cff9ff98c 100644 --- a/distrib/mpc-be_setup.iss +++ b/distrib/mpc-be_setup.iss @@ -16,7 +16,7 @@ ; You should have received a copy of the GNU General Public License ; along with this program. If not, see . -#if VER < EncodeVer(6,2,2) +#if VER < EncodeVer(6,3,1) #error A more recent version of Inno Setup 6 is required to compile this script (6.2.2 or newer) #endif #ifndef UNICODE @@ -146,7 +146,7 @@ Name: hu; MessagesFile: compiler:Languages\Hungarian.isl Name: hy; MessagesFile: compiler:Languages\Armenian.isl Name: it; MessagesFile: compiler:Languages\Italian.isl Name: ja; MessagesFile: compiler:Languages\Japanese.isl -Name: kr; MessagesFile: Languages\Korean.isl +Name: kr; MessagesFile: compiler:Languages\Korean.isl Name: nl; MessagesFile: compiler:Languages\Dutch.isl Name: pl; MessagesFile: compiler:Languages\Polish.isl Name: ro; MessagesFile: Languages\Romanian.isl diff --git a/docs/Compilation.txt b/docs/Compilation.txt index cdc46f2db0..3805fd3266 100644 --- a/docs/Compilation.txt +++ b/docs/Compilation.txt @@ -29,7 +29,7 @@ 3. Additional optional components - 3.1. Inno Setup 6.2.2 or never (https://jrsoftware.org/isdl.php). + 3.1. Inno Setup 6.3.1 or never (https://jrsoftware.org/isdl.php). 3.2. 7-zip file archiver (https://www.7-zip.org/download.html). From b6b718b2ea9c37f970c91f91be8c64033a21be60 Mon Sep 17 00:00:00 2001 From: v0lt Date: Fri, 5 Jul 2024 19:38:18 +0300 Subject: [PATCH 043/102] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Subtitles/VobSubFile.cpp | 10 +++++----- src/apps/mplayerc/HistoryDlg.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Subtitles/VobSubFile.cpp b/src/Subtitles/VobSubFile.cpp index 8cc4e6aa4e..5cc7b183d3 100644 --- a/src/Subtitles/VobSubFile.cpp +++ b/src/Subtitles/VobSubFile.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -350,7 +350,7 @@ bool CVobSubFile::Open(CString fn) sp[j].bForced = false; int packetsize = 0, datasize = 0; - BYTE* buff = GetPacket((int)j, packetsize, datasize, i); + BYTE* buff = GetPacket(j, packetsize, datasize, i); if (!buff) { sp[j].bValid = false; continue; @@ -1731,7 +1731,7 @@ bool CVobSubFile::SaveWinSubMux(CString fn) std::vector& sp = m_langs[m_nLang].subpos; for (size_t i = 0; i < sp.size(); i++) { - if (!GetFrame((int)i)) { + if (!GetFrame(i)) { continue; } @@ -1967,7 +1967,7 @@ bool CVobSubFile::SaveScenarist(CString fn) std::vector& sp = m_langs[m_nLang].subpos; for (size_t i = 0, k = 0; i < sp.size(); i++) { - if (!GetFrame((int)i)) { + if (!GetFrame(i)) { continue; } @@ -2197,7 +2197,7 @@ bool CVobSubFile::SaveMaestro(CString fn) std::vector& sp = m_langs[m_nLang].subpos; for (size_t i = 0, k = 0; i < sp.size(); i++) { - if (!GetFrame((int)i)) { + if (!GetFrame(i)) { continue; } diff --git a/src/apps/mplayerc/HistoryDlg.cpp b/src/apps/mplayerc/HistoryDlg.cpp index 7d3af5cae1..f27864f01d 100644 --- a/src/apps/mplayerc/HistoryDlg.cpp +++ b/src/apps/mplayerc/HistoryDlg.cpp @@ -1,5 +1,5 @@ /* - * (C) 2021-2023 see Authors.txt + * (C) 2021-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -386,7 +386,7 @@ void CHistoryDlg::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult) int nItem = ((NM_LISTVIEW *)pNMHDR)->iItem; size_t index = m_list.GetItemData(nItem); - if (index < (int)m_recentSessions.size()) { + if (index < m_recentSessions.size()) { const auto& sesInfo = m_recentSessions[index]; auto pFrame = AfxGetMainFrame(); From 3f1d4a1b6937857e3739f62d0cdbf4c7cd10dca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hack=E8=8C=B6=E3=82=93?= <120134269+Hackjjang@users.noreply.github.com> Date: Sat, 6 Jul 2024 12:41:18 +0900 Subject: [PATCH 044/102] Update Korean translation --- src/apps/mpcresources/text/mplayerc.kr.rc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.kr.rc.txt b/src/apps/mpcresources/text/mplayerc.kr.rc.txt index 173d6d3990..164c0e094d 100644 --- a/src/apps/mpcresources/text/mplayerc.kr.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.kr.rc.txt @@ -521,8 +521,8 @@ BEGIN DIALOGEX IDD_PPAGESYNC LINES 26 6 "수직 동기화" 7 "내장 수직 동기화" 8 "프레임 시간 수정 활성화" -9 "수직 동기화 전에 GPU 플러시" -10 "발표 후 GPU 플러시" +9 "수직 동기화 전, GPU 플러시" +10 "표시 후, GPU 플러시" 11 "플러시 대기" 12 "EVR 동기화 설정" 13 "비디오에서 디스플레이로 싱크" From 837c5c4fa969e31811c4d83bbe431711b347df9d Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 6 Jul 2024 06:55:33 +0300 Subject: [PATCH 045/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BA=D0=BE=D1=80=D0=B5=D0=B9=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20(=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=20Hackjjang).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mpcresources/mplayerc.kr.rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/mpcresources/mplayerc.kr.rc b/src/apps/mpcresources/mplayerc.kr.rc index d5887102b1..dfe3069f7e 100644 --- a/src/apps/mpcresources/mplayerc.kr.rc +++ b/src/apps/mpcresources/mplayerc.kr.rc @@ -1163,8 +1163,8 @@ BEGIN CONTROL "수직 동기화",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,14,121,10 CONTROL "내장 수직 동기화",IDC_VSYNC_INTERNAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,26,121,10 CONTROL "프레임 시간 수정 활성화",IDC_CHECK8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,51,170,10 - CONTROL "수직 동기화 전에 GPU 플러시",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,14,140,10 - CONTROL "발표 후 GPU 플러시",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,26,142,10 + CONTROL "수직 동기화 전, GPU 플러시",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,14,140,10 + CONTROL "표시 후, GPU 플러시",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,26,142,10 CONTROL "플러시 대기",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,38,100,10 GROUPBOX "EVR 동기화 설정",IDC_STATIC2,5,67,286,117 CONTROL "비디오에서 디스플레이로 싱크",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,79,142,8 From 66f1697ad9485a88c5b6735b7ca4acb427bec0c4 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 6 Jul 2024 09:50:10 +0300 Subject: [PATCH 046/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20ffmpeg=20n7.1-dev-1688-ge0eff64ed1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- .../ffmpeg/libavcodec/aac/aacdec_usac.c | 2 +- .../ffmpeg/libavcodec/aacsbr_template.c | 2 - src/ExtLib/ffmpeg/libavcodec/allcodecs.c | 1 + src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c | 27 ++---- src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c | 2 - src/ExtLib/ffmpeg/libavcodec/pngdec.c | 53 +++++------ src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c | 5 +- src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c | 2 - src/ExtLib/ffmpeg/libavcodec/vvc/dec.c | 18 ++-- src/ExtLib/ffmpeg/libavfilter/allfilters.c | 1 + .../ffmpeg/libavutil/hwcontext_d3d12va.c | 2 +- .../ffmpeg/libavutil/hwcontext_d3d12va.h | 8 ++ src/ExtLib/ffmpeg/libavutil/timestamp.c | 2 +- src/ExtLib/ffmpeg/libavutil/version.h | 2 +- src/ExtLib/ffmpeg/libswresample/swresample.h | 4 +- src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c | 51 ---------- .../ffmpeg/libswscale/x86/yuv2rgb_template.c | 4 - .../ffmpeg/libswscale/x86/yuv_2_rgb.asm | 93 +------------------ 20 files changed, 69 insertions(+), 214 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 83e8ab6855..79ee3ee535 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -19,7 +19,7 @@ MPCVideoDec Обновлен японский перевод (автор tsubasanouta). Обновлены библиотеки: - ffmpeg n7.1-dev-1585-g0b330d8642; + ffmpeg n7.1-dev-1688-ge0eff64ed1; vvdec v2.3.0-24-gad8f4bb. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 3ca19c5ff0..aedc8b284f 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -19,7 +19,7 @@ Updated Korean translation (by Hackjjang). Updated Japanese translation (by tsubasanouta). Updated libraries: - ffmpeg n7.1-dev-1585-g0b330d8642; + ffmpeg n7.1-dev-1688-ge0eff64ed1; vvdec v2.3.0-24-gad8f4bb. diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c index 4856c1786b..32b3c534bf 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c @@ -1134,7 +1134,7 @@ static void complex_stereo_downmix_cur(AACDecContext *ac, ChannelElement *cpe, } } -static void complex_stereo_interpolate_imag(float *im, float *re, const float f[6], +static void complex_stereo_interpolate_imag(float *im, float *re, const float f[7], int len, int factor_even, int factor_odd) { int i = 0; diff --git a/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c b/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c index 8bda251213..a729b7af38 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/aacsbr_template.c @@ -1273,8 +1273,6 @@ int ff_aac_sbr_decode_usac_data(AACDecContext *ac, ChannelElement *che, sbr->ready_for_dequant = 1; - int start = get_bits_count(gb); - if (sbr_ch == 1) { /* sbr_single_channel_element */ /* if (harmonicSBR) ... */ diff --git a/src/ExtLib/ffmpeg/libavcodec/allcodecs.c b/src/ExtLib/ffmpeg/libavcodec/allcodecs.c index b6ee47549a..9cb43e9222 100644 --- a/src/ExtLib/ffmpeg/libavcodec/allcodecs.c +++ b/src/ExtLib/ffmpeg/libavcodec/allcodecs.c @@ -852,6 +852,7 @@ extern const FFCodec ff_h264_vaapi_encoder; extern const FFCodec ff_h264_videotoolbox_encoder; extern const FFCodec ff_hevc_amf_encoder; extern const FFCodec ff_hevc_cuvid_decoder; +extern const FFCodec ff_hevc_d3d12va_encoder; extern const FFCodec ff_hevc_mediacodec_decoder; extern const FFCodec ff_hevc_mediacodec_encoder; extern const FFCodec ff_hevc_mf_encoder; diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c index e75768f303..988f242331 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c @@ -550,8 +550,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) return ff_get_format(s->avctx, pix_fmts); } -static int set_sps(HEVCContext *s, const HEVCSPS *sps, - enum AVPixelFormat pix_fmt) +static int set_sps(HEVCContext *s, const HEVCSPS *sps) { int ret, i; @@ -566,10 +565,6 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, if (ret < 0) goto fail; - export_stream_params(s, sps); - - s->avctx->pix_fmt = pix_fmt; - ff_hevc_pred_init(&s->hpc, sps->bit_depth); ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth); ff_videodsp_init (&s->vdsp, sps->bit_depth); @@ -632,7 +627,7 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id); return AVERROR_INVALIDDATA; } - if (!sh->first_slice_in_pic_flag && pps_id != sh->pps_id) { + if (!sh->first_slice_in_pic_flag && s->ps.pps_list[pps_id] != s->pps) { av_log(s->avctx, AV_LOG_ERROR, "PPS changed between slices.\n"); return AVERROR_INVALIDDATA; } @@ -2950,10 +2945,12 @@ static int hevc_frame_start(HEVCContext *s) ff_hevc_clear_refs(s); - ret = set_sps(s, sps, sps->pix_fmt); + ret = set_sps(s, sps); if (ret < 0) return ret; + export_stream_params(s, sps); + pix_fmt = get_format(s, sps); if (pix_fmt < 0) return pix_fmt; @@ -2996,6 +2993,10 @@ static int hevc_frame_start(HEVCContext *s) if (pps->tiles_enabled_flag) s->local_ctx[0].end_of_tiles_x = pps->column_width[0] << sps->log2_ctb_size; + ret = export_stream_params_from_sei(s); + if (ret < 0) + return ret; + ret = ff_hevc_set_new_ref(s, s->poc); if (ret < 0) goto fail; @@ -3016,10 +3017,6 @@ static int hevc_frame_start(HEVCContext *s) !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && !s->avctx->hwaccel; - ret = export_stream_params_from_sei(s); - if (ret < 0) - return ret; - ret = set_side_data(s); if (ret < 0) goto fail; @@ -3624,7 +3621,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, ff_refstruct_unref(&s->pps); if (s->ps.sps != s0->ps.sps) - if ((ret = set_sps(s, s0->ps.sps, src->pix_fmt)) < 0) + if ((ret = set_sps(s, s0->ps.sps)) < 0) return ret; s->seq_decode = s0->seq_decode; @@ -3669,10 +3666,6 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->sei.common.content_light = s0->sei.common.content_light; s->sei.common.aom_film_grain = s0->sei.common.aom_film_grain; - ret = export_stream_params_from_sei(s); - if (ret < 0) - return ret; - return 0; } #endif diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c index 74946aeaab..3483587146 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c @@ -1308,8 +1308,6 @@ static int mpeg_field_start(Mpeg1Context *s1, const uint8_t *buf, int buf_size) s->cur_pic.linesize[i]); } s->cur_pic.linesize[i] *= 2; - s->last_pic.linesize[i] *= 2; - s->next_pic.linesize[i] *= 2; } } diff --git a/src/ExtLib/ffmpeg/libavcodec/pngdec.c b/src/ExtLib/ffmpeg/libavcodec/pngdec.c index 1c910e6a5b..180806e5e1 100644 --- a/src/ExtLib/ffmpeg/libavcodec/pngdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/pngdec.c @@ -86,11 +86,12 @@ typedef struct PNGDecContext { int have_clli; uint32_t clli_max; uint32_t clli_avg; - int have_mdvc; - uint16_t mdvc_primaries[3][2]; - uint16_t mdvc_white_point[2]; - uint32_t mdvc_max_lum; - uint32_t mdvc_min_lum; + /* Mastering Display Color Volume */ + int have_mdcv; + uint16_t mdcv_primaries[3][2]; + uint16_t mdcv_white_point[2]; + uint32_t mdcv_max_lum; + uint32_t mdcv_min_lum; enum PNGHeaderState hdr_state; enum PNGImageState pic_state; @@ -763,24 +764,24 @@ static int populate_avctx_color_fields(AVCodecContext *avctx, AVFrame *frame) } } - if (s->have_mdvc) { - AVMasteringDisplayMetadata *mdvc; + if (s->have_mdcv) { + AVMasteringDisplayMetadata *mdcv; - ret = ff_decode_mastering_display_new(avctx, frame, &mdvc); + ret = ff_decode_mastering_display_new(avctx, frame, &mdcv); if (ret < 0) return ret; - if (mdvc) { - mdvc->has_primaries = 1; + if (mdcv) { + mdcv->has_primaries = 1; for (int i = 0; i < 3; i++) { - mdvc->display_primaries[i][0] = av_make_q(s->mdvc_primaries[i][0], 50000); - mdvc->display_primaries[i][1] = av_make_q(s->mdvc_primaries[i][1], 50000); + mdcv->display_primaries[i][0] = av_make_q(s->mdcv_primaries[i][0], 50000); + mdcv->display_primaries[i][1] = av_make_q(s->mdcv_primaries[i][1], 50000); } - mdvc->white_point[0] = av_make_q(s->mdvc_white_point[0], 50000); - mdvc->white_point[1] = av_make_q(s->mdvc_white_point[1], 50000); - mdvc->has_luminance = 1; - mdvc->max_luminance = av_make_q(s->mdvc_max_lum, 10000); - mdvc->min_luminance = av_make_q(s->mdvc_min_lum, 10000); + mdcv->white_point[0] = av_make_q(s->mdcv_white_point[0], 50000); + mdcv->white_point[1] = av_make_q(s->mdcv_white_point[1], 50000); + mdcv->has_luminance = 1; + mdcv->max_luminance = av_make_q(s->mdcv_max_lum, 10000); + mdcv->min_luminance = av_make_q(s->mdcv_min_lum, 10000); } } @@ -1571,20 +1572,20 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s, s->clli_max = bytestream2_get_be32u(&gb_chunk); s->clli_avg = bytestream2_get_be32u(&gb_chunk); break; - case MKTAG('m', 'D', 'V', 'c'): + case MKTAG('m', 'D', 'C', 'v'): if (bytestream2_get_bytes_left(&gb_chunk) != 24) { - av_log(avctx, AV_LOG_WARNING, "Invalid mDVc chunk size: %d\n", bytestream2_get_bytes_left(&gb_chunk)); + av_log(avctx, AV_LOG_WARNING, "Invalid mDCv chunk size: %d\n", bytestream2_get_bytes_left(&gb_chunk)); break; } - s->have_mdvc = 1; + s->have_mdcv = 1; for (int i = 0; i < 3; i++) { - s->mdvc_primaries[i][0] = bytestream2_get_be16u(&gb_chunk); - s->mdvc_primaries[i][1] = bytestream2_get_be16u(&gb_chunk); + s->mdcv_primaries[i][0] = bytestream2_get_be16u(&gb_chunk); + s->mdcv_primaries[i][1] = bytestream2_get_be16u(&gb_chunk); } - s->mdvc_white_point[0] = bytestream2_get_be16u(&gb_chunk); - s->mdvc_white_point[1] = bytestream2_get_be16u(&gb_chunk); - s->mdvc_max_lum = bytestream2_get_be32u(&gb_chunk); - s->mdvc_min_lum = bytestream2_get_be32u(&gb_chunk); + s->mdcv_white_point[0] = bytestream2_get_be16u(&gb_chunk); + s->mdcv_white_point[1] = bytestream2_get_be16u(&gb_chunk); + s->mdcv_max_lum = bytestream2_get_be32u(&gb_chunk); + s->mdcv_min_lum = bytestream2_get_be32u(&gb_chunk); break; case MKTAG('I', 'E', 'N', 'D'): if (!(s->pic_state & PNG_ALLIMAGE)) diff --git a/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c b/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c index 2053197dc1..409deb3ef1 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c +++ b/src/ExtLib/ffmpeg/libavcodec/vc1_loopfilter.c @@ -1128,10 +1128,7 @@ void vc1_b_h_intfi_loop_filter(VC1Context *v, uint8_t *dest, const uint32_t *cbp dst = dest + (block_num & 2) * 4 * s->linesize + (block_num & 1) * 8; if (!(flags & RIGHT_EDGE) || !(block_num & 5)) { - if (block_num > 3) - v->vc1dsp.vc1_h_loop_filter8(dst + 8, linesize, pq); - else - v->vc1dsp.vc1_h_loop_filter8(dst + 8, linesize, pq); + v->vc1dsp.vc1_h_loop_filter8(dst + 8, linesize, pq); } tt = ttblk[0] >> (block_num * 4) & 0xf; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c index bd0be2d821..8dd6ea77cd 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c @@ -1878,8 +1878,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in cu->lfnst_idx = lfnst_idx_decode(lc); cu->mts_idx = mts_idx_decode(lc); set_qp_c(lc); - if (ret < 0) - return ret; } else { ret = skipped_transform_tree_unit(lc); if (ret < 0) diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c b/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c index c9f25696b4..3c00c141ad 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/dec.c @@ -476,13 +476,14 @@ static int slices_realloc(VVCFrameContext *fc) return 0; } -static void ep_init_cabac_decoder(SliceContext *sc, const int index, +static int ep_init_cabac_decoder(SliceContext *sc, const int index, const H2645NAL *nal, GetBitContext *gb, const CodedBitstreamUnit *unit) { const H266RawSlice *slice = unit->content_ref; const H266RawSliceHeader *rsh = sc->sh.r; EntryPoint *ep = sc->eps + index; int size; + int ret; if (index < rsh->num_entry_points) { int skipped = 0; @@ -501,8 +502,11 @@ static void ep_init_cabac_decoder(SliceContext *sc, const int index, size = get_bits_left(gb) / 8; } av_assert0(gb->buffer + get_bits_count(gb) / 8 + size <= gb->buffer_end); - ff_init_cabac_decoder (&ep->cc, gb->buffer + get_bits_count(gb) / 8, size); + ret = ff_init_cabac_decoder (&ep->cc, gb->buffer + get_bits_count(gb) / 8, size); + if (ret < 0) + return ret; skip_bits(gb, size * 8); + return 0; } static int slice_init_entry_points(SliceContext *sc, @@ -538,7 +542,9 @@ static int slice_init_entry_points(SliceContext *sc, fc->tab.slice_idx[rs] = sc->slice_idx; } - ep_init_cabac_decoder(sc, i, nal, &gb, unit); + ret = ep_init_cabac_decoder(sc, i, nal, &gb, unit); + if (ret < 0) + return ret; if (i + 1 < sc->nb_eps) ctu_addr = sh->entry_point_start_ctu[i]; @@ -835,7 +841,6 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt) const CodedBitstreamH266Context *h266 = s->cbc->priv_data; CodedBitstreamFragment *frame = &s->current_frame; int ret = 0; - int eos_at_start = 1; s->last_eos = s->eos; s->eos = 0; @@ -851,10 +856,7 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt) const CodedBitstreamUnit *unit = frame->units + i; if (unit->type == VVC_EOB_NUT || unit->type == VVC_EOS_NUT) { - if (eos_at_start) - s->last_eos = 1; - else - s->eos = 1; + s->last_eos = 1; } else { ret = decode_nal_unit(s, fc, nal, unit); if (ret < 0) { diff --git a/src/ExtLib/ffmpeg/libavfilter/allfilters.c b/src/ExtLib/ffmpeg/libavfilter/allfilters.c index c532682fc2..63600e9b58 100644 --- a/src/ExtLib/ffmpeg/libavfilter/allfilters.c +++ b/src/ExtLib/ffmpeg/libavfilter/allfilters.c @@ -569,6 +569,7 @@ extern const AVFilter ff_vsrc_openclsrc; extern const AVFilter ff_vsrc_qrencodesrc; extern const AVFilter ff_vsrc_pal75bars; extern const AVFilter ff_vsrc_pal100bars; +extern const AVFilter ff_vsrc_perlin; extern const AVFilter ff_vsrc_rgbtestsrc; extern const AVFilter ff_vsrc_sierpinski; extern const AVFilter ff_vsrc_smptebars; diff --git a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c index f8db0d4813..ee5ac26417 100644 --- a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c +++ b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c @@ -247,7 +247,7 @@ static AVBufferRef *d3d12va_pool_alloc(void *opaque, size_t size) .Format = hwctx->format, .SampleDesc = {.Count = 1, .Quality = 0 }, .Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, - .Flags = D3D12_RESOURCE_FLAG_NONE, + .Flags = hwctx->flags, }; frame = av_mallocz(sizeof(AVD3D12VAFrame)); diff --git a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h index 5d27d28f42..38818f8525 100644 --- a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h +++ b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h @@ -137,6 +137,14 @@ typedef struct AVD3D12VAFramesContext { * If unset, will be automatically set. */ DXGI_FORMAT format; + + /** + * Options for working with resources. + * If unset, this will be D3D12_RESOURCE_FLAG_NONE. + * + * @see https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_resource_flags + */ + D3D12_RESOURCE_FLAGS flags; } AVD3D12VAFramesContext; // ==> Start patch MPC diff --git a/src/ExtLib/ffmpeg/libavutil/timestamp.c b/src/ExtLib/ffmpeg/libavutil/timestamp.c index 2a3e3012a4..6c231a517d 100644 --- a/src/ExtLib/ffmpeg/libavutil/timestamp.c +++ b/src/ExtLib/ffmpeg/libavutil/timestamp.c @@ -24,7 +24,7 @@ char *av_ts_make_time_string2(char *buf, int64_t ts, AVRational tb) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); } else { double val = av_q2d(tb) * ts; - double log = floor(log10(fabs(val))); + double log = (fpclassify(val) == FP_ZERO ? -INFINITY : floor(log10(fabs(val)))); int precision = (isfinite(log) && log < 0) ? -log + 5 : 6; int last = snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.*f", precision, val); last = FFMIN(last, AV_TS_MAX_STRING_SIZE - 1) - 1; diff --git a/src/ExtLib/ffmpeg/libavutil/version.h b/src/ExtLib/ffmpeg/libavutil/version.h index a8962734e7..814892a4d5 100644 --- a/src/ExtLib/ffmpeg/libavutil/version.h +++ b/src/ExtLib/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 27 +#define LIBAVUTIL_VERSION_MINOR 28 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libswresample/swresample.h b/src/ExtLib/ffmpeg/libswresample/swresample.h index 822cb743de..2155e8fb94 100644 --- a/src/ExtLib/ffmpeg/libswresample/swresample.h +++ b/src/ExtLib/ffmpeg/libswresample/swresample.h @@ -49,8 +49,8 @@ * matrix). This is using the swr_alloc() function. * @code * SwrContext *swr = swr_alloc(); - * av_opt_set_channel_layout(swr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0); - * av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0); + * av_opt_set_chlayout(swr, "in_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1, 0); + * av_opt_set_chlayout(swr, "out_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, 0); * av_opt_set_int(swr, "in_sample_rate", 48000, 0); * av_opt_set_int(swr, "out_sample_rate", 44100, 0); * av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0); diff --git a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c b/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c index 6754062245..41dfa80f33 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c +++ b/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c @@ -41,25 +41,8 @@ #define DITHER1XBPP // only for MMX -//MMX versions -#if HAVE_MMX -#undef RENAME -#define COMPILE_TEMPLATE_MMX -#define RENAME(a) a ## _mmx -#include "yuv2rgb_template.c" -#undef COMPILE_TEMPLATE_MMX -#endif /* HAVE_MMX */ - -// MMXEXT versions -#undef RENAME -#define COMPILE_TEMPLATE_MMXEXT -#define RENAME(a) a ## _mmxext -#include "yuv2rgb_template.c" -#undef COMPILE_TEMPLATE_MMXEXT - //SSSE3 versions #undef RENAME -#define COMPILE_TEMPLATE_SSSE3 #define RENAME(a) a ## _ssse3 #include "yuv2rgb_template.c" @@ -99,40 +82,6 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) } } - if (EXTERNAL_MMXEXT(cpu_flags)) { - switch (c->dstFormat) { - case AV_PIX_FMT_RGB24: - return yuv420_rgb24_mmxext; - case AV_PIX_FMT_BGR24: - return yuv420_bgr24_mmxext; - } - } - - if (EXTERNAL_MMX(cpu_flags)) { - switch (c->dstFormat) { - case AV_PIX_FMT_RGB32: - if (c->srcFormat == AV_PIX_FMT_YUVA420P) { -#if CONFIG_SWSCALE_ALPHA - return yuva420_rgb32_mmx; -#endif - break; - } else - return yuv420_rgb32_mmx; - case AV_PIX_FMT_BGR32: - if (c->srcFormat == AV_PIX_FMT_YUVA420P) { -#if CONFIG_SWSCALE_ALPHA - return yuva420_bgr32_mmx; -#endif - break; - } else - return yuv420_bgr32_mmx; - case AV_PIX_FMT_RGB565: - return yuv420_rgb16_mmx; - case AV_PIX_FMT_RGB555: - return yuv420_rgb15_mmx; - } - } - #endif /* HAVE_X86ASM */ return NULL; } diff --git a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c b/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c index 596943bb73..a4741e6873 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c +++ b/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c @@ -47,7 +47,6 @@ extern void RENAME(ff_yuv_420_bgr24)(x86_reg index, uint8_t *image, const uint8_ const uint8_t *pv_index, const uint64_t *pointer_c_dither, const uint8_t *py_2index); -#ifndef COMPILE_TEMPLATE_MMXEXT extern void RENAME(ff_yuv_420_rgb15)(x86_reg index, uint8_t *image, const uint8_t *pu_index, const uint8_t *pv_index, const uint64_t *pointer_c_dither, const uint8_t *py_2index); @@ -163,9 +162,7 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[], } return srcSliceH; } -#endif -#if !defined(COMPILE_TEMPLATE_MMX) static inline int RENAME(yuv420_rgb24)(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, @@ -193,4 +190,3 @@ static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t *src[], } return srcSliceH; } -#endif diff --git a/src/ExtLib/ffmpeg/libswscale/x86/yuv_2_rgb.asm b/src/ExtLib/ffmpeg/libswscale/x86/yuv_2_rgb.asm index a1f9134e08..b67ab162d2 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/yuv_2_rgb.asm +++ b/src/ExtLib/ffmpeg/libswscale/x86/yuv_2_rgb.asm @@ -38,12 +38,6 @@ pb_e0: times 16 db 224 pb_03: times 16 db 3 pb_07: times 16 db 7 -mask_1101: dw -1, -1, 0, -1 -mask_0010: dw 0, 0, -1, 0 -mask_0110: dw 0, -1, -1, 0 -mask_1001: dw -1, 0, 0, -1 -mask_0100: dw 0, -1, 0, 0 - SECTION .text ;----------------------------------------------------------------------------- @@ -55,14 +49,6 @@ SECTION .text ; ;----------------------------------------------------------------------------- -%macro MOV_H2L 1 -%if mmsize == 8 - psrlq %1, 32 -%else ; mmsize == 16 - psrldq %1, 8 -%endif -%endmacro - %macro yuv2rgb_fn 3 %if %3 == 32 @@ -91,18 +77,6 @@ SECTION .text %define m_blue m1 %endif -%if mmsize == 8 -%define time_num 1 -%define reg_num 8 -%define y_offset [pointer_c_ditherq + 8 * 8] -%define u_offset [pointer_c_ditherq + 9 * 8] -%define v_offset [pointer_c_ditherq + 10 * 8] -%define ug_coff [pointer_c_ditherq + 7 * 8] -%define vg_coff [pointer_c_ditherq + 6 * 8] -%define y_coff [pointer_c_ditherq + 3 * 8] -%define ub_coff [pointer_c_ditherq + 5 * 8] -%define vr_coff [pointer_c_ditherq + 4 * 8] -%elif mmsize == 16 %define time_num 2 %if ARCH_X86_32 %define reg_num 8 @@ -125,13 +99,11 @@ SECTION .text %define ub_coff m14 %define vr_coff m15 %endif ; ARCH_X86_32/64 -%endif ; coeff define mmsize == 8/16 cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters %if ARCH_X86_64 movsxd indexq, indexd -%if mmsize == 16 VBROADCASTSD y_offset, [pointer_c_ditherq + 8 * 8] VBROADCASTSD u_offset, [pointer_c_ditherq + 9 * 8] VBROADCASTSD v_offset, [pointer_c_ditherq + 10 * 8] @@ -141,7 +113,6 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters VBROADCASTSD ub_coff, [pointer_c_ditherq + 5 * 8] VBROADCASTSD vr_coff, [pointer_c_ditherq + 4 * 8] %endif -%endif .loop0: movu m_y, [py_2indexq + 2 * indexq] movh m_u, [pu_indexq + indexq] @@ -157,7 +128,7 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters psllw m1, 3 psllw m6, 3 psllw m7, 3 -%if (ARCH_X86_32 && mmsize == 16) +%if ARCH_X86_32 VBROADCASTSD m2, mu_offset VBROADCASTSD m3, mv_offset VBROADCASTSD m4, my_offset @@ -176,7 +147,7 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters pmulhw m0, m5 VBROADCASTSD m4, mvr_coff pmulhw m1, m4 -%else ; ARCH_X86_64 || mmsize == 8 +%else ; ARCH_X86_64 psubsw m0, u_offset ; U = U - 128 psubsw m1, v_offset ; V = V - 128 psubw m6, y_offset @@ -207,49 +178,10 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters packuswb m2, m7 ; G0 G2 G4 G6 ... G1 G3 G5 G7 ... mova m3, m_red mova m6, m_blue - MOV_H2L m_red + psrldq m_red, 8 punpcklbw m3, m2 ; R0 G0 R2 G2 R4 G4 R6 G6 R8 G8 ... punpcklbw m6, m_red ; B0 R1 B2 R3 B4 R5 B6 R7 B8 R9 ... - mova m5, m3 punpckhbw m2, m_blue ; G1 B1 G3 B3 G5 B5 G7 B7 G9 B9 ... -%if mmsize == 8 - punpcklwd m3 ,m6 ; R0 G0 B0 R1 R2 G2 B2 R3 - punpckhwd m5, m6 ; R4 G4 B4 R5 R6 G6 B6 R7 -%if cpuflag(mmxext) - pshufw m1, m2, 0xc6 - pshufw m6, m3, 0x84 - pshufw m7, m5, 0x38 - pand m6, [mask_1101] ; R0 G0 B0 R1 -- -- R2 G2 - movq m0, m1 - pand m7, [mask_0110] ; -- -- R6 G6 B6 R7 -- -- - movq m2, m1 - pand m1, [mask_0100] ; -- -- G3 B3 -- -- -- -- - psrlq m3, 48 ; B2 R3 -- -- -- -- -- -- - pand m0, [mask_0010] ; -- -- -- -- G1 B1 -- -- - psllq m5, 32 ; -- -- -- -- R4 G4 B4 R5 - pand m2, [mask_1001] ; G5 B5 -- -- -- -- G7 B7 - por m1, m3 - por m0, m6 - por m1, m5 - por m2, m7 - movntq [imageq], m0 - movntq [imageq + 8], m1 - movntq [imageq + 16], m2 -%else ; cpuflag(mmx) - movd [imageq], m3 ; R0 G0 R2 G2 - movd [imageq + 4], m2 ; G1 B1 - psrlq m3, 32 - psrlq m2, 16 - movd [imageq + 6], m3 ; R2 G2 B2 R3 - movd [imageq + 10], m2 ; G3 B3 - psrlq m2, 16 - movd [imageq + 12], m5 ; R4 G4 B4 R5 - movd [imageq + 16], m2 ; G5 B5 - psrlq m5, 32 - movd [imageq + 20], m2 ; -- -- G7 B7 - movd [imageq + 18], m5 ; R6 G6 B6 R7 -%endif ; cpuflag -%else ; mmsize == 16 pshufb m3, [rgb24_shuf1] ; r0 g0 r6 g6 r12 g12 r2 g2 r8 g8 r14 g14 r4 g4 r10 g10 pshufb m6, [rgb24_shuf2] ; b10 r11 b0 r1 b6 r7 b12 r13 b2 r3 b8 r9 b14 r15 b4 r5 pshufb m2, [rgb24_shuf3] ; g5 b5 g11 b11 g1 b1 g7 b7 g13 b13 g3 b3 g9 b9 g15 b15 @@ -274,7 +206,6 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters movu [imageq], m0 movu [imageq + 16], m1 movu [imageq + 32], m2 -%endif ; mmsize = 16 %else ; PACK RGB15/16/32 packuswb m0, m1 packuswb m3, m5 @@ -309,18 +240,12 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters movu [imageq + 24 * time_num], m_alpha %else ; PACK RGB15/16 %define depth 2 -%if cpuflag(ssse3) %define red_dither m3 %define green_dither m4 %define blue_dither m5 VBROADCASTSD red_dither, [pointer_c_ditherq + 0 * 8] VBROADCASTSD green_dither, [pointer_c_ditherq + 1 * 8] VBROADCASTSD blue_dither, [pointer_c_ditherq + 2 * 8] -%else ; cpuflag(mmx/mmxext) -%define blue_dither [pointer_c_ditherq + 2 * 8] -%define green_dither [pointer_c_ditherq + 1 * 8] -%define red_dither [pointer_c_ditherq + 0 * 8] -%endif %if %3 == 15 %define gmask pb_03 %define isRGB15 1 @@ -358,18 +283,6 @@ RET %endmacro -INIT_MMX mmx -yuv2rgb_fn yuv, rgb, 32 -yuv2rgb_fn yuv, bgr, 32 -yuv2rgb_fn yuva, rgb, 32 -yuv2rgb_fn yuva, bgr, 32 -yuv2rgb_fn yuv, rgb, 15 -yuv2rgb_fn yuv, rgb, 16 - -INIT_MMX mmxext -yuv2rgb_fn yuv, rgb, 24 -yuv2rgb_fn yuv, bgr, 24 - INIT_XMM ssse3 yuv2rgb_fn yuv, rgb, 24 yuv2rgb_fn yuv, bgr, 24 From 25f783ea3d72b040555435bc78082cebc4e1a314 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Sun, 7 Jul 2024 16:32:21 +1000 Subject: [PATCH 047/102] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20d34637d98012ac07ce?= =?UTF-8?q?5f4323fdccf91dcdd4d9ff.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=20=D0=BF=D1=80=D0=BE=D0=B8=D0=B3=D1=80=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D1=8B=D1=85=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2/UHD?= =?UTF-8?q?=20DV=20BD=20=D0=B4=D0=B8=D1=81=D0=BA=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/parser/MpegSplitter/MpegSplitter.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 4216fb725b..92bfbf0220 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -744,9 +744,12 @@ HRESULT CMpegSplitterFilter::DeliverPacket(std::unique_ptr p) return S_OK; } else if (m_bHandleDVStream) { if (TrackNumber == m_dwMasterDVTrackNumber) { + if (m_MasterDVStreamPacket) { + __super::DeliverPacket(std::move(m_MasterDVStreamPacket)); + } m_MasterDVStreamPacket = std::move(p); - } else if (TrackNumber == m_dwSecondaryDVTrackNumber && m_MasterDVStreamPacket) { - if (p->rtStart == m_MasterDVStreamPacket->rtStart) { + } else if (TrackNumber == m_dwSecondaryDVTrackNumber) { + if (m_MasterDVStreamPacket && p->rtStart == m_MasterDVStreamPacket->rtStart) { CH265Nalu Nalu; Nalu.SetBuffer(p->data(), p->size()); while (Nalu.ReadNext()) { @@ -755,11 +758,9 @@ HRESULT CMpegSplitterFilter::DeliverPacket(std::unique_ptr p) // Dolby Vision RPU // TODO - check for NALU_TYPE_HEVC_EOSEQ m_MasterDVStreamPacket->AppendData(Nalu.GetNALBuffer(), Nalu.GetLength()); - break; + return __super::DeliverPacket(std::move(m_MasterDVStreamPacket)); } } - - return __super::DeliverPacket(std::move(m_MasterDVStreamPacket)); } } else { return __super::DeliverPacket(std::move(p)); @@ -1500,6 +1501,8 @@ void CMpegSplitterFilter::DemuxSeek(REFERENCE_TIME rt) m_MVCExtensionQueue.clear(); m_MVCBaseQueue.clear(); + m_MasterDVStreamPacket.reset(); + if (rt == 0) { m_pFile->Seek(m_pFile->m_posMin); } else { From 52cfa14cf65569164b25f54c3b52ed88f9c1b1e6 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 8 Jul 2024 15:23:38 +1000 Subject: [PATCH 048/102] =?UTF-8?q?MPCVideoDec=20-=20=D0=B2=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20FillAVCodecProps()=20=D1=83?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20(=D0=BA=D0=BE=D0=B4=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD)=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=B0=20VVC=20=D0=BA=D0=BE=D0=B4=D0=B5=D0=BA?= =?UTF-8?q?=D0=B0,=20=D1=82.=D0=BA.=20=D1=8D=D1=82=D0=BE=20=D0=B1=D1=8B?= =?UTF-8?q?=D0=BB=D0=BE=20=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=B2=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B2=20ffmpeg=20=D0=B4=D0=B5=D0=BA?= =?UTF-8?q?=D0=BE=D0=B4=D0=B5=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/transform/MPCVideoDec/ffmpegContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/filters/transform/MPCVideoDec/ffmpegContext.cpp b/src/filters/transform/MPCVideoDec/ffmpegContext.cpp index ca1091e069..df8621ae2f 100644 --- a/src/filters/transform/MPCVideoDec/ffmpegContext.cpp +++ b/src/filters/transform/MPCVideoDec/ffmpegContext.cpp @@ -37,7 +37,7 @@ extern "C" { #include #include #undef class - #include + //#include } #pragma warning(pop) @@ -318,6 +318,7 @@ void FillAVCodecProps(struct AVCodecContext* pAVCtx, BITMAPINFOHEADER* pBMI) case AV_CODEC_ID_DXTORY: pAVCtx->pix_fmt = AV_PIX_FMT_RGB24; // and other RGB formats, but it is not important here break; + /* case AV_CODEC_ID_VVC: { auto s = reinterpret_cast(pAVCtx->priv_data); @@ -369,6 +370,7 @@ void FillAVCodecProps(struct AVCodecContext* pAVCtx, BITMAPINFOHEADER* pBMI) } } break; + */ } if (pAVCtx->pix_fmt == AV_PIX_FMT_NONE) { From e81ca9b41a5f64e43196a7120c2939dae6010163 Mon Sep 17 00:00:00 2001 From: v0lt Date: Mon, 8 Jul 2024 18:50:08 +0300 Subject: [PATCH 049/102] =?UTF-8?q?=D0=AF=D0=B2=D0=BD=D0=BE=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=BF=D0=B8=D1=81=D1=8B=D0=B2=D0=B0=D0=B5=D0=BC=20ARCH?= =?UTF-8?q?=5FX86,=20ARCH=5FX86=5F32,=20ARCH=5FX86=5F64=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B2=D1=81=D0=B5=D1=85=20=D0=BA=D0=BE=D0=BC=D0=BF?= =?UTF-8?q?=D0=B8=D0=BB=D1=8F=D1=82=D0=BE=D1=80=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/config.h | 17 +++++++++-------- src/common.props | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/ExtLib/ffmpeg/config.h b/src/ExtLib/ffmpeg/config.h index c759492631..1975e56e56 100644 --- a/src/ExtLib/ffmpeg/config.h +++ b/src/ExtLib/ffmpeg/config.h @@ -1,9 +1,17 @@ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H +#define ARCH_X86 1 +#ifdef ARCH_X86_64 + #define ARCH_X86_32 0 + #define ARCH_X86_64 1 +#else + #define ARCH_X86_32 1 + #define ARCH_X86_64 0 +#endif + #define SWS_MAX_FILTER_SIZE 256 #ifdef __GNUC__ - #define ARCH_X86 1 #define HAVE_INLINE_ASM 1 #define HAVE_AESNI 1 #define HAVE_AMD3DNOW 1 @@ -65,16 +73,12 @@ #ifdef ARCH_X86_64 #define BROKEN_RELOCATIONS 1 - #define ARCH_X86_32 0 - #define ARCH_X86_64 1 #define HAVE_FAST_64BIT 1 #define HAVE_FAST_CMOV 1 #define HAVE_MM_EMPTY 1 #define HAVE_XMM_CLOBBERS 1 #define CONFIG_PIC 1 #else - #define ARCH_X86_32 1 - #define ARCH_X86_64 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CMOV 0 #define HAVE_MM_EMPTY 0 @@ -141,9 +145,6 @@ #define HAVE_SSSE3_INLINE 0 #define HAVE_XOP_INLINE 0 #define HAVE_I686_INLINE 0 - #define ARCH_X86 0 - #define ARCH_X86_32 0 - #define ARCH_X86_64 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CMOV 0 #define HAVE_MM_EMPTY 0 diff --git a/src/common.props b/src/common.props index 3781d25127..ec33ca518a 100644 --- a/src/common.props +++ b/src/common.props @@ -23,8 +23,8 @@ true _WINDOWS;WINDOWS;WINVER=0x0A00;_WIN32_WINNT=0x0A00;_WIN32_IE=0x0800;PSAPI_VERSION=1;_USE_MATH_DEFINES;__STDC_CONSTANT_MACROS;_HAS_STD_BYTE=0;%(PreprocessorDefinitions) NOMINMAX;%(PreprocessorDefinitions) - WIN32;%(PreprocessorDefinitions) - _WIN64;WIN64;%(PreprocessorDefinitions) + WIN32;ARCH_X86_32;%(PreprocessorDefinitions) + _WIN64;WIN64;ARCH_X86_64;%(PreprocessorDefinitions) Level3 From d79aa4a267606770b62388e0bcec4b3023ef4e07 Mon Sep 17 00:00:00 2001 From: v0lt Date: Mon, 8 Jul 2024 20:50:30 +0300 Subject: [PATCH 050/102] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=BA=D0=B0=20commit=20e81ca9b.=20=D0=9F=D0=BE=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=BA=D0=BE=D0=B9-=D1=82=D0=BE=20=D0=BD=D0=B5=D0=B2?= =?UTF-8?q?=D0=B5=D0=B4=D0=BE=D0=BC=D0=BE=D0=B9=20=D0=BF=D1=80=D0=B8=D1=87?= =?UTF-8?q?=D0=B8=D0=BD=D0=B5=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20ARCH=5FX86=5F32=20=D0=B4=D0=BB=D1=8F=20x86=20=D0=BB=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=B5=D1=82=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81?= =?UTF-8?q?=D1=81=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/config.h | 22 +++++++++++++--------- src/common.props | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/ExtLib/ffmpeg/config.h b/src/ExtLib/ffmpeg/config.h index 1975e56e56..7af071e6ca 100644 --- a/src/ExtLib/ffmpeg/config.h +++ b/src/ExtLib/ffmpeg/config.h @@ -1,15 +1,6 @@ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -#define ARCH_X86 1 -#ifdef ARCH_X86_64 - #define ARCH_X86_32 0 - #define ARCH_X86_64 1 -#else - #define ARCH_X86_32 1 - #define ARCH_X86_64 0 -#endif - #define SWS_MAX_FILTER_SIZE 256 #ifdef __GNUC__ #define HAVE_INLINE_ASM 1 @@ -71,7 +62,10 @@ #define HAVE_XOP_INLINE 1 #define HAVE_I686_INLINE 0 + #define ARCH_X86 1 #ifdef ARCH_X86_64 + #define ARCH_X86_32 0 + #define ARCH_X86_64 1 #define BROKEN_RELOCATIONS 1 #define HAVE_FAST_64BIT 1 #define HAVE_FAST_CMOV 1 @@ -79,6 +73,8 @@ #define HAVE_XMM_CLOBBERS 1 #define CONFIG_PIC 1 #else + #define ARCH_X86_32 1 + #define ARCH_X86_64 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CMOV 0 #define HAVE_MM_EMPTY 0 @@ -151,6 +147,14 @@ #define HAVE_XMM_CLOBBERS 0 #define CONFIG_PIC 0 + #define ARCH_X86 1 + #ifdef ARCH_X86_64 + #define ARCH_X86_64 1 + #else + #define ARCH_X86_64 0 + #endif + #define ARCH_X86_32 0 + #define av_restrict #define __asm__ __asm #endif diff --git a/src/common.props b/src/common.props index ec33ca518a..8ffecda24d 100644 --- a/src/common.props +++ b/src/common.props @@ -23,7 +23,7 @@ true _WINDOWS;WINDOWS;WINVER=0x0A00;_WIN32_WINNT=0x0A00;_WIN32_IE=0x0800;PSAPI_VERSION=1;_USE_MATH_DEFINES;__STDC_CONSTANT_MACROS;_HAS_STD_BYTE=0;%(PreprocessorDefinitions) NOMINMAX;%(PreprocessorDefinitions) - WIN32;ARCH_X86_32;%(PreprocessorDefinitions) + WIN32;%(PreprocessorDefinitions) _WIN64;WIN64;ARCH_X86_64;%(PreprocessorDefinitions) Level3 From 4d24827a24822b08be5e2d3821a6787afa4c2f29 Mon Sep 17 00:00:00 2001 From: v0lt Date: Mon, 8 Jul 2024 20:56:30 +0300 Subject: [PATCH 051/102] =?UTF-8?q?MPCVideoDec:=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BE=D0=BF=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20pix=5Ffmt=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20FFV1.=20FFmpeg:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20ff=5Fffv1=5Fparse=5Fextra=5Fdata=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20pAVCtx->priv=5Fdata.=20=D0=9F=D0=BE=20=D0=BA=D0=B0=D0=BA?= =?UTF-8?q?=D0=BE=D0=B9-=D1=82=D0=BE=20=D0=BF=D1=80=D0=B8=D1=87=D0=B8?= =?UTF-8?q?=D0=BD=D0=B5=20FFmpeg=20=D0=BF=D0=B5=D1=80=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BB=20=D1=8D=D1=82=D0=BE=20=D0=B4=D0=B5=D0=BB=D0=B0?= =?UTF-8?q?=D1=82=D1=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/libavcodec/ffv1.h | 4 +++ src/ExtLib/ffmpeg/libavcodec/ffv1dec.c | 16 ++++++++++++ .../transform/MPCVideoDec/ffmpegContext.cpp | 25 ++++++++++++------- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1.h b/src/ExtLib/ffmpeg/libavcodec/ffv1.h index acec22e83e..39eef8087c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1.h +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1.h @@ -181,4 +181,8 @@ static inline void update_vlc_state(VlcState *const state, const int v) state->count = count; } +// ==> Start patch MPC +int ff_ffv1_parse_extra_data(AVCodecContext* avctx); +// ==> End patch MPC + #endif /* AVCODEC_FFV1_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c b/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c index 7a0d1909aa..32d2d58ca4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c @@ -1118,3 +1118,19 @@ const FFCodec ff_ffv1_decoder = { .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_USES_PROGRESSFRAMES, }; + +// ==> Start patch MPC +int ff_ffv1_parse_extra_data(AVCodecContext* avctx) +{ + FFV1Context* f = avctx->priv_data; + int ret; + + if ((ret = ff_ffv1_common_init(avctx)) < 0) + return ret; + + if (avctx->extradata_size > 0 && (ret = read_extra_header(f)) < 0) + return ret; + + return 0; +} +// ==> End patch MPC diff --git a/src/filters/transform/MPCVideoDec/ffmpegContext.cpp b/src/filters/transform/MPCVideoDec/ffmpegContext.cpp index df8621ae2f..8ba33dfa32 100644 --- a/src/filters/transform/MPCVideoDec/ffmpegContext.cpp +++ b/src/filters/transform/MPCVideoDec/ffmpegContext.cpp @@ -269,11 +269,18 @@ void FillAVCodecProps(struct AVCodecContext* pAVCtx, BITMAPINFOHEADER* pBMI) break; case AV_CODEC_ID_FFV1: if (pAVCtx->priv_data) { - const FFV1Context* h = (FFV1Context*)pAVCtx->priv_data; - if (h->version > 0) { // extra data has been parse - if (h->colorspace == 0) { + auto f = static_cast(pAVCtx->priv_data); + if (!f->version) { + if (ff_ffv1_parse_extra_data(pAVCtx) < 0) { + break; + } + } + if (f->version > 0) { // extra data has been parse + if (f->colorspace == 0) { + auto chorma_shift = 16 * f->chroma_h_shift + f->chroma_v_shift; + if (pAVCtx->bits_per_raw_sample <= 8) { // <=8 bit and transparency - switch (16 * h->chroma_h_shift + h->chroma_v_shift) { + switch (chorma_shift) { case 0x00: pAVCtx->pix_fmt = AV_PIX_FMT_YUV444P; break; case 0x01: pAVCtx->pix_fmt = AV_PIX_FMT_YUV440P; break; case 0x10: pAVCtx->pix_fmt = AV_PIX_FMT_YUV422P; break; @@ -283,21 +290,21 @@ void FillAVCodecProps(struct AVCodecContext* pAVCtx, BITMAPINFOHEADER* pBMI) } } else if (pAVCtx->bits_per_raw_sample <= 10) { // 9, 10 bit and transparency - switch (16 * h->chroma_h_shift + h->chroma_v_shift) { + switch (chorma_shift) { case 0x00: pAVCtx->pix_fmt = AV_PIX_FMT_YUV444P10; break; case 0x10: pAVCtx->pix_fmt = AV_PIX_FMT_YUV422P10; break; case 0x11: pAVCtx->pix_fmt = AV_PIX_FMT_YUV420P10; break; } } else if (pAVCtx->bits_per_raw_sample <= 16) { // 12, 14, 16 bit and transparency - switch (16 * h->chroma_h_shift + h->chroma_v_shift) { + switch (chorma_shift) { case 0x00: pAVCtx->pix_fmt = AV_PIX_FMT_YUV444P16; break; case 0x10: pAVCtx->pix_fmt = AV_PIX_FMT_YUV422P16; break; case 0x11: pAVCtx->pix_fmt = AV_PIX_FMT_YUV420P16; break; } } } - else if (h->colorspace == 1) { + else if (f->colorspace == 1) { pAVCtx->pix_fmt = AV_PIX_FMT_RGBA; // and other RGB formats, but it is not important here } } @@ -318,7 +325,7 @@ void FillAVCodecProps(struct AVCodecContext* pAVCtx, BITMAPINFOHEADER* pBMI) case AV_CODEC_ID_DXTORY: pAVCtx->pix_fmt = AV_PIX_FMT_RGB24; // and other RGB formats, but it is not important here break; - /* + /* case AV_CODEC_ID_VVC: { auto s = reinterpret_cast(pAVCtx->priv_data); @@ -370,7 +377,7 @@ void FillAVCodecProps(struct AVCodecContext* pAVCtx, BITMAPINFOHEADER* pBMI) } } break; - */ + */ } if (pAVCtx->pix_fmt == AV_PIX_FMT_NONE) { From b89eafa4a14edf8397b2d92993e27feee5482482 Mon Sep 17 00:00:00 2001 From: v0lt Date: Mon, 8 Jul 2024 21:45:23 +0300 Subject: [PATCH 052/102] =?UTF-8?q?MPCVideoDec:=20=D1=83=D0=BB=D1=83=D1=87?= =?UTF-8?q?=D1=88=D0=B5=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B6=D0=BA=D0=B0=20FFV1=20RGB=20=D0=B2=D1=8B=D1=81=D0=BE?= =?UTF-8?q?=D0=BA=D0=BE=D0=B9=20=D1=80=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8.=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20custom=5Fcode/ffmpeg.txt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/custom_code/ffmpeg.txt | 2 ++ src/filters/transform/MPCVideoDec/ffmpegContext.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/custom_code/ffmpeg.txt b/docs/custom_code/ffmpeg.txt index 77383076aa..c3d625069f 100644 --- a/docs/custom_code/ffmpeg.txt +++ b/docs/custom_code/ffmpeg.txt @@ -19,6 +19,8 @@ * libavcodec/dxva2.c * libavcodec/dxva2_hevc.c * libavcodec/dxva2_internal.h +* libavcodec/ffv1.h +* libavcodec/ffv1dec.c * libavcodec/h264_refs.c * libavcodec/h264_slice.c * libavcodec/h264dec.c diff --git a/src/filters/transform/MPCVideoDec/ffmpegContext.cpp b/src/filters/transform/MPCVideoDec/ffmpegContext.cpp index 8ba33dfa32..4acd71e3d5 100644 --- a/src/filters/transform/MPCVideoDec/ffmpegContext.cpp +++ b/src/filters/transform/MPCVideoDec/ffmpegContext.cpp @@ -305,7 +305,12 @@ void FillAVCodecProps(struct AVCodecContext* pAVCtx, BITMAPINFOHEADER* pBMI) } } else if (f->colorspace == 1) { - pAVCtx->pix_fmt = AV_PIX_FMT_RGBA; // and other RGB formats, but it is not important here + if (pAVCtx->bits_per_raw_sample <= 8) { + pAVCtx->pix_fmt = AV_PIX_FMT_RGBA; + } + else { + pAVCtx->pix_fmt = AV_PIX_FMT_RGB48; + } } } } From d7be6b6d42520d1eb7e734289e272bf2ee00e8ee Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Tue, 9 Jul 2024 09:09:48 +1000 Subject: [PATCH 053/102] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=B2=D1=8B=D1=81=D1=82=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B5=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=20ARCH=5FX86=5F32=20=D0=B8=20ARCH=5FX86=5F64?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/config.h | 5 +++-- src/common.props | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ExtLib/ffmpeg/config.h b/src/ExtLib/ffmpeg/config.h index 7af071e6ca..254ce6eab2 100644 --- a/src/ExtLib/ffmpeg/config.h +++ b/src/ExtLib/ffmpeg/config.h @@ -148,12 +148,13 @@ #define CONFIG_PIC 0 #define ARCH_X86 1 - #ifdef ARCH_X86_64 + #ifdef _WIN64 + #define ARCH_X86_32 0 #define ARCH_X86_64 1 #else + #define ARCH_X86_32 1 #define ARCH_X86_64 0 #endif - #define ARCH_X86_32 0 #define av_restrict #define __asm__ __asm diff --git a/src/common.props b/src/common.props index 8ffecda24d..3781d25127 100644 --- a/src/common.props +++ b/src/common.props @@ -24,7 +24,7 @@ _WINDOWS;WINDOWS;WINVER=0x0A00;_WIN32_WINNT=0x0A00;_WIN32_IE=0x0800;PSAPI_VERSION=1;_USE_MATH_DEFINES;__STDC_CONSTANT_MACROS;_HAS_STD_BYTE=0;%(PreprocessorDefinitions) NOMINMAX;%(PreprocessorDefinitions) WIN32;%(PreprocessorDefinitions) - _WIN64;WIN64;ARCH_X86_64;%(PreprocessorDefinitions) + _WIN64;WIN64;%(PreprocessorDefinitions) Level3 From f2b16f28a9f56c7c48bb07929a97d9bdf89c9e5f Mon Sep 17 00:00:00 2001 From: v0lt Date: Wed, 10 Jul 2024 17:45:44 +0300 Subject: [PATCH 054/102] =?UTF-8?q?FFmpeg:=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=B4=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ffmpeg/libavutil/hwcontext_d3d12va.c | 296 +++++++++--------- .../ffmpeg/libavutil/hwcontext_d3d12va.h | 6 +- 2 files changed, 150 insertions(+), 152 deletions(-) diff --git a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c index ee5ac26417..4ef00dff11 100644 --- a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c +++ b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.c @@ -534,154 +534,6 @@ static int d3d12va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, return AVERROR(EINVAL); } -// ==> Start patch MPC -int d3d12va_direct_copy(const AVFrame* src, AVFrame* tmp, uint8_t* output, - void (*convert_funct_ptr)(void*, AVFrame*, uint8_t*), void* ptr) -{ - AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data; - AVD3D12VADeviceContext *hwctx = ctx->device_ctx->hwctx; - D3D12VAFramesContext *s = ctx->hwctx; - AVD3D12VAFramesContext *frames_hwctx = &s->p; - - int ret; - - AVD3D12VAFrame* f = (AVD3D12VAFrame*)src->data[0]; - ID3D12Resource* texture = (ID3D12Resource*)f->texture; - - uint8_t* mapped_data; - int linesizes[4]; - - D3D12_TEXTURE_COPY_LOCATION staging_y_location = { 0 }; - D3D12_TEXTURE_COPY_LOCATION staging_uv_location = { 0 }; - - D3D12_TEXTURE_COPY_LOCATION texture_y_location = { - .pResource = texture, - .Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, - .SubresourceIndex = 0, - }; - - D3D12_TEXTURE_COPY_LOCATION texture_uv_location = { - .pResource = texture, - .Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, - .SubresourceIndex = 1, - }; - - D3D12_RESOURCE_BARRIER barrier = { - .Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION, - .Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE, - .Transition = { - .pResource = texture, - .StateBefore = D3D12_RESOURCE_STATE_COMMON, - .StateAfter = D3D12_RESOURCE_STATE_COPY_SOURCE, - .Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, - }, - }; - - hwctx->lock(hwctx->lock_ctx); - - if (!s->command_queue) { - ret = d3d12va_create_helper_objects(ctx); - if (ret < 0) - goto fail; - } - - for (int i = 0; i < 4; i++) - linesizes[i] = FFALIGN(src->width * (frames_hwctx->format == DXGI_FORMAT_P010 ? 2 : 1), - D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); - - staging_y_location = (D3D12_TEXTURE_COPY_LOCATION) { - .Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, - .PlacedFootprint = { - .Offset = 0, - .Footprint = { - .Format = frames_hwctx->format == DXGI_FORMAT_P010 ? - DXGI_FORMAT_R16_UNORM : DXGI_FORMAT_R8_UNORM, - .Width = ctx->width, - .Height = ctx->height, - .Depth = 1, - .RowPitch = linesizes[0], - }, - }, - }; - - staging_uv_location = (D3D12_TEXTURE_COPY_LOCATION) { - .Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, - .PlacedFootprint = { - .Offset = s->luma_component_size, - .Footprint = { - .Format = frames_hwctx->format == DXGI_FORMAT_P010 ? - DXGI_FORMAT_R16G16_UNORM : DXGI_FORMAT_R8G8_UNORM, - .Width = ctx->width >> 1, - .Height = ctx->height >> 1, - .Depth = 1, - .RowPitch = linesizes[0], - }, - }, - }; - - DX_CHECK(ID3D12CommandAllocator_Reset(s->command_allocator)); - - DX_CHECK(ID3D12GraphicsCommandList_Reset(s->command_list, s->command_allocator, NULL)); - - if (!s->staging_download_buffer) { - ret = d3d12va_create_staging_buffer_resource(ctx, D3D12_RESOURCE_STATE_COPY_DEST, - &s->staging_download_buffer, 1); - if (ret < 0) { - goto fail; - } - } - - staging_y_location.pResource = staging_uv_location.pResource = s->staging_download_buffer; - - ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, &barrier); - - ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list, - &staging_y_location, 0, 0, 0, - &texture_y_location, NULL); - - ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list, - &staging_uv_location, 0, 0, 0, - &texture_uv_location, NULL); - - barrier.Transition.StateBefore = barrier.Transition.StateAfter; - barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_COMMON; - ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, &barrier); - - DX_CHECK(ID3D12GraphicsCommandList_Close(s->command_list)); - - DX_CHECK(ID3D12CommandQueue_Wait(s->command_queue, f->sync_ctx.fence, f->sync_ctx.fence_value)); - - ID3D12CommandQueue_ExecuteCommandLists(s->command_queue, 1, (ID3D12CommandList **)&s->command_list); - - ret = d3d12va_wait_queue_idle(&s->sync_ctx, s->command_queue); - if (ret < 0) - goto fail; - - DX_CHECK(ID3D12Resource_Map(s->staging_download_buffer, 0, NULL, (void **)&mapped_data)); - av_image_fill_pointers(tmp->data, ctx->sw_format, ctx->height, mapped_data, linesizes); - - tmp->linesize[0] = linesizes[0]; - tmp->linesize[1] = linesizes[1]; - tmp->format = ctx->sw_format; - tmp->width = src->width; - tmp->height = src->height; - - convert_funct_ptr(ptr, tmp, output); - - tmp->data[0] = tmp->data[1] = NULL; - - ID3D12Resource_Unmap(s->staging_download_buffer, 0, NULL); - - hwctx->unlock(hwctx->lock_ctx); - - return 0; - -fail: - hwctx->unlock(hwctx->lock_ctx); - return AVERROR(EINVAL); -} -// ==> End patch MPC - static int d3d12va_load_functions(AVHWDeviceContext *hwdev) { D3D12VADevicePriv *priv = hwdev->hwctx; @@ -856,3 +708,151 @@ const HWContextType ff_hwcontext_type_d3d12va = { .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_D3D12, AV_PIX_FMT_NONE }, }; + +// ==> Start patch MPC +int d3d12va_direct_copy(const AVFrame* src, AVFrame* tmp, uint8_t* output, + void (*convert_funct_ptr)(void*, AVFrame*, uint8_t*), void* ptr) +{ + AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data; + AVD3D12VADeviceContext *hwctx = ctx->device_ctx->hwctx; + D3D12VAFramesContext *s = ctx->hwctx; + AVD3D12VAFramesContext *frames_hwctx = &s->p; + + int ret; + + AVD3D12VAFrame* f = (AVD3D12VAFrame*)src->data[0]; + ID3D12Resource* texture = (ID3D12Resource*)f->texture; + + uint8_t* mapped_data; + int linesizes[4]; + + D3D12_TEXTURE_COPY_LOCATION staging_y_location = { 0 }; + D3D12_TEXTURE_COPY_LOCATION staging_uv_location = { 0 }; + + D3D12_TEXTURE_COPY_LOCATION texture_y_location = { + .pResource = texture, + .Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, + .SubresourceIndex = 0, + }; + + D3D12_TEXTURE_COPY_LOCATION texture_uv_location = { + .pResource = texture, + .Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, + .SubresourceIndex = 1, + }; + + D3D12_RESOURCE_BARRIER barrier = { + .Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION, + .Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE, + .Transition = { + .pResource = texture, + .StateBefore = D3D12_RESOURCE_STATE_COMMON, + .StateAfter = D3D12_RESOURCE_STATE_COPY_SOURCE, + .Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, + }, + }; + + hwctx->lock(hwctx->lock_ctx); + + if (!s->command_queue) { + ret = d3d12va_create_helper_objects(ctx); + if (ret < 0) + goto fail; + } + + for (int i = 0; i < 4; i++) + linesizes[i] = FFALIGN(src->width * (frames_hwctx->format == DXGI_FORMAT_P010 ? 2 : 1), + D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); + + staging_y_location = (D3D12_TEXTURE_COPY_LOCATION) { + .Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, + .PlacedFootprint = { + .Offset = 0, + .Footprint = { + .Format = frames_hwctx->format == DXGI_FORMAT_P010 ? + DXGI_FORMAT_R16_UNORM : DXGI_FORMAT_R8_UNORM, + .Width = ctx->width, + .Height = ctx->height, + .Depth = 1, + .RowPitch = linesizes[0], + }, + }, + }; + + staging_uv_location = (D3D12_TEXTURE_COPY_LOCATION) { + .Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, + .PlacedFootprint = { + .Offset = s->luma_component_size, + .Footprint = { + .Format = frames_hwctx->format == DXGI_FORMAT_P010 ? + DXGI_FORMAT_R16G16_UNORM : DXGI_FORMAT_R8G8_UNORM, + .Width = ctx->width >> 1, + .Height = ctx->height >> 1, + .Depth = 1, + .RowPitch = linesizes[0], + }, + }, + }; + + DX_CHECK(ID3D12CommandAllocator_Reset(s->command_allocator)); + + DX_CHECK(ID3D12GraphicsCommandList_Reset(s->command_list, s->command_allocator, NULL)); + + if (!s->staging_download_buffer) { + ret = d3d12va_create_staging_buffer_resource(ctx, D3D12_RESOURCE_STATE_COPY_DEST, + &s->staging_download_buffer, 1); + if (ret < 0) { + goto fail; + } + } + + staging_y_location.pResource = staging_uv_location.pResource = s->staging_download_buffer; + + ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, &barrier); + + ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list, + &staging_y_location, 0, 0, 0, + &texture_y_location, NULL); + + ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list, + &staging_uv_location, 0, 0, 0, + &texture_uv_location, NULL); + + barrier.Transition.StateBefore = barrier.Transition.StateAfter; + barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_COMMON; + ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, &barrier); + + DX_CHECK(ID3D12GraphicsCommandList_Close(s->command_list)); + + DX_CHECK(ID3D12CommandQueue_Wait(s->command_queue, f->sync_ctx.fence, f->sync_ctx.fence_value)); + + ID3D12CommandQueue_ExecuteCommandLists(s->command_queue, 1, (ID3D12CommandList **)&s->command_list); + + ret = d3d12va_wait_queue_idle(&s->sync_ctx, s->command_queue); + if (ret < 0) + goto fail; + + DX_CHECK(ID3D12Resource_Map(s->staging_download_buffer, 0, NULL, (void **)&mapped_data)); + av_image_fill_pointers(tmp->data, ctx->sw_format, ctx->height, mapped_data, linesizes); + + tmp->linesize[0] = linesizes[0]; + tmp->linesize[1] = linesizes[1]; + tmp->format = ctx->sw_format; + tmp->width = src->width; + tmp->height = src->height; + + convert_funct_ptr(ptr, tmp, output); + + tmp->data[0] = tmp->data[1] = NULL; + + ID3D12Resource_Unmap(s->staging_download_buffer, 0, NULL); + + hwctx->unlock(hwctx->lock_ctx); + + return 0; + +fail: + hwctx->unlock(hwctx->lock_ctx); + return AVERROR(EINVAL); +} +// ==> End patch MPC diff --git a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h index 38818f8525..e8d15a48eb 100644 --- a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h +++ b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d12va.h @@ -36,10 +36,6 @@ #include #include -// ==> Start patch MPC -#include "frame.h" -// ==> End patch MPC - /** * @brief This struct is allocated as AVHWDeviceContext.hwctx * @@ -148,6 +144,8 @@ typedef struct AVD3D12VAFramesContext { } AVD3D12VAFramesContext; // ==> Start patch MPC +#include "frame.h" + int d3d12va_direct_copy(const AVFrame* src, AVFrame* tmp, uint8_t* output, void (*convert_funct_ptr)(void*, AVFrame*, uint8_t*), void* ptr); // ==> End patch MPC From 78092f7864e3f8ed42a83c06da6955eb981b6e3b Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Sat, 13 Jul 2024 06:48:06 +0300 Subject: [PATCH 055/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20ResizableLib=20v1.5.3-8-g25a89da.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 1 + docs/Changelog.txt | 1 + .../ui/ResizableLib/ResizableDialog.cpp | 19 +-- src/ExtLib/ui/ResizableLib/ResizableDialog.h | 2 +- src/ExtLib/ui/ResizableLib/ResizableGrip.cpp | 10 +- src/ExtLib/ui/ResizableLib/ResizableGrip.h | 2 +- .../ui/ResizableLib/ResizableLayout.cpp | 75 +++++---- src/ExtLib/ui/ResizableLib/ResizableLayout.h | 22 +-- .../ui/ResizableLib/ResizableMinMax.cpp | 2 +- src/ExtLib/ui/ResizableLib/ResizableMinMax.h | 2 +- .../ui/ResizableLib/ResizableMsgSupport.cpp | 4 +- .../ui/ResizableLib/ResizableMsgSupport.h | 4 +- src/ExtLib/ui/ResizableLib/ResizablePage.cpp | 22 +-- src/ExtLib/ui/ResizableLib/ResizablePage.h | 9 +- src/ExtLib/ui/ResizableLib/ResizableSheet.cpp | 142 ++++++++++-------- src/ExtLib/ui/ResizableLib/ResizableSheet.h | 10 +- .../ui/ResizableLib/ResizableSheetState.cpp | 15 +- .../ui/ResizableLib/ResizableSheetState.h | 8 +- src/ExtLib/ui/ResizableLib/ResizableState.cpp | 2 +- src/ExtLib/ui/ResizableLib/ResizableState.h | 2 +- .../ui/ResizableLib/ResizableVersion.cpp | 11 +- src/ExtLib/ui/ResizableLib/ResizableVersion.h | 2 +- .../ui/ResizableLib/ResizableWndState.cpp | 10 +- .../ui/ResizableLib/ResizableWndState.h | 2 +- 24 files changed, 207 insertions(+), 172 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 79ee3ee535..f75346ed36 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -20,6 +20,7 @@ MPCVideoDec Обновлены библиотеки: ffmpeg n7.1-dev-1688-ge0eff64ed1; + ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index aedc8b284f..8ad5fb8e9f 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -20,6 +20,7 @@ Updated Japanese translation (by tsubasanouta). Updated libraries: ffmpeg n7.1-dev-1688-ge0eff64ed1; + ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/src/ExtLib/ui/ResizableLib/ResizableDialog.cpp b/src/ExtLib/ui/ResizableLib/ResizableDialog.cpp index 512f3156f9..7c95712be7 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableDialog.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableDialog.cpp @@ -5,7 +5,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -82,18 +82,19 @@ BOOL CResizableDialog::OnNcCreate(LPCREATESTRUCT lpCreateStruct) if (!CreateSizeGrip(!bChild)) return FALSE; + // Moved from behind if (!bChild) because user could resize the dialog smaller as in resource defined and that causes some static text to be clipped or disappear. + MakeResizable(lpCreateStruct); + if (!bChild) { // set the initial size as the min track size SetMinTrackSize(CSize(lpCreateStruct->cx, lpCreateStruct->cy)); } - - MakeResizable(lpCreateStruct); return TRUE; } -void CResizableDialog::OnDestroy() +void CResizableDialog::OnDestroy() { if (m_bEnableSaveRestore) SaveWindowRect(m_sSection, m_bRectOnly); @@ -106,10 +107,10 @@ void CResizableDialog::OnDestroy() __super::OnDestroy(); } -void CResizableDialog::OnSize(UINT nType, int cx, int cy) +void CResizableDialog::OnSize(UINT nType, int cx, int cy) { __super::OnSize(nType, cx, cy); - + if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW) return; // arrangement not needed @@ -123,7 +124,7 @@ void CResizableDialog::OnSize(UINT nType, int cx, int cy) ArrangeLayout(); } -void CResizableDialog::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) +void CResizableDialog::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { MinMaxInfo(lpMMI); } @@ -141,7 +142,7 @@ void CResizableDialog::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly) LoadWindowRect(pszSection, bRectOnly); } -BOOL CResizableDialog::OnEraseBkgnd(CDC* pDC) +BOOL CResizableDialog::OnEraseBkgnd(CDC* pDC) { ClipChildren(pDC, FALSE); @@ -152,7 +153,7 @@ BOOL CResizableDialog::OnEraseBkgnd(CDC* pDC) return bRet; } -LRESULT CResizableDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CResizableDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if (message != WM_NCCALCSIZE || wParam == 0) return __super::WindowProc(message, wParam, lParam); diff --git a/src/ExtLib/ui/ResizableLib/ResizableDialog.h b/src/ExtLib/ui/ResizableLib/ResizableDialog.h index 153996790f..9173ce6a77 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableDialog.h +++ b/src/ExtLib/ui/ResizableLib/ResizableDialog.h @@ -12,7 +12,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 diff --git a/src/ExtLib/ui/ResizableLib/ResizableGrip.cpp b/src/ExtLib/ui/ResizableLib/ResizableGrip.cpp index e823a9460b..0071fdb737 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableGrip.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableGrip.cpp @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -61,7 +61,7 @@ void CResizableGrip::UpdateSizeGrip() | (IsSizeGripVisible() ? SWP_SHOWWINDOW : SWP_HIDEWINDOW)); } -// pbStatus points to a variable, maintained by the caller, that +// pStatus points to a variable, maintained by the caller, that // holds its visibility status. Initialize the variable with 1 // to allow to temporarily hide the grip, 0 to allow to // temporarily show the grip (with respect to the dwMask bit). @@ -235,10 +235,8 @@ LRESULT CResizableGrip::CSizeGrip::WindowProc(UINT message, BeginPaint(&ps) : CDC::FromHandle((HDC)wParam); // select bitmaps - CBitmap *pOldGrip, *pOldMask; - - pOldGrip = m_dcGrip.SelectObject(&m_bmGrip); - pOldMask = m_dcMask.SelectObject(&m_bmMask); + CBitmap *pOldGrip = m_dcGrip.SelectObject(&m_bmGrip); + CBitmap *pOldMask = m_dcMask.SelectObject(&m_bmMask); // obtain original grip bitmap, make the mask and prepare masked bitmap CScrollBar::WindowProc(message, (WPARAM)m_dcGrip.GetSafeHdc(), lParam); diff --git a/src/ExtLib/ui/ResizableLib/ResizableGrip.h b/src/ExtLib/ui/ResizableLib/ResizableGrip.h index bfbb336eda..f0ae37da2a 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableGrip.h +++ b/src/ExtLib/ui/ResizableLib/ResizableGrip.h @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 diff --git a/src/ExtLib/ui/ResizableLib/ResizableLayout.cpp b/src/ExtLib/ui/ResizableLib/ResizableLayout.cpp index 826d22015b..3d1b7dcbf1 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableLayout.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableLayout.cpp @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -28,6 +28,19 @@ static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif +/*! + * Definition of the standard anchors + */ +const ANCHOR TOP_LEFT(0, 0); +const ANCHOR TOP_CENTER(50, 0); +const ANCHOR TOP_RIGHT(100, 0); +const ANCHOR MIDDLE_LEFT(0, 50); +const ANCHOR MIDDLE_CENTER(50, 50); +const ANCHOR MIDDLE_RIGHT(100, 50); +const ANCHOR BOTTOM_LEFT(0, 100); +const ANCHOR BOTTOM_CENTER(50, 100); +const ANCHOR BOTTOM_RIGHT(100, 100); + /*! * @internal Constant used to detect clipping and refresh properties * @@ -75,18 +88,13 @@ void CResizableLayout::AddAnchor(HWND hWnd, ANCHOR anchorTopLeft, ANCHOR anchorB // adjust position, if client area has been scrolled rectChild.OffsetRect(-rectParent.TopLeft()); - // go calculate margins - CSize marginTopLeft, marginBottomRight; - // calculate margin for the top-left corner - - marginTopLeft.cx = rectChild.left - rectParent.Width() * anchorTopLeft.cx / 100; - marginTopLeft.cy = rectChild.top - rectParent.Height() * anchorTopLeft.cy / 100; + CSize marginTopLeft(rectChild.left - rectParent.Width() * anchorTopLeft.cx / 100, + rectChild.top - rectParent.Height() * anchorTopLeft.cy / 100); // calculate margin for the bottom-right corner - - marginBottomRight.cx = rectChild.right - rectParent.Width() * anchorBottomRight.cx / 100; - marginBottomRight.cy = rectChild.bottom - rectParent.Height() * anchorBottomRight.cy / 100; + CSize marginBottomRight(rectChild.right - rectParent.Width() * anchorBottomRight.cx / 100, + rectChild.bottom - rectParent.Height() * anchorBottomRight.cy / 100); // prepare the structure LAYOUTINFO layout(hWnd, anchorTopLeft, marginTopLeft, @@ -128,19 +136,29 @@ void CResizableLayout::AddAllOtherAnchors(ANCHOR anchorTopLeft, ANCHOR anchorBot ASSERT(::IsWindow(hParent)); HWND hWnd = ::GetWindow(hParent, GW_CHILD); - while (hWnd != NULL) + for (; hWnd != NULL; hWnd = ::GetNextWindow(hWnd, GW_HWNDNEXT)) { + TCHAR szClassName[32]; + if (::GetClassName(hWnd, szClassName, _countof(szClassName))) + { + if (lstrcmp(szClassName, WC_SCROLLBAR) == 0) + { + // skip size grip (which is handled on its own) + DWORD dwStyle = ::GetWindowLong(hWnd, GWL_STYLE); + if ((dwStyle & (WS_CHILD | WS_CLIPSIBLINGS | SBS_SIZEGRIP)) == (WS_CHILD | WS_CLIPSIBLINGS | SBS_SIZEGRIP)) + continue; + } + } + POSITION pos; if (!m_mapLayout.Lookup(hWnd, pos)) AddAnchor(hWnd, anchorTopLeft, anchorBottomRight); - - hWnd = ::GetNextWindow(hWnd, GW_HWNDNEXT); } } /*! * This function adds a placeholder to the layout manager, that will be - * dinamically set by a callback function whenever required. + * dynamically set by a callback function whenever required. * * @return The return value is an integer used to distinguish between * different placeholders in the callback implementation. @@ -196,7 +214,7 @@ BOOL CResizableLayout::ArrangeLayoutCallback(LAYOUTINFO& layout) const * controls layout should be updated, usually after a resize operation. * * @remarks All the controls added to the layout are moved and resized at - * once for performace reasons, so all the controls are in their + * once for performance reasons, so all the controls are in their * old position when AddAnchorCallback is called. * To know where a control will be placed use GetAnchorPosition. * @@ -204,14 +222,12 @@ BOOL CResizableLayout::ArrangeLayoutCallback(LAYOUTINFO& layout) const */ void CResizableLayout::ArrangeLayout() const { - // common vars - UINT uFlags; - CRect rectParent, rectChild; const INT_PTR count = m_listLayout.GetCount() + m_listLayoutCB.GetCount(); - if (count <= 0) return; + CRect rectParent, rectChild; + // get parent window's rect GetTotalClientRect(&rectParent); @@ -223,6 +239,7 @@ void CResizableLayout::ArrangeLayout() const // get layout info const LAYOUTINFO layout = m_listLayout.GetNext(pos); + UINT uFlags; // calculate new child's position, size and flags for SetWindowPos CalcNewChildPosition(layout, rectParent, rectChild, &uFlags); @@ -245,6 +262,7 @@ void CResizableLayout::ArrangeLayout() const if (!ArrangeLayoutCallback(layout)) continue; + UINT uFlags; // calculate new child's position, size and flags for SetWindowPos CalcNewChildPosition(layout, rectParent, rectChild, &uFlags); @@ -345,7 +363,7 @@ void CResizableLayout::GetClippingRegion(CRgn* pRegion) const if (::IsWindowVisible(layout.hWnd)) ClipChildWindow(layout, pRegion); } - + for (POSITION pos = m_listLayoutCB.GetHeadPosition(); pos != NULL;) { // get layout info @@ -379,7 +397,7 @@ inline CWnd* GetRootParentWnd(CWnd* pWnd) * area to avoid flickering. * * @param pDC Pointer to the target device context - * @param bUndo Flag that specifies wether to restore the clipping region + * @param bUndo Flag that specifies whether to restore the clipping region * * @return The return value is @c TRUE if the clipping region has been * modified, @c FALSE otherwise @@ -594,7 +612,7 @@ BOOL CResizableLayout::LikesClipping(const LAYOUTINFO& layout) const return clipping.bLikesClipping; } - LONG_PTR style = ::GetWindowLongPtr(layout.hWnd, GWL_STYLE); + const LONG_PTR style = ::GetWindowLongPtr(layout.hWnd, GWL_STYLE); // skip windows that wants background repainted if (0 == lstrcmp(layout.sWndClass, WC_BUTTON)) @@ -684,7 +702,8 @@ void CResizableLayout::CalcNewChildPosition(const LAYOUTINFO& layout, NeedsRefresh(layout, rectChild, rectNew) : layout.properties.bCachedNeedsRefresh; // set flags - if (lpFlags) { + if (lpFlags) + { *lpFlags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREPOSITION; if (bRefresh) *lpFlags |= SWP_NOCOPYBITS; @@ -721,10 +740,10 @@ BOOL CResizableLayout::GetAnchorMargins(HWND hWnd, const CSize &sizeChild, CRect const LAYOUTINFO& layout = m_listLayout.GetAt(pos); // augmented size, relative to anchor points - CSize size = sizeChild + layout.marginTopLeft - layout.marginBottomRight; + const CSize size = sizeChild + layout.marginTopLeft - layout.marginBottomRight; // percent of parent size occupied by this control - CSize percent(layout.anchorBottomRight.cx - layout.anchorTopLeft.cx, + const CSize percent(layout.anchorBottomRight.cx - layout.anchorTopLeft.cx, layout.anchorBottomRight.cy - layout.anchorTopLeft.cy); // calculate total margins @@ -755,10 +774,10 @@ BOOL CResizableLayout::GetAnchorMargins(HWND hWnd, const CSize &sizeChild, CRect * @c LikesClipping only once, and the @a refresh property as * dynamic, causing @c NeedsRefresh to be called every time. * @n This should be right for most situations, as the need for - * @a refresh usually depends on the size fo a control, while the + * @a refresh usually depends on the size of the control, while the * support for @a clipping is usually linked to the specific type * of control, which is unlikely to change at run-time, but you can - * still override this function if a different beahvior is needed. + * still override this function if a different behaviour is needed. * * @sa LikesClipping NeedsRefresh LAYOUTINFO RESIZEPROPERTIES */ @@ -827,7 +846,7 @@ void CResizableLayout::MakeResizable(LPCREATESTRUCT lpCreateStruct) const * This function should be called inside the parent window @c WM_NCCALCSIZE * message handler to help eliminate flickering. * - * @param bAfterDefault Flag that specifies wether the call is made before + * @param bAfterDefault Flag that specifies whether the call is made before * or after the default handler * @param lpncsp Pointer to the @c NCCALCSIZE_PARAMS structure that is * passed to the message handler diff --git a/src/ExtLib/ui/ResizableLib/ResizableLayout.h b/src/ExtLib/ui/ResizableLib/ResizableLayout.h index 6d2302d553..3ebb452063 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableLayout.h +++ b/src/ExtLib/ui/ResizableLib/ResizableLayout.h @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -54,27 +54,27 @@ typedef struct tagANCHOR } ANCHOR, *PANCHOR, *LPANCHOR; /*! @defgroup ConstAnchors Alignment Constants - * Define common layout alignment constants for anchor points. + * Declare common layout alignment constants for anchor points. * @{ */ //! Anchor to the top-left corner - inline const ANCHOR TOP_LEFT(0, 0); + extern const ANCHOR TOP_LEFT; //! Anchor to the top edge and center horizontally - inline const ANCHOR TOP_CENTER(50, 0); + extern const ANCHOR TOP_CENTER; //! Anchor to the top-right corner - inline const ANCHOR TOP_RIGHT(100, 0); + extern const ANCHOR TOP_RIGHT; //! Anchor to the left edge and center vertically - inline const ANCHOR MIDDLE_LEFT(0, 50); + extern const ANCHOR MIDDLE_LEFT; //! Anchor to the center - inline const ANCHOR MIDDLE_CENTER(50, 50); + extern const ANCHOR MIDDLE_CENTER; //! Anchor to the right edge and center vertically - inline const ANCHOR MIDDLE_RIGHT(100, 50); + extern const ANCHOR MIDDLE_RIGHT; //! Anchor to the bottom-left corner - inline const ANCHOR BOTTOM_LEFT(0, 100); + extern const ANCHOR BOTTOM_LEFT; //! Anchor to the bottom edge and center horizontally - inline const ANCHOR BOTTOM_CENTER(50, 100); + extern const ANCHOR BOTTOM_CENTER; //! Anchor to the bottom-right corner - inline const ANCHOR BOTTOM_RIGHT(100, 100); + extern const ANCHOR BOTTOM_RIGHT; // @} //! @brief Holds a control layout settings diff --git a/src/ExtLib/ui/ResizableLib/ResizableMinMax.cpp b/src/ExtLib/ui/ResizableLib/ResizableMinMax.cpp index 4001fa436a..59e3ea3778 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableMinMax.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableMinMax.cpp @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 diff --git a/src/ExtLib/ui/ResizableLib/ResizableMinMax.h b/src/ExtLib/ui/ResizableLib/ResizableMinMax.h index 31cc578bfa..74f7a59917 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableMinMax.h +++ b/src/ExtLib/ui/ResizableLib/ResizableMinMax.h @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 diff --git a/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.cpp b/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.cpp index 3426a4ba08..832cb6e9ad 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.cpp @@ -5,7 +5,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -27,7 +27,7 @@ static char THIS_FILE[] = __FILE__; ///////////////////////////////////////////////////////////////////////////// // Registered message to communicate with the library -// static intializer must be called before user code +// static initializer must be called before user code #pragma warning(disable:4073) #pragma init_seg(lib) diff --git a/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.h b/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.h index ef21720457..009f35b4f5 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.h +++ b/src/ExtLib/ui/ResizableLib/ResizableMsgSupport.h @@ -5,7 +5,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -24,7 +24,7 @@ typedef struct tagRESIZEPROPERTIES { - // wether to ask for resizing properties every time + // whether to ask for resizing properties every time BOOL bAskClipping; BOOL bAskRefresh; // otherwise, use the cached properties diff --git a/src/ExtLib/ui/ResizableLib/ResizablePage.cpp b/src/ExtLib/ui/ResizableLib/ResizablePage.cpp index e2c8620aa6..9fd5932ee1 100644 --- a/src/ExtLib/ui/ResizableLib/ResizablePage.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizablePage.cpp @@ -5,7 +5,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -61,14 +61,14 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CResizablePage message handlers -void CResizablePage::OnSize(UINT nType, int cx, int cy) +void CResizablePage::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); - + ArrangeLayout(); } -BOOL CResizablePage::OnEraseBkgnd(CDC* pDC) +BOOL CResizablePage::OnEraseBkgnd(CDC* pDC) { ClipChildren(pDC, FALSE); @@ -79,25 +79,25 @@ BOOL CResizablePage::OnEraseBkgnd(CDC* pDC) return bRet; } -void CResizablePage::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) +void CResizablePage::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { MinMaxInfo(lpMMI); } -BOOL CResizablePage::OnInitDialog() +BOOL CResizablePage::OnInitDialog() { CPropertyPage::OnInitDialog(); - + // set the initial size as the min track size CRect rc; GetWindowRect(&rc); SetMinTrackSize(rc.Size()); - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE } -void CResizablePage::OnDestroy() +void CResizablePage::OnDestroy() { // remove child windows RemoveAllAnchors(); @@ -106,7 +106,7 @@ void CResizablePage::OnDestroy() CPropertyPage::OnDestroy(); } -LRESULT CResizablePage::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CResizablePage::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if (message != WM_NCCALCSIZE || wParam == 0) return CPropertyPage::WindowProc(message, wParam, lParam); diff --git a/src/ExtLib/ui/ResizableLib/ResizablePage.h b/src/ExtLib/ui/ResizableLib/ResizablePage.h index 359ee8b3ad..e2133b2ef7 100644 --- a/src/ExtLib/ui/ResizableLib/ResizablePage.h +++ b/src/ExtLib/ui/ResizableLib/ResizablePage.h @@ -12,7 +12,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -40,15 +40,14 @@ class CResizablePage : public CPropertyPage, public CResizableLayout, explicit CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0); // Attributes -public: // Operations -public: // Overrides + virtual BOOL OnInitDialog(); // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CResizablePage) - protected: +protected: virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); //}}AFX_VIRTUAL @@ -66,12 +65,10 @@ class CResizablePage : public CPropertyPage, public CResizableLayout, }; // Generated message map functions -protected: //{{AFX_MSG(CResizablePage) afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); - virtual BOOL OnInitDialog(); afx_msg void OnDestroy(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/src/ExtLib/ui/ResizableLib/ResizableSheet.cpp b/src/ExtLib/ui/ResizableLib/ResizableSheet.cpp index 7eccb329a5..d897101a60 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableSheet.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableSheet.cpp @@ -5,7 +5,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -50,13 +50,13 @@ CResizableSheet::CResizableSheet() } CResizableSheet::CResizableSheet(UINT nIDCaption, CWnd *pParentWnd, UINT iSelectPage) - : CPropertySheet(nIDCaption, pParentWnd, iSelectPage) + : CPropertySheet(nIDCaption, pParentWnd, iSelectPage) { PrivateConstruct(); } CResizableSheet::CResizableSheet(LPCTSTR pszCaption, CWnd *pParentWnd, UINT iSelectPage) - : CPropertySheet(pszCaption, pParentWnd, iSelectPage) + : CPropertySheet(pszCaption, pParentWnd, iSelectPage) { PrivateConstruct(); } @@ -79,7 +79,7 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CResizableSheet message handlers -BOOL CResizableSheet::OnNcCreate(LPCREATESTRUCT lpCreateStruct) +BOOL CResizableSheet::OnNcCreate(LPCREATESTRUCT lpCreateStruct) { if (!CPropertySheet::OnNcCreate(lpCreateStruct)) return FALSE; @@ -93,11 +93,11 @@ BOOL CResizableSheet::OnNcCreate(LPCREATESTRUCT lpCreateStruct) return FALSE; MakeResizable(lpCreateStruct); - + return TRUE; } -BOOL CResizableSheet::OnInitDialog() +BOOL CResizableSheet::OnInitDialog() { BOOL bResult = CPropertySheet::OnInitDialog(); @@ -108,7 +108,7 @@ BOOL CResizableSheet::OnInitDialog() return bResult; } -void CResizableSheet::OnDestroy() +void CResizableSheet::OnDestroy() { if (m_bEnableSaveRestore) { @@ -220,7 +220,7 @@ void CResizableSheet::PresetLayout() // grow tab to the available sheet space if (cyDiff > 0) rectSheet.bottom = rectPage.bottom + cyDiff; - + if (GetStyle() & WS_CHILD) GetTabControl()->MoveWindow(&rectSheet); @@ -263,15 +263,8 @@ BOOL CResizableSheet::ArrangeLayoutCallback(LAYOUTINFO &layout) const if (!GetAnchorPosition(pTab->m_hWnd, rectSheet, rectPage)) return FALSE; // no page yet - // temporarily resize the tab control to calc page size - CRect rectSave; - pTab->GetWindowRect(rectSave); - ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectSave, 2); - pTab->SetRedraw(FALSE); - pTab->MoveWindow(rectPage, FALSE); - pTab->AdjustRect(FALSE, &rectPage); - pTab->MoveWindow(rectSave, FALSE); - pTab->SetRedraw(TRUE); + // calculate page size/position from tab rect + AdjustTabRects(rectPage); // set margins layout.marginTopLeft = rectPage.TopLeft() - rectSheet.TopLeft(); @@ -286,10 +279,10 @@ BOOL CResizableSheet::ArrangeLayoutCallback(LAYOUTINFO &layout) const return TRUE; } -void CResizableSheet::OnSize(UINT nType, int cx, int cy) +void CResizableSheet::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); - + if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW) return; // arrangement not needed @@ -312,7 +305,7 @@ BOOL CResizableSheet::OnPageChanging(NMHDR* /*pNotifyStruct*/, LRESULT* /*pResul return FALSE; // continue routing } -BOOL CResizableSheet::OnEraseBkgnd(CDC* pDC) +BOOL CResizableSheet::OnEraseBkgnd(CDC* pDC) { ClipChildren(pDC, FALSE); @@ -334,9 +327,6 @@ BOOL CResizableSheet::CalcSizeExtra(HWND /*hWndChild*/, const CSize& sizeChild, if (!GetAnchorMargins(pTab->m_hWnd, sizeChild, rectMargins)) return FALSE; - // get margin caused by tabcontrol - CRect rectTabMargins(0,0,0,0); - // get tab position after resizing and calc page rect CRect rectPage, rectSheet; GetTotalClientRect(&rectSheet); @@ -344,49 +334,71 @@ BOOL CResizableSheet::CalcSizeExtra(HWND /*hWndChild*/, const CSize& sizeChild, if (!GetAnchorPosition(pTab->m_hWnd, rectSheet, rectPage)) return FALSE; // no page yet - // temporarily resize the tab control to calc page size - CRect rectSave; - pTab->GetWindowRect(rectSave); - ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectSave, 2); - pTab->SetRedraw(FALSE); - pTab->MoveWindow(rectPage, FALSE); - pTab->AdjustRect(TRUE, &rectTabMargins); - pTab->MoveWindow(rectSave, FALSE); - pTab->SetRedraw(TRUE); + // calculate tab margins + CRect rectTabMargins = AdjustTabRects(rectPage); // add non-client size - ::AdjustWindowRectEx(&rectTabMargins, GetStyle(), !(GetStyle() & WS_CHILD) && + const DWORD dwStyle = GetStyle(); + ::AdjustWindowRectEx(&rectTabMargins, dwStyle, !(dwStyle & WS_CHILD) && ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle()); - // compute extra size sizeExtra = rectMargins.TopLeft() + rectMargins.BottomRight() + rectTabMargins.Size(); return TRUE; } -void CResizableSheet::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) +CRect CResizableSheet::AdjustTabRects(CRect &rectPage) const +{ + CTabCtrl* pTab = GetTabControl(); + CRect rectTabMargins; + if (m_rectLastPage == rectPage) + { + // use cached rects to avoid flickering while moving the window + rectPage = m_rectLastAjustedPage; + rectTabMargins = m_rectLastTabMargins; + } + else + { + m_rectLastPage = rectPage; + + // temporarily resize the tab control to calc page size + CRect rectSave; + pTab->GetWindowRect(rectSave); + ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectSave, 2); + pTab->SetRedraw(FALSE); + pTab->MoveWindow(rectPage, FALSE); + pTab->AdjustRect(FALSE, &rectPage); + pTab->AdjustRect(TRUE, &rectTabMargins); + pTab->MoveWindow(rectSave, FALSE); + pTab->SetRedraw(TRUE); + + m_rectLastAjustedPage = rectPage; + m_rectLastTabMargins = rectTabMargins; + } + return rectTabMargins; +} + +void CResizableSheet::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { MinMaxInfo(lpMMI); if (!GetTabControl()) return; - const int nCount = GetPageCount(); - for (int idx = 0; idx < nCount; ++idx) + int idx = GetPageCount(); + if (IsWizard()) // wizard mode { - if (IsWizard()) // wizard mode - { - // use pre-calculated margins - CRect rectExtra(-CPoint(m_sizePageTL), -CPoint(m_sizePageBR)); - // add non-client size - ::AdjustWindowRectEx(&rectExtra, GetStyle(), !(GetStyle() & WS_CHILD) && - ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle()); + CRect rectExtra(-CPoint(m_sizePageTL), -CPoint(m_sizePageBR)); + const DWORD dwStyle = GetStyle(); + ::AdjustWindowRectEx(&rectExtra, dwStyle, !(dwStyle & WS_CHILD) && + ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle()); + while (--idx >= 0) ChainMinMaxInfo(lpMMI, *GetPage(idx), rectExtra.Size()); - } - else // tab mode - { + } + else // tab mode + { + while (--idx >= 0) ChainMinMaxInfoCB(lpMMI, *GetPage(idx)); - } } } @@ -399,29 +411,29 @@ int CResizableSheet::GetMinWidth() int max = 0, min = rectSheet.Width(); // search for leftmost and rightmost button margins - for (int i = 0; i < 7; i++) + for (int i = 0; i < 7; ++i) { const CWnd* pWnd = GetDlgItem(_propButtons[i]); // exclude not present or hidden buttons - if (pWnd == NULL || !(pWnd->GetStyle() & WS_VISIBLE)) - continue; - - // left position is relative to the right border - // of the parent window (negative value) - pWnd->GetWindowRect(&rectWnd); - ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectWnd, 2); - const int left = rectSheet.right - rectWnd.left; - const int right = rectSheet.right - rectWnd.right; - - if (left > max) - max = left; - if (right < min) - min = right; + if (pWnd != NULL && (pWnd->GetStyle() & WS_VISIBLE)) + { + // left position is relative to the right border + // of the parent window (negative value) + pWnd->GetWindowRect(&rectWnd); + ::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rectWnd, 2); + const int left = rectSheet.right - rectWnd.left; + const int right = rectSheet.right - rectWnd.right; + + if (left > max) + max = left; + if (right < min) + min = right; + } } // sizing border width const int border = GetSystemMetrics(SM_CXSIZEFRAME); - + // compute total width return max + min + 2*border; } @@ -450,7 +462,7 @@ void CResizableSheet::RefreshLayout() SendMessage(WM_SIZE); } -LRESULT CResizableSheet::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CResizableSheet::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if (message != WM_NCCALCSIZE || wParam == 0 || !m_bLayoutDone) return CPropertySheet::WindowProc(message, wParam, lParam); diff --git a/src/ExtLib/ui/ResizableLib/ResizableSheet.h b/src/ExtLib/ui/ResizableLib/ResizableSheet.h index 6638ab828b..faede2fb6e 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableSheet.h +++ b/src/ExtLib/ui/ResizableLib/ResizableSheet.h @@ -10,7 +10,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -59,18 +59,19 @@ class CResizableSheet : public CPropertySheet, public CResizableLayout, // internal status CString m_sSection; // section name (identifies a parent window) + // cached tab rects + mutable CRect m_rectLastPage, m_rectLastAjustedPage, m_rectLastTabMargins; + // Operations public: // Overrides + virtual BOOL OnInitDialog(); // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CResizableSheet) - public: - virtual BOOL OnInitDialog(); protected: virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); //}}AFX_VIRTUAL - protected: // Implementation public: @@ -81,6 +82,7 @@ class CResizableSheet : public CPropertySheet, public CResizableLayout, void PrivateConstruct(); BOOL IsWizard() const; + CRect AdjustTabRects(CRect &rectPage) const; // callable from derived classes protected: diff --git a/src/ExtLib/ui/ResizableLib/ResizableSheetState.cpp b/src/ExtLib/ui/ResizableLib/ResizableSheetState.cpp index a1f566e836..ab9130cbb6 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableSheetState.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableSheetState.cpp @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -39,15 +39,15 @@ CResizableSheetState::~CResizableSheetState() // either in the registry or a private .INI file // depending on your application settings -#define ACTIVEPAGE_ENT _T("ActivePage") +#define ACTIVEPAGE_ENT _T("ActivePage") /*! * This function saves the current property sheet active page using the base * class persist method. * @sa CResizableState::WriteState - * + * * @param pszName String that identifies stored settings - * + * * @return Returns @a TRUE if successful, @a FALSE otherwise */ BOOL CResizableSheetState::SavePage(LPCTSTR pszName) @@ -59,10 +59,9 @@ BOOL CResizableSheetState::SavePage(LPCTSTR pszName) if (pSheet == NULL) return FALSE; - int page = pSheet->m_psh.nStartPage; const CTabCtrl *pTab = pSheet->GetTabControl(); - if (pTab != NULL) - page = pTab->GetCurSel(); + int page = (pTab != NULL) ? pTab->GetCurSel() : pSheet->m_psh.nStartPage; + if (page < 0) page = pSheet->m_psh.nStartPage; @@ -89,7 +88,7 @@ BOOL CResizableSheetState::LoadPage(LPCTSTR pszName) // MPC-BE custom code if (!ReadState(CString(pszName), ACTIVEPAGE_ENT, data)) return FALSE; - + CPropertySheet* pSheet = DYNAMIC_DOWNCAST(CPropertySheet, GetResizableWnd()); return (pSheet != NULL) && pSheet->SetActivePage(_ttoi(data)); diff --git a/src/ExtLib/ui/ResizableLib/ResizableSheetState.h b/src/ExtLib/ui/ResizableLib/ResizableSheetState.h index 3b391cc3e8..7abd41e864 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableSheetState.h +++ b/src/ExtLib/ui/ResizableLib/ResizableSheetState.h @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -38,14 +38,14 @@ * This class is used in the provided resizable counterparts of * the standard MFC property sheet classes. */ -class CResizableSheetState : public CResizableWndState +class CResizableSheetState : public CResizableWndState { protected: - //! @brief Load and set the active property page + //! @brief Load and set the active property page BOOL LoadPage(LPCTSTR pszName); - //! @brief Save the current active property page + //! @brief Save the current active property page BOOL SavePage(LPCTSTR pszName); //! @brief Override to provide the parent window diff --git a/src/ExtLib/ui/ResizableLib/ResizableState.cpp b/src/ExtLib/ui/ResizableLib/ResizableState.cpp index 84640ea261..ecf80382f5 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableState.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableState.cpp @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 diff --git a/src/ExtLib/ui/ResizableLib/ResizableState.h b/src/ExtLib/ui/ResizableLib/ResizableState.h index a022aca9d9..1546b0249c 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableState.h +++ b/src/ExtLib/ui/ResizableLib/ResizableState.h @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 diff --git a/src/ExtLib/ui/ResizableLib/ResizableVersion.cpp b/src/ExtLib/ui/ResizableLib/ResizableVersion.cpp index 969bcff39f..2f4d58f90b 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableVersion.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableVersion.cpp @@ -5,7 +5,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -21,7 +21,7 @@ ////////////////////////////////////////////////////////////////////// // Static initializer object (with macros to hide in ClassView) -// static intializer must be called before user code +// static initializer must be called before user code #pragma warning(disable:4073) #pragma init_seg(lib) @@ -52,6 +52,8 @@ static _VersionInitializer g_version; static DLLVERSIONINFO g_dviCommCtrls; static OSVERSIONINFOEX g_osviWindows; +#pragma warning(push) +#pragma warning(disable:4996) static void CheckOsVersion() { // Try calling GetVersionEx using the OSVERSIONINFOEX structure. @@ -59,7 +61,7 @@ static void CheckOsVersion() g_osviWindows.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if (GetVersionEx((LPOSVERSIONINFO)&g_osviWindows)) return; - + // If that fails, try using the OSVERSIONINFO structure. g_osviWindows.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); if (GetVersionEx((LPOSVERSIONINFO)&g_osviWindows)) @@ -72,6 +74,7 @@ static void CheckOsVersion() g_osviWindows.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS; g_osviWindows.szCSDVersion[0] = TEXT('\0'); } +#pragma warning(pop) static void CheckCommCtrlsVersion() { @@ -194,7 +197,7 @@ void InitThemeSettings() typedef BOOL (STDAPICALLTYPE * IS_APP_THEMED)(VOID); typedef DWORD (STDAPICALLTYPE * GET_THEME_APP_PROPERTIES)(VOID); - // check dll is in place, themes can't work without + // check DLL is in place, themes can't work without HMODULE hLib = GetModuleHandle(_T("uxtheme.dll")); if (hLib == NULL) return; diff --git a/src/ExtLib/ui/ResizableLib/ResizableVersion.h b/src/ExtLib/ui/ResizableLib/ResizableVersion.h index c5282dc374..1956871687 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableVersion.h +++ b/src/ExtLib/ui/ResizableLib/ResizableVersion.h @@ -5,7 +5,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 diff --git a/src/ExtLib/ui/ResizableLib/ResizableWndState.cpp b/src/ExtLib/ui/ResizableLib/ResizableWndState.cpp index 81f57e0b9b..30187bb96e 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableWndState.cpp +++ b/src/ExtLib/ui/ResizableLib/ResizableWndState.cpp @@ -3,7 +3,7 @@ // This file is part of ResizableLib // https://github.com/ppescher/resizablelib // -// Copyright (C) 2000-2015 by Paolo Messina +// Copyright (C) 2000-2024 by Paolo Messina // mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License 2.0 @@ -57,7 +57,8 @@ CResizableWndState::~CResizableWndState() */ BOOL CResizableWndState::SaveWindowRect(LPCTSTR pszName, BOOL bRectOnly) { - WINDOWPLACEMENT wp = {sizeof(WINDOWPLACEMENT)}; + WINDOWPLACEMENT wp; + wp.length = sizeof(WINDOWPLACEMENT); if (!GetResizableWnd()->GetWindowPlacement(&wp)) return FALSE; @@ -69,7 +70,7 @@ BOOL CResizableWndState::SaveWindowRect(LPCTSTR pszName, BOOL bRectOnly) if (bRectOnly) // save size/pos only (normal state) { data.Format(PLACEMENT_FMT, rc.left, rc.top, - rc.right, rc.bottom, SW_SHOWNORMAL, 0U, 0L, 0L); + rc.right, rc.bottom, (unsigned)SW_SHOWNORMAL, 0U, 0L, 0L); } else // save also min/max state { @@ -98,7 +99,8 @@ BOOL CResizableWndState::SaveWindowRect(LPCTSTR pszName, BOOL bRectOnly) BOOL CResizableWndState::LoadWindowRect(LPCTSTR pszName, BOOL bRectOnly) { CString data; - WINDOWPLACEMENT wp = {sizeof(WINDOWPLACEMENT)}; + WINDOWPLACEMENT wp; + wp.length = sizeof(WINDOWPLACEMENT); // MPC-BE custom code if (!ReadState(CString(pszName), PLACEMENT_ENT, data)) // never saved before diff --git a/src/ExtLib/ui/ResizableLib/ResizableWndState.h b/src/ExtLib/ui/ResizableLib/ResizableWndState.h index bfdd7ef1bf..e0985a609e 100644 --- a/src/ExtLib/ui/ResizableLib/ResizableWndState.h +++ b/src/ExtLib/ui/ResizableLib/ResizableWndState.h @@ -7,7 +7,7 @@ // http://www.geocities.com/ppescher - mailto:ppescher@hotmail.com // // The contents of this file are subject to the Artistic License (the "License"). -// You may not use this file except in compliance with the License. +// You may not use this file except in compliance with the License. // You may obtain a copy of the License at: // http://www.opensource.org/licenses/artistic-license.html // From 6e6ce70b7e64316da26261ea91e5e22e8e071ce4 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Sat, 13 Jul 2024 14:04:17 +1000 Subject: [PATCH 056/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20dav1d=201.4.2-15-g2355eeb;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 1 + docs/Changelog.txt | 1 + lib/libdav1d.a | Bin 1812252 -> 1814344 bytes lib64/libdav1d.a | Bin 3291910 -> 3297928 bytes 4 files changed, 2 insertions(+) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index f75346ed36..eb5f5da2d0 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -19,6 +19,7 @@ MPCVideoDec Обновлен японский перевод (автор tsubasanouta). Обновлены библиотеки: + dav1d 1.4.2-15-g2355eeb; ffmpeg n7.1-dev-1688-ge0eff64ed1; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 8ad5fb8e9f..9173d5ebcf 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -19,6 +19,7 @@ Updated Korean translation (by Hackjjang). Updated Japanese translation (by tsubasanouta). Updated libraries: + dav1d 1.4.2-15-g2355eeb; ffmpeg n7.1-dev-1688-ge0eff64ed1; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/lib/libdav1d.a b/lib/libdav1d.a index 95fdb6ba2629c6c78543e246c1ce5f54b7147bce..e252fa8ae05a55815374ea94135c3c48651b0c95 100644 GIT binary patch delta 155264 zcmeFa33yD`|Hpr4GP#pvMkXO7AtDHZAbTd(*j1HiQMDzpgjg~Wu~gO2MB9|uQjVpT z)>dj)rU+s!S`|uLdsIs8d;ZV!_dI9jeO~u-_T`>) zGw%85n~cL3GiElnM@Gek(0?gjlH~S=B+XjST|uHG{heEJO_HeFRKnd}eE$!eZitU$ zryu`^&i;RyIMTNNpO#+I+5c~=|Nn3Q|GV~g8&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vV1nLZXD;9&b!l_#6=GKe=+ZnbpQYW From 7d333b87282c0ba032002d207dc334f901903515 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 13 Jul 2024 08:49:04 +0300 Subject: [PATCH 057/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20ffmpeg=20n7.1-dev-1805-g9af348bd1a.=20=D0=A3?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=B8=D0=BB?= =?UTF-8?q?=D1=8F=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20htt?= =?UTF-8?q?ps://github.com/FFmpeg/FFmpeg/commit/e9e8bea2e79bc3c481a6f81f75?= =?UTF-8?q?f6c871e3e0f367.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- src/ExtLib/ffmpeg/libavcodec/flac_parser.c | 2 + src/ExtLib/ffmpeg/libavcodec/golomb.h | 5 + src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c | 21 +-- src/ExtLib/ffmpeg/libavcodec/me_cmp.c | 2 +- src/ExtLib/ffmpeg/libavcodec/motion_est.c | 2 +- src/ExtLib/ffmpeg/libavcodec/packet.c | 1 + src/ExtLib/ffmpeg/libavcodec/packet.h | 13 ++ src/ExtLib/ffmpeg/libavcodec/version.h | 2 +- src/ExtLib/ffmpeg/libavcodec/vvc/refs.c | 2 +- src/ExtLib/ffmpeg/libavcodec/vvc/thread.c | 2 +- src/ExtLib/ffmpeg/libavfilter/af_aresample.c | 5 +- src/ExtLib/ffmpeg/libavutil/executor.c | 16 +- .../ffmpeg/libavutil/hwcontext_d3d11va.c | 3 +- src/ExtLib/ffmpeg/libavutil/hwcontext_dxva2.c | 2 +- src/ExtLib/ffmpeg/libavutil/imgutils.c | 2 +- src/ExtLib/ffmpeg/libavutil/wchar_filename.h | 2 +- .../ffmpeg/libavutil/x86/intreadwrite.h | 32 +--- src/ExtLib/ffmpeg/libswscale/swscale.c | 4 +- .../ffmpeg/libswscale/swscale_internal.h | 2 - src/ExtLib/ffmpeg/libswscale/utils.c | 4 - src/ExtLib/ffmpeg/libswscale/x86/swscale.c | 2 - .../ffmpeg/libswscale/x86/swscale_template.c | 20 --- src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c | 167 +++++++++++++++++- src/ExtLib/ffmpeg/libswscale/yuv2rgb.c | 4 +- 26 files changed, 235 insertions(+), 86 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index eb5f5da2d0..553653952c 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -20,7 +20,7 @@ MPCVideoDec Обновлены библиотеки: dav1d 1.4.2-15-g2355eeb; - ffmpeg n7.1-dev-1688-ge0eff64ed1; + ffmpeg n7.1-dev-1805-g9af348bd1a; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 9173d5ebcf..c99bda0a74 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -20,7 +20,7 @@ Updated Japanese translation (by tsubasanouta). Updated libraries: dav1d 1.4.2-15-g2355eeb; - ffmpeg n7.1-dev-1688-ge0eff64ed1; + ffmpeg n7.1-dev-1805-g9af348bd1a; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/src/ExtLib/ffmpeg/libavcodec/flac_parser.c b/src/ExtLib/ffmpeg/libavcodec/flac_parser.c index 47904d515a..d9c47801f8 100644 --- a/src/ExtLib/ffmpeg/libavcodec/flac_parser.c +++ b/src/ExtLib/ffmpeg/libavcodec/flac_parser.c @@ -518,6 +518,8 @@ static int check_header_mismatch(FLACParseContext *fpc, for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++) curr = curr->next; + av_assert0(i < FLAC_MAX_SEQUENTIAL_HEADERS); + if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY || header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) { FLACHeaderMarker *start, *end; diff --git a/src/ExtLib/ffmpeg/libavcodec/golomb.h b/src/ExtLib/ffmpeg/libavcodec/golomb.h index 4f1285e908..e33a73955c 100644 --- a/src/ExtLib/ffmpeg/libavcodec/golomb.h +++ b/src/ExtLib/ffmpeg/libavcodec/golomb.h @@ -402,6 +402,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, log = av_log2(buf); if (log > 31 - limit) { + av_assert2(log >= k); buf >>= log - k; buf += (30U - log) << k; LAST_SKIP_BITS(re, gb, 32 + k - log); @@ -424,6 +425,8 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, /** * read unsigned golomb rice code (jpegls). + * + * @returns -1 on error */ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len) @@ -535,6 +538,8 @@ static inline int get_sr_golomb(GetBitContext *gb, int k, int limit, /** * read signed golomb rice code (flac). + * + * @returns INT_MIN on error */ static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int esc_len) diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c index 988f242331..47be8f8f74 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c @@ -2789,14 +2789,8 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext const HEVCPPS *pps = s->pps; int ret; - if (s->sh.dependent_slice_segment_flag) { - int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; - int prev_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1]; - if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) { - av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n"); - return AVERROR_INVALIDDATA; - } - } + if (!s->sh.first_slice_in_pic_flag) + s->slice_idx += !s->sh.dependent_slice_segment_flag; if (!s->sh.dependent_slice_segment_flag && s->sh.slice_type != HEVC_SLICE_I) { ret = ff_hevc_slice_rpl(s); @@ -2818,6 +2812,15 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext return AVERROR_PATCHWELCOME; } + if (s->sh.dependent_slice_segment_flag) { + int ctb_addr_ts = pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; + int prev_rs = pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1]; + if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) { + av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n"); + return AVERROR_INVALIDDATA; + } + } + s->local_ctx[0].first_qp_group = !s->sh.dependent_slice_segment_flag; if (!pps->cu_qp_delta_enabled_flag) @@ -2826,8 +2829,6 @@ static int decode_slice_data(HEVCContext *s, const H2645NAL *nal, GetBitContext s->local_ctx[0].tu.cu_qp_offset_cb = 0; s->local_ctx[0].tu.cu_qp_offset_cr = 0; - s->slice_idx += !s->sh.dependent_slice_segment_flag; - if (s->avctx->active_thread_type == FF_THREAD_SLICE && s->sh.num_entry_point_offsets > 0 && pps->num_tile_rows == 1 && pps->num_tile_columns == 1) diff --git a/src/ExtLib/ffmpeg/libavcodec/me_cmp.c b/src/ExtLib/ffmpeg/libavcodec/me_cmp.c index 592ee76084..f3e2f2482e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/me_cmp.c +++ b/src/ExtLib/ffmpeg/libavcodec/me_cmp.c @@ -517,7 +517,7 @@ av_cold int ff_set_cmp(const MECmpContext *c, me_cmp_func *cmp, int type, int mp cmp[i] = zero_cmp; return 0; } - if (type > FF_ARRAY_ELEMS(cmp_func_list) || + if (type >= FF_ARRAY_ELEMS(cmp_func_list) || !cmp_func_list[type].available || !mpvenc && cmp_func_list[type].mpv_only) { av_log(NULL, AV_LOG_ERROR, diff --git a/src/ExtLib/ffmpeg/libavcodec/motion_est.c b/src/ExtLib/ffmpeg/libavcodec/motion_est.c index 554fc9780e..e4f17fb2d8 100644 --- a/src/ExtLib/ffmpeg/libavcodec/motion_est.c +++ b/src/ExtLib/ffmpeg/libavcodec/motion_est.c @@ -1454,7 +1454,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) s->b_direct_mv_table[mot_xy][0]= 0; s->b_direct_mv_table[mot_xy][1]= 0; - return 256*256*256*64; + return 256*256*256*64-1; } c->xmin= xmin; diff --git a/src/ExtLib/ffmpeg/libavcodec/packet.c b/src/ExtLib/ffmpeg/libavcodec/packet.c index e118bbaad1..032f270777 100644 --- a/src/ExtLib/ffmpeg/libavcodec/packet.c +++ b/src/ExtLib/ffmpeg/libavcodec/packet.c @@ -305,6 +305,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type) case AV_PKT_DATA_IAMF_MIX_GAIN_PARAM: return "IAMF Mix Gain Parameter Data"; case AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM: return "IAMF Demixing Info Parameter Data"; case AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM: return "IAMF Recon Gain Info Parameter Data"; + case AV_PKT_DATA_FRAME_CROPPING: return "Frame Cropping"; } return NULL; } diff --git a/src/ExtLib/ffmpeg/libavcodec/packet.h b/src/ExtLib/ffmpeg/libavcodec/packet.h index f05deb7950..13667ffa36 100644 --- a/src/ExtLib/ffmpeg/libavcodec/packet.h +++ b/src/ExtLib/ffmpeg/libavcodec/packet.h @@ -326,6 +326,19 @@ enum AVPacketSideDataType { */ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, + /** + * The number of pixels to discard from the top/bottom/left/right border of the + * decoded frame to obtain the sub-rectangle intended for presentation. + * + * @code + * u32le crop_top + * u32le crop_bottom + * u32le crop_left + * u32le crop_right + * @endcode + */ + AV_PKT_DATA_FRAME_CROPPING, + /** * The number of side data types. * This is not part of the public API/ABI in the sense that it may diff --git a/src/ExtLib/ffmpeg/libavcodec/version.h b/src/ExtLib/ffmpeg/libavcodec/version.h index 230d5fa13e..80e2ae630d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/version.h +++ b/src/ExtLib/ffmpeg/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 9 +#define LIBAVCODEC_VERSION_MINOR 10 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c b/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c index 26a5b0b34c..c1fc6132c2 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/refs.c @@ -310,7 +310,7 @@ void ff_vvc_bump_frame(VVCContext *s, VVCFrameContext *fc) static VVCFrame *find_ref_idx(VVCContext *s, VVCFrameContext *fc, int poc, uint8_t use_msb) { - const int mask = use_msb ? ~0 : fc->ps.sps->max_pic_order_cnt_lsb - 1; + const unsigned mask = use_msb ? ~0 : fc->ps.sps->max_pic_order_cnt_lsb - 1; for (int i = 0; i < FF_ARRAY_ELEMS(fc->DPB); i++) { VVCFrame *ref = &fc->DPB[i]; diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c b/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c index 0cacb1f51c..8dd9a36fd5 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/thread.c @@ -565,7 +565,7 @@ static void task_run_stage(VVCTask *t, VVCContext *s, VVCLocalContext *lc) VVCFrameContext *fc = t->fc; VVCFrameThread *ft = fc->ft; const VVCTaskStage stage = t->stage; - run_func run[] = { + static const run_func run[] = { run_parse, run_inter, run_recon, diff --git a/src/ExtLib/ffmpeg/libavfilter/af_aresample.c b/src/ExtLib/ffmpeg/libavfilter/af_aresample.c index d6bd77beb3..8ff2fe5973 100644 --- a/src/ExtLib/ffmpeg/libavfilter/af_aresample.c +++ b/src/ExtLib/ffmpeg/libavfilter/af_aresample.c @@ -195,8 +195,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref) av_frame_copy_props(outsamplesref, insamplesref); outsamplesref->format = outlink->format; ret = av_channel_layout_copy(&outsamplesref->ch_layout, &outlink->ch_layout); - if (ret < 0) + if (ret < 0) { + av_frame_free(&outsamplesref); + av_frame_free(&insamplesref); return ret; + } outsamplesref->sample_rate = outlink->sample_rate; if(insamplesref->pts != AV_NOPTS_VALUE) { diff --git a/src/ExtLib/ffmpeg/libavutil/executor.c b/src/ExtLib/ffmpeg/libavutil/executor.c index fb20104b58..bfce2ac444 100644 --- a/src/ExtLib/ffmpeg/libavutil/executor.c +++ b/src/ExtLib/ffmpeg/libavutil/executor.c @@ -20,6 +20,8 @@ #include "config.h" +#include + #include "mem.h" #include "thread.h" @@ -49,6 +51,7 @@ typedef struct ThreadInfo { struct AVExecutor { AVTaskCallbacks cb; int thread_count; + bool recursive; ThreadInfo *threads; uint8_t *local_contexts; @@ -194,18 +197,25 @@ void av_executor_execute(AVExecutor *e, AVTask *t) AVTaskCallbacks *cb = &e->cb; AVTask **prev; - ff_mutex_lock(&e->lock); + if (e->thread_count) + ff_mutex_lock(&e->lock); if (t) { for (prev = &e->tasks; *prev && cb->priority_higher(*prev, t); prev = &(*prev)->next) /* nothing */; add_task(prev, t); } - ff_cond_signal(&e->cond); - ff_mutex_unlock(&e->lock); + if (e->thread_count) { + ff_cond_signal(&e->cond); + ff_mutex_unlock(&e->lock); + } if (!e->thread_count || !HAVE_THREADS) { + if (e->recursive) + return; + e->recursive = true; // We are running in a single-threaded environment, so we must handle all tasks ourselves while (run_one_task(e, e->local_contexts)) /* nothing */; + e->recursive = false; } } diff --git a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d11va.c b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d11va.c index fbed02320e..4bb62f114e 100644 --- a/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d11va.c +++ b/src/ExtLib/ffmpeg/libavutil/hwcontext_d3d11va.c @@ -200,6 +200,7 @@ static AVBufferRef *wrap_texture_buf(AVHWFramesContext *ctx, ID3D11Texture2D *te sizeof(*frames_hwctx->texture_infos)); if (!frames_hwctx->texture_infos) { ID3D11Texture2D_Release(tex); + av_free(desc); return NULL; } s->nb_surfaces = s->nb_surfaces_used + 1; @@ -212,7 +213,7 @@ static AVBufferRef *wrap_texture_buf(AVHWFramesContext *ctx, ID3D11Texture2D *te desc->texture = tex; desc->index = index; - buf = av_buffer_create((uint8_t *)desc, sizeof(desc), free_texture, tex, 0); + buf = av_buffer_create((uint8_t *)desc, sizeof(*desc), free_texture, tex, 0); if (!buf) { ID3D11Texture2D_Release(tex); av_free(desc); diff --git a/src/ExtLib/ffmpeg/libavutil/hwcontext_dxva2.c b/src/ExtLib/ffmpeg/libavutil/hwcontext_dxva2.c index 1136bacf21..7ec0b03aad 100644 --- a/src/ExtLib/ffmpeg/libavutil/hwcontext_dxva2.c +++ b/src/ExtLib/ffmpeg/libavutil/hwcontext_dxva2.c @@ -155,7 +155,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, size_t size) if (s->nb_surfaces_used < hwctx->nb_surfaces) { s->nb_surfaces_used++; return av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1], - sizeof(*hwctx->surfaces), dxva2_pool_release_dummy, 0, 0); + sizeof(**hwctx->surfaces), dxva2_pool_release_dummy, 0, 0); } return NULL; diff --git a/src/ExtLib/ffmpeg/libavutil/imgutils.c b/src/ExtLib/ffmpeg/libavutil/imgutils.c index 3992d3b643..8aa7159741 100644 --- a/src/ExtLib/ffmpeg/libavutil/imgutils.c +++ b/src/ExtLib/ffmpeg/libavutil/imgutils.c @@ -298,7 +298,7 @@ int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enu stride = 8LL*w; stride += 128*8; - if ((int)w<=0 || (int)h<=0 || stride >= INT_MAX || stride*(uint64_t)(h+128) >= INT_MAX) { + if (w==0 || h==0 || w > INT32_MAX || h > INT32_MAX || stride >= INT_MAX || stride*(h + 128ULL) >= INT_MAX) { av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h); return AVERROR(EINVAL); } diff --git a/src/ExtLib/ffmpeg/libavutil/wchar_filename.h b/src/ExtLib/ffmpeg/libavutil/wchar_filename.h index 8794f07983..9ba0cbf0b7 100644 --- a/src/ExtLib/ffmpeg/libavutil/wchar_filename.h +++ b/src/ExtLib/ffmpeg/libavutil/wchar_filename.h @@ -57,7 +57,7 @@ static inline int wchartocp(unsigned int code_page, const wchar_t *filename_w, errno = EINVAL; return -1; } - *filename = (char*)av_malloc_array(num_chars, sizeof *filename); + *filename = (char*)av_malloc_array(num_chars, sizeof **filename); if (!*filename) { errno = ENOMEM; return -1; diff --git a/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h b/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h index 5e57d6a8cd..65cc6b39a1 100644 --- a/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h +++ b/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h @@ -23,41 +23,27 @@ #include #include "config.h" +#if HAVE_INTRINSICS_SSE2 && defined(__SSE2__) +#include +#endif #include "libavutil/attributes.h" -#if HAVE_MMX - -#ifdef __SSE__ +#if HAVE_INTRINSICS_SSE2 && defined(__SSE2__) #define AV_COPY128 AV_COPY128 static av_always_inline void AV_COPY128(void *d, const void *s) { - struct v {uint64_t v[2];}; - - __asm__("movaps %1, %%xmm0 \n\t" - "movaps %%xmm0, %0 \n\t" - : "=m"(*(struct v*)d) - : "m" (*(const struct v*)s) - : "xmm0"); + __m128i tmp = _mm_load_si128((const __m128i *)s); + _mm_store_si128((__m128i *)d, tmp); } -#endif /* __SSE__ */ - -#ifdef __SSE2__ - #define AV_ZERO128 AV_ZERO128 static av_always_inline void AV_ZERO128(void *d) { - struct v {uint64_t v[2];}; - - __asm__("pxor %%xmm0, %%xmm0 \n\t" - "movdqa %%xmm0, %0 \n\t" - : "=m"(*(struct v*)d) - :: "xmm0"); + __m128i zero = _mm_setzero_si128(); + _mm_store_si128((__m128i *)d, zero); } -#endif /* __SSE2__ */ - -#endif /* HAVE_MMX */ +#endif /* HAVE_INTRINSICS_SSE2 && defined(__SSE2__) */ #endif /* AVUTIL_X86_INTREADWRITE_H */ diff --git a/src/ExtLib/ffmpeg/libswscale/swscale.c b/src/ExtLib/ffmpeg/libswscale/swscale.c index 9736734881..df0d5708aa 100644 --- a/src/ExtLib/ffmpeg/libswscale/swscale.c +++ b/src/ExtLib/ffmpeg/libswscale/swscale.c @@ -1175,7 +1175,7 @@ int sws_receive_slice(struct SwsContext *c, unsigned int slice_start, } for (int i = 0; i < FF_ARRAY_ELEMS(dst); i++) { - ptrdiff_t offset = c->frame_dst->linesize[i] * (slice_start >> c->chrDstVSubSample); + ptrdiff_t offset = c->frame_dst->linesize[i] * (ptrdiff_t)(slice_start >> c->chrDstVSubSample); dst[i] = FF_PTR_ADD(c->frame_dst->data[i], offset); } @@ -1236,7 +1236,7 @@ void ff_sws_slice_worker(void *priv, int jobnr, int threadnr, for (int i = 0; i < FF_ARRAY_ELEMS(dst) && parent->frame_dst->data[i]; i++) { const int vshift = (i == 1 || i == 2) ? c->chrDstVSubSample : 0; const ptrdiff_t offset = parent->frame_dst->linesize[i] * - ((slice_start + parent->dst_slice_start) >> vshift); + (ptrdiff_t)((slice_start + parent->dst_slice_start) >> vshift); dst[i] = parent->frame_dst->data[i] + offset; } diff --git a/src/ExtLib/ffmpeg/libswscale/swscale_internal.h b/src/ExtLib/ffmpeg/libswscale/swscale_internal.h index 0818f50c7f..e5610161d0 100644 --- a/src/ExtLib/ffmpeg/libswscale/swscale_internal.h +++ b/src/ExtLib/ffmpeg/libswscale/swscale_internal.h @@ -46,8 +46,6 @@ #define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE -#define DITHER1XBPP - #if HAVE_BIGENDIAN #define ALT32_CORR (-1) #else diff --git a/src/ExtLib/ffmpeg/libswscale/utils.c b/src/ExtLib/ffmpeg/libswscale/utils.c index 12dba712c1..bc8d7627e2 100644 --- a/src/ExtLib/ffmpeg/libswscale/utils.c +++ b/src/ExtLib/ffmpeg/libswscale/utils.c @@ -1952,14 +1952,10 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, av_log(c, AV_LOG_INFO, "%s scaler, from %s to %s%s ", scaler, av_get_pix_fmt_name(srcFormat), -#ifdef DITHER1XBPP dstFormat == AV_PIX_FMT_BGR555 || dstFormat == AV_PIX_FMT_BGR565 || dstFormat == AV_PIX_FMT_RGB444BE || dstFormat == AV_PIX_FMT_RGB444LE || dstFormat == AV_PIX_FMT_BGR444BE || dstFormat == AV_PIX_FMT_BGR444LE ? "dithered " : "", -#else - "", -#endif av_get_pix_fmt_name(dstFormat)); if (INLINE_MMXEXT(cpu_flags)) diff --git a/src/ExtLib/ffmpeg/libswscale/x86/swscale.c b/src/ExtLib/ffmpeg/libswscale/x86/swscale.c index ad7f67f90e..43319fd6b2 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/swscale.c +++ b/src/ExtLib/ffmpeg/libswscale/x86/swscale.c @@ -40,8 +40,6 @@ const DECLARE_ALIGNED(8, uint64_t, ff_dither8)[2] = { #if HAVE_INLINE_ASM -#define DITHER1XBPP - DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL; DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL; diff --git a/src/ExtLib/ffmpeg/libswscale/x86/swscale_template.c b/src/ExtLib/ffmpeg/libswscale/x86/swscale_template.c index 6190fcb4fe..6bff2a44aa 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/swscale_template.c +++ b/src/ExtLib/ffmpeg/libswscale/x86/swscale_template.c @@ -384,11 +384,9 @@ static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter, YSCALEYUV2RGBX "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%0), %%mm2\n\t" "paddusb "GREEN_DITHER"(%0), %%mm4\n\t" "paddusb "RED_DITHER"(%0), %%mm5\n\t" -#endif WRITERGB16(%4, "%5", %%FF_REGa) YSCALEYUV2PACKEDX_END } @@ -408,11 +406,9 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter, YSCALEYUV2RGBX "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%0), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%0), %%mm4 \n\t" "paddusb "RED_DITHER"(%0), %%mm5 \n\t" -#endif WRITERGB16(%4, "%5", %%FF_REGa) YSCALEYUV2PACKEDX_END } @@ -461,11 +457,9 @@ static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter, YSCALEYUV2RGBX "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%0), %%mm2\n\t" "paddusb "GREEN_DITHER"(%0), %%mm4\n\t" "paddusb "RED_DITHER"(%0), %%mm5\n\t" -#endif WRITERGB15(%4, "%5", %%FF_REGa) YSCALEYUV2PACKEDX_END } @@ -485,11 +479,9 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter, YSCALEYUV2RGBX "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%0), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%0), %%mm4 \n\t" "paddusb "RED_DITHER"(%0), %%mm5 \n\t" -#endif WRITERGB15(%4, "%5", %%FF_REGa) YSCALEYUV2PACKEDX_END } @@ -891,11 +883,9 @@ static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2], YSCALEYUV2RGB(%%FF_REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" -#endif WRITERGB15(%%FF_REGb, DSTW_OFFSET"(%5)", %%FF_REGBP) "pop %%"FF_REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"FF_REG_b" \n\t" @@ -920,11 +910,9 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2], YSCALEYUV2RGB(%%FF_REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" -#endif WRITERGB16(%%FF_REGb, DSTW_OFFSET"(%5)", %%FF_REGBP) "pop %%"FF_REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"FF_REG_b" \n\t" @@ -1240,11 +1228,9 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0, YSCALEYUV2RGB1(%%FF_REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" -#endif WRITERGB15(%%FF_REGb, DSTW_OFFSET"(%5)", %%FF_REGBP) "pop %%"FF_REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"FF_REG_b" \n\t" @@ -1261,11 +1247,9 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0, YSCALEYUV2RGB1b(%%FF_REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" -#endif WRITERGB15(%%FF_REGb, DSTW_OFFSET"(%5)", %%FF_REGBP) "pop %%"FF_REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"FF_REG_b" \n\t" @@ -1293,11 +1277,9 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0, YSCALEYUV2RGB1(%%FF_REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" -#endif WRITERGB16(%%FF_REGb, DSTW_OFFSET"(%5)", %%FF_REGBP) "pop %%"FF_REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"FF_REG_b" \n\t" @@ -1314,11 +1296,9 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0, YSCALEYUV2RGB1b(%%FF_REGBP, %5) "pxor %%mm7, %%mm7 \n\t" /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ -#ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" -#endif WRITERGB16(%%FF_REGb, DSTW_OFFSET"(%5)", %%FF_REGBP) "pop %%"FF_REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"FF_REG_b" \n\t" diff --git a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c b/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c index 41dfa80f33..68e903c6ad 100644 --- a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c +++ b/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb.c @@ -1,7 +1,8 @@ /* * software YUV to RGB converter * - * Copyright (C) 2009 Konstantin Shishkov + * Copyright (C) 2001-2007 Michael Niedermayer + * Copyright (C) 2009-2010 Konstantin Shishkov * * MMX/MMXEXT template stuff (needed for fast movntq support), * 1,4,8bpp support and context / deglobalize stuff @@ -39,12 +40,166 @@ #if HAVE_X86ASM -#define DITHER1XBPP // only for MMX +#define YUV2RGB_LOOP(depth) \ + h_size = (c->dstW + 7) & ~7; \ + if (h_size * depth > FFABS(dstStride[0])) \ + h_size -= 8; \ + \ + vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ + \ + for (y = 0; y < srcSliceH; y++) { \ + uint8_t *image = dst[0] + (y + srcSliceY) * dstStride[0]; \ + const uint8_t *py = src[0] + y * srcStride[0]; \ + const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \ + const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \ + x86_reg index = -h_size / 2; \ -//SSSE3 versions -#undef RENAME -#define RENAME(a) a ## _ssse3 -#include "yuv2rgb_template.c" +extern void ff_yuv_420_rgb24_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index); +extern void ff_yuv_420_bgr24_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index); + +extern void ff_yuv_420_rgb15_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index); +extern void ff_yuv_420_rgb16_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index); +extern void ff_yuv_420_rgb32_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index); +extern void ff_yuv_420_bgr32_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index); +extern void ff_yuva_420_rgb32_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index, const uint8_t *pa_2index); +extern void ff_yuva_420_bgr32_ssse3(x86_reg index, uint8_t *image, const uint8_t *pu_index, + const uint8_t *pv_index, const uint64_t *pointer_c_dither, + const uint8_t *py_2index, const uint8_t *pa_2index); + +static inline int yuv420_rgb15_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + + YUV2RGB_LOOP(2) + + c->blueDither = ff_dither8[y & 1]; + c->greenDither = ff_dither8[y & 1]; + c->redDither = ff_dither8[(y + 1) & 1]; + + ff_yuv_420_rgb15_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); + } + return srcSliceH; +} + +static inline int yuv420_rgb16_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + + YUV2RGB_LOOP(2) + + c->blueDither = ff_dither8[y & 1]; + c->greenDither = ff_dither4[y & 1]; + c->redDither = ff_dither8[(y + 1) & 1]; + + ff_yuv_420_rgb16_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); + } + return srcSliceH; +} + +static inline int yuv420_rgb32_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + + YUV2RGB_LOOP(4) + + ff_yuv_420_rgb32_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); + } + return srcSliceH; +} + +static inline int yuv420_bgr32_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + + YUV2RGB_LOOP(4) + + ff_yuv_420_bgr32_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); + } + return srcSliceH; +} + +static inline int yuva420_rgb32_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + YUV2RGB_LOOP(4) + + const uint8_t *pa = src[3] + y * srcStride[3]; + ff_yuva_420_rgb32_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index, pa - 2 * index); + } + return srcSliceH; +} + +static inline int yuva420_bgr32_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + + YUV2RGB_LOOP(4) + + const uint8_t *pa = src[3] + y * srcStride[3]; + ff_yuva_420_bgr32_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index, pa - 2 * index); + } + return srcSliceH; +} + +static inline int yuv420_rgb24_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + + YUV2RGB_LOOP(3) + + ff_yuv_420_rgb24_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); + } + return srcSliceH; +} + +static inline int yuv420_bgr24_ssse3(SwsContext *c, const uint8_t *src[], + int srcStride[], + int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]) +{ + int y, h_size, vshift; + + YUV2RGB_LOOP(3) + + ff_yuv_420_bgr24_ssse3(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); + } + return srcSliceH; +} #endif /* HAVE_X86ASM */ diff --git a/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c b/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c index 977eb3a7dd..cfbc54abd0 100644 --- a/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c +++ b/src/ExtLib/ffmpeg/libswscale/yuv2rgb.c @@ -100,9 +100,9 @@ const int *sws_getCoefficients(int colorspace) #define PUTRGBA(dst, ysrc, asrc, i, abase) \ Y = ysrc[2 * i]; \ - dst[2 * i] = r[Y] + g[Y] + b[Y] + (asrc[2 * i] << abase); \ + dst[2 * i] = r[Y] + g[Y] + b[Y] + ((uint32_t)(asrc[2 * i]) << abase); \ Y = ysrc[2 * i + 1]; \ - dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << abase); + dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + ((uint32_t)(asrc[2 * i + 1]) << abase); #define PUTRGB48(dst, src, asrc, i, abase) \ Y = src[ 2 * i]; \ From 8d36bbc166a8d087a3979e412159e98f24845153 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 13 Jul 2024 17:08:52 +0300 Subject: [PATCH 058/102] =?UTF-8?q?BaseSplitter:=20=D0=BA=D0=BE=D1=81?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=B8=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=B4=D0=B0?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parser/BaseSplitter/AsyncReader.cpp | 4 --- src/filters/parser/BaseSplitter/AsyncReader.h | 6 ++--- .../parser/BaseSplitter/BaseSplitter.cpp | 10 ------- .../parser/BaseSplitter/BaseSplitter.h | 27 +++++++++++-------- 4 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/filters/parser/BaseSplitter/AsyncReader.cpp b/src/filters/parser/BaseSplitter/AsyncReader.cpp index e4608f1f3d..f04d68f3fd 100644 --- a/src/filters/parser/BaseSplitter/AsyncReader.cpp +++ b/src/filters/parser/BaseSplitter/AsyncReader.cpp @@ -30,16 +30,12 @@ CAsyncFileReader::CAsyncFileReader(CString fn, HRESULT& hr, BOOL bSupportURL) : CUnknown(L"CAsyncFileReader", nullptr, &hr) , m_bSupportURL(bSupportURL) - , m_hBreakEvent(nullptr) - , m_lOsError(0) { hr = Open(fn) ? S_OK : E_FAIL; } CAsyncFileReader::CAsyncFileReader(CHdmvClipInfo::CPlaylist& Items, HRESULT& hr) : CUnknown(L"CAsyncFileReader", nullptr, &hr) - , m_hBreakEvent(nullptr) - , m_lOsError(0) { hr = OpenFiles(Items) ? S_OK : E_FAIL; } diff --git a/src/filters/parser/BaseSplitter/AsyncReader.h b/src/filters/parser/BaseSplitter/AsyncReader.h index 09798c27c7..39cdf7c7c2 100644 --- a/src/filters/parser/BaseSplitter/AsyncReader.h +++ b/src/filters/parser/BaseSplitter/AsyncReader.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -52,8 +52,8 @@ class CAsyncFileReader : public CUnknown, public CMultiFiles, public IAsyncReade }; protected: - HANDLE m_hBreakEvent; - LONG m_lOsError; // CFileException::m_lOsError + HANDLE m_hBreakEvent = nullptr; + LONG m_lOsError = 0; // CFileException::m_lOsError SourceType m_sourcetype = SourceType::LOCAL; diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp index d631002bfc..0087c74d2c 100644 --- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp +++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp @@ -31,16 +31,6 @@ CBaseSplitterFilter::CBaseSplitterFilter(LPCWSTR pName, LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid) : CBaseFilter(pName, pUnk, this, clsid) - , m_rtDuration(0), m_rtStart(0), m_rtStop(0), m_rtCurrent(0) - , m_dRate(1.0) - , m_nOpenProgress(100) - , m_fAbort(false) - , m_rtLastStart(INVALID_TIME) - , m_rtLastStop(INVALID_TIME) - , m_priority(THREAD_PRIORITY_NORMAL) - , m_nFlag(0) - , m_iQueueDuration(QUEUE_DURATION_DEF) - //, m_iNetworkTimeout(NETWORK_TIMEOUT_DEF) { if (phr) { *phr = S_OK; diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.h b/src/filters/parser/BaseSplitter/BaseSplitter.h index 7c1cb06fc9..f303e0722f 100644 --- a/src/filters/parser/BaseSplitter/BaseSplitter.h +++ b/src/filters/parser/BaseSplitter/BaseSplitter.h @@ -77,31 +77,35 @@ class CBaseSplitterFilter virtual HRESULT CreateOutputs(IAsyncReader* pAsyncReader) PURE; // override this ... virtual LPCWSTR GetPartFilename(IAsyncReader* pAsyncReader); - LONGLONG m_nOpenProgress; - bool m_fAbort; + LONGLONG m_nOpenProgress = 100; + bool m_fAbort = false; - REFERENCE_TIME m_rtDuration; // derived filter should set this at the end of CreateOutputs - REFERENCE_TIME m_rtStart, m_rtStop, m_rtCurrent, m_rtNewStart, m_rtNewStop; - double m_dRate; + REFERENCE_TIME m_rtDuration = 0; // derived filter should set this at the end of CreateOutputs + REFERENCE_TIME m_rtStart = 0; + REFERENCE_TIME m_rtStop = 0; + REFERENCE_TIME m_rtCurrent = 0; + REFERENCE_TIME m_rtNewStart = 0; + REFERENCE_TIME m_rtNewStop = 0; + double m_dRate = 1.0; std::list m_bDiscontinuitySent; std::list m_pActivePins; CAMEvent m_eEndFlush; - bool m_fFlushing; + bool m_fFlushing = false; void DeliverBeginFlush(); void DeliverEndFlush(); HRESULT DeliverPacket(std::unique_ptr p); - int m_priority; + int m_priority = THREAD_PRIORITY_NORMAL; CFontInstaller m_fontinst; - DWORD m_nFlag; + DWORD m_nFlag = 0; - int m_iQueueDuration; // 100..15000 ms - //int m_iNetworkTimeout; // 2000..20000 ms + int m_iQueueDuration = QUEUE_DURATION_DEF; // 100..15000 ms + //int m_iNetworkTimeout = NETWORK_TIMEOUT_DEF; // 2000..20000 ms REFERENCE_TIME m_rtOffset = INVALID_TIME; @@ -165,7 +169,8 @@ class CBaseSplitterFilter virtual HRESULT SetPositionsInternal(void* id, LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags); private: - REFERENCE_TIME m_rtLastStart, m_rtLastStop; + REFERENCE_TIME m_rtLastStart = INVALID_TIME; + REFERENCE_TIME m_rtLastStop = INVALID_TIME; std::list m_LastSeekers; public: From 54ef79ba75d6248cee4b514a360015bd6928f60d Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 13 Jul 2024 20:51:07 +0300 Subject: [PATCH 059/102] =?UTF-8?q?DSUtil/DSMPropertyBag:=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=81=D0=BC=D0=B5=D1=82=D0=B8=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/DSMPropertyBag.h | 63 +++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/src/DSUtil/DSMPropertyBag.h b/src/DSUtil/DSMPropertyBag.h index 1c385856f5..4c25d6b805 100644 --- a/src/DSUtil/DSMPropertyBag.h +++ b/src/DSUtil/DSMPropertyBag.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2022 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -42,37 +42,30 @@ class IDSMPropertyBagImpl : public ATL::CSimpleMap, public I { std::mutex m_mutex; - BOOL Add(const CStringW& key, const CStringW& val) { - return __super::Add(key, val); - } - BOOL SetAt(const CStringW& key, const CStringW& val) { - return __super::SetAt(key, val); - } - public: IDSMPropertyBagImpl() = default; ~IDSMPropertyBagImpl() = default; // IPropertyBag - STDMETHODIMP Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog); - STDMETHODIMP Write(LPCOLESTR pszPropName, VARIANT* pVar); + STDMETHODIMP Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog) override; + STDMETHODIMP Write(LPCOLESTR pszPropName, VARIANT* pVar) override; // IPropertyBag2 - STDMETHODIMP Read(ULONG cProperties, PROPBAG2* pPropBag, IErrorLog* pErrLog, VARIANT* pvarValue, HRESULT* phrError); - STDMETHODIMP Write(ULONG cProperties, PROPBAG2* pPropBag, VARIANT* pvarValue); - STDMETHODIMP CountProperties(ULONG* pcProperties); - STDMETHODIMP GetPropertyInfo(ULONG iProperty, ULONG cProperties, PROPBAG2* pPropBag, ULONG* pcProperties); - STDMETHODIMP LoadObject(LPCOLESTR pstrName, DWORD dwHint, IUnknown* pUnkObject, IErrorLog* pErrLog); + STDMETHODIMP Read(ULONG cProperties, PROPBAG2* pPropBag, IErrorLog* pErrLog, VARIANT* pvarValue, HRESULT* phrError) override; + STDMETHODIMP Write(ULONG cProperties, PROPBAG2* pPropBag, VARIANT* pvarValue) override; + STDMETHODIMP CountProperties(ULONG* pcProperties) override; + STDMETHODIMP GetPropertyInfo(ULONG iProperty, ULONG cProperties, PROPBAG2* pPropBag, ULONG* pcProperties) override; + STDMETHODIMP LoadObject(LPCOLESTR pstrName, DWORD dwHint, IUnknown* pUnkObject, IErrorLog* pErrLog) override; // IDSMPropertyBag - STDMETHODIMP SetProperty(LPCWSTR key, LPCWSTR value); - STDMETHODIMP SetProperty(LPCWSTR key, VARIANT* var); - STDMETHODIMP GetProperty(LPCWSTR key, BSTR* value); - STDMETHODIMP DelAllProperties(); - STDMETHODIMP DelProperty(LPCWSTR key); + STDMETHODIMP SetProperty(LPCWSTR key, LPCWSTR value) override; + STDMETHODIMP SetProperty(LPCWSTR key, VARIANT* var) override; + STDMETHODIMP GetProperty(LPCWSTR key, BSTR* value) override; + STDMETHODIMP DelAllProperties() override; + STDMETHODIMP DelProperty(LPCWSTR key) override; }; class CDSMResource @@ -104,12 +97,12 @@ class IDSMResourceBagImpl : public IDSMResourceBag // IDSMResourceBag - STDMETHODIMP_(DWORD) ResGetCount(); - STDMETHODIMP ResGet(DWORD iIndex, BSTR* ppName, BSTR* ppDesc, BSTR* ppMime, BYTE** ppData, DWORD* pDataLen, DWORD_PTR* pTag = nullptr); - STDMETHODIMP ResSet(DWORD iIndex, LPCWSTR pName, LPCWSTR pDesc, LPCWSTR pMime, BYTE* pData, DWORD len, DWORD_PTR tag = 0); - STDMETHODIMP ResAppend(LPCWSTR pName, LPCWSTR pDesc, LPCWSTR pMime, BYTE* pData, DWORD len, DWORD_PTR tag = 0); - STDMETHODIMP ResRemoveAt(DWORD iIndex); - STDMETHODIMP ResRemoveAll(DWORD_PTR tag = 0); + STDMETHODIMP_(DWORD) ResGetCount() override; + STDMETHODIMP ResGet(DWORD iIndex, BSTR* ppName, BSTR* ppDesc, BSTR* ppMime, BYTE** ppData, DWORD* pDataLen, DWORD_PTR* pTag = nullptr) override; + STDMETHODIMP ResSet(DWORD iIndex, LPCWSTR pName, LPCWSTR pDesc, LPCWSTR pMime, BYTE* pData, DWORD len, DWORD_PTR tag = 0) override; + STDMETHODIMP ResAppend(LPCWSTR pName, LPCWSTR pDesc, LPCWSTR pMime, BYTE* pData, DWORD len, DWORD_PTR tag = 0) override; + STDMETHODIMP ResRemoveAt(DWORD iIndex) override; + STDMETHODIMP ResRemoveAll(DWORD_PTR tag = 0) override; }; // IDSMChapterBag @@ -154,14 +147,14 @@ class IDSMChapterBagImpl : public IDSMChapterBag // IDSMChapterBag - STDMETHODIMP_(DWORD) ChapGetCount(); - STDMETHODIMP ChapGet(DWORD iIndex, REFERENCE_TIME* prt, BSTR* ppName = nullptr); - STDMETHODIMP ChapSet(DWORD iIndex, REFERENCE_TIME rt, LPCWSTR pName); - STDMETHODIMP ChapAppend(REFERENCE_TIME rt, LPCWSTR pName); - STDMETHODIMP ChapRemoveAt(DWORD iIndex); - STDMETHODIMP ChapRemoveAll(); - STDMETHODIMP_(long) ChapLookup(REFERENCE_TIME* prt, BSTR* ppName = nullptr); - STDMETHODIMP ChapSort(); + STDMETHODIMP_(DWORD) ChapGetCount() override; + STDMETHODIMP ChapGet(DWORD iIndex, REFERENCE_TIME* prt, BSTR* ppName = nullptr) override; + STDMETHODIMP ChapSet(DWORD iIndex, REFERENCE_TIME rt, LPCWSTR pName) override; + STDMETHODIMP ChapAppend(REFERENCE_TIME rt, LPCWSTR pName) override; + STDMETHODIMP ChapRemoveAt(DWORD iIndex) override; + STDMETHODIMP ChapRemoveAll() override; + STDMETHODIMP_(long) ChapLookup(REFERENCE_TIME* prt, BSTR* ppName = nullptr) override; + STDMETHODIMP ChapSort() override; }; class CDSMChapterBag : public CUnknown, public IDSMChapterBagImpl @@ -170,7 +163,7 @@ class CDSMChapterBag : public CUnknown, public IDSMChapterBagImpl CDSMChapterBag(LPUNKNOWN pUnk, HRESULT* phr); DECLARE_IUNKNOWN; - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); + STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) override; }; template From f5f5cc0c6a1c89be1ae2e728ac052fb73b4fbf4f Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 13 Jul 2024 22:42:35 +0300 Subject: [PATCH 060/102] =?UTF-8?q?DSUtil/DSMPropertyBag:=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BE=D0=BA=20=D1=81=D0=B2=D0=BE=D0=B9=D1=81=D1=82?= =?UTF-8?q?=D0=B2=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D1=8F=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20=D1=87=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=D0=BC=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/DSMPropertyBag.cpp | 33 ++++++++++++------- src/DSUtil/DSMPropertyBag.h | 8 ++++- .../muxer/BaseMuxer/BaseMuxerInputPin.cpp | 2 +- src/filters/muxer/DSMMuxer/DSMMuxer.cpp | 21 +++++++----- .../parser/BaseSplitter/BaseSplitter.cpp | 2 +- 5 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/DSUtil/DSMPropertyBag.cpp b/src/DSUtil/DSMPropertyBag.cpp index da7cf7240d..9abed2f43e 100644 --- a/src/DSUtil/DSMPropertyBag.cpp +++ b/src/DSUtil/DSMPropertyBag.cpp @@ -29,6 +29,17 @@ // IPropertyBag +ATL::CSimpleMap* IDSMPropertyBagImpl::LockProps() +{ + m_mutex.lock(); + return &m_properties; +} + +void IDSMPropertyBagImpl::UnlockProps() +{ + m_mutex.unlock(); +} + STDMETHODIMP IDSMPropertyBagImpl::Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog) { CheckPointer(pVar, E_POINTER); @@ -38,7 +49,7 @@ STDMETHODIMP IDSMPropertyBagImpl::Read(LPCOLESTR pszPropName, VARIANT* pVar, IEr std::lock_guard lock(m_mutex); - CStringW value = Lookup(pszPropName); + CStringW value = m_properties.Lookup(pszPropName); if (value.IsEmpty()) { return E_FAIL; } @@ -62,7 +73,7 @@ STDMETHODIMP IDSMPropertyBagImpl::Read(ULONG cProperties, PROPBAG2* pPropBag, IE std::lock_guard lock(m_mutex); for (ULONG i = 0; i < cProperties; phrError[i] = S_OK, i++) { - CComVariant(Lookup(pPropBag[i].pstrName)).Detach(pvarValue); + CComVariant(m_properties.Lookup(pPropBag[i].pstrName)).Detach(pvarValue); } return S_OK; } @@ -83,7 +94,7 @@ STDMETHODIMP IDSMPropertyBagImpl::CountProperties(ULONG* pcProperties) std::lock_guard lock(m_mutex); - *pcProperties = GetSize(); + *pcProperties = m_properties.GetSize(); return S_OK; } @@ -95,7 +106,7 @@ STDMETHODIMP IDSMPropertyBagImpl::GetPropertyInfo(ULONG iProperty, ULONG cProper std::lock_guard lock(m_mutex); for (ULONG i = 0; i < cProperties; i++, iProperty++, (*pcProperties)++) { - CStringW key = GetKeyAt(iProperty); + CStringW key = m_properties.GetKeyAt(iProperty); pPropBag[i].pstrName = (BSTR)CoTaskMemAlloc((key.GetLength()+1)*sizeof(WCHAR)); if (!pPropBag[i].pstrName) { return E_FAIL; @@ -119,10 +130,10 @@ HRESULT IDSMPropertyBagImpl::SetProperty(LPCWSTR key, LPCWSTR value) std::lock_guard lock(m_mutex); - if (!Lookup(key).IsEmpty()) { - SetAt(key, value); + if (!m_properties.Lookup(key).IsEmpty()) { + m_properties.SetAt(key, value); } else { - Add(key, value); + m_properties.Add(key, value); } return S_OK; } @@ -144,11 +155,11 @@ HRESULT IDSMPropertyBagImpl::GetProperty(LPCWSTR key, BSTR* value) std::lock_guard lock(m_mutex); - int i = FindKey(key); + int i = m_properties.FindKey(key); if (i < 0) { return E_FAIL; } - *value = GetValueAt(i).AllocSysString(); + *value = m_properties.GetValueAt(i).AllocSysString(); return S_OK; } @@ -156,7 +167,7 @@ HRESULT IDSMPropertyBagImpl::DelAllProperties() { std::lock_guard lock(m_mutex); - RemoveAll(); + m_properties.RemoveAll(); return S_OK; } @@ -164,7 +175,7 @@ HRESULT IDSMPropertyBagImpl::DelProperty(LPCWSTR key) { std::lock_guard lock(m_mutex); - return Remove(key) ? S_OK : S_FALSE; + return m_properties.Remove(key) ? S_OK : S_FALSE; } // diff --git a/src/DSUtil/DSMPropertyBag.h b/src/DSUtil/DSMPropertyBag.h index 4c25d6b805..38bbb0cec8 100644 --- a/src/DSUtil/DSMPropertyBag.h +++ b/src/DSUtil/DSMPropertyBag.h @@ -38,14 +38,20 @@ public IPropertyBag2 { STDMETHOD(DelProperty) (LPCWSTR key) PURE; }; -class IDSMPropertyBagImpl : public ATL::CSimpleMap, public IDSMPropertyBag, public IPropertyBag +class IDSMPropertyBagImpl : public IDSMPropertyBag, public IPropertyBag { std::mutex m_mutex; +protected: + ATL::CSimpleMap m_properties; + public: IDSMPropertyBagImpl() = default; ~IDSMPropertyBagImpl() = default; + ATL::CSimpleMap* LockProps(); + void UnlockProps(); + // IPropertyBag STDMETHODIMP Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog) override; diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp index cce43e0ac3..3de06acba3 100644 --- a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp +++ b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp @@ -135,7 +135,7 @@ HRESULT CBaseMuxerInputPin::BreakConnect() return hr; } - RemoveAll(); + m_properties.RemoveAll(); // TODO: remove extra disconnected pins, leave one diff --git a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp index 9a920f7671..56384c977a 100644 --- a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp +++ b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp @@ -123,8 +123,8 @@ void CDSMMuxerFilter::MuxFileInfo(IBitStream* pBS) int len = 1; CSimpleMap si; - for (int i = 0; i < GetSize(); i++) { - CStringA key = CStringA(CString(GetKeyAt(i))), value = WStrToUTF8(GetValueAt(i)); + for (int i = 0; i < m_properties.GetSize(); i++) { + CStringA key = CStringA(CString(m_properties.GetKeyAt(i))), value = WStrToUTF8(m_properties.GetValueAt(i)); if (key.GetLength() != 4) { continue; } @@ -147,14 +147,19 @@ void CDSMMuxerFilter::MuxStreamInfo(IBitStream* pBS, CBaseMuxerInputPin* pPin) int len = 1; CSimpleMap si; - for (int i = 0; i < pPin->GetSize(); i++) { - CStringA key = CStringA(CString(pPin->GetKeyAt(i))), value = WStrToUTF8(pPin->GetValueAt(i)); - if (key.GetLength() != 4) { - continue; + auto props = pPin->LockProps(); + if (props) { + for (int i = 0; i < props->GetSize(); i++) { + CStringA key = CStringA(props->GetKeyAt(i)); + if (key.GetLength() != 4) { + continue; + } + CStringA value = WStrToUTF8(props->GetValueAt(i)); + si.Add(key, value); + len += 4 + value.GetLength() + 1; } - si.Add(key, value); - len += 4 + value.GetLength() + 1; } + pPin->UnlockProps(); if (len > 1) { MuxPacketHeader(pBS, DSMP_STREAMINFO, len); diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp index 0087c74d2c..3e9011243c 100644 --- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp +++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp @@ -192,7 +192,7 @@ HRESULT CBaseSplitterFilter::DeleteOutputs() CAutoLock cAutoLockMT(&m_csmtnew); m_mtnew.clear(); - RemoveAll(); + m_properties.RemoveAll(); ResRemoveAll(); ChapRemoveAll(); From e719045c8e0ed2c81d2ee99f595e93a0185f24a0 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 13 Jul 2024 23:20:50 +0300 Subject: [PATCH 061/102] =?UTF-8?q?DSMMuxer:=20=D1=83=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD=D0=B5?= =?UTF-8?q?=D1=80=D1=8B=20=D1=81=D1=82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D1=82?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE=D1=82?= =?UTF-8?q?=D0=B5=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/muxer/DSMMuxer/DSMMuxer.cpp | 32 ++++++++++++------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp index 56384c977a..fae2034750 100644 --- a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp +++ b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -121,23 +121,22 @@ void CDSMMuxerFilter::MuxPacketHeader(IBitStream* pBS, dsmp_t type, UINT64 len) void CDSMMuxerFilter::MuxFileInfo(IBitStream* pBS) { int len = 1; - CSimpleMap si; + std::list entries; for (int i = 0; i < m_properties.GetSize(); i++) { - CStringA key = CStringA(CString(m_properties.GetKeyAt(i))), value = WStrToUTF8(m_properties.GetValueAt(i)); + CStringA key = CStringA(m_properties.GetKeyAt(i)); if (key.GetLength() != 4) { continue; } - si.Add(key, value); + CStringA value = WStrToUTF8(m_properties.GetValueAt(i)); + entries.emplace_back(key + value); len += 4 + value.GetLength() + 1; } MuxPacketHeader(pBS, DSMP_FILEINFO, len); pBS->BitWrite(DSMF_VERSION, 8); - for (int i = 0; i < si.GetSize(); i++) { - CStringA key = si.GetKeyAt(i), value = si.GetValueAt(i); - pBS->ByteWrite((LPCSTR)key, 4); - pBS->ByteWrite((LPCSTR)value, value.GetLength() + 1); + for (const auto& entry : entries) { + pBS->ByteWrite((LPCSTR)entry, entry.GetLength() + 1); } } @@ -145,7 +144,7 @@ void CDSMMuxerFilter::MuxFileInfo(IBitStream* pBS) void CDSMMuxerFilter::MuxStreamInfo(IBitStream* pBS, CBaseMuxerInputPin* pPin) { int len = 1; - CSimpleMap si; + std::list entries; auto props = pPin->LockProps(); if (props) { @@ -155,7 +154,7 @@ void CDSMMuxerFilter::MuxStreamInfo(IBitStream* pBS, CBaseMuxerInputPin* pPin) continue; } CStringA value = WStrToUTF8(props->GetValueAt(i)); - si.Add(key, value); + entries.emplace_back(key + value); len += 4 + value.GetLength() + 1; } } @@ -164,10 +163,8 @@ void CDSMMuxerFilter::MuxStreamInfo(IBitStream* pBS, CBaseMuxerInputPin* pPin) if (len > 1) { MuxPacketHeader(pBS, DSMP_STREAMINFO, len); pBS->BitWrite(pPin->GetID(), 8); - for (int i = 0; i < si.GetSize(); i++) { - CStringA key = si.GetKeyAt(i), value = si.GetValueAt(i); - pBS->ByteWrite((LPCSTR)key, 4); - pBS->ByteWrite((LPCSTR)value, value.GetLength() + 1); + for (const auto& entry : entries) { + pBS->ByteWrite((LPCSTR)entry, entry.GetLength() + 1); } } } @@ -265,12 +262,13 @@ void CDSMMuxerFilter::MuxHeader(IBitStream* pBS) // chapters if (pCB) { - std::list chapters; + pCB->ChapSort(); + + std::vector chapters; + chapters.reserve(pCB->ChapGetCount()); REFERENCE_TIME rtPrev = 0; int len = 0; - pCB->ChapSort(); - for (DWORD i = 0; i < pCB->ChapGetCount(); i++) { CDSMChapter c; CComBSTR name; From 6272601c463af419d9a9aa29c0138f5ebab71ecc Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 14 Jul 2024 07:08:23 +0300 Subject: [PATCH 062/102] =?UTF-8?q?BaseSplitter,=20BaseMuxer:=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D0=BC=20DelAll?= =?UTF-8?q?Properties=20=D0=B4=D0=BB=D1=8F=20=D1=83=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81=D0=B2=D0=BE=D0=B9=D1=81=D1=82?= =?UTF-8?q?=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp | 4 ++-- src/filters/parser/BaseSplitter/BaseSplitter.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp index 3de06acba3..b0bfee2dcf 100644 --- a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp +++ b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -135,7 +135,7 @@ HRESULT CBaseMuxerInputPin::BreakConnect() return hr; } - m_properties.RemoveAll(); + DelAllProperties(); // TODO: remove extra disconnected pins, leave one diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp index 3e9011243c..632c7ec5b8 100644 --- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp +++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp @@ -192,7 +192,7 @@ HRESULT CBaseSplitterFilter::DeleteOutputs() CAutoLock cAutoLockMT(&m_csmtnew); m_mtnew.clear(); - m_properties.RemoveAll(); + DelAllProperties(); ResRemoveAll(); ChapRemoveAll(); From 6d0b803ddc4a839bdca37def0f165f041b57378f Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 14 Jul 2024 10:03:56 +0300 Subject: [PATCH 063/102] =?UTF-8?q?DSUtil/DSMPropertyBag:=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D0=BC=20=D1=82=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D1=8B?= =?UTF-8?q?=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D0=BE?= =?UTF-8?q?=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/DSMPropertyBag.cpp | 17 ++++------- src/DSUtil/DSMPropertyBag.h | 3 -- src/filters/muxer/DSMMuxer/DSMMuxer.cpp | 38 ++++++++++++++++--------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/DSUtil/DSMPropertyBag.cpp b/src/DSUtil/DSMPropertyBag.cpp index 9abed2f43e..6eb2c6b4ac 100644 --- a/src/DSUtil/DSMPropertyBag.cpp +++ b/src/DSUtil/DSMPropertyBag.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2022 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -29,17 +29,6 @@ // IPropertyBag -ATL::CSimpleMap* IDSMPropertyBagImpl::LockProps() -{ - m_mutex.lock(); - return &m_properties; -} - -void IDSMPropertyBagImpl::UnlockProps() -{ - m_mutex.unlock(); -} - STDMETHODIMP IDSMPropertyBagImpl::Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog) { CheckPointer(pVar, E_POINTER); @@ -105,6 +94,10 @@ STDMETHODIMP IDSMPropertyBagImpl::GetPropertyInfo(ULONG iProperty, ULONG cProper std::lock_guard lock(m_mutex); + if (iProperty + cProperties > (ULONG)m_properties.GetSize()) { + return E_FAIL; + } + for (ULONG i = 0; i < cProperties; i++, iProperty++, (*pcProperties)++) { CStringW key = m_properties.GetKeyAt(iProperty); pPropBag[i].pstrName = (BSTR)CoTaskMemAlloc((key.GetLength()+1)*sizeof(WCHAR)); diff --git a/src/DSUtil/DSMPropertyBag.h b/src/DSUtil/DSMPropertyBag.h index 38bbb0cec8..9d05740b52 100644 --- a/src/DSUtil/DSMPropertyBag.h +++ b/src/DSUtil/DSMPropertyBag.h @@ -49,9 +49,6 @@ class IDSMPropertyBagImpl : public IDSMPropertyBag, public IPropertyBag IDSMPropertyBagImpl() = default; ~IDSMPropertyBagImpl() = default; - ATL::CSimpleMap* LockProps(); - void UnlockProps(); - // IPropertyBag STDMETHODIMP Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog) override; diff --git a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp index fae2034750..790ef026f3 100644 --- a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp +++ b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp @@ -124,11 +124,11 @@ void CDSMMuxerFilter::MuxFileInfo(IBitStream* pBS) std::list entries; for (int i = 0; i < m_properties.GetSize(); i++) { - CStringA key = CStringA(m_properties.GetKeyAt(i)); - if (key.GetLength() != 4) { + const CStringA key(m_properties.GetKeyAt(i)); + const CStringA value = WStrToUTF8(m_properties.GetValueAt(i)); + if (key.GetLength() != 4 || value.IsEmpty()) { continue; } - CStringA value = WStrToUTF8(m_properties.GetValueAt(i)); entries.emplace_back(key + value); len += 4 + value.GetLength() + 1; } @@ -138,7 +138,6 @@ void CDSMMuxerFilter::MuxFileInfo(IBitStream* pBS) for (const auto& entry : entries) { pBS->ByteWrite((LPCSTR)entry, entry.GetLength() + 1); } - } void CDSMMuxerFilter::MuxStreamInfo(IBitStream* pBS, CBaseMuxerInputPin* pPin) @@ -146,19 +145,32 @@ void CDSMMuxerFilter::MuxStreamInfo(IBitStream* pBS, CBaseMuxerInputPin* pPin) int len = 1; std::list entries; - auto props = pPin->LockProps(); - if (props) { - for (int i = 0; i < props->GetSize(); i++) { - CStringA key = CStringA(props->GetKeyAt(i)); - if (key.GetLength() != 4) { + ULONG cProperties = 0; + HRESULT hr = pPin->CountProperties(&cProperties); + if (SUCCEEDED(hr) && cProperties > 0) { + for (ULONG iProperty = 0; iProperty < cProperties; iProperty++) { + PROPBAG2 PropBag = {}; + ULONG cPropertiesReturned = 0; + hr = pPin->GetPropertyInfo(iProperty, 1, &PropBag, &cPropertiesReturned); + if (FAILED(hr)) { continue; } - CStringA value = WStrToUTF8(props->GetValueAt(i)); - entries.emplace_back(key + value); - len += 4 + value.GetLength() + 1; + + HRESULT hr2; + CComVariant var; + hr = pPin->Read(1, &PropBag, nullptr, &var, &hr2); + if (SUCCEEDED(hr) && SUCCEEDED(hr2) && (var.vt & (VT_BSTR | VT_BYREF)) == VT_BSTR) { + const CStringA key(PropBag.pstrName); + const CStringA value = WStrToUTF8(var.bstrVal); + if (key.GetLength() != 4 || value.IsEmpty()) { + continue; + } + entries.emplace_back(key + value); + len += 4 + value.GetLength() + 1; + } + CoTaskMemFree(PropBag.pstrName); } } - pPin->UnlockProps(); if (len > 1) { MuxPacketHeader(pBS, DSMP_STREAMINFO, len); From 292926b31b8736e1209898318ebaefe3b9726cb9 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 14 Jul 2024 22:20:01 +0300 Subject: [PATCH 064/102] =?UTF-8?q?DSUtil/DSMPropertyBag:=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B0=20ATL::CSimpleMap=20=D0=BD=D0=B0=20std?= =?UTF-8?q?::unordered=5Fmap.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/DSMPropertyBag.cpp | 48 +++++++++++++++---------- src/DSUtil/DSMPropertyBag.h | 3 +- src/filters/muxer/DSMMuxer/DSMMuxer.cpp | 8 ++--- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/DSUtil/DSMPropertyBag.cpp b/src/DSUtil/DSMPropertyBag.cpp index 6eb2c6b4ac..5a7104b463 100644 --- a/src/DSUtil/DSMPropertyBag.cpp +++ b/src/DSUtil/DSMPropertyBag.cpp @@ -38,11 +38,11 @@ STDMETHODIMP IDSMPropertyBagImpl::Read(LPCOLESTR pszPropName, VARIANT* pVar, IEr std::lock_guard lock(m_mutex); - CStringW value = m_properties.Lookup(pszPropName); - if (value.IsEmpty()) { + auto it = m_properties.find(pszPropName); + if (it == m_properties.end()) { return E_FAIL; } - CComVariant(value).Detach(pVar); + CComVariant(it->second).Detach(pVar); return S_OK; } @@ -61,8 +61,15 @@ STDMETHODIMP IDSMPropertyBagImpl::Read(ULONG cProperties, PROPBAG2* pPropBag, IE std::lock_guard lock(m_mutex); - for (ULONG i = 0; i < cProperties; phrError[i] = S_OK, i++) { - CComVariant(m_properties.Lookup(pPropBag[i].pstrName)).Detach(pvarValue); + for (ULONG i = 0; i < cProperties; i++) { + auto it = m_properties.find(pPropBag[i].pstrName); + + if (it != m_properties.end() ) { + CComVariant(it->second).Detach(pvarValue); + phrError[i] = S_OK; + } else { + phrError[i] = E_FAIL; + } } return S_OK; } @@ -83,7 +90,7 @@ STDMETHODIMP IDSMPropertyBagImpl::CountProperties(ULONG* pcProperties) std::lock_guard lock(m_mutex); - *pcProperties = m_properties.GetSize(); + *pcProperties = (ULONG)m_properties.size(); return S_OK; } @@ -94,17 +101,20 @@ STDMETHODIMP IDSMPropertyBagImpl::GetPropertyInfo(ULONG iProperty, ULONG cProper std::lock_guard lock(m_mutex); - if (iProperty + cProperties > (ULONG)m_properties.GetSize()) { + if (iProperty + cProperties > (ULONG)m_properties.size()) { return E_FAIL; } + auto it = m_properties.cbegin(); + std::advance(it, iProperty); + for (ULONG i = 0; i < cProperties; i++, iProperty++, (*pcProperties)++) { - CStringW key = m_properties.GetKeyAt(iProperty); - pPropBag[i].pstrName = (BSTR)CoTaskMemAlloc((key.GetLength()+1)*sizeof(WCHAR)); + auto& key = it->first; + pPropBag[i].pstrName = (BSTR)CoTaskMemAlloc((key.length()+1)*sizeof(WCHAR)); if (!pPropBag[i].pstrName) { return E_FAIL; } - wcscpy_s(pPropBag[i].pstrName, key.GetLength()+1, key); + wcscpy_s(pPropBag[i].pstrName, key.length()+1, key.c_str()); } return S_OK; } @@ -123,11 +133,13 @@ HRESULT IDSMPropertyBagImpl::SetProperty(LPCWSTR key, LPCWSTR value) std::lock_guard lock(m_mutex); - if (!m_properties.Lookup(key).IsEmpty()) { - m_properties.SetAt(key, value); + auto it = m_properties.find(key); + if (it != m_properties.end()) { + it->second = value; } else { - m_properties.Add(key, value); + m_properties.emplace(key, value); } + return S_OK; } @@ -148,11 +160,11 @@ HRESULT IDSMPropertyBagImpl::GetProperty(LPCWSTR key, BSTR* value) std::lock_guard lock(m_mutex); - int i = m_properties.FindKey(key); - if (i < 0) { + auto& it = m_properties.find(key); + if (it == m_properties.end()) { return E_FAIL; } - *value = m_properties.GetValueAt(i).AllocSysString(); + *value = it->second.AllocSysString(); return S_OK; } @@ -160,7 +172,7 @@ HRESULT IDSMPropertyBagImpl::DelAllProperties() { std::lock_guard lock(m_mutex); - m_properties.RemoveAll(); + m_properties.clear(); return S_OK; } @@ -168,7 +180,7 @@ HRESULT IDSMPropertyBagImpl::DelProperty(LPCWSTR key) { std::lock_guard lock(m_mutex); - return m_properties.Remove(key) ? S_OK : S_FALSE; + return m_properties.erase(key) ? S_OK : S_FALSE; } // diff --git a/src/DSUtil/DSMPropertyBag.h b/src/DSUtil/DSMPropertyBag.h index 9d05740b52..5e720dd6da 100644 --- a/src/DSUtil/DSMPropertyBag.h +++ b/src/DSUtil/DSMPropertyBag.h @@ -24,6 +24,7 @@ #include "IDSMResourceBag.h" #include +#include #include // IDSMPropertyBag @@ -43,7 +44,7 @@ class IDSMPropertyBagImpl : public IDSMPropertyBag, public IPropertyBag std::mutex m_mutex; protected: - ATL::CSimpleMap m_properties; + std::unordered_map m_properties; // unordered_map because no need to sort by key here public: IDSMPropertyBagImpl() = default; diff --git a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp index 790ef026f3..38419095a9 100644 --- a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp +++ b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp @@ -123,13 +123,11 @@ void CDSMMuxerFilter::MuxFileInfo(IBitStream* pBS) int len = 1; std::list entries; - for (int i = 0; i < m_properties.GetSize(); i++) { - const CStringA key(m_properties.GetKeyAt(i)); - const CStringA value = WStrToUTF8(m_properties.GetValueAt(i)); - if (key.GetLength() != 4 || value.IsEmpty()) { + for (const auto&[key, value] : m_properties) { + if (key.length() != 4 || value.IsEmpty()) { continue; } - entries.emplace_back(key + value); + entries.emplace_back(CStringA(key.c_str(), key.length()) + WStrToUTF8(value)); len += 4 + value.GetLength() + 1; } From c8dbdd6a55f7348557861fb4b7ca7e1bdcbb33c4 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 15 Jul 2024 11:04:31 +1000 Subject: [PATCH 065/102] =?UTF-8?q?=D0=92=D1=80=D1=83=D1=87=D0=BD=D1=83?= =?UTF-8?q?=D1=8E=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B6=D0=B0=D0=B5=D0=BC?= =?UTF-8?q?=D1=8B=D0=B5=20=D1=81=D1=83=D0=B1=D1=82=D0=B8=D1=82=D1=80=D1=8B?= =?UTF-8?q?=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D1=81=D0=BE=D1=85?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D1=8F=D1=8E=D1=82=D1=81=D1=8F=20=D0=B2=20?= =?UTF-8?q?=D0=BF=D0=BB=D0=B5=D0=B9=D0=BB=D0=B8=D1=81=D1=82=D0=B5.=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20=D1=87=D1=82=D0=BE?= =?UTF-8?q?=D0=B1=D1=8B=20=D0=BD=D0=B5=20=D0=B1=D1=8B=D0=BB=D0=BE=20=D0=B4?= =?UTF-8?q?=D1=83=D0=B1=D0=BB=D0=B5=D0=B9=20=D0=BF=D1=80=D0=B8=20=D1=80?= =?UTF-8?q?=D1=83=D1=87=D0=BD=D0=BE=D0=B9=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B7=D0=BA=D0=B5=20=D0=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B8=D1=85?= =?UTF-8?q?=20=D0=B0=D1=83=D0=B4=D0=B8=D0=BE-=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/MainFrm.cpp | 15 +++++++++++---- src/apps/mplayerc/MainFrm.h | 2 +- src/apps/mplayerc/PlayerPlaylistBar.cpp | 22 +++++++++++++++++++++- src/apps/mplayerc/PlayerPlaylistBar.h | 3 +++ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index ae898d1e30..d000df1b72 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -5933,7 +5933,7 @@ void CMainFrame::DropFiles(std::list& slFiles) } } else { ISubStream *pSubStream = nullptr; - if (LoadSubtitle(fname, &pSubStream)) { + if (LoadSubtitle(fname, &pSubStream, false)) { SetSubtitle(pSubStream); // the subtitle at the insert position according to LoadSubtitle() b_SubLoaded = true; @@ -6741,7 +6741,7 @@ void CMainFrame::OnFileLoadSubtitle() } else { for (const auto& fn : fns) { ISubStream *pSubStream = nullptr; - if (LoadSubtitle(fn, &pSubStream)) { + if (LoadSubtitle(fn, &pSubStream, false)) { SetSubtitle(pSubStream); // the subtitle at the insert position according to LoadSubtitle() AddSubtitlePathsAddons(fn.GetString()); } @@ -6785,7 +6785,7 @@ void CMainFrame::OnFileLoadAudio() if (CComQIPtr pGBA = m_pGB.p) { HRESULT hr = pGBA->RenderAudioFile(fname); if (SUCCEEDED(hr)) { - pli->m_auds.emplace_back(fname); + m_wndPlaylistBar.AddAudioToCurrent(fname); AddAudioPathsAddons(fname.GetString()); CComQIPtr pSS = FindSwitcherFilter(); @@ -16214,7 +16214,7 @@ void CMainFrame::ApplyExraRendererSettings() } } -bool CMainFrame::LoadSubtitle(const CExtraFileItem& subItem, ISubStream **actualStream) +bool CMainFrame::LoadSubtitle(const CExtraFileItem& subItem, ISubStream **actualStream, bool bAutoLoad) { CAppSettings& s = AfxGetAppSettings(); @@ -16238,6 +16238,9 @@ bool CMainFrame::LoadSubtitle(const CExtraFileItem& subItem, ISubStream **actual *actualStream = m_pSubStreams.back(); s.fEnableSubtitles = true; } + if (!bAutoLoad) { + m_wndPlaylistBar.AddSubtitleToCurrent(fname); + } return true; } @@ -16287,6 +16290,10 @@ bool CMainFrame::LoadSubtitle(const CExtraFileItem& subItem, ISubStream **actual s.fEnableSubtitles = true; } + if (!bAutoLoad) { + m_wndPlaylistBar.AddSubtitleToCurrent(fname); + } + if (subChangeNotifyThread.joinable() && !::PathIsURLW(fname)) { auto it = std::find_if(m_ExtSubFiles.cbegin(), m_ExtSubFiles.cend(), [&fname](filepathtime_t fpt) { return fpt.path == fname; }); if (it == m_ExtSubFiles.cend()) { diff --git a/src/apps/mplayerc/MainFrm.h b/src/apps/mplayerc/MainFrm.h index d17ba9fdcd..ecff76a9b1 100644 --- a/src/apps/mplayerc/MainFrm.h +++ b/src/apps/mplayerc/MainFrm.h @@ -711,7 +711,7 @@ class CMainFrame : public CFrameWnd, public CDropTarget, public CDPI void ApplyExraRendererSettings(); // subtitle streams order function - bool LoadSubtitle(const CExtraFileItem& subItem, ISubStream **actualStream = nullptr); + bool LoadSubtitle(const CExtraFileItem& subItem, ISubStream **actualStream = nullptr, bool bAutoLoad = true); void UpdateSubtitle(bool fDisplayMessage = false, bool fApplyDefStyle = false); void SetSubtitle(ISubStream* pSubStream, int iSubtitleSel = -1, bool fApplyDefStyle = false); diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp index ed9369ab7c..d0b0eb5c4a 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.cpp +++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp @@ -301,7 +301,7 @@ CString CPlaylistItem::GetLabel(int i) const } template -static bool FindFileInList(std::list& sl, CString fn) +static bool FindFileInList(std::list& sl, const CString& fn) { for (const auto& item : sl) { if (CString(item).CompareNoCase(fn) == 0) { @@ -937,6 +937,26 @@ void CPlayerPlaylistBar::SelectDefaultPlaylist() TSelectTab(); } +void CPlayerPlaylistBar::AddAudioToCurrent(const CString& fn) +{ + auto pli = GetCur(); + if (pli) { + if (!FindFileInList(pli->m_auds, fn)) { + pli->m_auds.emplace_back(fn); + } + } +} + +void CPlayerPlaylistBar::AddSubtitleToCurrent(const CString& fn) +{ + auto pli = GetCur(); + if (pli) { + if (!FindFileInList(pli->m_subs, fn)) { + pli->m_subs.emplace_back(fn); + } + } +} + BOOL CPlayerPlaylistBar::PreCreateWindow(CREATESTRUCT& cs) { if (!CSizingControlBarG::PreCreateWindow(cs)) { diff --git a/src/apps/mplayerc/PlayerPlaylistBar.h b/src/apps/mplayerc/PlayerPlaylistBar.h index 75c6a674da..732c9c5738 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.h +++ b/src/apps/mplayerc/PlayerPlaylistBar.h @@ -374,6 +374,9 @@ class CPlayerPlaylistBar : public CPlayerBar void SelectDefaultPlaylist(); + void AddAudioToCurrent(const CString& fn); + void AddSubtitleToCurrent(const CString& fn); + protected: virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual BOOL PreTranslateMessage(MSG* pMsg); From 865c311637668cd3192e9065e0ae12357f1c66d0 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 15 Jul 2024 11:39:06 +1000 Subject: [PATCH 066/102] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=20=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D1=8B=D0=B4=D1=83=D1=89=D0=B5=D0=BC=D1=83=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=83.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/MainFrm.cpp | 24 +++++++++++++----------- src/apps/mplayerc/PlayerPlaylistBar.cpp | 10 ++++++++++ src/apps/mplayerc/PlayerPlaylistBar.h | 1 + 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index d000df1b72..ee0c49cf9f 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -6782,17 +6782,19 @@ void CMainFrame::OnFileLoadAudio() while (pos) { CString fname = fd.GetNextPathName(pos); - if (CComQIPtr pGBA = m_pGB.p) { - HRESULT hr = pGBA->RenderAudioFile(fname); - if (SUCCEEDED(hr)) { - m_wndPlaylistBar.AddAudioToCurrent(fname); - AddAudioPathsAddons(fname.GetString()); - - CComQIPtr pSS = FindSwitcherFilter(); - if (pSS) { - DWORD cStreams = 0; - if (SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 0) { - pSS->Enable(cStreams - 1, AMSTREAMSELECTENABLE_ENABLE); + if (!m_wndPlaylistBar.CheckAudioInCurrent(fname)) { + if (CComQIPtr pGBA = m_pGB.p) { + HRESULT hr = pGBA->RenderAudioFile(fname); + if (SUCCEEDED(hr)) { + m_wndPlaylistBar.AddAudioToCurrent(fname); + AddAudioPathsAddons(fname.GetString()); + + CComQIPtr pSS = FindSwitcherFilter(); + if (pSS) { + DWORD cStreams = 0; + if (SUCCEEDED(pSS->Count(&cStreams)) && cStreams > 0) { + pSS->Enable(cStreams - 1, AMSTREAMSELECTENABLE_ENABLE); + } } } } diff --git a/src/apps/mplayerc/PlayerPlaylistBar.cpp b/src/apps/mplayerc/PlayerPlaylistBar.cpp index d0b0eb5c4a..a94eb7d104 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.cpp +++ b/src/apps/mplayerc/PlayerPlaylistBar.cpp @@ -937,6 +937,16 @@ void CPlayerPlaylistBar::SelectDefaultPlaylist() TSelectTab(); } +bool CPlayerPlaylistBar::CheckAudioInCurrent(const CString& fn) +{ + auto pli = GetCur(); + if (pli) { + return FindFileInList(pli->m_auds, fn); + } + + return false; +} + void CPlayerPlaylistBar::AddAudioToCurrent(const CString& fn) { auto pli = GetCur(); diff --git a/src/apps/mplayerc/PlayerPlaylistBar.h b/src/apps/mplayerc/PlayerPlaylistBar.h index 732c9c5738..0abafdd739 100644 --- a/src/apps/mplayerc/PlayerPlaylistBar.h +++ b/src/apps/mplayerc/PlayerPlaylistBar.h @@ -374,6 +374,7 @@ class CPlayerPlaylistBar : public CPlayerBar void SelectDefaultPlaylist(); + bool CheckAudioInCurrent(const CString& fn); void AddAudioToCurrent(const CString& fn); void AddSubtitleToCurrent(const CString& fn); From 5cac3571ee265bd37200883b376db36d96b90819 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Tue, 16 Jul 2024 13:39:35 +1000 Subject: [PATCH 067/102] =?UTF-8?q?MpegSplitter=20-=20=D1=83=D0=BB=D1=83?= =?UTF-8?q?=D1=87=D1=88=D0=B5=D0=BD=20=D0=BF=D0=B0=D1=80=D1=81=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3=20DTS-HD=20=D0=B4=D0=BE=D1=80=D0=BE=D0=B6=D0=B5=D0=BA.?= =?UTF-8?q?=20=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD=D1=8B=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20DTS-HD=20HRA=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D1=8F=20-=20=D1=82=D0=B0?= =?UTF-8?q?=D0=BA=20=D0=B6=D0=B5=20=D1=83=D1=87=D0=B8=D1=82=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=B5=D0=BC=20=D0=B8=20DTS:X=20=D0=BF=D1=80=D0=BE=D1=84?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=20(=D1=8D=D1=82=D0=BE=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D0=B5=D1=87=D0=BD=D0=BE=20=D1=85=D0=BE=D1=82=D1=8C=20=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=BA=D0=BE=D1=81=D1=82=D1=8C,=20=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=B1=D1=8B=D0=B2=D0=B0=D0=B5=D1=82).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parser/MP4Splitter/MP4Splitter.cpp | 4 +- .../MatroskaSplitter/MatroskaSplitter.cpp | 2 +- .../parser/MpegSplitter/MpegSplitter.cpp | 16 +++-- .../parser/MpegSplitter/MpegSplitterFile.cpp | 65 ++++++++++++++----- .../parser/MpegSplitter/MpegSplitterFile.h | 6 ++ .../source/DTSAC3Source/DTSAC3Source.cpp | 4 +- .../transform/MpaDecFilter/MpaDecFilter.cpp | 18 +++-- 7 files changed, 83 insertions(+), 32 deletions(-) diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp index f15e805da7..f81eee6d08 100644 --- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp +++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp @@ -693,7 +693,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) wfe->wBitsPerSample = aframe.param1; } wfe->nBlockAlign = (wfe->nChannels * wfe->wBitsPerSample) / 8; - if (aframe.param2 == DCA_PROFILE_HD_HRA) { + if (aframe.param2 == DCA_PROFILE_HD_HRA || aframe.param2 == DCA_PROFILE_HD_HRA_X || aframe.param2 == DCA_PROFILE_HD_HRA_X_IMAX) { wfe->nAvgBytesPerSec += CalcBitrate(aframe) / 8; } else { wfe->nAvgBytesPerSec = 0; @@ -1820,7 +1820,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) wfe->wBitsPerSample = aframe.param1; } wfe->nBlockAlign = (wfe->nChannels * wfe->wBitsPerSample) / 8; - if (aframe.param2 == DCA_PROFILE_HD_HRA) { + if (aframe.param2 == DCA_PROFILE_HD_HRA || aframe.param2 == DCA_PROFILE_HD_HRA_X || aframe.param2 == DCA_PROFILE_HD_HRA_X_IMAX) { // DTS-HD High Resolution Audio wfe->nAvgBytesPerSec += CalcBitrate(aframe) / 8; } else { diff --git a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp index 830d0ff49e..79228b9ed9 100644 --- a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp +++ b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp @@ -1254,7 +1254,7 @@ HRESULT CMatroskaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) wfe->wBitsPerSample = aframe.param1; } wfe->nBlockAlign = wfe->nChannels * wfe->wBitsPerSample / 8; - if (aframe.param2 == DCA_PROFILE_HD_HRA) { + if (aframe.param2 == DCA_PROFILE_HD_HRA || aframe.param2 == DCA_PROFILE_HD_HRA_X || aframe.param2 == DCA_PROFILE_HD_HRA_X_IMAX) { wfe->nAvgBytesPerSec += CalcBitrate(aframe) / 8; } else { wfe->nAvgBytesPerSec = 0; diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 92bfbf0220..dffc1e1eef 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -398,10 +398,18 @@ static CString GetMediaTypeDesc(const CMediaType *pMediaType, const CHdmvClipInf } break; case WAVE_FORMAT_DTS2: { - if (pPresentationDesc) { - Infos.emplace_back(pPresentationDesc); - } else { - Infos.emplace_back(L"DTS"); + CStringW codecName; + if (pInfo->cbSize == 1) { + const auto profile = (reinterpret_cast(pInfo + 1))[0]; + GetDTSHDDescription(profile, codecName); + Infos.emplace_back(codecName); + } + if (codecName.IsEmpty()) { + if (pPresentationDesc) { + Infos.emplace_back(pPresentationDesc); + } else { + Infos.emplace_back(L"DTS"); + } } } break; diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp index f6f561692c..f51e37857e 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp @@ -420,9 +420,13 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader) m_pmt_streams.clear(); m_ProgramData.clear(); + mpeg_streams.clear(); avc_streams.clear(); hevc_streams.clear(); + vvc_streams.clear(); + dtshd_streams.clear(); + m_SyncPoints.clear(); Seek(m_posMin); @@ -667,6 +671,8 @@ void CMpegSplitterFile::SearchStreams(const __int64 start, const __int64 stop, c mpeg_streams.clear(); avc_streams.clear(); hevc_streams.clear(); + vvc_streams.clear(); + dtshd_streams.clear(); Seek(start); @@ -1265,6 +1271,14 @@ DWORD CMpegSplitterFile::AddStream(const WORD pid, BYTE pesid, const BYTE ext_id if (Read(h, len, &s.mt, false)) { s.dts.bDTSCore = true; type = stream_type::audio; + + if (pes_stream_type == AUDIO_STREAM_DTS_HD || pes_stream_type == AUDIO_STREAM_DTS_HD_MASTER_AUDIO) { + Seek(start); + auto& h = dtshd_streams[s]; + h.pData.reserve(static_cast(16)* KILOBYTE); + h.pData.resize(static_cast(len)); + ByteRead(h.pData.data(), len); + } } } @@ -1361,29 +1375,46 @@ DWORD CMpegSplitterFile::AddStream(const WORD pid, BYTE pesid, const BYTE ext_id if (pes_stream_type == AUDIO_STREAM_DTS_HD || pes_stream_type == AUDIO_STREAM_DTS_HD_MASTER_AUDIO) { stream* source = (stream*)m_streams[stream_type::audio].GetStream(s); if (source && source->dts.bDTSCore && !source->dts.bDTSHD && source->mt.pbFormat) { - Seek(start); - if (BitRead(32, true) == FCC(DTS_SYNCWORD_SUBSTREAM)) { - BYTE* buf = DNew BYTE[len]; + auto& h = dtshd_streams[s]; + auto size = h.pData.size(); + h.pData.resize(size + len); + ByteRead(h.pData.data() + size, len); + + if (h.pData.size() >= static_cast(16) * KILOBYTE) { + BYTE* start = h.pData.data(); + BYTE* end = start + h.pData.size(); audioframe_t aframe; - if (ByteRead(buf, len) == S_OK && ParseDTSHDHeader(buf, len, &aframe)) { - WAVEFORMATEX* wfe = (WAVEFORMATEX*)source->mt.pbFormat; - wfe->nSamplesPerSec = aframe.samplerate; - wfe->nChannels = aframe.channels; - if (aframe.param1) { - wfe->wBitsPerSample = aframe.param1; - } - if (aframe.param2 == DCA_PROFILE_HD_HRA) { - wfe->nAvgBytesPerSec += CalcBitrate(aframe) / 8; - } else { - wfe->nAvgBytesPerSec = 0; + int size = ParseDTSHeader(start, &aframe); + if (size) { + auto wfe = reinterpret_cast(source->mt.pbFormat); + if (aframe.samples) { + wfe->nAvgBytesPerSec = size * aframe.samplerate / aframe.samples; } + if (start + size + 40 <= end) { + if (ParseDTSHDHeader(start + size, end - start - size, &aframe)) { + wfe->nSamplesPerSec = aframe.samplerate; + wfe->nChannels = aframe.channels; + if (aframe.param1) { + wfe->wBitsPerSample = aframe.param1; + } + wfe->nBlockAlign = wfe->nChannels * wfe->wBitsPerSample / 8; + if (aframe.param2 == DCA_PROFILE_HD_HRA || aframe.param2 == DCA_PROFILE_HD_HRA_X || aframe.param2 == DCA_PROFILE_HD_HRA_X_IMAX) { + wfe->nAvgBytesPerSec += CalcBitrate(aframe) / 8; + } else { + wfe->nAvgBytesPerSec = 0; + } - source->dts.bDTSHD = true; + wfe = reinterpret_cast(source->mt.ReallocFormatBuffer(sizeof(WAVEFORMATEX) + 1)); + wfe->cbSize = 1; + ((BYTE*)(wfe + 1))[0] = aframe.param2; + } + } } - delete [] buf; + + source->dts.bDTSHD = true; } } - } else if (pes_stream_type == AUDIO_STREAM_AC3 || pes_stream_type == AUDIO_STREAM_AC3_PLUS || pes_stream_type == AUDIO_STREAM_EAC3 || pes_stream_type == SECONDARY_AUDIO_AC3_PLUS) { + } else if (pes_stream_type == AUDIO_STREAM_AC3 || pes_stream_type == AUDIO_STREAM_AC3_PLUS || pes_stream_type == AUDIO_STREAM_EAC3 || pes_stream_type == SECONDARY_AUDIO_AC3_PLUS) { stream* source = (stream*)m_streams[stream_type::audio].GetStream(s); if (source && source->mt.pbFormat && source->bParseEAC3SubStream) { Seek(start); diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.h b/src/filters/parser/MpegSplitter/MpegSplitterFile.h index 2124434773..122bde8f43 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.h +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.h @@ -61,6 +61,12 @@ class CMpegSplitterFile : public CBaseSplitterFileEx }; std::map vvc_streams; + struct dtshd_data { + dtshdr h; + std::vector pData; + }; + std::map dtshd_streams; + template class CValidStream { BYTE m_nValidStream = 0; diff --git a/src/filters/source/DTSAC3Source/DTSAC3Source.cpp b/src/filters/source/DTSAC3Source/DTSAC3Source.cpp index 8cf94cb926..3f47d07cd0 100644 --- a/src/filters/source/DTSAC3Source/DTSAC3Source.cpp +++ b/src/filters/source/DTSAC3Source/DTSAC3Source.cpp @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -313,7 +313,7 @@ CDTSAC3Stream::CDTSAC3Stream(const WCHAR* wfn, CSource* pParent, HRESULT* phr) if (HD_size) { m_framesize += HD_size; - if (aframe.param2 == DCA_PROFILE_HD_HRA) { + if (aframe.param2 == DCA_PROFILE_HD_HRA || aframe.param2 == DCA_PROFILE_HD_HRA_X || aframe.param2 == DCA_PROFILE_HD_HRA_X_IMAX) { m_bitrate += CalcBitrate(aframe); } else { m_bitrate = 0; diff --git a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp index c6e274b957..bbb4c71667 100644 --- a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp +++ b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp @@ -1909,9 +1909,12 @@ HRESULT CMpaDecFilter::DeliverBitstream(BYTE* pBuff, const int size, const REFER } break; case IEC61937_DTSHD: - length = m_DTSHDProfile == DCA_PROFILE_HD_HRA ? BS_DTSHD_SIZE / 4 : BS_DTSHD_SIZE; - subtype = m_DTSHDProfile == DCA_PROFILE_HD_HRA ? 2 : 4; - isHDMI = true; + { + bool bIsDTSHDHRA = m_DTSHDProfile == DCA_PROFILE_HD_HRA || m_DTSHDProfile == DCA_PROFILE_HD_HRA_X || m_DTSHDProfile == DCA_PROFILE_HD_HRA_X_IMAX; + length = bIsDTSHDHRA ? BS_DTSHD_SIZE / 4 : BS_DTSHD_SIZE; + subtype = bIsDTSHDHRA ? 2 : 4; + isHDMI = true; + } break; case IEC61937_EAC3: length = BS_EAC3_SIZE; @@ -2195,9 +2198,12 @@ CMediaType CMpaDecFilter::CreateMediaTypeHDMI(WORD type) switch(type) { case IEC61937_DTSHD: - wfex.Format.nChannels = m_DTSHDProfile == DCA_PROFILE_HD_HRA ? 2 : 8; - wfex.dwChannelMask = m_DTSHDProfile == DCA_PROFILE_HD_HRA ? KSAUDIO_SPEAKER_STEREO : KSAUDIO_SPEAKER_7POINT1_SURROUND; - subtype = KSDATAFORMAT_SUBTYPE_IEC61937_DTS_HD; + { + bool bIsDTSHDHRA = m_DTSHDProfile == DCA_PROFILE_HD_HRA || m_DTSHDProfile == DCA_PROFILE_HD_HRA_X || m_DTSHDProfile == DCA_PROFILE_HD_HRA_X_IMAX; + wfex.Format.nChannels = bIsDTSHDHRA ? 2 : 8; + wfex.dwChannelMask = bIsDTSHDHRA ? KSAUDIO_SPEAKER_STEREO : KSAUDIO_SPEAKER_7POINT1_SURROUND; + subtype = KSDATAFORMAT_SUBTYPE_IEC61937_DTS_HD; + } break; case IEC61937_EAC3: wfex.Format.nChannels = 2; From a173afe840ddab5391d18cef8e35ace835fc093f Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Wed, 17 Jul 2024 06:48:21 +0300 Subject: [PATCH 068/102] =?UTF-8?q?SubPic:=20=D0=BA=D0=BE=D1=80=D1=80?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B8=D1=80=D1=83=D0=B5=D0=BC=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20bitmap=20=D1=81?= =?UTF-8?q?=D1=83=D0=B1=D1=82=D0=B8=D1=82=D1=80=D0=BE=D0=B2=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BB=D1=83=D1=87=D0=B0=D0=B5,=20=D0=BA=D0=BE=D0=B3?= =?UTF-8?q?=D0=B4=D0=B0=20=D1=81=D1=83=D0=B1=D1=82=D0=B8=D1=82=D1=80=D1=8B?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D0=BF=D0=BE=D0=BC=D0=B5=D1=89=D0=B0=D1=8E?= =?UTF-8?q?=D1=82=D1=81=D1=8F=20=D0=BD=D0=B0=20=D0=B2=D0=B8=D0=B4=D0=B5?= =?UTF-8?q?=D0=BE=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SubPic/SubPicImpl.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/SubPic/SubPicImpl.cpp b/src/SubPic/SubPicImpl.cpp index 864150c11b..ffa6a78915 100644 --- a/src/SubPic/SubPicImpl.cpp +++ b/src/SubPic/SubPicImpl.cpp @@ -152,8 +152,22 @@ STDMETHODIMP CSubPicImpl::GetSourceAndDest( if (bNeedSpecialCase && !bMatchesAR) { const auto extraHeight = szTarget.cy - m_virtualTextureSize.cy * scaleY; const auto extraWidth = szTarget.cx - m_virtualTextureSize.cx * scaleX; - offset.SetPoint(lround(extraWidth / 2.), lround(extraHeight / 2.)); - rcTemp.OffsetRect(offset); + if (extraHeight != 0.0 || extraWidth != 0.0) { + offset.SetPoint(lround(extraWidth / 2.), lround(extraHeight / 2.)); + rcTemp.OffsetRect(offset); + } + + // shift bitmap subtitles if they go beyond the right/bottom border of the frame + offset.SetPoint(0, 0); + if (rcTemp.right > rcTarget.right) { + offset.x -= (rcTemp.right - rcTarget.right); + } + if (rcTemp.bottom > rcTarget.bottom) { + offset.y -= (rcTemp.bottom - rcTarget.bottom); + } + if (offset.x != 0 || offset.y != 0) { + rcTemp.OffsetRect(offset); + } } rcTemp.OffsetRect(ShiftPos); From a7c53a229080841089c28e37407963b46969fc1c Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 18 Jul 2024 07:08:35 +0300 Subject: [PATCH 069/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20Changelog.Rus.txt=20=D0=B8=20Changelog.txt?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 9 +++++++++ docs/Changelog.txt | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 553653952c..544fc25acf 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -2,6 +2,9 @@ 1.7.2.x dev ============================= +Сплиттеры +Улучшено определение дорожек DTS-HD. + MpegSplitter Улучшена поддержка Dolby Vision Profile 7. @@ -9,10 +12,16 @@ MPCVideoDec Теперь декодер VVdeC используется для видео VVC на процессорах без поддержки SSE4.1. Исправлено преобразование P010 в YV12. Оптимизировано преобразование P010 в NV12 для процессоров без SSE4. +Оптимизирована работа c NVDEC. +Исправлено определение выходного формата для видео FFV1. Плеер Улучшена поддержка перемещения окна свойств файла между дисплеями с разным масштабированием текста. Исправлено запоминания позиции некоторых DVD-Video. +Субтитры добавленные вручную теперь сохраняются в плейлисте. + +Инсталлятор +Для компиляции инсталлятора требуется InnoSetup 6.3.1 или новее. Обновлен румынский перевод (автор Andrei Miloiu). Обновлен корейский перевод (автор Hackjjang). diff --git a/docs/Changelog.txt b/docs/Changelog.txt index c99bda0a74..06c54da8dc 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -2,6 +2,9 @@ 1.7.2.x dev ============================= +Splitters +Improved DTS-HD track detection. + MpegSplitter Improved support for Dolby Vision Profile 7. @@ -9,10 +12,16 @@ MPCVideoDec The VVdeC decoder is now used for VVC video on processors without SSE4.1 support. Fixed P010 to YV12 conversion. Optimized P010 to NV12 conversion for processors without SSE4. +Optimized work with NVDEC. +Fixed output format detection for FFV1 video. Player Improved support for moving the file properties window between displays with different text scaling. Fixed remembering the position of some DVD-Videos. +Subtitles added manually are now saved in the playlist. + +Installer +Compiling the installer requires InnoSetup 6.1.0 or later. Updated Romanian translation (by Andrei Miloiu). Updated Korean translation (by Hackjjang). From b1f2abf071e0799c1a92598ad89c4e419d9b4cdc Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 18 Jul 2024 07:27:44 +0300 Subject: [PATCH 070/102] =?UTF-8?q?MPC=5Fcomponents:=20=D0=9E=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=20MPC=20Video=20Renderer=200.8.5?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distrib/MPC_components | 2 +- distrib/mpc-be_setup.iss | 2 +- docs/Changelog.Rus.txt | 1 + docs/Changelog.txt | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/distrib/MPC_components b/distrib/MPC_components index 1a24dfdabd..ecf0de1c46 160000 --- a/distrib/MPC_components +++ b/distrib/MPC_components @@ -1 +1 @@ -Subproject commit 1a24dfdabda82cba5ed6e4b16fb470c6388bd11f +Subproject commit ecf0de1c46206d90391cd55a61e4f3bab9db43d9 diff --git a/distrib/mpc-be_setup.iss b/distrib/mpc-be_setup.iss index 6cff9ff98c..0a226743d7 100644 --- a/distrib/mpc-be_setup.iss +++ b/distrib/mpc-be_setup.iss @@ -68,7 +68,7 @@ #define Description = app_name + " x64 " + app_version #define VisualElementsManifest = "VisualElements\mpc-be64.VisualElementsManifest.xml" #endif -#define mpcvr_desc = "MPC Video Renderer 0.8.3" +#define mpcvr_desc = "MPC Video Renderer 0.8.5" [Setup] #ifdef Win32Build diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 544fc25acf..09570bf12a 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -22,6 +22,7 @@ MPCVideoDec Инсталлятор Для компиляции инсталлятора требуется InnoSetup 6.3.1 или новее. +Обновлен MPC Video Renderer 0.8.5. Обновлен румынский перевод (автор Andrei Miloiu). Обновлен корейский перевод (автор Hackjjang). diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 06c54da8dc..c3d140d941 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -22,6 +22,7 @@ Subtitles added manually are now saved in the playlist. Installer Compiling the installer requires InnoSetup 6.1.0 or later. +Updated MPC Video Renderer 0.8.5. Updated Romanian translation (by Andrei Miloiu). Updated Korean translation (by Hackjjang). From d89d8637a4028f783833cf50d757dfd5cc90914e Mon Sep 17 00:00:00 2001 From: alexins Date: Mon, 22 Jul 2024 18:31:59 +0200 Subject: [PATCH 071/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5:=20Little-CMS=20git-lcms2.16-60-g1c902?= =?UTF-8?q?1b;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 1 + docs/Changelog.txt | 1 + src/ExtLib/lcms2/src/cmsxform.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 09570bf12a..d53d5cba1a 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -31,6 +31,7 @@ MPCVideoDec Обновлены библиотеки: dav1d 1.4.2-15-g2355eeb; ffmpeg n7.1-dev-1805-g9af348bd1a; + Little-CMS git-lcms2.16-60-g1c9021b; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index c3d140d941..e35f9244af 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -31,6 +31,7 @@ Updated Japanese translation (by tsubasanouta). Updated libraries: dav1d 1.4.2-15-g2355eeb; ffmpeg n7.1-dev-1805-g9af348bd1a; + Little-CMS git-lcms2.16-60-g1c9021b; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/src/ExtLib/lcms2/src/cmsxform.c b/src/ExtLib/lcms2/src/cmsxform.c index 99e9bb96c9..2f8b4e5eca 100644 --- a/src/ExtLib/lcms2/src/cmsxform.c +++ b/src/ExtLib/lcms2/src/cmsxform.c @@ -1070,7 +1070,7 @@ cmsBool IsProperColorSpace(cmsColorSpaceSignature Check, cmsUInt32Number dwForm int Space1 = (int) T_COLORSPACE(dwFormat); int Space2 = _cmsLCMScolorSpace(Check); - if (Space1 == PT_ANY) return TRUE; + if (Space1 == PT_ANY) return (T_CHANNELS(dwFormat) == cmsChannelsOf(Check)); if (Space1 == Space2) return TRUE; if (Space1 == PT_LabV2 && Space2 == PT_Lab) return TRUE; From b731cee86ad2da0c6600a3b60e2bc3f6fb910eaa Mon Sep 17 00:00:00 2001 From: alexins Date: Mon, 22 Jul 2024 18:34:28 +0200 Subject: [PATCH 072/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5:=20MediaInfo=20git-v24.06-10-g88f3ea4a?= =?UTF-8?q?a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 1 + docs/Changelog.txt | 1 + src/ExtLib/MediaInfo/Language/be.csv | 10 +- src/ExtLib/MediaInfo/Language/ca.csv | 8 + src/ExtLib/MediaInfo/Language/cs.csv | 8 + src/ExtLib/MediaInfo/Language/de.csv | 8 + src/ExtLib/MediaInfo/Language/es.csv | 10 +- src/ExtLib/MediaInfo/Language/eu.csv | 8 + src/ExtLib/MediaInfo/Language/fr.csv | 8 + src/ExtLib/MediaInfo/Language/gr.csv | 12 +- src/ExtLib/MediaInfo/Language/hu.csv | 10 +- src/ExtLib/MediaInfo/Language/hy.csv | 10 +- src/ExtLib/MediaInfo/Language/it.csv | 8 + src/ExtLib/MediaInfo/Language/ja.csv | 10 +- src/ExtLib/MediaInfo/Language/ko.csv | 8 + src/ExtLib/MediaInfo/Language/nl.csv | 8 + src/ExtLib/MediaInfo/Language/pl.csv | 10 +- src/ExtLib/MediaInfo/Language/pt-BR.csv | 8 + src/ExtLib/MediaInfo/Language/ro.csv | 10 +- src/ExtLib/MediaInfo/Language/ru.csv | 8 + src/ExtLib/MediaInfo/Language/sk.csv | 10 +- src/ExtLib/MediaInfo/Language/sv.csv | 12 +- src/ExtLib/MediaInfo/Language/tr.csv | 8 + src/ExtLib/MediaInfo/Language/uk.csv | 8 + src/ExtLib/MediaInfo/Language/zh-CN.csv | 8 + src/ExtLib/MediaInfo/Language/zh-TW.csv | 8 + src/ExtLib/MediaInfo/MediaInfo.vcxproj | 4 +- .../MediaInfo/MediaInfo.vcxproj.filters | 6 + .../MediaInfo/MediaInfo/Audio/File_Dat.cpp | 547 ++++++++++++++++++ .../MediaInfo/MediaInfo/Audio/File_Dat.h | 59 ++ .../MediaInfo/MediaInfo/Audio/File_Wvpk.cpp | 33 +- .../MediaInfo/MediaInfo/Audio/File_Wvpk.h | 2 +- .../MediaInfo/MediaInfo/File__Analyze.cpp | 15 +- .../File__Analyze_Streams_Finish.cpp | 11 + .../MediaInfo/File__MultipleParsing.cpp | 7 + .../MediaInfo/MediaInfo/Image/File_Jpeg.cpp | 66 ++- .../MediaInfo/MediaInfo/Image/File_Jpeg.h | 1 + .../MediaInfo/MediaInfo/MediaInfo_Config.cpp | 42 +- .../MediaInfo/MediaInfo/MediaInfo_Config.h | 7 + .../MediaInfo/MediaInfo_Config_Automatic.cpp | 3 +- .../MediaInfo/MediaInfo_Config_MediaInfo.cpp | 80 ++- .../MediaInfo/MediaInfo_Config_MediaInfo.h | 20 +- .../MediaInfo/MediaInfo/MediaInfo_File.cpp | 9 + .../MediaInfo/MediaInfo/MediaInfo_Inform.cpp | 32 +- .../MediaInfo/Multiple/File_Mpeg4.cpp | 44 +- .../MediaInfo/MediaInfo/Multiple/File_Mpeg4.h | 1 + .../Multiple/File_Mpeg4_Elements.cpp | 26 +- .../MediaInfo/Multiple/File_MpegTs.cpp | 8 +- .../MediaInfo/MediaInfo/Multiple/File_Mxf.cpp | 120 +++- .../MediaInfo/MediaInfo/Multiple/File_Mxf.h | 5 + .../MediaInfo/Multiple/File_Riff.cpp | 18 +- .../MediaInfo/Multiple/File_Riff_Elements.cpp | 12 +- src/ExtLib/MediaInfo/MediaInfo/Setup.h | 5 +- .../MediaInfo/MediaInfo/Text/File_Cdp.cpp | 2 +- .../MediaInfo/Text/File_DtvccTransport.cpp | 2 +- .../MediaInfo/MediaInfo/Text/File_Eia608.cpp | 27 +- .../MediaInfo/MediaInfo/Text/File_Eia608.h | 4 +- .../MediaInfo/MediaInfo/Text/File_Eia708.cpp | 24 +- .../MediaInfo/MediaInfo/Text/File_Eia708.h | 3 +- .../MediaInfo/MediaInfo/Text/File_Scte20.cpp | 2 +- .../MediaInfo/MediaInfo/Video/File_Hevc.cpp | 22 +- .../MediaInfo/MediaInfo/Video/File_Hevc.h | 2 +- 62 files changed, 1317 insertions(+), 172 deletions(-) create mode 100644 src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.cpp create mode 100644 src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.h diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index d53d5cba1a..bd48401e6a 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -32,6 +32,7 @@ MPCVideoDec dav1d 1.4.2-15-g2355eeb; ffmpeg n7.1-dev-1805-g9af348bd1a; Little-CMS git-lcms2.16-60-g1c9021b; + MediaInfo git-v24.06-10-g88f3ea4aa; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index e35f9244af..cc25c1a5b7 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -32,6 +32,7 @@ Updated libraries: dav1d 1.4.2-15-g2355eeb; ffmpeg n7.1-dev-1805-g9af348bd1a; Little-CMS git-lcms2.16-60-g1c9021b; + MediaInfo git-v24.06-10-g88f3ea4aa; ResizableLib v1.5.3-8-g25a89da; vvdec v2.3.0-24-gad8f4bb. diff --git a/src/ExtLib/MediaInfo/Language/be.csv b/src/ExtLib/MediaInfo/Language/be.csv index 079ca3ab5e..d35bc0c65d 100644 --- a/src/ExtLib/MediaInfo/Language/be.csv +++ b/src/ExtLib/MediaInfo/Language/be.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Калекцыя Colorimetry;Каларыметрыя ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Асноўныя колеры colour_range; Comment;Каментар @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Суадносіны кадра DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Арыгінальныя суадносіны бакоў +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Распаўсюджвальнік Distributor; Dolby_Atmos_Metadata; @@ -1359,4 +1367,4 @@ WrittenBy;Напісаў Yes;Так Your system;Ваша сістэма ZZ_Automatic_Percent;67 -ZZ_AutomaticLanguage_Percent;72 \ No newline at end of file +ZZ_AutomaticLanguage_Percent;71 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/ca.csv b/src/ExtLib/MediaInfo/Language/ca.csv index f45b314f26..8468babd7f 100644 --- a/src/ExtLib/MediaInfo/Language/ca.csv +++ b/src/ExtLib/MediaInfo/Language/ca.csv @@ -293,6 +293,10 @@ CoDirector;Codirector Collection;Col·lecció Colorimetry;Colorimetria ColorSpace;Espai de color +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Primàries de color colour_range;Gama de color Comment;Comentari @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Relació d'aspecte DisplayAspectRatio_CleanAperture;Relació d'aspecte d'obertura neta DisplayAspectRatio_Original;Relació d'aspecte original +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distribuït per Distributor;Distribuïdor Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/cs.csv b/src/ExtLib/MediaInfo/Language/cs.csv index 69ec9d0ef6..e22c763f34 100644 --- a/src/ExtLib/MediaInfo/Language/cs.csv +++ b/src/ExtLib/MediaInfo/Language/cs.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Collection Colorimetry; ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Komentář @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Poměr stran DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original; +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distributed by Distributor; Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/de.csv b/src/ExtLib/MediaInfo/Language/de.csv index 8543abb141..07cc49263e 100644 --- a/src/ExtLib/MediaInfo/Language/de.csv +++ b/src/ExtLib/MediaInfo/Language/de.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Sammlung Colorimetry;Colorimetrie ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Kommentar @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Bildseitenverhältnis DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Ursprüngliches Bildseitenverhältnis +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Vertrieb durch Distributor; Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/es.csv b/src/ExtLib/MediaInfo/Language/es.csv index 3544024998..3c59013003 100644 --- a/src/ExtLib/MediaInfo/Language/es.csv +++ b/src/ExtLib/MediaInfo/Language/es.csv @@ -293,6 +293,10 @@ CoDirector;Codirector Collection;Colección Colorimetry;Colorimetría ColorSpace;Espacio de color +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Colores primarios colour_range;Rango de color Comment;Comentarios @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Relación de aspecto DisplayAspectRatio_CleanAperture;Relación aspecto abertura limpia DisplayAspectRatio_Original;Relación de aspecto original +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distribuido por Distributor;Distribuidor Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;Escrito en WrittenBy;Escrito por Yes;Sí Your system;Tu sistema -ZZ_Automatic_Percent;69 +ZZ_Automatic_Percent;68 ZZ_AutomaticLanguage_Percent;79 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/eu.csv b/src/ExtLib/MediaInfo/Language/eu.csv index 8a7eeae900..d2ec89573e 100644 --- a/src/ExtLib/MediaInfo/Language/eu.csv +++ b/src/ExtLib/MediaInfo/Language/eu.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Bilduma Colorimetry;Margoneurketa ColorSpace;Margo tartea +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Lehen margoak colour_range; Comment;Aipamena @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Erakuspen ikuspegi maila DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Jatorrizko ikuspegi maila +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Banatzailea Distributor; Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/fr.csv b/src/ExtLib/MediaInfo/Language/fr.csv index 8ae40c837b..7fda12f423 100644 --- a/src/ExtLib/MediaInfo/Language/fr.csv +++ b/src/ExtLib/MediaInfo/Language/fr.csv @@ -293,6 +293,10 @@ CoDirector;Codirecteur Collection;Collection Colorimetry;Colorimétrie ColorSpace;Espace de couleurs +ColorTheme;Thème +ColorTheme_Dark;Thème sombre +ColorTheme_Light;Thème clair +ColorTheme_System;Utiliser la configuration du système colour_primaries;Coordonnées de chromaticité colour_range;Gamme de couleurs Comment;Commentaire @@ -358,6 +362,10 @@ Disabled;Désactivé DisplayAspectRatio;Facteur de forme l/h DisplayAspectRatio_CleanAperture;Ratio, Ouverture propre DisplayAspectRatio_Original;Ratio original l/h +DisplayCaptions;Gestion des flux 608/708 +DisplayCaptions_Command;Quand une commande est détectée +DisplayCaptions_Content;Quand un contenu est détecté +DisplayCaptions_Stream;Même sans contenu ou commande DistributedBy;Distribué par Distributor;Distributeur Dolby_Atmos_Metadata;Métadonnées Dolby Atmos diff --git a/src/ExtLib/MediaInfo/Language/gr.csv b/src/ExtLib/MediaInfo/Language/gr.csv index 29c5c421e9..117f7f47cf 100644 --- a/src/ExtLib/MediaInfo/Language/gr.csv +++ b/src/ExtLib/MediaInfo/Language/gr.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Συλλογή Colorimetry; ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Σχόλιο @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Λόγος εικόνας DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original; +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distributed by Distributor; Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;Τοποθεσία καταγραφής WrittenBy;Γραμμένο από Yes;Ναι Your system;Το σύστημά σας -ZZ_Automatic_Percent;56 -ZZ_AutomaticLanguage_Percent;61 \ No newline at end of file +ZZ_Automatic_Percent;55 +ZZ_AutomaticLanguage_Percent;60 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/hu.csv b/src/ExtLib/MediaInfo/Language/hu.csv index 869204adea..ce57cf0955 100644 --- a/src/ExtLib/MediaInfo/Language/hu.csv +++ b/src/ExtLib/MediaInfo/Language/hu.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Gyűjtemény Colorimetry;Színkódolás ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Megjegyzés @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Képarány DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Eredeti képarány +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Terjesztő Distributor; Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;Írás helye WrittenBy;Írta Yes;igen Your system;Rendszer -ZZ_Automatic_Percent;63 +ZZ_Automatic_Percent;62 ZZ_AutomaticLanguage_Percent;69 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/hy.csv b/src/ExtLib/MediaInfo/Language/hy.csv index af0b24ba4f..491e6761cd 100644 --- a/src/ExtLib/MediaInfo/Language/hy.csv +++ b/src/ExtLib/MediaInfo/Language/hy.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Հավաքածուն Colorimetry;Գույնայնությունը ColorSpace;Գույնային տարածքը +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Հիմնական գույները colour_range; Comment;Մեկնաբանություն @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Կողմերի հարաբերականությունը DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Կողմերի հարաբեր-ը օրիգինալում +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Տարածողը Distributor; Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;Գրելու տեղը WrittenBy;Գրվել է՝ Yes;Այո Your system;Ձեր համակարգը -ZZ_Automatic_Percent;68 +ZZ_Automatic_Percent;67 ZZ_AutomaticLanguage_Percent;72 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/it.csv b/src/ExtLib/MediaInfo/Language/it.csv index d2202377bd..c40db80433 100644 --- a/src/ExtLib/MediaInfo/Language/it.csv +++ b/src/ExtLib/MediaInfo/Language/it.csv @@ -293,6 +293,10 @@ CoDirector;Codirettore Collection;Collezione Colorimetry;Colorimetria ColorSpace;Spazio colore +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Colori primari colour_range;Intervallo colore Comment;Commento @@ -358,6 +362,10 @@ Disabled;Disabilitato/a DisplayAspectRatio;Rapporto aspetto visualizzazione DisplayAspectRatio_CleanAperture;Rapporto aspetto visualizzazione apertura DisplayAspectRatio_Original;Rapporto aspetto originale +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distribuito da Distributor;Distributore Dolby_Atmos_Metadata;Metadati Dolby Atmos diff --git a/src/ExtLib/MediaInfo/Language/ja.csv b/src/ExtLib/MediaInfo/Language/ja.csv index 69550e6190..6564ca419e 100644 --- a/src/ExtLib/MediaInfo/Language/ja.csv +++ b/src/ExtLib/MediaInfo/Language/ja.csv @@ -293,6 +293,10 @@ CoDirector;共同ディレクター Collection;コレクション Colorimetry;測色 ColorSpace;色空間 +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;原色 colour_range;色の範囲 Comment;コメント @@ -358,6 +362,10 @@ Disabled;無効 DisplayAspectRatio;モニターのアスペクト比 DisplayAspectRatio_CleanAperture;表示されるモニターのアスペクト比 (Clean aperture) DisplayAspectRatio_Original;元のモニターのアスペクト比 +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;配給者 Distributor;配給 Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;作成場所 WrittenBy;著者 Yes;はい Your system;システム情報 -ZZ_Automatic_Percent;85 +ZZ_Automatic_Percent;84 ZZ_AutomaticLanguage_Percent;85 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/ko.csv b/src/ExtLib/MediaInfo/Language/ko.csv index 3085b5d01b..448f2de404 100644 --- a/src/ExtLib/MediaInfo/Language/ko.csv +++ b/src/ExtLib/MediaInfo/Language/ko.csv @@ -293,6 +293,10 @@ CoDirector; Collection;콜렉션 Colorimetry;색체계 ColorSpace; +ColorTheme;테마 +ColorTheme_Dark;어둠 +ColorTheme_Light;밝음 +ColorTheme_System;시스템 설정 사용 colour_primaries; colour_range; Comment;주석 @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;화면 종횡비 DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;원본 화면 종횡비 +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;배포 Distributor; Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/nl.csv b/src/ExtLib/MediaInfo/Language/nl.csv index 160283131a..d7ccaa4e24 100644 --- a/src/ExtLib/MediaInfo/Language/nl.csv +++ b/src/ExtLib/MediaInfo/Language/nl.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Collectie Colorimetry; Colorimetrie ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Commentaar @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Beeldverhouding DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Originele beeldverhouding +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Gedistribueerd door Distributor; Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/pl.csv b/src/ExtLib/MediaInfo/Language/pl.csv index 13e5305803..bedc221706 100644 --- a/src/ExtLib/MediaInfo/Language/pl.csv +++ b/src/ExtLib/MediaInfo/Language/pl.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Kolekcja Colorimetry;Kolorymetria ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Komentarz @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Proporcje obrazu DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Oryginalne proporcje obrazu +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Rozpowszechnianie Distributor; Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;Lokalizacja WrittenBy;Napisał Yes;Tak Your system;System -ZZ_Automatic_Percent;59 +ZZ_Automatic_Percent;58 ZZ_AutomaticLanguage_Percent;70 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/pt-BR.csv b/src/ExtLib/MediaInfo/Language/pt-BR.csv index ee8735091e..d625455e7a 100644 --- a/src/ExtLib/MediaInfo/Language/pt-BR.csv +++ b/src/ExtLib/MediaInfo/Language/pt-BR.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Coleção Colorimetry;Colorimetria ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Comentário @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Proporção da imagem DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Proporção original da imagem +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distribuído por Distributor; Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/ro.csv b/src/ExtLib/MediaInfo/Language/ro.csv index cca3ec3607..25a2b04b41 100644 --- a/src/ExtLib/MediaInfo/Language/ro.csv +++ b/src/ExtLib/MediaInfo/Language/ro.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Colectie Colorimetry; ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Comentariu @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Raport imagine DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original; +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distribuit de Distributor; Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;Locul mesajului WrittenBy;Scris de Yes;Da Your system;Sistemul dvs -ZZ_Automatic_Percent;25 +ZZ_Automatic_Percent;24 ZZ_AutomaticLanguage_Percent;54 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/ru.csv b/src/ExtLib/MediaInfo/Language/ru.csv index 3e08b5ee9f..55aa0b1242 100644 --- a/src/ExtLib/MediaInfo/Language/ru.csv +++ b/src/ExtLib/MediaInfo/Language/ru.csv @@ -293,6 +293,10 @@ CoDirector;Содиректор Collection;Коллекция Colorimetry;Колориметрия ColorSpace;Цветовое пространство +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Основные цвета colour_range;Цветовой диапазон Comment;Примечание @@ -358,6 +362,10 @@ Disabled;Отключено DisplayAspectRatio;Соотношение сторон дисплея DisplayAspectRatio_CleanAperture;Соотношение сторон дисплея чистой апертуры DisplayAspectRatio_Original;Соотношение сторон дисплея оригинала +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Распространитель Distributor;Распространитель Dolby_Atmos_Metadata;Метаданные Dolby Atmos diff --git a/src/ExtLib/MediaInfo/Language/sk.csv b/src/ExtLib/MediaInfo/Language/sk.csv index cb19c9c0f9..2b86787cf3 100644 --- a/src/ExtLib/MediaInfo/Language/sk.csv +++ b/src/ExtLib/MediaInfo/Language/sk.csv @@ -293,6 +293,10 @@ CoDirector; Collection;Collection Colorimetry; ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries; colour_range; Comment;Komentár @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Pomer strán DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Pôvodný pomer strán pre zobrazenie +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distribútor Distributor; Dolby_Atmos_Metadata; @@ -1359,4 +1367,4 @@ WrittenBy;Napísal Yes;Áno Your system;Váš systém ZZ_Automatic_Percent;59 -ZZ_AutomaticLanguage_Percent;64 \ No newline at end of file +ZZ_AutomaticLanguage_Percent;63 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/sv.csv b/src/ExtLib/MediaInfo/Language/sv.csv index 64d2316295..3d1a52e1e4 100644 --- a/src/ExtLib/MediaInfo/Language/sv.csv +++ b/src/ExtLib/MediaInfo/Language/sv.csv @@ -293,6 +293,10 @@ CoDirector;Medregisör Collection;Samling Colorimetry;Kolorimetri ColorSpace;Färgrymd +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Primärfärger colour_range;Färgskala Comment;Kommentar @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;Skärmbildförhållande DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;Ursprungligt skärmbildförhållande +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Distribuerad av Distributor;Distributör Dolby_Atmos_Metadata; @@ -1358,5 +1366,5 @@ Written_Location;Ort WrittenBy;Skrivet av Yes;Ja Your system;Ditt system -ZZ_Automatic_Percent;78 -ZZ_AutomaticLanguage_Percent;79 \ No newline at end of file +ZZ_Automatic_Percent;77 +ZZ_AutomaticLanguage_Percent;78 \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/Language/tr.csv b/src/ExtLib/MediaInfo/Language/tr.csv index 5b866bf4e7..d11d1439ef 100644 --- a/src/ExtLib/MediaInfo/Language/tr.csv +++ b/src/ExtLib/MediaInfo/Language/tr.csv @@ -293,6 +293,10 @@ CoDirector;Yardımcı Yönetmen Collection;Koleksiyon Colorimetry;Renkölçüm ColorSpace;Renk alanı +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Renk öncelikleri colour_range;Renk aralığı Comment;Yorum @@ -358,6 +362,10 @@ Disabled;Etkisizleştirildi DisplayAspectRatio;Görüntü en-boy oranı DisplayAspectRatio_CleanAperture;Temiz diyafram görüntüsü en-boy oranı DisplayAspectRatio_Original;Orijinal görüntü en-boy oranı +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Dağıtan Distributor;Dağıtıcı Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/Language/uk.csv b/src/ExtLib/MediaInfo/Language/uk.csv index 855d741c0a..80bb641ab1 100644 --- a/src/ExtLib/MediaInfo/Language/uk.csv +++ b/src/ExtLib/MediaInfo/Language/uk.csv @@ -293,6 +293,10 @@ CoDirector;Содиректор Collection;Колекція Colorimetry;Колориметрія ColorSpace;Простір кольору +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;Основні кольори colour_range;Діапазон кольору Comment;Примітка @@ -358,6 +362,10 @@ Disabled;Відключено DisplayAspectRatio;Співвідношення сторін дисплея DisplayAspectRatio_CleanAperture;Співвідношення сторін дисплея чистої апертури DisplayAspectRatio_Original;Співвідношення сторін дисплея оригіналу +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;Розповсюджувач Distributor;Розповсюджувач Dolby_Atmos_Metadata;Метадані Dolby Atmos diff --git a/src/ExtLib/MediaInfo/Language/zh-CN.csv b/src/ExtLib/MediaInfo/Language/zh-CN.csv index e03baeee5f..707716cb73 100644 --- a/src/ExtLib/MediaInfo/Language/zh-CN.csv +++ b/src/ExtLib/MediaInfo/Language/zh-CN.csv @@ -293,6 +293,10 @@ CoDirector;联合导演 Collection;系列 Colorimetry;比色法 ColorSpace;色彩空间 +ColorTheme;主题 +ColorTheme_Dark;深色 +ColorTheme_Light;浅色 +ColorTheme_System;用系统设置 colour_primaries;色彩原色 colour_range;色彩范围 Comment;注释 @@ -358,6 +362,10 @@ Disabled;禁用 DisplayAspectRatio;画面比例 DisplayAspectRatio_CleanAperture;干净光圈画面比例 DisplayAspectRatio_Original;原始画面比例 +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;发行商 Distributor;发行商 Dolby_Atmos_Metadata;杜比全景声元数据 diff --git a/src/ExtLib/MediaInfo/Language/zh-TW.csv b/src/ExtLib/MediaInfo/Language/zh-TW.csv index f45fa6ca23..cb15054209 100644 --- a/src/ExtLib/MediaInfo/Language/zh-TW.csv +++ b/src/ExtLib/MediaInfo/Language/zh-TW.csv @@ -293,6 +293,10 @@ CoDirector; Collection;收藏 Colorimetry;比色法 ColorSpace; +ColorTheme; +ColorTheme_Dark; +ColorTheme_Light; +ColorTheme_System; colour_primaries;色彩原色 colour_range; Comment;註釋 @@ -358,6 +362,10 @@ Disabled; DisplayAspectRatio;顯示長寬比例 DisplayAspectRatio_CleanAperture; DisplayAspectRatio_Original;原始顯示長寬比例 +DisplayCaptions; +DisplayCaptions_Command; +DisplayCaptions_Content; +DisplayCaptions_Stream; DistributedBy;發布者 Distributor; Dolby_Atmos_Metadata; diff --git a/src/ExtLib/MediaInfo/MediaInfo.vcxproj b/src/ExtLib/MediaInfo/MediaInfo.vcxproj index b5350f697c..972a3cda2d 100644 --- a/src/ExtLib/MediaInfo/MediaInfo.vcxproj +++ b/src/ExtLib/MediaInfo/MediaInfo.vcxproj @@ -41,7 +41,7 @@ .;ThirdParty/base64;ThirdParty/tinyxml2;ThirdParty/MD5;../ZenLib;../zlib;%(AdditionalIncludeDirectories) - _LIB;MEDIAINFO_XML_YES;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_DVDIF_ANALYZE_NO;%(PreprocessorDefinitions) + _LIB;MEDIAINFO_XML_YES;MEDIAINFO_MINIMAL_YES;MEDIAINFO_ADVANCED_NO;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_DVDIF_ANALYZE_NO;%(PreprocessorDefinitions) TurnOffAllWarnings Use MediaInfo/PreComp.h @@ -69,6 +69,7 @@ + @@ -316,6 +317,7 @@ + diff --git a/src/ExtLib/MediaInfo/MediaInfo.vcxproj.filters b/src/ExtLib/MediaInfo/MediaInfo.vcxproj.filters index 9ea49ecd1d..4828191420 100644 --- a/src/ExtLib/MediaInfo/MediaInfo.vcxproj.filters +++ b/src/ExtLib/MediaInfo/MediaInfo.vcxproj.filters @@ -773,6 +773,9 @@ Header Files\Video + + Header Files\Audio + @@ -1492,5 +1495,8 @@ Source Files\Video + + Source Files\Audio + \ No newline at end of file diff --git a/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.cpp b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.cpp new file mode 100644 index 0000000000..35083f637b --- /dev/null +++ b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.cpp @@ -0,0 +1,547 @@ +/* Copyright (c) MediaArea.net SARL. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license that can + * be found in the License.html file in the root of the source tree. + */ + +//--------------------------------------------------------------------------- +// Digital Audio Tape +// https://nixdoc.net/man-pages/IRIX/man4/datframe.4.html +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Pre-compilation +#include "MediaInfo/PreComp.h" +#ifdef __BORLANDC__ + #pragma hdrstop +#endif +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +#include "MediaInfo/Setup.h" +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +#if defined(MEDIAINFO_DAT_YES) +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +#include "MediaInfo/Audio/File_Dat.h" +#include "MediaInfo/MediaInfo_Config_MediaInfo.h" +#include "MediaInfo/TimeCode.h" +using namespace ZenLib; +using namespace std; +//--------------------------------------------------------------------------- + +namespace MediaInfoLib +{ + +//*************************************************************************** +// Constants +//*************************************************************************** + +//--------------------------------------------------------------------------- +static const char* Dat_pack_id[] = +{ + "Program Time", + "Absolute Time", + "Running Time", + "Table of Contents", + "Date", + "Catalog Number", + "International Standard Recording Code", + "Pro Binary", +}; +const auto Dat_pack_id_size = sizeof(Dat_pack_id) / sizeof(*Dat_pack_id); + +//--------------------------------------------------------------------------- +static const char* Dat_fmtid[4] = +{ + "for audio use", + nullptr, + nullptr, + nullptr, +}; + +//--------------------------------------------------------------------------- +static const char* Dat_emphasis[4] = +{ + "off", + "50/15 ms", + nullptr, + nullptr, +}; + +//--------------------------------------------------------------------------- +static const int16u Dat_sampfreq[4] = +{ + 48000, + 44100, + 32000, + 0, +}; + +//--------------------------------------------------------------------------- +static const int8u Dat_numchans[4] = +{ + 2, + 4, + 0, + 0, +}; + +//--------------------------------------------------------------------------- +static const int8u Dat_quantization[4] = +{ + 16, + 12, + 0, + 0, +}; + +//--------------------------------------------------------------------------- +static const char* Dat_trackpitch[4] = +{ + "Normal", + "Wide", + nullptr, + nullptr, +}; + +//--------------------------------------------------------------------------- +static const char* Dat_copy[4] = +{ + "Yes", + nullptr, + "No", + nullptr, +}; + +//--------------------------------------------------------------------------- +static const char* Dat_sid[4] = +{ + "SMPTE", + "Local Pro DIO", + "Time-of-day Pro DIO", + nullptr, +}; + +//--------------------------------------------------------------------------- +static const float Dat_xrate[8] = +{ + 30, + 30 / 1.001, // NDF + 30 / 1.001, // DF + 25, + 24, + 0, + 0, + 0, +}; + +//--------------------------------------------------------------------------- +enum items { + item_emphasis, + item_sampfreq, + item_numchans, + item_quantization, + item_Max, +}; + +//--------------------------------------------------------------------------- +class file_dat_frame { +public: + TimeCode TCs[7] = {}; + int8u TC_IDs[7] = {}; + int16u dtsubid_pno = (int16u)-1; +}; +class file_dat_priv { +public: + file_dat_frame Frame_First; + file_dat_frame Frame_Last; + int8u Items[item_Max][4] = {}; + int8u Frame_Count_Valid = 32; // Mini 31 frames for catching wrong pro time codes +}; + +//*************************************************************************** +// Constructor/Destructor +//*************************************************************************** + +//--------------------------------------------------------------------------- +File_Dat::File_Dat() +: File__Analyze() +{ + //Configuration + #if MEDIAINFO_TRACE + Trace_Layers_Update(8); //Stream + #endif //MEDIAINFO_TRACE + Frame_Count_NotParsedIncluded=0; +} + +//--------------------------------------------------------------------------- +File_Dat::~File_Dat() +{ + delete Priv; +} + +//*************************************************************************** +// Streams management +//*************************************************************************** + +//--------------------------------------------------------------------------- +void File_Dat::Streams_Accept() +{ + auto Conditional = [&](int8u* Values) { + int Max_Pos = 0; + int Max_Value = 0; + for (size_t i = 0; i < 4; i++) { + if (Max_Value < Values[i]) { + Max_Value = Values[i]; + Max_Pos = i; + } + } + Max_Value >>= 2; + for (size_t i = 0; i < 4; i++) { + if (Max_Value < Values[i] && i != Max_Pos) { + return -1; + } + } + return Max_Pos; + }; + auto Conditional_Int8 = [&](audio Field, items Item, const int8u Array[]) { + auto Index = Conditional(Priv->Items[Item]); + if (Index >= 0) { + if (Array[Index]) { + Fill(Stream_Audio, 0, Field, Array[Index]); + } + else { + Fill(Stream_Audio, 0, Field, "Value" + to_string(Index)); + } + } + }; + auto Conditional_Int16 = [&](audio Field, items Item, const int16u Array[]) { + auto Index = Conditional(Priv->Items[Item]); + if (Index >= 0) { + if (Array[Index]) { + Fill(Stream_Audio, 0, Field, Array[Index]); + } + else { + Fill(Stream_Audio, 0, Field, "Value" + to_string(Index)); + } + } + }; + auto Conditional_Char = [&](audio Field, items Item, const char* Array[]) { + auto Index = Conditional(Priv->Items[Item]); + if (Index >= 0) { + if (Array[Index]) { + Fill(Stream_Audio, 0, Field, Array[Index]); + } + else { + Fill(Stream_Audio, 0, Field, "Value" + to_string(Index)); + } + } + }; + auto Conditional_TimeCode = [&](size_t i) { + if (!Priv->Frame_First.TC_IDs[i]) { + return; + } + Stream_Prepare(Stream_Other); + TimeCode& First = Priv->Frame_First.TCs[i]; + if (First.IsValid()) { + TimeCode& Last = Priv->Frame_Last.TCs[i]; + if (Last.IsValid()) { + First.SetFramesMax(Last.GetFramesMax()); + First.SetDropFrame(Last.IsDropFrame()); + First.Set1001fps(Last.Is1001fps()); + } + Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code"); + Fill(Stream_Other, StreamPos_Last, Other_Format, "SMPTE TC"); + Fill(Stream_Other, StreamPos_Last, Other_MuxingMode, Dat_pack_id[Priv->Frame_First.TC_IDs[i] - 1]); + Fill(Stream_Other, StreamPos_Last, Other_BitRate, 0); + Fill(Stream_Other, StreamPos_Last, Other_TimeCode_FirstFrame, First.ToString()); + Fill(Stream_Other, StreamPos_Last, Other_FrameRate, First.GetFramesMax() == 33 ? (100.0 / 3.0) : First.GetFrameRate()); + } + }; + + Fill(Stream_General, 0, General_Format, "DAT"); + Stream_Prepare(Stream_Audio); + Fill(Stream_Audio, 0, Audio_Format, "PCM"); + Fill(Stream_Audio, 0, Audio_BitRate, float32_int64s(1536000 * 441 / 480)); + if (File_Size != (int64u)-1) { + Fill(Stream_Audio, 0, Audio_StreamSize, float32_int64s((((float)File_Size / 5822) * 5760) * 441 / 480), 0); + } + Conditional_Char(Audio_Format_Settings_Emphasis, item_emphasis, Dat_emphasis); + Conditional_Int16(Audio_SamplingRate, item_sampfreq, Dat_sampfreq); + Conditional_Int8(Audio_Channel_s_, item_numchans, Dat_numchans); + Conditional_Int8(Audio_BitDepth, item_quantization, Dat_quantization); + for (int i = 0; i < 7; i++) { + Conditional_TimeCode(i); + } +} + +//--------------------------------------------------------------------------- +void File_Dat::Streams_Finish() +{ + auto Conditional_TimeCode = [&](size_t i, size_t& StreamPos) { + if (!Priv->Frame_First.TC_IDs[i]) { + return; + } + TimeCode& Last = Priv->Frame_Last.TCs[i]; + if (Last.IsValid()) { + TimeCode& First = Priv->Frame_First.TCs[i]; + if (First.IsValid()) { + Last.SetFramesMax(First.GetFramesMax()); + Last.SetDropFrame(First.IsDropFrame()); + Last.Set1001fps(First.Is1001fps()); + } + Fill(Stream_Other, StreamPos, Other_TimeCode_LastFrame, Last.ToString()); + } + StreamPos++; + }; + + size_t StreamPos = 0; + for (int i = 0; i < 7; i++) { + Conditional_TimeCode(i, StreamPos); + } +} + +//*************************************************************************** +// Buffer - Global +//*************************************************************************** + +//--------------------------------------------------------------------------- +void File_Dat::Read_Buffer_Unsynched() +{ + if (Priv) { + Priv->Frame_Last = {}; + } + FrameInfo = frame_info(); +} + +//*************************************************************************** +// Buffer - Per element +//*************************************************************************** + +//--------------------------------------------------------------------------- +void File_Dat::Header_Parse() +{ + Header_Fill_Size(5822); + Header_Fill_Code(0, "dtframe"); +} + +//*************************************************************************** +// Elements +//*************************************************************************** + +//--------------------------------------------------------------------------- +void File_Dat::Data_Parse() +{ + Skip_XX(5760, "audio"); + Element_Begin1("dtsubcode"); + BS_Begin(); + size_t numpacks_Min = 0; + auto Frame = Priv ? Priv->Frame_Last : file_dat_frame(); + for (int i = 0; i < 7; i++) { + auto ParityCheck_Cur = Buffer + (size_t)(Buffer_Offset + Element_Offset); + auto ParityCheck_End = ParityCheck_Cur + 8; + int8u Parity = 0; + for (; ParityCheck_Cur < ParityCheck_End; ParityCheck_Cur++) { + Parity ^= *ParityCheck_Cur; + } + Element_Begin1("dtsubcodepack"); + int8u id; + Get_S1(4, id, "id"); Element_Info1C(id && id <= Dat_pack_id_size, Dat_pack_id[id - 1]); + if (id) { + numpacks_Min++; + } + switch (id) { + case 0: + Skip_BS(52, "padding"); + break; + case 2: + case 3: + Frame.TC_IDs[i] = id; + dttimepack(Frame.TCs[i]); + break; + default: + Skip_BS(52, "(Unknown)"); + } + Skip_S1( 8, "parity"); + if (Parity) { + Trusted_IsNot("parity"); + } + Element_End0(); + } + Element_Begin1("dtsubid"); + int8u dataid, pno1, numpacks, pno2, pno3; + Skip_SB( "ctrlid - Priority ID"); + Skip_SB( "ctrlid - Start ID"); + Skip_SB( "ctrlid - Shortening ID"); + Skip_SB( "ctrlid - TOC ID"); + Get_S1 ( 4, dataid, "dataid"); + Get_S1 ( 4, pno1, "pno (program number) - 1"); + Get_S1 ( 4, numpacks, "numpacks"); + Get_S1 ( 4, pno2, "pno (program number) - 2"); + Get_S1 ( 4, pno3, "pno (program number) - 3"); + Info_S1( 8, ipf, "ipf (interpolation flags)"); + Skip_Flags(ipf, 6, "left ipf"); + Skip_Flags(ipf, 7, "right ipf"); + int16u pno = ((int16u)pno1 << 8) | (pno2 << 4) | pno3; + auto pno_IsSpecial_Check = [](int8u pno) { + return pno == 0xAA || pno == 0xBB || pno == 0xEE; + }; + bool pno_CurrentIsSpecial = pno_IsSpecial_Check(pno); + bool pno_IsValid = false; + if ((pno1 < 8 && pno2 < 10 && pno3 < 10) || pno_CurrentIsSpecial) { // pno is BCD or 0x0AA meaning unknown or 0x0BB meaning lead-in or 0x0EE meaning lead-out + bool pno_PreviousIsSpecial = pno_IsSpecial_Check(Frame.dtsubid_pno); + if (pno_CurrentIsSpecial || pno_PreviousIsSpecial || pno == Frame.dtsubid_pno + 1) { + pno_IsValid = true; + } + Frame.dtsubid_pno = pno; + } + if (dataid || numpacks >= 8 || numpacks < numpacks_Min || !pno_IsValid) { + Trusted_IsNot("dtsubid"); + } + Element_End0(); + Element_Begin1("dtmainid"); + int8u fmtid, emphasis, sampfreq, numchans, quantization; + Get_S1 ( 2, fmtid, "fmtid"); Param_Info1C(Dat_fmtid[fmtid], Dat_fmtid[fmtid]); + Get_S1 ( 2, emphasis, "emphasis"); Param_Info1C(Dat_emphasis[emphasis], Dat_emphasis[emphasis]); + Get_S1 ( 2, sampfreq, "sampfreq"); Param_Info2C(Dat_sampfreq[sampfreq], Dat_sampfreq[sampfreq], " Hz"); + Get_S1 ( 2, numchans, "numchans"); Param_Info2C(Dat_numchans[numchans], Dat_numchans[numchans], " channels"); + Get_S1 ( 2, quantization, "quantization"); Param_Info2C(Dat_quantization[quantization], Dat_quantization[quantization], "bits"); + Info_S1( 2, trackpitch, "trackpitch"); Param_Info1C(Dat_trackpitch[trackpitch], Dat_trackpitch[trackpitch]); + Info_S1( 2, copy, "copy"); Param_Info1C(Dat_copy[copy], Dat_copy[copy]); + Skip_S1( 2, "pack"); + if (fmtid) { + Trusted_IsNot("dtmainid"); + } + Element_End0(); + BS_End(); + Element_End0(); + + FILLING_BEGIN(); + Element_Info1C(Frame_Count_NotParsedIncluded != (int64u)-1, __T("Frame ") + Ztring::ToZtring(Frame_Count_NotParsedIncluded)); + Element_Info1C((FrameInfo.PTS!=(int64u)-1), __T("PTS ")+Ztring().Duration_From_Milliseconds(float64_int64s(((float64)FrameInfo.PTS)/1000000))); + if (Frame_Count_NotParsedIncluded != (int64u)-1) { + Frame_Count_NotParsedIncluded++; + } + + if (!Status[IsAccepted]) { + if (!Priv) { + Priv = new file_dat_priv; + } + if (!Frame_Count) { + Priv->Frame_First = Frame; + } + Priv->Items[item_emphasis][emphasis]++; + Priv->Items[item_sampfreq][sampfreq]++; + Priv->Items[item_numchans][numchans]++; + Priv->Items[item_quantization][quantization]++; + + Frame_Count++; + if (Frame_Count >= Priv->Frame_Count_Valid) + { + Accept(); + Fill(); + if (!IsSub && Config->ParseSpeed < 1.0 && File_Offset + Buffer_Offset < File_Size / 2) + { + if (File_Size != (int64u)-1) { + Open_Buffer_Unsynch(); + GoTo((((File_Size) / 5822) - 1) * 5822); + } + else { + Finish(); + } + + } + } + + } + Priv->Frame_Last = Frame; + FILLING_ELSE(); + if (Priv) { + if (!Frame_Count) { + Priv->Frame_First = {}; + } + Priv->Frame_Last = {}; + } + FILLING_END(); +} + +//*************************************************************************** +// C++ +//*************************************************************************** + +//--------------------------------------------------------------------------- +void File_Dat::dttimepack(TimeCode& TC) +{ + // Parsing + int16u sample; + int8u pno1, pno23, index, h, m, s, f; + bool pro; + Get_SB ( pro, "pro"); + if (pro) { + Skip_SB( "fill"); + Get_S1 ( 2, pno1, "sid"); Param_Info1C(Dat_sid[pno1], Dat_sid[pno1]); + Get_S1 ( 2, pno23, "freq"); Param_Info2C(Dat_sampfreq[pno23], Dat_sampfreq[pno23], " Hz"); + Get_S1 ( 3, index, "xrate"); Param_Info2C(pno23 && Dat_xrate[index], Dat_xrate[index], " fps"); + Get_S2 (11, sample, "sample"); + } + else { + Get_S1 (3, pno1, "pno1"); + Get_BCD( pno23, "pno2", "pno3"); + Get_BCD( index, "index1", "index2"); + } + Element_Begin1("dttimecode"); + Get_BCD( h, "h1", "h2"); + Get_BCD( m, "m1", "m2"); + Get_BCD( s, "s1", "s2"); + Get_BCD( f, "f1", "f2"); + auto FramesMax = TC.GetFramesMax(); + auto FrameMas_Theory = pro ? (index <= 2 ? 29 : (((int32u)Dat_xrate[index]) - 1)) : 33; + if (f > FrameMas_Theory && FramesMax <= FrameMas_Theory) { + //Fill_Conformance("dttimepack", "dttimepack is indicated as pro time code but contains frame numbers as if it is non pro time code"); + FramesMax = 33; + } + else if (FramesMax < FrameMas_Theory) { + FramesMax = FrameMas_Theory; + } + bool IS1001fps = FramesMax != 33 && pro && (index == 1 || index == 2); + TC = TimeCode(h, m, s, f, FramesMax, TimeCode::FPS1001(IS1001fps).DropFrame(IS1001fps && index == 2)); + Element_Info1(TC.ToString()); + Element_End0(); + Element_Info1(TC.ToString()); + Element_Level -= 2; + Element_Info1(TC.ToString()); + Element_Level += 2; + if ((!pro && (pno1 >= 10 || pno23 == (int8u)-1 || index == (int8u)-1)) || (pro && (!Dat_sampfreq[pno23] || (pno23 && !Dat_xrate[index]) || sample >= 1440)) || !TC.IsValid()) { + Trusted_IsNot("dtsubcode dttimecode"); + } +} + +void File_Dat::Get_BCD(int8u& Value, const char* Name0, const char* Name1) +{ + int8u Value0; + Get_S1 (4, Value0, Name0); + Get_S1 (4, Value, Name1); + int8u ValueHex = (Value0 << 4) | Value; + if (ValueHex == 0xAA || ValueHex == 0xBB || ValueHex == 0xEE) { + Value = ValueHex; + } + else if (Value0 >= 10 || Value >= 10) { + Value = (int8u)-1; + } + else { + Value += Value0 * 10; + } +} + +//*************************************************************************** +// C++ +//*************************************************************************** + +} //NameSpace + +#endif //MEDIAINFO_DAT_YES + diff --git a/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.h b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.h new file mode 100644 index 0000000000..b5e1ba78c2 --- /dev/null +++ b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Dat.h @@ -0,0 +1,59 @@ +/* Copyright (c) MediaArea.net SARL. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license that can + * be found in the License.html file in the root of the source tree. + */ + +//--------------------------------------------------------------------------- +#ifndef MediaInfo_File_DatH +#define MediaInfo_File_DatH +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +#include "MediaInfo/Tag/File__Tags.h" +//--------------------------------------------------------------------------- + +namespace ZenLib +{ +class TimeCode; +} + +namespace MediaInfoLib +{ + +//*************************************************************************** +// Class File_Dat +//*************************************************************************** + +class file_dat_priv; + +class File_Dat : public File__Analyze +{ +public : + //Constructor/Destructor + File_Dat(); + ~File_Dat(); + +private : + //Streams management + void Streams_Accept(); + void Streams_Finish(); + + //Buffer - Global + void Read_Buffer_Unsynched(); + + //Buffer - Per element + void Header_Parse(); + void Data_Parse(); + + //Helpers + void dttimepack(TimeCode& TC); + void Get_BCD(int8u& Value, const char* Name0, const char* Name1); + + //Temp + file_dat_priv* Priv = nullptr; +}; + +} //NameSpace + +#endif diff --git a/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.cpp b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.cpp index 4ecff62913..1bb8274fb8 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.cpp @@ -154,7 +154,7 @@ void File_Wvpk::Streams_Finish() int64u BitDepth=dsf?1:(Wvpk_Resolution[(resolution1?1:0)*2+(resolution0?1:0)]); int64u Duration=Samples*1000/SamplingRate; int64u CompressedSize=File_Size-TagsSize; - int64u UncompressedSize=Duration*(mono?1:2)*BitDepth*(SamplingRate<<(3*dsf))/8/1000; + int64u UncompressedSize=Duration*(num_channels?num_channels:(mono?1:2))*BitDepth*(SamplingRate<<(3*dsf))/8/1000; float32 CompressionRatio=((float32)UncompressedSize)/CompressedSize; Fill(Stream_Audio, 0, Audio_StreamSize, CompressedSize, 3, true); Fill(Stream_Audio, 0, Audio_Duration, Duration, 10, true); @@ -585,8 +585,8 @@ void File_Wvpk::Data_Parse_Fill() Fill(Stream_Audio, 0, Audio_Codec_Settings, Mode); if (dsf) { - Fill(Stream_Audio, 0, Audio_Format_Settings_Mode, "DSF"); - Fill(Stream_Audio, 0, Audio_Format_Settings, "DSF"); + Fill(Stream_Audio, 0, Audio_Format_Settings_Mode, "DSD"); + Fill(Stream_Audio, 0, Audio_Format_Settings, "DSD"); } if (correction) Fill(Stream_Audio, 0, Audio_Format_AdditionalFeatures, "Correction"); @@ -613,7 +613,27 @@ void File_Wvpk::id_07() void File_Wvpk::id_0D() { //Parsing - Get_L1 (num_channels, "num_channels"); + if (Size > 7) + { + //No backward compatibility guaranteed, skipping all + Skip_XX(Size, "(Not parsed)"); + return; + } + int8u num_chans_low8; + Get_L1 (num_chans_low8, "num_channels"); + num_channels = num_chans_low8; + if (Size >= 6) + { + int8u num_chans_high4; + Skip_L1( "num_streams"); + BS_Begin(); + Skip_S1(4, "reserved"); + Get_S1 (4, num_chans_high4, "num_channels (hi)"); + BS_End(); + num_channels |= (num_chans_high4 << 8); + num_channels++; + Param_Info2(num_channels, " channels"); + } switch (Size) { case 1 : @@ -633,12 +653,12 @@ void File_Wvpk::id_0D() } break; case 4 : + case 6 : Get_L3 (channel_mask, "channel_mask"); break; - case 5 : + default: Get_L4 (channel_mask, "channel_mask"); break; - default : Skip_XX(Size, "unknown"); } } @@ -650,6 +670,7 @@ void File_Wvpk::id_0E() Get_L1 (Temp, "framerate multiplier"); if (Temp<31) SamplingRate_Shift=Temp; + Skip_XX(Size-1, "(Not parsed)"); } //--------------------------------------------------------------------------- diff --git a/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.h b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.h index 36f0b9bd0b..9a097807b1 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.h +++ b/src/ExtLib/MediaInfo/MediaInfo/Audio/File_Wvpk.h @@ -78,7 +78,7 @@ private : bool dsf; int8u SamplingRate_Index; int8u SamplingRate_Shift; - int8u num_channels; + int16u num_channels; int32u SamplingRate; int32u channel_mask; int32u Size; diff --git a/src/ExtLib/MediaInfo/MediaInfo/File__Analyze.cpp b/src/ExtLib/MediaInfo/MediaInfo/File__Analyze.cpp index 185ffe7e2e..ad0bbf8dca 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/File__Analyze.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/File__Analyze.cpp @@ -300,13 +300,17 @@ void conformance::Clear_Conformance() #if MEDIAINFO_CONFORMANCE void conformance::Merge_Conformance(bool FromConfig) { + auto Limit = MediaInfoLib::Config.Conformance_Limit_Get(); + if (!Limit) { + return; + } for (size_t Level = 0; Level < Conformance_Max; Level++) { auto& Conformance = ConformanceErrors[Level]; auto& Conformance_Total = ConformanceErrors_Total[Level]; for (const auto& FieldValue : Conformance) { auto Current = find(Conformance_Total.begin(), Conformance_Total.end(), FieldValue); if (Current != Conformance_Total.end()) { - if (Current->FramePoss.size() < 32) { + if (Current->FramePoss.size() < Limit) { if (FromConfig) { Current->FramePoss.insert(Current->FramePoss.begin(), { (int64u)-2 }); } @@ -321,19 +325,19 @@ void conformance::Merge_Conformance(bool FromConfig) Current->FramePoss.push_back({ Frame_Count, Frame_Count_NotParsedIncluded, FieldValue.FramePoss[0].SubFramePos_Min, PTS, File_Offset }); } } - else if (Current->FramePoss.size() == 32) + else if (Current->FramePoss.size() == Limit) Current->FramePoss.push_back({}); //Indicating "..." continue; } if (!CheckIf(FieldValue.Flags)) { continue; } - if (Conformance_Total.size() < 32) { + if (Conformance_Total.size() < Limit) { Conformance_Total.push_back(FieldValue); Conformance_Total.back().FramePoss.front() = { FromConfig ? ((int64u)-2) : Frame_Count, FromConfig ? ((int64u)-1) : Frame_Count_NotParsedIncluded, FieldValue.FramePoss[0].SubFramePos_Min, FromConfig ? ((int64u)-1) : PTS, File_Offset }; } else { - if (Conformance_Total.size() == 32) { + if (Conformance_Total.size() == Limit) { field_value TooMany; TooMany.Field = "GeneralCompliance"; TooMany.Value = "[More conformance errors...]"; @@ -1058,7 +1062,7 @@ void File__Analyze::Open_Buffer_Continue (const int8u* ToAdd, size_t ToAdd_Size) //Copying buffer if (ToAdd_Size>0) { - memcpy_Unaligned_Unaligned(Buffer_Temp+Buffer_Size, ToAdd, ToAdd_Size); + memcpy_Unaligned_Unaligned(Buffer_Temp+Buffer_Temp_Size, ToAdd, ToAdd_Size); Buffer_Temp_Size+=ToAdd_Size; } @@ -1962,6 +1966,7 @@ void File__Analyze::Buffer_Clear() } } Buffer_Size=0; + Buffer_Temp=nullptr; Buffer_Temp_Size=0; Buffer_Offset=0; Buffer_Offset_Temp=0; diff --git a/src/ExtLib/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp b/src/ExtLib/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp index 5187df9e1f..3d70aaa93c 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp @@ -1356,6 +1356,7 @@ void File__Analyze::Streams_Finish_StreamOnly_Audio(size_t Pos) for (size_t i=Pos+1; i Ccap_i; + for (int i=31; i>=0; i--) + { + if (Pcap & (1< using namespace ZenLib; using namespace std; //--------------------------------------------------------------------------- @@ -137,7 +138,7 @@ namespace MediaInfoLib { //--------------------------------------------------------------------------- -const Char* MediaInfo_Version=__T("MediaInfoLib - v24.05"); +const Char* MediaInfo_Version=__T("MediaInfoLib - v24.06"); const Char* MediaInfo_Url=__T("http://MediaArea.net/MediaInfo"); Ztring EmptyZtring; //Use it when we can't return a reference to a true Ztring const Ztring EmptyZtring_Const; //Use it when we can't return a reference to a true Ztring, const version @@ -483,6 +484,7 @@ void MediaInfo_Config::Init(bool Force) ThousandsPoint=Ztring(); CarriageReturnReplace=__T(" / "); #if MEDIAINFO_ADVANCED + Conformance_Limit=32; Collection_Trigger=-2; Collection_Display=display_if::Needed; #endif @@ -1455,6 +1457,15 @@ Ztring MediaInfo_Config::Option (const String &Option, const String &Value_Raw) CustomMapping_Set(Value); return Ztring(); } + if (Option_Lower==__T("conformance_limit")) + { + #if MEDIAINFO_CONFORMANCE + Conformance_Limit_Set(Value); + return Ztring(); + #else // MEDIAINFO_CONFORMANCE + return __T("advanced features are disabled due to compilation options"); + #endif // MEDIAINFO_CONFORMANCE + } if (Option_Lower==__T("collection_trigger")) { #if MEDIAINFO_ADVANCED @@ -3536,6 +3547,35 @@ ZtringListList MediaInfo_Config::SubFile_Config_Get () // Collections //*************************************************************************** +//--------------------------------------------------------------------------- +#if MEDIAINFO_CONFORMANCE +Ztring MediaInfo_Config::Conformance_Limit_Set(const Ztring& Value) +{ + int64s ValueI; + auto Value_Lower(Value); + transform(Value_Lower.begin(), Value_Lower.end(), Value_Lower.begin(), (int(*)(int))tolower); //(int(*)(int)) is a patch for unix + if (Value_Lower==__T("inf")) + ValueI=-1; + else + { + ValueI=-Value.To_int64s(); + if ((!ValueI && Value != __T("0")) || ValueI>numeric_limits::max()) + return __T("Invalid Conformance_Limit value"); + } + + CriticalSectionLocker CSL(CS); + Conformance_Limit=(int64u)ValueI; + return {}; +} + +int64u MediaInfo_Config::Conformance_Limit_Get() +{ + CriticalSectionLocker CSL(CS); + + return Conformance_Limit; +} +#endif // MEDIAINFO_CONFORMANCE + //--------------------------------------------------------------------------- #if MEDIAINFO_ADVANCED void MediaInfo_Config::Collection_Trigger_Set(const Ztring& Value) diff --git a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config.h b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config.h index 3b30d54c65..0e97e35077 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config.h +++ b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config.h @@ -334,6 +334,10 @@ public : ZtringListList SubFile_Config_Get (); + #if MEDIAINFO_CONFORMANCE + Ztring Conformance_Limit_Set (const Ztring &Value); + int64u Conformance_Limit_Get (); + #endif //MEDIAINFO_CONFORMANCE #if MEDIAINFO_ADVANCED void Collection_Trigger_Set (const Ztring& Value); int64s Collection_Trigger_Get(); @@ -526,6 +530,9 @@ private : ZtringListList SubFile_Config; + #if MEDIAINFO_CONFORMANCE + int64u Conformance_Limit; + #endif //MEDIAINFO_CONFORMANCE #if MEDIAINFO_ADVANCED int64s Collection_Trigger; display_if Collection_Display; diff --git a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp index 2ae706a798..50e7d9aa3a 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp @@ -1441,6 +1441,7 @@ void MediaInfo_Config_Format (InfoMap &Info) "APT-X100;;;A;Aptx100;;AUD AUE aud aue;;;Lossy\n" "AU;;;A;Au;uLaw/AU Audio File;au;audio/basic\n" "CAF;;;A;Caf;Core Audio Format;caf;audio/x-caf;https://developer.apple.com/library/content/documentation/MusicAudio/Reference/CAFSpec/CAF_overview/CAF_overview.html\n" + "DAT;;;A;;Digital Audio Tape;hda;;;Lossless\n" "DolbyE;;;A;Aes3;;dde\n" "DSDIFF;;;A;Dsdiff;Direct Stream Digital Interchange File Format;dff;;;Lossy\n" "DSD;;;A;;Direct Stream Digital;;;;Lossless\n" @@ -1496,7 +1497,7 @@ void MediaInfo_Config_Format (InfoMap &Info) "ICO;;;I;Ico;;ico;image/vnd.microsoft.icon;;Lossless\n" "JNG;;;I;Jng;JPEG Network Graphic;jng;;;Lossy\n" "JPEG;;;I;Jpeg;;h3d jpeg jpg jpe jps mpo;image/jpeg;;Lossy\n" - "JPEG 2000;;;I;Jpeg;;jp2;image/jp2;http://www.morgan-multimedia.com/JPEG 2000/\n" + "JPEG 2000;;;I;Jpeg;;jp2 jph j2c j2k jhc;image/jp2;http://www.morgan-multimedia.com/JPEG 2000/\n" "LZ77;;;I\n" "MNG;;;I;Mng;Multiple-Image Network Graphic;mng;;;Lossless\n" "PCX;;;I;pcx;Personal Computer eXchange;pcx;image/pcx;;Lossless\n" diff --git a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp index d40c01bf70..bc54e9d74d 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp @@ -134,6 +134,18 @@ const size_t Buffer_NormalSize=/*188*7;//*/64*1024; // Info //*************************************************************************** +const char* DisplayCaptions_Strings[] = +{ + "Command", + "Content", + "Stream", +}; +static_assert(sizeof(DisplayCaptions_Strings) / sizeof(*DisplayCaptions_Strings) == DisplayCaptions_Max, ""); + +//*************************************************************************** +// Class +//*************************************************************************** + MediaInfo_Config_MediaInfo::MediaInfo_Config_MediaInfo() { MediaInfoLib::Config.Init(); //Initialize Configuration @@ -242,9 +254,7 @@ MediaInfo_Config_MediaInfo::MediaInfo_Config_MediaInfo() #if defined(MEDIAINFO_LIBMMS_YES) File_Mmsh_Describe_Only=false; #endif //defined(MEDIAINFO_LIBMMS_YES) - File_Eia608_DisplayEmptyStream=false; - File_Eia708_DisplayEmptyStream=false; - File_CommandOnlyMeansEmpty=false; + DisplayCaptions=DisplayCaptions_Command; File_ProbeCaption_Set({}); State=0; #if defined(MEDIAINFO_AC3_YES) @@ -1239,33 +1249,23 @@ Ztring MediaInfo_Config_MediaInfo::Option (const String &Option, const String &V return __T("Libmms support is disabled due to compilation options"); #endif //defined(MEDIAINFO_LIBMMS_YES) } - else if (Option_Lower==__T("file_eia708_displayemptystream")) + else if (Option_Lower==__T("file_displaycaptions")) { - File_Eia708_DisplayEmptyStream_Set(!(Value==__T("0") || Value.empty())); - return __T(""); + return File_DisplayCaptions_Set(Value); } - else if (Option_Lower==__T("file_eia708_displayemptystream_get")) + else if (Option_Lower==__T("file_eia708_displayemptystream")) { - return File_Eia708_DisplayEmptyStream_Get()?"1":"0"; + return File_DisplayCaptions_Set(Ztring().From_UTF8(DisplayCaptions_Strings[Value==__T("0")?DisplayCaptions_Command:DisplayCaptions_Stream])); } else if (Option_Lower==__T("file_eia608_displayemptystream")) { - File_Eia608_DisplayEmptyStream_Set(!(Value==__T("0") || Value.empty())); - return __T(""); - } - else if (Option_Lower==__T("file_eia608_displayemptystream_get")) - { - return File_Eia608_DisplayEmptyStream_Get()?"1":"0"; + return File_DisplayCaptions_Set(Ztring().From_UTF8(DisplayCaptions_Strings[Value==__T("0")?DisplayCaptions_Command:DisplayCaptions_Stream])); } else if (Option_Lower==__T("file_commandonlymeansempty")) { - File_CommandOnlyMeansEmpty_Set(!(Value==__T("0") || Value.empty())); + return File_DisplayCaptions_Set(Ztring().From_UTF8(DisplayCaptions_Strings[Value==__T("0")?DisplayCaptions_Command:DisplayCaptions_Content])); return __T(""); } - else if (Option_Lower==__T("file_commandonlymeansempty_get")) - { - return File_CommandOnlyMeansEmpty_Get()?"1":"0"; - } else if (Option_Lower==__T("file_probecaption")) { File_ProbeCaption_Set(Value); @@ -3577,42 +3577,28 @@ bool MediaInfo_Config_MediaInfo::File_Mmsh_Describe_Only_Get () #endif //defined(MEDIAINFO_LIBMMS_YES) //--------------------------------------------------------------------------- -void MediaInfo_Config_MediaInfo::File_Eia608_DisplayEmptyStream_Set (bool NewValue) -{ - CriticalSectionLocker CSL(CS); - File_Eia608_DisplayEmptyStream=NewValue; -} - -bool MediaInfo_Config_MediaInfo::File_Eia608_DisplayEmptyStream_Get () -{ - CriticalSectionLocker CSL(CS); - return File_Eia608_DisplayEmptyStream; -} - -//--------------------------------------------------------------------------- -void MediaInfo_Config_MediaInfo::File_Eia708_DisplayEmptyStream_Set (bool NewValue) +Ztring MediaInfo_Config_MediaInfo::File_DisplayCaptions_Set (const Ztring& NewValue) { - CriticalSectionLocker CSL(CS); - File_Eia708_DisplayEmptyStream=NewValue; -} + auto NewValueS = NewValue.To_UTF8(); + size_t i = 0; + for (; i < DisplayCaptions_Max; i++) { + if (NewValueS == DisplayCaptions_Strings[i]) { + break; + } + } + if (i >= DisplayCaptions_Max) + return __T("Unknown value"); -bool MediaInfo_Config_MediaInfo::File_Eia708_DisplayEmptyStream_Get () -{ CriticalSectionLocker CSL(CS); - return File_Eia708_DisplayEmptyStream; -} + DisplayCaptions = (display_captions)i; -//--------------------------------------------------------------------------- -void MediaInfo_Config_MediaInfo::File_CommandOnlyMeansEmpty_Set (bool NewValue) -{ - CriticalSectionLocker CSL(CS); - File_CommandOnlyMeansEmpty=NewValue; + return {}; } -bool MediaInfo_Config_MediaInfo::File_CommandOnlyMeansEmpty_Get () +display_captions MediaInfo_Config_MediaInfo::File_DisplayCaptions_Get () { CriticalSectionLocker CSL(CS); - return File_CommandOnlyMeansEmpty; + return DisplayCaptions; } //--------------------------------------------------------------------------- diff --git a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h index aab78de8ad..4b6696baaf 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h +++ b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h @@ -84,6 +84,14 @@ struct config_probe string Parser; }; +enum display_captions +{ + DisplayCaptions_Command, + DisplayCaptions_Content, + DisplayCaptions_Stream, + DisplayCaptions_Max +}; + //*************************************************************************** // Class MediaInfo_Config_MediaInfo //*************************************************************************** @@ -387,12 +395,8 @@ public : void File_Mmsh_Describe_Only_Set (bool NewValue); bool File_Mmsh_Describe_Only_Get (); #endif //defined(MEDIAINFO_LIBMMS_YES) - void File_Eia608_DisplayEmptyStream_Set (bool NewValue); - bool File_Eia608_DisplayEmptyStream_Get (); - void File_Eia708_DisplayEmptyStream_Set (bool NewValue); - bool File_Eia708_DisplayEmptyStream_Get (); - void File_CommandOnlyMeansEmpty_Set(bool NewValue); - bool File_CommandOnlyMeansEmpty_Get(); + Ztring File_DisplayCaptions_Set (const Ztring& NewValue); + display_captions File_DisplayCaptions_Get (); Ztring File_ProbeCaption_Set(const Ztring& NewValue); config_probe File_ProbeCaption_Get(const string& Parser); #if defined(MEDIAINFO_AC3_YES) @@ -627,9 +631,7 @@ private : #if defined(MEDIAINFO_LIBMMS_YES) bool File_Mmsh_Describe_Only; #endif //defined(MEDIAINFO_LIBMMS_YES) - bool File_Eia608_DisplayEmptyStream; - bool File_Eia708_DisplayEmptyStream; - bool File_CommandOnlyMeansEmpty; + display_captions DisplayCaptions; std::vector File_ProbeCaption; size_t File_ProbeCaption_Pos; #if defined(MEDIAINFO_AC3_YES) diff --git a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_File.cpp b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_File.cpp index 2d2903c67a..4813afe706 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_File.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_File.cpp @@ -240,6 +240,9 @@ #if defined(MEDIAINFO_DTSUHD_YES) #include "MediaInfo/Audio/File_DtsUhd.h" #endif +#if defined(MEDIAINFO_DAT_YES) + #include "MediaInfo/Audio/File_Dat.h" +#endif #if defined(MEDIAINFO_DOLBYE_YES) #include "MediaInfo/Audio/File_DolbyE.h" #endif @@ -644,6 +647,9 @@ static File__Analyze* SelectFromExtension(const String& Parser) #if defined(MEDIAINFO_DTSUHD_YES) if (Parser==__T("DtsUhd")) return new File_DtsUhd(); #endif + #if defined(MEDIAINFO_DAT_YES) + if (Parser==__T("Dat")) return new File_Dat(); + #endif #if defined(MEDIAINFO_DOLBYE_YES) if (Parser==__T("DolbyE")) return new File_DolbyE(); #endif @@ -1052,6 +1058,9 @@ int MediaInfo_Internal::ListFormats(const String &File_Name) #if defined(MEDIAINFO_DTSUHD_YES) delete Info; Info=new File_DtsUhd(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1; #endif + #if defined(MEDIAINFO_DAT_YES) + delete Info; Info=new File_Dat(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1; + #endif // Too many false-positives // #if defined(MEDIAINFO_DOLBYE_YES) // delete Info; Info=new File_DolbyE(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1; diff --git a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Inform.cpp b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Inform.cpp index 5c921789ef..2e965c1b18 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Inform.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/MediaInfo_Inform.cpp @@ -436,7 +436,23 @@ Ztring MediaInfo_Internal::Inform() #endif //defined(MEDIAINFO_CSV_YES) if (HTML) - Retour+=__T("\n\n\n\n\n"); + Retour+=__T("\n" + "\n" + " \n" + " \n" + " \n" + " MediaInfo\n" + " \n" + " \n" + " \n"); #if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) if (XML_0_7_78_MA || XML_0_7_78_MI || JSON) { @@ -469,7 +485,7 @@ Ztring MediaInfo_Internal::Inform() for (size_t StreamPos=0; StreamPos<(size_t)Count_Get((stream_t)StreamKind); StreamPos++) { //Pour chaque stream - if (HTML) Retour+=__T("\n\n

"); + if (HTML) Retour+=__T(" \n \n \n "); + if (HTML) Retour+=__T("\n "); #if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) if (XML || XML_0_7_78_MA || XML_0_7_78_MI || JSON) { @@ -511,12 +527,12 @@ Ztring MediaInfo_Internal::Inform() Retour+=Inform((stream_t)StreamKind, StreamPos, false); } - if (HTML) Retour+=__T("

"); #if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) Node* Node_Current=NULL; if (XML || XML_0_7_78_MA || XML_0_7_78_MI || JSON) Node_Current=Node_MI?Node_MI->Add_Child("track", true):Node_Main->Add_Child("track", true); @@ -489,7 +505,7 @@ Ztring MediaInfo_Internal::Inform() } Retour+=A; } - if (HTML) Retour+=__T("

\n
"); + if (HTML) Retour += __T("

"); if (!XML && !XML_0_7_78_MA && !XML_0_7_78_MI && !JSON) Retour+=MediaInfoLib::Config.LineSeparator_Get(); } } - if (HTML) Retour+=__T("\n\n\n"); + if (HTML) Retour+=__T(" \n\n"); if (!CSV && !HTML && !XML && !XML_0_7_78_MA && !XML_0_7_78_MI && !JSON) { @@ -858,11 +874,11 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I for (size_t Pos=0; Pos\n "); + Retour+=__T(" \n "); Retour+=Prefix+Nom.TrimLeft(); - Retour+=__T(" :\n "); + Retour+=__T(" :\n "); Retour+=Valeur; - Retour+=__T("\n "); + Retour+=__T("\n "); } #endif //defined(MEDIAINFO_HTML_YES) #if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp index 19465791d7..1d3bab3330 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp @@ -379,21 +379,31 @@ void File_Mpeg4::Streams_Accept() TestContinuousFileNames();*/ } - if (!IsSub && MajorBrand==0x6A703220) //"jp2 " - { - StreamSource=IsStream; //TODO: do the difference between raw stream and sequence of files with file count being frame count - TestContinuousFileNames(); - - Stream_Prepare((Config->File_Names.size()>1 || Config->File_IsReferenced_Get())?Stream_Video:Stream_Image); - if (StreamKind_Last==Stream_Video) - Fill(Stream_Video, StreamPos_Last, Video_FrameCount, Config->File_Names.size()); - } + Streams_Accept_jp2(); //Configuration Buffer_MaximumSize=64*1024*1024; //Some big frames are possible (e.g YUV 4:2:2 10 bits 1080p) File_Buffer_Size_Hint_Pointer=Config->File_Buffer_Size_Hint_Pointer_Get(); } + +//--------------------------------------------------------------------------- +void File_Mpeg4::Streams_Accept_jp2(bool IsJp2) +{ + //Warning: this method can be called several times + + if (IsSub || StreamKind_Last != Stream_General || !(IsJp2 || MajorBrand==0x6A703220 || MajorBrand==0x6a707820)) //"jp2 " + return; + + StreamSource=IsStream; //TODO: do the difference between raw stream and sequence of files with file count being frame count + TestContinuousFileNames(); + + Stream_Prepare((Config->File_Names.size()>1 || Config->File_IsReferenced_Get())?Stream_Video:Stream_Image); + Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Format), "JPEG 2000"); + if (StreamKind_Last==Stream_Video) + Fill(Stream_Video, StreamPos_Last, Video_FrameCount, Config->File_Names.size()); +} + //--------------------------------------------------------------------------- void File_Mpeg4::Streams_Finish() { @@ -1003,6 +1013,7 @@ void File_Mpeg4::Streams_Finish() stream_t NewKind=StreamKind_Last; size_t NewPos1; Ztring ID; + vector StreamOrders; if (Temp->second.Parsers[0]->Retrieve(Stream_General, 0, General_Format)==__T("ChannelGrouping")) { //Channel coupling, removing the 2 corresponding streams @@ -1011,6 +1022,8 @@ void File_Mpeg4::Streams_Finish() if (StreamSize_Encoded) StreamSize_Encoded+=Retrieve(StreamKind_Last, NewPos1, Fill_Parameter(StreamKind_Last, Generic_StreamSize)).To_int64u(); + StreamOrders.push_back(Retrieve_Const(StreamKind_Last, NewPos1, General_StreamOrder)); + StreamOrders.push_back(Retrieve_Const(StreamKind_Last, StreamPos_Last, General_StreamOrder)); Stream_Erase(NewKind, StreamPos_Last); Stream_Erase(NewKind, NewPos1); @@ -1052,6 +1065,12 @@ void File_Mpeg4::Streams_Finish() Ztring Parser_ID=ID+__T('-')+Retrieve(StreamKind_Last, StreamPos_Last, General_ID); if (ID.size()+1==Parser_ID.size()) Parser_ID.resize(ID.size()); + if (!StreamOrders.empty()) + { + Clear(StreamKind_Last, StreamPos_Last, General_StreamOrder); + for (auto& StreamOrder : StreamOrders) + Fill(StreamKind_Last, StreamPos_Last, General_StreamOrder, StreamOrder); + } Fill(StreamKind_Last, StreamPos_Last, General_ID, Parser_ID, true); if (StreamPos) { @@ -2998,10 +3017,13 @@ string File_Mpeg4::CreateElementName() string Result; for (size_t i = 1; i < Element_Level; i++) { Result += Ztring().From_CC4(Element[i].Code).Trim().To_UTF8(); - if (Result.back() >= '0' && Result.back() <= '9') { + if (Result.empty()) { + Result = "0x20202020"; // Full of spaces + } + else if (Result.back() >= '0' && Result.back() <= '9') { Result += '_'; } - Result += __T(' '); + Result += ' '; } if (!Result.empty()) Result.pop_back(); diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h index b9803cd9b4..1efecaa6df 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h @@ -47,6 +47,7 @@ class File_Mpeg4 : public File__Analyze, File__HasReferences protected : //Streams management void Streams_Accept(); + void Streams_Accept_jp2(bool IsJp2=false); void Streams_Finish(); void Streams_Finish_CommercialNames (); diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp index 159127f14c..77e7d921d2 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp @@ -1833,13 +1833,15 @@ void File_Mpeg4::jp2h_colr() #if defined(MEDIAINFO_ICC_YES) if (Element_Offset=132) { + Streams_Accept_jp2(); File_Icc ICC_Parser; ICC_Parser.StreamKind=StreamKind_Last; ICC_Parser.IsAdditional=true; Open_Buffer_Init(&ICC_Parser); Open_Buffer_Continue(&ICC_Parser); Open_Buffer_Finalize(&ICC_Parser); - Merge(ICC_Parser, StreamKind_Last, 0, 0); + if (StreamKind_Last!=Stream_General) // We don't want e.g. ICC version as container version + Merge(ICC_Parser, StreamKind_Last, 0, 0); } else Skip_XX(Element_Size-Element_Offset, "ICC profile"); @@ -1858,16 +1860,26 @@ void File_Mpeg4::jp2h_ihdr() Element_Name("Header"); //Parsing - Skip_B4( "Height"); - Skip_B4( "Width"); + int32u Height, Width; + int8u BPC; + Get_B4 (Height, "Height"); + Get_B4 (Width, "Width"); Skip_B2( "NC - Number of components"); - BS_Begin(); - Skip_SB( "BPC - Bits per component (Sign)"); - Skip_S1(7, "BPC - Bits per component (Value)"); - BS_End(); + Get_B1 (BPC, "BPC - Bits per component"); Skip_B1( "C - Compression type"); Skip_B1( "UnkC - Colourspace Unknown"); Skip_B1( "IPR - Intellectual Property"); + + FILLING_BEGIN() + Streams_Accept_jp2(true); + if (Width) + Fill(StreamKind_Last, StreamPos_Last, "Width", Width, 10, true); + if (Height) + Fill(StreamKind_Last, StreamPos_Last, "Height", Height, 10, true); + BPC++; + if (BPC) + Fill(StreamKind_Last, StreamPos_Last, "BitDepth", BPC, 10, true); + FILLING_END() } //--------------------------------------------------------------------------- diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp index bc92824b39..3e423273cd 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp @@ -1343,18 +1343,20 @@ void File_MpegTs::Streams_Update_Duration_Update() } } - if (Duration_Max) - Fill(Stream_General, 0, General_Duration, ((float64)Duration_Max) / 27000, 6, true); if (Duration_Count && Duration_Sum && Bytes_Sum) { //Filling Duration and bitrate with an average of content from all streams with PCR //Min and Max are based on a a 1 byte precision in the computed byte count + +/- 500 ns tolerance for hte PCR vale - Fill(Stream_General, 0, General_OverallBitRate, Bytes_Sum * 8 / (((float64)Duration_Sum) / 27000000), 0, true); + auto OverallBitRate = Bytes_Sum / (((float64)Duration_Sum) / ( 8 * 27000000) ); // 8-bit per byte and 27 MHz duration + Fill(Stream_General, 0, General_Duration, File_Size / (OverallBitRate / 8000), 6, true); + Fill(Stream_General, 0, General_OverallBitRate, OverallBitRate, 0, true); Fill(Stream_General, 0, "OverallBitRate_Precision_Min", (Bytes_Sum - Duration_Count) * 8 / (((float64)(Duration_Sum + 13500 * Duration_Count)) / 27000000), 0, true); Fill_SetOptions(Stream_General, 0, "OverallBitRate_Precision_Min", "N NT"); Fill(Stream_General, 0, "OverallBitRate_Precision_Max", (Bytes_Sum + Duration_Count) * 8 / (((float64)(Duration_Sum - 13500 * Duration_Count)) / 27000000), 0, true); Fill_SetOptions(Stream_General, 0, "OverallBitRate_Precision_Max", "N NT"); } + else if (Duration_Max) + Fill(Stream_General, 0, General_Duration, ((float64)Duration_Max) / 27000, 6, true); if (IsVbr) Fill(Stream_General, 0, General_OverallBitRate_Mode, "VBR", Unlimited, true, true); diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp index c2a2969d5f..3328fd582c 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp @@ -588,6 +588,9 @@ namespace Elements UUID(060E2B34, 01020101, 0E067F03, 00000000, 0000, "", GenericContainer_Sony, "") // 09 - Dolby + UUID(060E2B34, 01010105, 0E090400, 00000000, 0000, "Dolby", Dolby_040000000000, "") + UUID(060E2B34, 02530105, 0E090502, 00000000, 0000, "Dolby", Dolby_050200000000, "") + UUID(060E2B34, 01020105, 0E090502, 01000101, 0000, "Dolby", Dolby_050201000101, "") UUID(060E2B34, 01020105, 0E090607, 01010100, 0000, "Dolby", Dolby_PHDRImageMetadataItem, "") UUID(060E2B34, 02530105, 0E090607, 01010103, 0000, "Dolby", Dolby_PHDRMetadataTrackSubDescriptor, "") UUID(060E2B34, 01010105, 0E090607, 01010104, 0000, "Dolby", Dolby_DataDefinition, "") @@ -3784,6 +3787,49 @@ void File_Mxf::Streams_Finish_Descriptor(const int128u DescriptorUID, const int1 } } + Streams_Finish_Descriptor(Descriptor); + auto StreamKind_Last_Sav=StreamKind_Last; + auto StreamPos_Last_Sav=StreamPos_Last; + auto ID_Sav=Ztring::ToZtring(Descriptor->second.LinkedTrackID); + for (size_t StreamKind=Stream_Text; StreamKindsecond.StreamKind==Stream_Video) + { + Fill((stream_t)StreamKind, StreamPos, General_StreamOrder, Retrieve_Const(Stream_Video, 0, General_StreamOrder)); + continue; + } + if (Descriptor->second.StreamKind==Stream_Audio) //TODO: handle correctly when ID is same in different tracks + { + continue; + } + StreamKind_Last=(stream_t)StreamKind; + StreamPos_Last=StreamPos; + Streams_Finish_Descriptor(Descriptor); + } + } +} + +//--------------------------------------------------------------------------- +void File_Mxf::Streams_Finish_Descriptor(descriptors::iterator Descriptor) +{ + size_t Before_Count[Stream_Max]; + for (size_t Pos=0; Posfirst=="BitRate") continue; // Not always valid e.g. Dolby E. TODO: check in case of normal check if (Info->first=="StreamOrder") - continue; // Is not useful and has some issues with Dolby E + { + Fill(StreamKind_Last, StreamPos_Last+Pos, Info->first.c_str(), Info->second); + continue; + } // Filling both values Fill(StreamKind_Last, StreamPos_Last+Pos, (Info->first+"_Original").c_str(), FromEssence); //TODO: use the generic engine by filling descriptor info before merging essence info @@ -4833,7 +4882,7 @@ void File_Mxf::Read_Buffer_Continue() Get_B1(SS, "SS"); Get_B1(Drop, "Drop"); Get_B1(FF, "SS"); - TimeCode TC(HH, MM, SS, FF, FF<=99?99:255, TimeCode::flags().DropFrame()); + TimeCode TC(HH, MM, SS, FF, FF<=99?99:255, TimeCode::flags().DropFrame(Drop)); Element_Info1(TC.ToString()); if (!Frame_Count_NotParsedIncluded) { @@ -6481,6 +6530,8 @@ void File_Mxf::Data_Parse() ELEMENT(TextBasedFramework, "Text-based Framework") ELEMENT(GenericStreamTextBasedSet, "Generic Stream Text-based Set") ELEMENT(MXFGenericStreamDataElementKey_09_01, "MXF Generic Stream Data Element Key") + ELEMENT(Dolby_050200000000, "Dolby .05.02.00.00.00.00") + ELEMENT(Dolby_050201000101, "Dolby .05.02.01.00.01.01") ELEMENT(Dolby_PHDRMetadataTrackSubDescriptor, "Dolby PHDRMetadataTrackSubDescriptor") ELEMENT(Omneon_010201010100, "Omneon .01.02.01.01.01.00") ELEMENT(Omneon_010201020100, "Omneon .01.02.01.02.01.00") @@ -9698,6 +9749,25 @@ void File_Mxf::Dolby_PHDRImageMetadataItem() Skip_String(Element_Size, "Data"); } +//--------------------------------------------------------------------------- +void File_Mxf::Dolby_050200000000() +{ + { + std::map::iterator Primer_Value=Primer_Values.find(Code2); + if (Primer_Value!=Primer_Values.end()) + { + int32u Code_Compare1=Primer_Value->second.hi>>32; + int32u Code_Compare2=(int32u)Primer_Value->second.hi; + int32u Code_Compare3=Primer_Value->second.lo>>32; + int32u Code_Compare4=(int32u)Primer_Value->second.lo; + if(0); + ELEMENT_UUID(Dolby_040000000000, "Dolby 04.00.00.00.00.00") + } + } + + GenericDataEssenceDescriptor(); +} + //--------------------------------------------------------------------------- void File_Mxf::Dolby_PHDRMetadataTrackSubDescriptor() { @@ -14665,6 +14735,14 @@ void File_Mxf::Omneon_010201020100_8006() Skip_UTF8(Length2, "Content"); } +//--------------------------------------------------------------------------- +// 0x8006 +void File_Mxf::Dolby_040000000000() +{ + //Parsing + Skip_UTF8(Length2, "Content"); +} + //--------------------------------------------------------------------------- // void File_Mxf::Dolby_DataDefinition() @@ -19197,13 +19275,13 @@ bool File_Mxf::BookMark_Needed() { int64u ProbeCaptionBytePos=(int64u)-1; int64u ProbeCaptionByteDur=(int64u)-1; - int64u Duration=0; + float32 Duration=0; for (size_t StreamKind=Stream_General; StreamKindFile_ProbeCaption_Get(ParserName); + int64u HeaderSize=0; + int64u ContentSize=File_Size; + if (!Partitions.empty()) + { + const auto& FirstPartition=Partitions.front(); + HeaderSize=FirstPartition.PartitionPackByteCount+FirstPartition.HeaderByteCount+FirstPartition.IndexByteCount; + ContentSize-=HeaderSize; + const auto& LastPartition=Partitions.back(); + if (LastPartition.StreamOffset==FirstPartition.FooterPartition) + { + int64u FooterSize=File_Size-LastPartition.StreamOffset; + ContentSize-=FooterSize; + } + } switch (Probe.Start_Type) { case config_probe_size: @@ -19233,15 +19325,13 @@ bool File_Mxf::BookMark_Needed() case config_probe_dur: if (Duration) { - Probe.Start=Probe.Start*100/Duration; //TODO: real timestamp - if (!Probe.Start) - Probe.Start=1; + ProbeCaptionBytePos=HeaderSize+(float32)Probe.Start/Duration*ContentSize; //TODO: real timestamp } else - Probe.Start=50; - // Fall through + ProbeCaptionBytePos=HeaderSize+ContentSize/2; + break; case config_probe_percent: - ProbeCaptionBytePos=File_Size/100*Probe.Start; + ProbeCaptionBytePos=HeaderSize+ContentSize/100*Probe.Start; break; } switch (Probe.Duration_Type) { @@ -19251,15 +19341,13 @@ bool File_Mxf::BookMark_Needed() case config_probe_dur: if (Duration) { - Probe.Duration=Probe.Duration*100/Duration; //TODO: real timestamp - if (!Probe.Duration) - Probe.Duration++; + ProbeCaptionByteDur=(float32)Probe.Duration/Duration*ContentSize; //TODO: real timestamp } else - Probe.Duration=1; - // Fall through + ProbeCaptionByteDur=ContentSize/100; + break; case config_probe_percent: - ProbeCaptionByteDur=File_Size/100*Probe.Duration; + ProbeCaptionByteDur=ContentSize/100*Probe.Duration; break; } auto MaxOffset=ProbeCaptionBytePos+ProbeCaptionByteDur; diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.h b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.h index 5db258ae1f..1090dcae6f 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.h +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Mxf.h @@ -225,7 +225,9 @@ protected : void AS11_AAF_Core(); void AS11_AAF_Segmentation(); void AS11_AAF_UKDPP(); + void Dolby_050201000101() { MXFGenericStreamDataElementKey_09_01(); } void Dolby_PHDRImageMetadataItem(); + void Dolby_050200000000(); void Dolby_PHDRMetadataTrackSubDescriptor(); void Omneon_010201010100(); void Omneon_010201020100(); @@ -604,6 +606,7 @@ protected : void AS11_UKDPP_ProgrammeTextLanguage(); void AS11_UKDPP_ContactEmail(); void AS11_UKDPP_ContactTelephoneNumber(); + void Dolby_040000000000(); void Dolby_DataDefinition(); void Dolby_SourceTrackID(); void Dolby_SimplePayloadSID(); @@ -1477,6 +1480,8 @@ protected : int64u DemuxedSampleCount_AddedToFirstFrame; int64u DemuxedElementSize_AddedToFirstFrame; #endif //MEDIAINFO_DEMUX || MEDIAINFO_SEEK + + void Streams_Finish_Descriptor (descriptors::iterator Descriptor); }; } //NameSpace diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff.cpp b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff.cpp index ba35b1f625..f9ae872963 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff.cpp @@ -313,20 +313,18 @@ void File_Riff::Streams_Finish () for (size_t Pos=0; Possecond.Parsers[0]->Count_Get(StreamKind_Last); Pos++) { Ztring Temp_ID=ID; - Ztring Temp_ID_String=ID; Merge(*Temp->second.Parsers[0], StreamKind_Last, Pos, StreamPos_Base+Pos); if (!Retrieve(StreamKind_Last, StreamPos_Last, General_ID).empty()) { if (!Temp_ID.empty()) - { Temp_ID+=__T('-'); - Temp_ID_String+=__T('-'); - } Temp_ID+=Retrieve(StreamKind_Last, StreamPos_Last, General_ID); - Temp_ID_String+=Retrieve(StreamKind_Last, StreamPos_Last, General_ID); } Fill(StreamKind_Last, StreamPos_Last, General_ID, Temp_ID, true); - Fill(StreamKind_Last, StreamPos_Last, General_StreamOrder, Temp_ID_String, true); + auto Temp_ID_DashPos=Temp_ID.find(__T('-')); + if (Temp_ID_DashPos!=string::npos) + Temp_ID.resize(Temp_ID_DashPos); + Fill(StreamKind_Last, StreamPos_Last, General_StreamOrder, Temp_ID, true); //Special case: multiple fmt/data chunks in WAV if (StreamKind_Last==Stream_Audio //TODO: smarter merge @@ -870,7 +868,12 @@ bool File_Riff::Header_Begin() Element_Begin1("...Continued"); Element_ThisIsAList(); if (Buffer_DataToParse_End) + { + Header_Fill_Code(0x64617461); Header_Fill_Size(Buffer_DataToParse_End-(File_Offset+Buffer_Offset)); + if (Buffer_DataToParse_End>File_Size) + Buffer_DataToParse_End=File_Size; // Done here for at least one conformance check of the value. TODO: better handling + } else Header_Fill_Size(Element_Size); Element_End(); @@ -1092,8 +1095,7 @@ void File_Riff::Header_Parse() if (File_Offset+Buffer_Offset+8+Size_Complete>File_Size) { if (Element_Level<=2) //Incoherencies info only at the top level chunk - IsTruncated(File_Offset+Buffer_Offset+8+Size_Complete, Element_Offset!=8, "RIFF"); - Size_Complete=File_Size-(File_Offset+Buffer_Offset+Element_Offset); + IsTruncated(File_Offset+Buffer_Offset+8+Size_Complete, Element_Offset!=8, Ztring().From_CC4(Name).Trim().To_UTF8().c_str()); } //Alignment diff --git a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp index 980dde615b..bbe10094d8 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp @@ -3425,7 +3425,7 @@ void File_Riff::RMP3_data() { Element_Name("Raw datas"); - Fill(Stream_Audio, StreamPos_Last, Audio_StreamSize, Buffer_DataToParse_End-Buffer_DataToParse_Begin); + Fill(Stream_Audio, StreamPos_Last, Audio_StreamSize, Buffer_DataToParse_End?((Buffer_DataToParse_End>File_Size?File_Size:Buffer_DataToParse_End)-Buffer_DataToParse_Begin):(Element_TotalSize_Get()-Alignement_ExtraByte)); Stream_Prepare(Stream_Audio); //Creating parser @@ -3440,7 +3440,7 @@ void File_Riff::RMP3_data() StreamItem.Parsers.push_back(Parser); #else //MEDIAINFO_MPEG4_YES Fill(Stream_Audio, StreamPos_Last, Audio_Format, "MPEG Audio"); - Skip_XX(Buffer_DataToParse_End-Buffer_DataToParse_Begin, "Data"); + Skip_XX(Buffer_DataToParse_End?((Buffer_DataToParse_End>File_Size?File_Size:Buffer_DataToParse_End)-Buffer_DataToParse_Begin):(Element_TotalSize_Get()-Alignement_ExtraByte), "Data"); #endif } @@ -3741,7 +3741,7 @@ void File_Riff::WAVE_axml() Element_Name("AXML"); //Parsing - Adm->TotalSize=Buffer_DataToParse_End?(Buffer_DataToParse_End-(File_Offset+Buffer_Offset)):Element_TotalSize_Get(); + Adm->TotalSize=Buffer_DataToParse_End?((Buffer_DataToParse_End>File_Size?File_Size:Buffer_DataToParse_End)-Buffer_DataToParse_Begin):(Element_TotalSize_Get()-Alignement_ExtraByte); WAVE_axml_Continue(); } } @@ -3992,7 +3992,7 @@ void File_Riff::WAVE_data() if (Buffer_DataToParse_End && Buffer_DataToParse_End-Buffer_DataToParse_Begin<100) { - Skip_XX(Buffer_DataToParse_End-Buffer_Offset, "Unknown"); + Skip_XX(Buffer_DataToParse_End-Alignement_ExtraByte-Buffer_Offset, "Unknown"); return; //This is maybe embeded in another container, and there is only the header (What is the junk?) } @@ -4000,7 +4000,7 @@ void File_Riff::WAVE_data() Element_Code=(int64u)-1; FILLING_BEGIN(); - int64u StreamSize=(Buffer_DataToParse_End?(Buffer_DataToParse_End-Buffer_DataToParse_Begin):Element_Size)-(Element_Code==Elements::AIFF_SSND?8:0); + int64u StreamSize=(Buffer_DataToParse_End?((Buffer_DataToParse_End>File_Size?File_Size:Buffer_DataToParse_End)-Buffer_DataToParse_Begin):(Element_TotalSize_Get()-Alignement_ExtraByte))-(Element_Code==Elements::AIFF_SSND?8:0); Fill(Stream_Audio, StreamPos_Last, Audio_StreamSize, StreamSize, 10, true); if (Retrieve(Stream_Audio, StreamPos_Last, Audio_Format)==__T("PCM") && BlockAlign) Fill(Stream_Audio, StreamPos_Last, Audio_SamplingCount, StreamSize/BlockAlign, 10, true); @@ -4022,6 +4022,8 @@ void File_Riff::WAVE_data() Fill(Stream_General, 0, General_Duration, Retrieve_Const(Stream_General, 0, General_Duration).To_int64u()+Duration, 0, true); // Found files with 2 fmt/data chunks Fill(Stream_Audio, StreamPos_Last, Audio_Duration, Duration, 0, true); } + if (!Buffer_DataToParse_End) + WAVE_data_Continue(); FILLING_END(); } diff --git a/src/ExtLib/MediaInfo/MediaInfo/Setup.h b/src/ExtLib/MediaInfo/MediaInfo/Setup.h index 1f416d204c..11f7e39be8 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Setup.h +++ b/src/ExtLib/MediaInfo/MediaInfo/Setup.h @@ -104,7 +104,7 @@ #if !defined (MEDIAINFO_LIBCURL_NO) && !defined (MEDIAINFO_LIBCURL_YES) #define MEDIAINFO_LIBCURL_NO #endif - #if !defined (MEDIAINFO_LIBMMS_NO) && !defined (MEDIAINFO_LIBMM_YES) + #if !defined (MEDIAINFO_LIBMMS_NO) && !defined (MEDIAINFO_LIBMMS_YES) #define MEDIAINFO_LIBMMS_NO #endif #if !defined (MEDIAINFO_DVDIF_ANALYZE_NO) && !defined (MEDIAINFO_DVDIF_ANALYZE_YES) @@ -738,6 +738,9 @@ #if !defined(MEDIAINFO_AUDIO_NO) && !defined(MEDIAINFO_CELT_NO) && !defined(MEDIAINFO_CELT_YES) #define MEDIAINFO_CELT_YES #endif +#if !defined(MEDIAINFO_AUDIO_NO) && !defined(MEDIAINFO_DAT_NO) && !defined(MEDIAINFO_DAT_YES) + #define MEDIAINFO_DAT_YES +#endif #if !defined(MEDIAINFO_AUDIO_NO) && !defined(MEDIAINFO_DOLBYE_NO) && !defined(MEDIAINFO_DOLBYE_YES) #define MEDIAINFO_DOLBYE_YES #endif diff --git a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Cdp.cpp b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Cdp.cpp index fd08c4691e..d92f36f5a9 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Cdp.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Cdp.cpp @@ -472,7 +472,7 @@ void File_Cdp::ccdata_section() BS_End(); #if MEDIAINFO_ADVANCED - if (cc_type>=2 && !Streams[2] && Config->File_Eia708_DisplayEmptyStream_Get()) + if (cc_type>=2 && !Streams[2] && Config->File_DisplayCaptions_Get()==DisplayCaptions_Stream) CreateStream(2); #endif //MEDIAINFO_ADVANCED diff --git a/src/ExtLib/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp b/src/ExtLib/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp index 9a1b4fec7b..94c1ef3403 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp @@ -241,7 +241,7 @@ void File_DtvccTransport::Read_Buffer_Continue() BS_End(); #if MEDIAINFO_ADVANCED - if (cc_type>=2 && !Streams[2] && Config->File_Eia708_DisplayEmptyStream_Get()) + if (cc_type>=2 && !Streams[2] && Config->File_DisplayCaptions_Get()==DisplayCaptions_Stream) CreateStream(2); #endif //MEDIAINFO_ADVANCED diff --git a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.cpp b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.cpp index 8295ea5075..e755e55f82 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.cpp @@ -85,7 +85,6 @@ File_Eia608::File_Eia608() cc_data_1_Old=0x00; cc_data_2_Old=0x00; HasContent=false; - HasContent_Displayed=false; HasJumped=false; } @@ -103,7 +102,8 @@ File_Eia608::~File_Eia608() //--------------------------------------------------------------------------- void File_Eia608::Streams_Fill() { - if (Config->File_Eia608_DisplayEmptyStream_Get() && Streams.size()<2) + auto DisplayCaptions=Config->File_DisplayCaptions_Get(); + if (DisplayCaptions==DisplayCaptions_Stream && Streams.size()<2) Streams.resize(2); if (!HasContent && ServiceDescriptors && ServiceDescriptors->ServiceDescriptors608.find(cc_type)!=ServiceDescriptors->ServiceDescriptors608.end()) @@ -114,8 +114,15 @@ void File_Eia608::Streams_Fill() } for (size_t Pos=0; PosFile_CommandOnlyMeansEmpty_Get())) || (Pos<2 && Config->File_Eia608_DisplayEmptyStream_Get())) + { + const auto Stream=Streams[Pos]; + if (Stream || DisplayCaptions==DisplayCaptions_Stream) { + auto HasCommand=Stream; + auto HasContent=Stream && Stream->HasContent(); + if (!HasContent && DisplayCaptions==DisplayCaptions_Content) + continue; + Stream_Prepare(Stream_Text); Fill(Stream_Text, StreamPos_Last, Text_Format, "EIA-608"); Fill(Stream_Text, StreamPos_Last, Text_StreamSize, 0); @@ -130,7 +137,7 @@ void File_Eia608::Streams_Fill() } if (Config->ParseSpeed>=1.0) { - Fill(Stream_Text, StreamPos_Last, "CaptionServiceContent_IsPresent", DataDetected[Pos+1]?"Yes":"No", Unlimited, true, true); //1 bit per service, starting at 1 + Fill(Stream_Text, StreamPos_Last, "CaptionServiceContent_IsPresent", HasContent?"Yes":"No", Unlimited, true, true); Fill_SetOptions(Stream_Text, StreamPos_Last, "CaptionServiceContent_IsPresent", "N NT"); } if (ServiceDescriptors) @@ -149,7 +156,13 @@ void File_Eia608::Streams_Fill() Fill_SetOptions(Stream_Text, StreamPos_Last, "CaptionServiceDescriptor_IsPresent", "N NT"); } } + if (!HasContent) + { + Fill(Stream_Text, StreamPos_Last, "InternalDetectionKind", HasCommand?"Command":"Stream", Unlimited, true, true); + Fill_SetOptions(Stream_Text, StreamPos_Last, "InternalDetectionKind", "N NT"); + } } + } } //--------------------------------------------------------------------------- @@ -164,9 +177,10 @@ void File_Eia608::Streams_Finish() if (PTS_End>PTS_Begin) Fill(Stream_General, 0, General_Duration, float64_int64s(((float64)(PTS_End-PTS_Begin))/1000000)); + auto DisplayCaptions=Config->File_DisplayCaptions_Get(); size_t i=0; for (size_t StreamPos=0; StreamPosFile_Eia608_DisplayEmptyStream_Get())) + if (Streams[StreamPos] || (StreamPos<2 && DisplayCaptions==DisplayCaptions_Stream)) { Fill(Stream_Text, i, Text_Duration, Retrieve_Const(Stream_General, 0, General_Duration)); if (!Streams[StreamPos]) @@ -476,8 +490,6 @@ void File_Eia608::XDS() XDS_Data.erase(XDS_Data.begin()+XDS_Level); XDS_Level=(size_t)-1; - - DataDetected[5]=true; //bit 5=XDS } //--------------------------------------------------------------------------- @@ -1306,7 +1318,6 @@ void File_Eia608::Character_Fill(wchar_t Character) if (!HasContent) HasContent=true; - DataDetected[1+StreamPos]=true; } //--------------------------------------------------------------------------- diff --git a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.h b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.h index 002f0b42b5..21a4aea7de 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.h +++ b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia608.h @@ -163,15 +163,15 @@ private : Duration_End_Command=FLT_MAX; Duration_End_Command_WasJustUpdated=false; } + + int64u HasContent() { return Count_PopOn + Count_RollUp + Count_PaintOn; } }; std::vector Streams; int8u cc_data_1_Old; int8u cc_data_2_Old; bool HasContent; - bool HasContent_Displayed; bool HasJumped; - std::bitset<8> DataDetected; //1=CC1, 2=CC2, 3=T1, 4=T2, 5=XDS }; } //NameSpace diff --git a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia708.cpp b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia708.cpp index df4220fa6f..a3eae7b04d 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia708.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Eia708.cpp @@ -59,7 +59,6 @@ File_Eia708::File_Eia708() //Temp StandAloneCommand=false; HasContent=false; - DataDetected=0x0000000000000000LL; } //--------------------------------------------------------------------------- @@ -76,7 +75,8 @@ File_Eia708::~File_Eia708() //--------------------------------------------------------------------------- void File_Eia708::Streams_Fill() { - if (Config->File_Eia708_DisplayEmptyStream_Get() && Streams.size()<2) + auto DisplayCaptions=Config->File_DisplayCaptions_Get(); + if (DisplayCaptions==DisplayCaptions_Stream && Streams.size()<2) Streams.resize(2); if (ServiceDescriptors) @@ -89,9 +89,16 @@ void File_Eia708::Streams_Fill() } } - for (size_t Pos=0; PosFile_CommandOnlyMeansEmpty_Get())) || (Pos && Pos<2 && Config->File_Eia708_DisplayEmptyStream_Get())) + for (size_t Pos=1; PosHasContent(); + if (!HasContent && DisplayCaptions==DisplayCaptions_Content) + continue; + Stream_Prepare(Stream_Text); Fill(Stream_Text, StreamPos_Last, Text_ID, Pos); Fill(Stream_Text, StreamPos_Last, "CaptionServiceName", Pos); @@ -101,7 +108,7 @@ void File_Eia708::Streams_Fill() Fill(Stream_Text, StreamPos_Last, Text_BitRate_Mode, "CBR"); if (Config->ParseSpeed>=1.0) { - Fill(Stream_Text, StreamPos_Last, "CaptionServiceContent_IsPresent", (DataDetected&((int64u)1)< Streams; int8u service_number; int8u block_size; bool HasContent; - int64u DataDetected; //1 service per bit //Elements void NUL(); //NUL diff --git a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Scte20.cpp b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Scte20.cpp index 2c3644ffa4..083b3d5410 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Text/File_Scte20.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Text/File_Scte20.cpp @@ -157,7 +157,7 @@ void File_Scte20::Read_Buffer_Init() #endif //defined(MEDIAINFO_EIA608_YES) //Configuration - Eia608_DisplayEmptyStream=Config->File_Eia608_DisplayEmptyStream_Get(); + Eia608_DisplayEmptyStream=Config->File_DisplayCaptions_Get()==DisplayCaptions_Stream; } //--------------------------------------------------------------------------- diff --git a/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.cpp b/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.cpp index 1c8250faf5..f2748e256d 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.cpp +++ b/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.cpp @@ -1914,8 +1914,9 @@ void File_Hevc::seq_parameter_set() } if (nuh_layer_id) { - max_sub_layers_minus1=0; + const auto vps_max_sub_layers_minus1 = (*video_parameter_set_Item)->vps_max_sub_layers_minus1; Get_S1 (3, sps_ext_or_max_sub_layers_minus1, "sps_ext_or_max_sub_layers_minus1"); + max_sub_layers_minus1=sps_ext_or_max_sub_layers_minus1 == 7 ? vps_max_sub_layers_minus1 : sps_ext_or_max_sub_layers_minus1; } else { @@ -2046,9 +2047,16 @@ void File_Hevc::seq_parameter_set() Skip_UE( "max_transform_hierarchy_depth_inter"); Skip_UE( "max_transform_hierarchy_depth_intra"); TEST_SB_SKIP( "scaling_list_enabled_flag"); - TEST_SB_SKIP( "sps_scaling_list_data_present_flag"); - scaling_list_data(); - TEST_SB_END(); + bool sps_infer_scaling_list_flag = false; + if (MultiLayerExtSpsFlag) + Get_SB (sps_infer_scaling_list_flag, "sps_infer_scaling_list_flag"); + if (sps_infer_scaling_list_flag) + Skip_S1 (6, "sps_scaling_list_ref_layer_id"); + else { + TEST_SB_SKIP( "sps_scaling_list_data_present_flag"); + scaling_list_data(); + TEST_SB_END(); + } TEST_SB_END(); Skip_SB( "amp_enabled_flag"); Skip_SB( "sample_adaptive_offset_enabled_flag"); @@ -2085,7 +2093,7 @@ void File_Hevc::seq_parameter_set() Skip_SB( "sps_temporal_mvp_enabled_flag"); Skip_SB( "strong_intra_smoothing_enabled_flag"); TEST_SB_SKIP( "vui_parameters_present_flag"); - vui_parameters(video_parameter_set_Item, vui_parameters_Item); + vui_parameters(vui_parameters_Item, max_sub_layers_minus1); TEST_SB_END(); TESTELSE_SB_SKIP( "sps_extension_flag"); int8u sps_extension_4bits; @@ -4197,7 +4205,7 @@ void File_Hevc::short_term_ref_pic_sets(int8u num_short_term_ref_pic_sets) } //--------------------------------------------------------------------------- -void File_Hevc::vui_parameters(std::vector::iterator video_parameter_set_Item, seq_parameter_set_struct::vui_parameters_struct* &vui_parameters_Item_) +void File_Hevc::vui_parameters(seq_parameter_set_struct::vui_parameters_struct* &vui_parameters_Item_, int8u maxNumSubLayersMinus1) { //Parsing seq_parameter_set_struct::vui_parameters_struct::xxl_common *xxL_Common=NULL; @@ -4246,7 +4254,7 @@ void File_Hevc::vui_parameters(std::vector::iterato Skip_UE( "vui_num_ticks_poc_diff_one_minus1"); TEST_SB_END(); TEST_SB_SKIP( "hrd_parameters_present_flag"); - hrd_parameters(true, (*video_parameter_set_Item)->vps_max_sub_layers_minus1, xxL_Common, NAL, VCL); + hrd_parameters(true, maxNumSubLayersMinus1, xxL_Common, NAL, VCL); TEST_SB_END(); TEST_SB_END(); TEST_SB_SKIP( "bitstream_restriction_flag"); diff --git a/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.h b/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.h index 3c5bb91f7d..df27984a70 100644 --- a/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.h +++ b/src/ExtLib/MediaInfo/MediaInfo/Video/File_Hevc.h @@ -418,7 +418,7 @@ private : void slice_segment_header(); void profile_tier_level(profile_tier_level_struct& p, bool profilePresentFlag, int8u maxNumSubLayersMinus1); void short_term_ref_pic_sets(int8u num_short_term_ref_pic_sets); - void vui_parameters(std::vector::iterator video_parameter_set_Item, seq_parameter_set_struct::vui_parameters_struct* &vui_parameters_Item); + void vui_parameters(seq_parameter_set_struct::vui_parameters_struct* &vui_parameters_Item, int8u maxNumSubLayersMinus1); void hrd_parameters(bool commonInfPresentFlag, int8u maxNumSubLayersMinus1, seq_parameter_set_struct::vui_parameters_struct::xxl_common* &xxL_Common, seq_parameter_set_struct::vui_parameters_struct::xxl* &NAL, seq_parameter_set_struct::vui_parameters_struct::xxl* &VCL); void sub_layer_hrd_parameters(seq_parameter_set_struct::vui_parameters_struct::xxl_common* xxL_Common, int8u bit_rate_scale, int8u cpb_size_scale, int32u cpb_cnt_minus1, seq_parameter_set_struct::vui_parameters_struct::xxl* &hrd_parameters_Item); void scaling_list_data(); From a78e9727d355a3514e708948fbd81abd29d6b1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hack=E8=8C=B6=E3=82=93?= <120134269+Hackjjang@users.noreply.github.com> Date: Tue, 23 Jul 2024 13:30:59 +0900 Subject: [PATCH 073/102] Update mplayerc.kr.rc.txt --- src/apps/mpcresources/text/mplayerc.kr.rc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/mpcresources/text/mplayerc.kr.rc.txt b/src/apps/mpcresources/text/mplayerc.kr.rc.txt index 164c0e094d..e13f02c848 100644 --- a/src/apps/mpcresources/text/mplayerc.kr.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.kr.rc.txt @@ -424,7 +424,7 @@ BEGIN DIALOGEX IDD_PPAGEPLAYER LINES 49 23 "최근 파일 수 :" 26 "DVD 위치 기억" 27 "파일 위치 기억" -28 "종료 시, 팬&스캔 확대율 기억" +28 "종료 시, 팬&&스캔 확대율 기억" 29 "메인 재생 목록 기억" 31 "최근 열람한 파일 경로를 제목 표시줄에 표기" 33 "기타" From b1fce635706366cba450d406b9088638d16c61dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hack=E8=8C=B6=E3=82=93?= <120134269+Hackjjang@users.noreply.github.com> Date: Wed, 24 Jul 2024 05:33:50 +0900 Subject: [PATCH 074/102] Update mplayerc.kr.rc.txt --- src/apps/mpcresources/text/mplayerc.kr.rc.txt | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/apps/mpcresources/text/mplayerc.kr.rc.txt b/src/apps/mpcresources/text/mplayerc.kr.rc.txt index e13f02c848..7c8d7ab136 100644 --- a/src/apps/mpcresources/text/mplayerc.kr.rc.txt +++ b/src/apps/mpcresources/text/mplayerc.kr.rc.txt @@ -150,7 +150,7 @@ BEGIN DIALOGEX IDD_PLAYLISTNAME LINES 10 END BEGIN DIALOGEX IDD_PNSPRESET_DLG LINES 22 -3 "팬 & 스캔 사전 설정" +3 "팬 && 스캔 사전 설정" 12 "새로 만들기" 13 "삭제" 14 "위로" @@ -1205,25 +1205,25 @@ STRING IDS_AG_PAUSE "일시 중지" STRING IDS_AG_PLAY "재생" STRING IDS_AG_PLAYLIST_FILE "재생 목록" STRING IDS_AG_PLAYPAUSE "재생/일시 중지" -STRING IDS_AG_PNS_CENTER "팬&스캔 - 중앙 배치" -STRING IDS_AG_PNS_DEC_HEIGHT "팬&스캔 - 높이 축소" -STRING IDS_AG_PNS_DEC_SIZE "팬&스캔 - 크기 축소" -STRING IDS_AG_PNS_DEC_WIDTH "팬&스캔 - 폭 축소" -STRING IDS_AG_PNS_DOWN "팬&스캔 - 아래로" -STRING IDS_AG_PNS_DOWNLEFT "팬&스캔 - 왼쪽 아래로" -STRING IDS_AG_PNS_DOWNRIGHT "퍈&스캔 - 오른쪽 아래로" -STRING IDS_AG_PNS_FLIP "팬&스캔 - 좌우반전" -STRING IDS_AG_PNS_INC_HEIGHT "팬&스캔 - 높이 확대" -STRING IDS_AG_PNS_INC_SIZE "팬&스캔 - 크기 확대" -STRING IDS_AG_PNS_INC_WIDTH "팬&스캔 - 폭 확대" -STRING IDS_AG_PNS_LEFT "팬&스캔 - 왼쪽으로" -STRING IDS_AG_PNS_RESET "팬&스캔 - 초기화" -STRING IDS_AG_PNS_RIGHT "팬&스캔 - 오른쪽으로" -STRING IDS_AG_PNS_ROTATE_CCW "팬&스캔 - 반시계 방향으로 회전" -STRING IDS_AG_PNS_ROTATE_CW "팬&스캔 - 시계 방향으로 회전" -STRING IDS_AG_PNS_UP "팬&스캔 - 위로" -STRING IDS_AG_PNS_UPLEFT "팬&스캔 - 왼쪽 위로" -STRING IDS_AG_PNS_UPRIGHT "팬&스캔 - 오른쪽 위로" +STRING IDS_AG_PNS_CENTER "팬&&스캔 - 중앙 배치" +STRING IDS_AG_PNS_DEC_HEIGHT "팬&&스캔 - 높이 축소" +STRING IDS_AG_PNS_DEC_SIZE "팬&&스캔 - 크기 축소" +STRING IDS_AG_PNS_DEC_WIDTH "팬&&스캔 - 폭 축소" +STRING IDS_AG_PNS_DOWN "팬&&스캔 - 아래로" +STRING IDS_AG_PNS_DOWNLEFT "팬&&스캔 - 왼쪽 아래로" +STRING IDS_AG_PNS_DOWNRIGHT "퍈&&스캔 - 오른쪽 아래로" +STRING IDS_AG_PNS_FLIP "팬&&스캔 - 좌우반전" +STRING IDS_AG_PNS_INC_HEIGHT "팬&&스캔 - 높이 확대" +STRING IDS_AG_PNS_INC_SIZE "팬&&스캔 - 크기 확대" +STRING IDS_AG_PNS_INC_WIDTH "팬&&스캔 - 폭 확대" +STRING IDS_AG_PNS_LEFT "팬&&스캔 - 왼쪽으로" +STRING IDS_AG_PNS_RESET "팬&&스캔 - 초기화" +STRING IDS_AG_PNS_RIGHT "팬&&스캔 - 오른쪽으로" +STRING IDS_AG_PNS_ROTATE_CCW "팬&&스캔 - 반시계 방향으로 회전" +STRING IDS_AG_PNS_ROTATE_CW "팬&&스캔 - 시계 방향으로 회전" +STRING IDS_AG_PNS_UP "팬&&스캔 - 위로" +STRING IDS_AG_PNS_UPLEFT "팬&&스캔 - 왼쪽 위로" +STRING IDS_AG_PNS_UPRIGHT "팬&&스캔 - 오른쪽 위로" STRING IDS_AG_PREVIOUS "이전" STRING IDS_AG_PREVIOUS_FILE "이전 파일" STRING IDS_AG_PREV_AUDIO "이전 오디오" @@ -1258,7 +1258,7 @@ STRING IDS_AG_SUBTITLE_RELOAD "자막 다시 불러오기" STRING IDS_AG_TEARING_TEST "티어링 테스트" STRING IDS_AG_TITLE "타이틀 %d" STRING IDS_AG_TITLE2 "타이틀 : %02d/%02d" -STRING IDS_AG_TOGGLE_CAPTION "제목 표시줄 & 메뉴 토글" +STRING IDS_AG_TOGGLE_CAPTION "제목 표시줄 && 메뉴 토글" STRING IDS_AG_TOGGLE_CAPTURE "캡처 토글" STRING IDS_AG_TOGGLE_CONTROLS "제어 토글" STRING IDS_AG_TOGGLE_INFO "파일 정보 토글" From 318e99cbccef39c4e2fbd0338824a21819684502 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 27 Jul 2024 09:57:17 +0300 Subject: [PATCH 075/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BA=D0=BE=D1=80=D0=B5=D0=B9=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20(=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=20Hackjjang).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mpcresources/mplayerc.kr.rc | 44 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/apps/mpcresources/mplayerc.kr.rc b/src/apps/mpcresources/mplayerc.kr.rc index dfe3069f7e..49928ed013 100644 --- a/src/apps/mpcresources/mplayerc.kr.rc +++ b/src/apps/mpcresources/mplayerc.kr.rc @@ -281,7 +281,7 @@ BEGIN CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,275,45,12,13 CONTROL "DVD 위치 기억",IDC_DVD_POS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,60,156,9 CONTROL "파일 위치 기억",IDC_FILE_POS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,72,158,9 - CONTROL "종료 시, 팬&스캔 확대율 기억",IDC_CHECK11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,84,156,9 + CONTROL "종료 시, 팬&&스캔 확대율 기억",IDC_CHECK11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,84,156,9 CONTROL "메인 재생 목록 기억",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,96,156,9 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,129,108,158,1 CONTROL "최근 열람한 파일 경로를 제목 표시줄에 표기",IDC_CHECK4, @@ -609,7 +609,7 @@ END IDD_PNSPRESET_DLG DIALOGEX 0, 0, 210, 120 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "팬 & 스캔 사전 설정" +CAPTION "팬 && 스캔 사전 설정" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LISTBOX IDC_LIST1,5,5,125,50,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP @@ -2653,9 +2653,9 @@ END STRINGTABLE BEGIN - IDS_AG_PNS_FLIP "팬&스캔 - 좌우반전" - IDS_AG_PNS_ROTATE_CCW "팬&스캔 - 반시계 방향으로 회전" - IDS_AG_PNS_ROTATE_CW "팬&스캔 - 시계 방향으로 회전" + IDS_AG_PNS_FLIP "팬&&스캔 - 좌우반전" + IDS_AG_PNS_ROTATE_CCW "팬&&스캔 - 반시계 방향으로 회전" + IDS_AG_PNS_ROTATE_CW "팬&&스캔 - 시계 방향으로 회전" IDS_AG_TEARING_TEST "티어링 테스트" IDS_SCALE_16_9 "16:9 TV 스케일,%.3f,%.3f,%.3f,%.3f" IDS_SCALE_WIDESCREEN "와이드 스크린으로 확대,%.3f,%.3f,%.3f,%.3f" @@ -2868,12 +2868,12 @@ BEGIN IDS_AG_VIDFRM_NORMAL "비디오폼 : 기본" IDS_AG_VIDFRM_DOUBLE "비디오폼 : 2배" IDS_AG_ALWAYS_ON_TOP "항상 위에 유지" - IDS_AG_PNS_INC_SIZE "팬&스캔 - 크기 확대" - IDS_AG_PNS_INC_WIDTH "팬&스캔 - 폭 확대" - IDS_AG_PNS_INC_HEIGHT "팬&스캔 - 높이 확대" - IDS_AG_PNS_DEC_SIZE "팬&스캔 - 크기 축소" - IDS_AG_PNS_DEC_WIDTH "팬&스캔 - 폭 축소" - IDS_AG_PNS_DEC_HEIGHT "팬&스캔 - 높이 축소" + IDS_AG_PNS_INC_SIZE "팬&&스캔 - 크기 확대" + IDS_AG_PNS_INC_WIDTH "팬&&스캔 - 폭 확대" + IDS_AG_PNS_INC_HEIGHT "팬&&스캔 - 높이 확대" + IDS_AG_PNS_DEC_SIZE "팬&&스캔 - 크기 축소" + IDS_AG_PNS_DEC_WIDTH "팬&&스캔 - 폭 축소" + IDS_AG_PNS_DEC_HEIGHT "팬&&스캔 - 높이 축소" END STRINGTABLE @@ -2885,15 +2885,15 @@ END STRINGTABLE BEGIN - IDS_AG_PNS_CENTER "팬&스캔 - 중앙 배치" - IDS_AG_PNS_LEFT "팬&스캔 - 왼쪽으로" - IDS_AG_PNS_RIGHT "팬&스캔 - 오른쪽으로" - IDS_AG_PNS_UP "팬&스캔 - 위로" - IDS_AG_PNS_DOWN "팬&스캔 - 아래로" - IDS_AG_PNS_UPLEFT "팬&스캔 - 왼쪽 위로" - IDS_AG_PNS_UPRIGHT "팬&스캔 - 오른쪽 위로" - IDS_AG_PNS_DOWNLEFT "팬&스캔 - 왼쪽 아래로" - IDS_AG_PNS_DOWNRIGHT "퍈&스캔 - 오른쪽 아래로" + IDS_AG_PNS_CENTER "팬&&스캔 - 중앙 배치" + IDS_AG_PNS_LEFT "팬&&스캔 - 왼쪽으로" + IDS_AG_PNS_RIGHT "팬&&스캔 - 오른쪽으로" + IDS_AG_PNS_UP "팬&&스캔 - 위로" + IDS_AG_PNS_DOWN "팬&&스캔 - 아래로" + IDS_AG_PNS_UPLEFT "팬&&스캔 - 왼쪽 위로" + IDS_AG_PNS_UPRIGHT "팬&&스캔 - 오른쪽 위로" + IDS_AG_PNS_DOWNLEFT "팬&&스캔 - 왼쪽 아래로" + IDS_AG_PNS_DOWNRIGHT "퍈&&스캔 - 오른쪽 아래로" IDS_AG_VOLUME_UP "음량 크게" IDS_AG_VOLUME_DOWN "음량 작게" IDS_AG_VOLUME_MUTE "음 소거" @@ -3111,7 +3111,7 @@ BEGIN IDS_MAINFRM_DIR_TITLE "디렉터리 선택" IDS_MAINFRM_DIR_CHECK "하위 폴더 포함" IDS_AG_PAUSE "일시 중지" - IDS_AG_TOGGLE_CAPTION "제목 표시줄 & 메뉴 토글" + IDS_AG_TOGGLE_CAPTION "제목 표시줄 && 메뉴 토글" IDS_AG_TOGGLE_SEEKER "탐색 표시줄 토글" IDS_AG_TOGGLE_CONTROLS "제어 토글" END @@ -3420,7 +3420,7 @@ BEGIN IDS_AG_VIDFRM_STRETCH "비디오폼 : 늘리기" IDS_AG_VIDFRM_INSIDE "비디오폼 : 안쪽" IDS_AG_VIDFRM_OUTSIDE "비디오폼 : 바깥쪽" - IDS_AG_PNS_RESET "팬&스캔 - 초기화" + IDS_AG_PNS_RESET "팬&&스캔 - 초기화" END STRINGTABLE From d3551e3175eee16f5e64372564c780f56709c306 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 27 Jul 2024 16:36:24 +0300 Subject: [PATCH 076/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20ffmpeg=20n7.1-dev-1969-g719e46f54c.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c | 1 + src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c | 3 + .../ffmpeg/libavcodec/aac/aacdec_usac.c | 1 + src/ExtLib/ffmpeg/libavcodec/adpcm.c | 44 ++- src/ExtLib/ffmpeg/libavcodec/alsdec.c | 4 +- src/ExtLib/ffmpeg/libavcodec/cbs_av1.c | 18 +- src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c | 9 +- src/ExtLib/ffmpeg/libavcodec/cbs_h265.h | 65 ++++ .../libavcodec/cbs_h265_syntax_template.c | 367 +++++++++++++++--- src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c | 14 +- src/ExtLib/ffmpeg/libavcodec/pngdec.c | 7 +- src/ExtLib/ffmpeg/libavcodec/proresdec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c | 6 +- src/ExtLib/ffmpeg/libavcodec/vvc/dsp.c | 4 +- src/ExtLib/ffmpeg/libavcodec/vvc/dsp.h | 1 + .../ffmpeg/libavcodec/vvc/filter_template.c | 14 +- src/ExtLib/ffmpeg/libavutil/avsscanf.c | 1 - src/ExtLib/ffmpeg/libavutil/buffer.c | 10 +- src/ExtLib/ffmpeg/libavutil/cpu.c | 1 + src/ExtLib/ffmpeg/libavutil/cpu.h | 1 + src/ExtLib/ffmpeg/libavutil/file_open.c | 8 +- src/ExtLib/ffmpeg/libavutil/frame.c | 2 +- src/ExtLib/ffmpeg/libavutil/slicethread.c | 30 +- src/ExtLib/ffmpeg/libavutil/timecode.c | 3 +- src/ExtLib/ffmpeg/libavutil/version.h | 2 +- src/ExtLib/ffmpeg/libswscale/output.c | 26 +- src/ExtLib/ffmpeg/libswscale/utils.c | 3 +- .../ffmpeg/libswscale/x86/yuv2rgb_template.c | 192 --------- 30 files changed, 517 insertions(+), 326 deletions(-) delete mode 100644 src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index bd48401e6a..b5b26112c8 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -30,7 +30,7 @@ MPCVideoDec Обновлены библиотеки: dav1d 1.4.2-15-g2355eeb; - ffmpeg n7.1-dev-1805-g9af348bd1a; + ffmpeg n7.1-dev-1969-g719e46f54c; Little-CMS git-lcms2.16-60-g1c9021b; MediaInfo git-v24.06-10-g88f3ea4aa; ResizableLib v1.5.3-8-g25a89da; diff --git a/docs/Changelog.txt b/docs/Changelog.txt index cc25c1a5b7..b0f63ccdac 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -30,7 +30,7 @@ Updated Japanese translation (by tsubasanouta). Updated libraries: dav1d 1.4.2-15-g2355eeb; - ffmpeg n7.1-dev-1805-g9af348bd1a; + ffmpeg n7.1-dev-1969-g719e46f54c; Little-CMS git-lcms2.16-60-g1c9021b; MediaInfo git-v24.06-10-g88f3ea4aa; ResizableLib v1.5.3-8-g25a89da; diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c index ea2ba84a80..c37de2e003 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec.c @@ -166,6 +166,7 @@ static av_cold int che_configure(AACDecContext *ac, ac->proc.sbr_ctx_close(ac->che[type][id]); } av_freep(&ac->che[type][id]); + memset(ac->output_element, 0, sizeof(ac->output_element)); } return 0; } diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c index 91a3268889..20bbb007ff 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_lpd.c @@ -130,6 +130,9 @@ int ff_aac_parse_fac_data(AACUsacElemData *ce, GetBitContext *gb, if (use_gain) ce->fac.gain = get_bits(gb, 7); + if (len/8 > 8) + return AVERROR_PATCHWELCOME; + for (int i = 0; i < len/8; i++) { ret = parse_codebook_idx(gb, ce->fac.kv[i], 1, 1); if (ret < 0) diff --git a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c index 32b3c534bf..1b79d19a30 100644 --- a/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c +++ b/src/ExtLib/ffmpeg/libavcodec/aac/aacdec_usac.c @@ -834,6 +834,7 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce, "Number of scalefactor bands in group (%d) " "exceeds limit (%d).\n", ics->max_sfb, ics->num_swb); + ics->max_sfb = 0; return AVERROR(EINVAL); } diff --git a/src/ExtLib/ffmpeg/libavcodec/adpcm.c b/src/ExtLib/ffmpeg/libavcodec/adpcm.c index f63afefd63..afdbeaa15e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/adpcm.c +++ b/src/ExtLib/ffmpeg/libavcodec/adpcm.c @@ -262,7 +262,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) break; case AV_CODEC_ID_ADPCM_DTK: case AV_CODEC_ID_ADPCM_EA: - min_channels = 2; + min_channels = 1; break; case AV_CODEC_ID_ADPCM_AFC: case AV_CODEC_ID_ADPCM_EA_R1: @@ -914,10 +914,12 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, bytestream2_seek(gb, -8, SEEK_CUR); break; case AV_CODEC_ID_ADPCM_EA: + /* Stereo is 30 bytes per block */ + /* Mono is 15 bytes per block */ has_coded_samples = 1; *coded_samples = bytestream2_get_le32(gb); *coded_samples -= *coded_samples % 28; - nb_samples = (buf_size - 12) / 30 * 28; + nb_samples = (buf_size - 12) / (ch == 2 ? 30 : 15) * 28; break; case AV_CODEC_ID_ADPCM_IMA_EA_EACS: has_coded_samples = 1; @@ -1652,10 +1654,10 @@ static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, int coeff1l, coeff2l, coeff1r, coeff2r; int shift_left, shift_right; - /* Each EA ADPCM frame has a 12-byte header followed by 30-byte pieces, - each coding 28 stereo samples. */ + /* Each EA ADPCM frame has a 12-byte header followed by 30-byte (stereo) or 15-byte (mono) pieces, + each coding 28 stereo/mono samples. */ - if (channels != 2) + if (channels != 2 && channels != 1) return AVERROR_INVALIDDATA; current_left_sample = sign_extend(bytestream2_get_le16u(&gb), 16); @@ -1670,11 +1672,16 @@ static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, coeff1r = ea_adpcm_table[ byte & 0x0F]; coeff2r = ea_adpcm_table[(byte & 0x0F) + 4]; - byte = bytestream2_get_byteu(&gb); - shift_left = 20 - (byte >> 4); - shift_right = 20 - (byte & 0x0F); + if (channels == 2){ + byte = bytestream2_get_byteu(&gb); + shift_left = 20 - (byte >> 4); + shift_right = 20 - (byte & 0x0F); + } else{ + /* Mono packs the shift into the coefficient byte's lower nibble instead */ + shift_left = 20 - (byte & 0x0F); + } - for (int count2 = 0; count2 < 28; count2++) { + for (int count2 = 0; count2 < (channels == 2 ? 28 : 14); count2++) { byte = bytestream2_get_byteu(&gb); next_left_sample = sign_extend(byte >> 4, 4) * (1 << shift_left); next_right_sample = sign_extend(byte, 4) * (1 << shift_right); @@ -1691,11 +1698,24 @@ static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, previous_right_sample = current_right_sample; current_right_sample = av_clip_int16(next_right_sample); *samples++ = current_left_sample; - *samples++ = current_right_sample; + + if (channels == 2){ + *samples++ = current_right_sample; + } else { + next_left_sample = sign_extend(byte, 4) * (1 << shift_left); + + next_left_sample = (next_left_sample + + (current_left_sample * coeff1l) + + (previous_left_sample * coeff2l) + 0x80) >> 8; + + previous_left_sample = current_left_sample; + current_left_sample = av_clip_int16(next_left_sample); + + *samples++ = current_left_sample; + } } } - - bytestream2_skip(&gb, 2); // Skip terminating 0x0000 + bytestream2_skip(&gb, channels == 2 ? 2 : 3); // Skip terminating NULs ) /* End of CASE */ CASE(ADPCM_EA_MAXIS_XA, int coeff[2][2], shift[2]; diff --git a/src/ExtLib/ffmpeg/libavcodec/alsdec.c b/src/ExtLib/ffmpeg/libavcodec/alsdec.c index be72994432..f4f67917d7 100644 --- a/src/ExtLib/ffmpeg/libavcodec/alsdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/alsdec.c @@ -2110,8 +2110,8 @@ static av_cold int decode_init(AVCodecContext *avctx) if (sconf->floating) { ctx->acf = av_malloc_array(channels, sizeof(*ctx->acf)); - ctx->shift_value = av_malloc_array(channels, sizeof(*ctx->shift_value)); - ctx->last_shift_value = av_malloc_array(channels, sizeof(*ctx->last_shift_value)); + ctx->shift_value = av_calloc(channels, sizeof(*ctx->shift_value)); + ctx->last_shift_value = av_calloc(channels, sizeof(*ctx->last_shift_value)); ctx->last_acf_mantissa = av_malloc_array(channels, sizeof(*ctx->last_acf_mantissa)); ctx->raw_mantissa = av_calloc(channels, sizeof(*ctx->raw_mantissa)); diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_av1.c b/src/ExtLib/ffmpeg/libavcodec/cbs_av1.c index fb82996022..458381f038 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_av1.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_av1.c @@ -36,7 +36,7 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, CBS_TRACE_READ_START(); zeroes = 0; - while (1) { + while (zeroes < 32) { if (get_bits_left(gbc) < 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid uvlc code at " "%s: bitstream ended.\n", name); @@ -49,10 +49,18 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, } if (zeroes >= 32) { - // Note that the spec allows an arbitrarily large number of - // zero bits followed by a one bit in this case, but the - // libaom implementation does not support it. - value = MAX_UINT_BITS(32); + // The spec allows at least thirty-two zero bits followed by a + // one to mean 2^32-1, with no constraint on the number of + // zeroes. The libaom reference decoder does not match this, + // instead reading thirty-two zeroes but not the following one + // to mean 2^32-1. These two interpretations are incompatible + // and other implementations may follow one or the other. + // Therefore we reject thirty-two zeroes because the intended + // behaviour is not clear. + av_log(ctx->log_ctx, AV_LOG_ERROR, "Thirty-two zero bits in " + "%s uvlc code: considered invalid due to conflicting " + "standard and reference decoder behaviour.\n", name); + return AVERROR_INVALIDDATA; } else { if (get_bits_left(gbc) < zeroes) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid uvlc code at " diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c index 5ec781ddab..d73d77a985 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h2645.c @@ -499,7 +499,8 @@ static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx, size_t size = nal->size; enum AVCodecID codec_id = ctx->codec->codec_id; - if (codec_id != AV_CODEC_ID_VVC && nal->nuh_layer_id > 0) + if (codec_id == AV_CODEC_ID_HEVC && nal->nuh_layer_id > 0 && + (nal->type < HEVC_NAL_VPS || nal->type > HEVC_NAL_PPS)) continue; // Remove trailing zeroes. @@ -2274,6 +2275,12 @@ static const SEIMessageTypeDescriptor cbs_sei_h265_types[] = { sizeof(H265RawSEIAlphaChannelInfo), SEI_MESSAGE_RW(h265, sei_alpha_channel_info), }, + { + SEI_TYPE_THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO, + 1, 0, + sizeof(H265RawSEI3DReferenceDisplaysInfo), + SEI_MESSAGE_RW(h265, sei_3d_reference_displays_info), + }, SEI_MESSAGE_TYPE_END }; diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h265.h b/src/ExtLib/ffmpeg/libavcodec/cbs_h265.h index 91a5a55317..892a35bd22 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h265.h +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h265.h @@ -248,12 +248,16 @@ typedef struct H265RawSPS { uint8_t sps_video_parameter_set_id; uint8_t sps_max_sub_layers_minus1; + uint8_t sps_ext_or_max_sub_layers_minus1; uint8_t sps_temporal_id_nesting_flag; H265RawProfileTierLevel profile_tier_level; uint8_t sps_seq_parameter_set_id; + uint8_t update_rep_format_flag; + uint8_t sps_rep_format_idx; + uint8_t chroma_format_idc; uint8_t separate_colour_plane_flag; @@ -284,6 +288,8 @@ typedef struct H265RawSPS { uint8_t max_transform_hierarchy_depth_intra; uint8_t scaling_list_enabled_flag; + uint8_t sps_infer_scaling_list_flag; + uint8_t sps_scaling_list_ref_layer_id; uint8_t sps_scaling_list_data_present_flag; H265RawScalingList scaling_list; @@ -342,6 +348,9 @@ typedef struct H265RawSPS { uint8_t motion_vector_resolution_control_idc; uint8_t intra_boundary_filtering_disable_flag; + + // Multilayer extension. + uint8_t inter_view_mv_vert_constraint_flag; } H265RawSPS; typedef struct H265RawPPS { @@ -433,6 +442,46 @@ typedef struct H265RawPPS { uint8_t luma_bit_depth_entry_minus8; uint8_t chroma_bit_depth_entry_minus8; uint16_t pps_palette_predictor_initializers[3][128]; + + // Multilayer extension. + uint8_t poc_reset_info_present_flag; + uint8_t pps_infer_scaling_list_flag; + uint8_t pps_scaling_list_ref_layer_id; + uint8_t num_ref_loc_offsets; + uint8_t ref_loc_offset_layer_id[64]; + uint8_t scaled_ref_layer_offset_present_flag[64]; + int16_t scaled_ref_layer_left_offset[64]; + int16_t scaled_ref_layer_top_offset[64]; + int16_t scaled_ref_layer_right_offset[64]; + int16_t scaled_ref_layer_bottom_offset[64]; + uint8_t ref_region_offset_present_flag[64]; + int16_t ref_region_left_offset[64]; + int16_t ref_region_top_offset[64]; + int16_t ref_region_right_offset[64]; + int16_t ref_region_bottom_offset[64]; + uint8_t resample_phase_set_present_flag[64]; + uint8_t phase_hor_luma[64]; + uint8_t phase_ver_luma[64]; + uint8_t phase_hor_chroma_plus8[64]; + uint8_t phase_ver_chroma_plus8[64]; + uint8_t colour_mapping_enabled_flag; + uint8_t num_cm_ref_layers_minus1; + uint8_t cm_ref_layer_id[62]; + uint8_t cm_octant_depth; + uint8_t cm_y_part_num_log2; + uint8_t luma_bit_depth_cm_input_minus8; + uint8_t chroma_bit_depth_cm_input_minus8; + uint8_t luma_bit_depth_cm_output_minus8; + uint8_t chroma_bit_depth_cm_output_minus8; + uint8_t cm_res_quant_bits; + uint8_t cm_delta_flc_bits_minus1; + int16_t cm_adapt_threshold_u_delta; + int16_t cm_adapt_threshold_v_delta; + uint8_t split_octant_flag[2]; + uint8_t coded_res_flag[12][2][2][4]; + uint8_t res_coeff_q[12][2][2][4][3]; + uint32_t res_coeff_s[12][2][2][4][3]; + uint8_t res_coeff_r[12][2][2][4][3]; } H265RawPPS; typedef struct H265RawAUD { @@ -671,6 +720,22 @@ typedef struct H265RawSEIAlphaChannelInfo { uint8_t alpha_channel_clip_type_flag; } H265RawSEIAlphaChannelInfo; +typedef struct H265RawSEI3DReferenceDisplaysInfo { + uint8_t prec_ref_display_width; + uint8_t ref_viewing_distance_flag; + uint8_t prec_ref_viewing_dist; + uint8_t num_ref_displays_minus1; + uint8_t left_view_id[31]; + uint8_t right_view_id[31]; + uint8_t exponent_ref_display_width[31]; + uint8_t mantissa_ref_display_width[31]; + uint8_t exponent_ref_viewing_distance[31]; + uint8_t mantissa_ref_viewing_distance[31]; + uint8_t additional_shift_present_flag[31]; + uint16_t num_sample_shift_plus512[31]; + uint8_t three_dimensional_reference_displays_extension_flag; +} H265RawSEI3DReferenceDisplaysInfo; + typedef struct H265RawSEI { H265RawNALUnitHeader nal_unit_header; SEIRawMessageList message_list; diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c index 86ca00a0c9..f1be30a6c9 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c @@ -747,6 +747,16 @@ static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw, return 0; } +static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw, + H265RawSPS *current) +{ + int err; + + flag(inter_view_mv_vert_constraint_flag); + + return 0; +} + static int FUNC(vui_parameters_default)(CodedBitstreamContext *ctx, RWContext *rw, H265RawVUI *current, H265RawSPS *sps) @@ -781,6 +791,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, int err, i; unsigned int min_cb_log2_size_y, ctb_log2_size_y, min_cb_size_y, min_tb_log2_size_y; + unsigned int multi_layer_ext_sps_flag; HEADER("Sequence Parameter Set"); @@ -788,18 +799,25 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, ub(4, sps_video_parameter_set_id); h265->active_vps = vps = h265->vps[current->sps_video_parameter_set_id]; + if (!vps) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "VPS id %d not available.\n", + current->sps_video_parameter_set_id); + return AVERROR_INVALIDDATA; + } + + if (current->nal_unit_header.nuh_layer_id == 0) + u(3, sps_max_sub_layers_minus1, 0, vps->vps_max_sub_layers_minus1); + else { + u(3, sps_ext_or_max_sub_layers_minus1, 0, HEVC_MAX_SUB_LAYERS); + infer(sps_max_sub_layers_minus1, current->sps_ext_or_max_sub_layers_minus1 == HEVC_MAX_SUB_LAYERS + ? vps->vps_max_sub_layers_minus1 + : current->sps_ext_or_max_sub_layers_minus1); + } + multi_layer_ext_sps_flag = current->nal_unit_header.nuh_layer_id && + current->sps_ext_or_max_sub_layers_minus1 == HEVC_MAX_SUB_LAYERS; + if (!multi_layer_ext_sps_flag) { + flag(sps_temporal_id_nesting_flag); - u(3, sps_max_sub_layers_minus1, 0, HEVC_MAX_SUB_LAYERS - 1); - flag(sps_temporal_id_nesting_flag); - if (vps) { - if (vps->vps_max_sub_layers_minus1 > current->sps_max_sub_layers_minus1) { - av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " - "sps_max_sub_layers_minus1 (%d) must be less than or equal to " - "vps_max_sub_layers_minus1 (%d).\n", - vps->vps_max_sub_layers_minus1, - current->sps_max_sub_layers_minus1); - return AVERROR_INVALIDDATA; - } if (vps->vps_temporal_id_nesting_flag && !current->sps_temporal_id_nesting_flag) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " @@ -807,59 +825,79 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, "vps_temporal_id_nesting_flag is 1.\n"); return AVERROR_INVALIDDATA; } - } + if (current->sps_max_sub_layers_minus1 == 0 && + current->sps_temporal_id_nesting_flag != 1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " + "sps_temporal_id_nesting_flag must be 1 if " + "sps_max_sub_layers_minus1 is 0.\n"); + return AVERROR_INVALIDDATA; + } - CHECK(FUNC(profile_tier_level)(ctx, rw, ¤t->profile_tier_level, - 1, current->sps_max_sub_layers_minus1)); + CHECK(FUNC(profile_tier_level)(ctx, rw, ¤t->profile_tier_level, + 1, current->sps_max_sub_layers_minus1)); + } else { + if (current->sps_max_sub_layers_minus1 > 0) + infer(sps_temporal_id_nesting_flag, vps->vps_temporal_id_nesting_flag); + else + infer(sps_temporal_id_nesting_flag, 1); + } ue(sps_seq_parameter_set_id, 0, 15); - ue(chroma_format_idc, 0, 3); - if (current->chroma_format_idc == 3) - flag(separate_colour_plane_flag); - else - infer(separate_colour_plane_flag, 0); + if (multi_layer_ext_sps_flag) { + flag(update_rep_format_flag); + if (current->update_rep_format_flag) + ub(8, sps_rep_format_idx); + } else { + ue(chroma_format_idc, 0, 3); + if (current->chroma_format_idc == 3) + flag(separate_colour_plane_flag); + else + infer(separate_colour_plane_flag, 0); - ue(pic_width_in_luma_samples, 1, HEVC_MAX_WIDTH); - ue(pic_height_in_luma_samples, 1, HEVC_MAX_HEIGHT); + ue(pic_width_in_luma_samples, 1, HEVC_MAX_WIDTH); + ue(pic_height_in_luma_samples, 1, HEVC_MAX_HEIGHT); - flag(conformance_window_flag); - if (current->conformance_window_flag) { - ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples); - ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples); - ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples); - ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples); - } else { - infer(conf_win_left_offset, 0); - infer(conf_win_right_offset, 0); - infer(conf_win_top_offset, 0); - infer(conf_win_bottom_offset, 0); - } + flag(conformance_window_flag); + if (current->conformance_window_flag) { + ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples); + ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples); + ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples); + ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples); + } else { + infer(conf_win_left_offset, 0); + infer(conf_win_right_offset, 0); + infer(conf_win_top_offset, 0); + infer(conf_win_bottom_offset, 0); + } - ue(bit_depth_luma_minus8, 0, 8); - ue(bit_depth_chroma_minus8, 0, 8); + ue(bit_depth_luma_minus8, 0, 8); + ue(bit_depth_chroma_minus8, 0, 8); + } ue(log2_max_pic_order_cnt_lsb_minus4, 0, 12); - flag(sps_sub_layer_ordering_info_present_flag); - for (i = (current->sps_sub_layer_ordering_info_present_flag ? - 0 : current->sps_max_sub_layers_minus1); - i <= current->sps_max_sub_layers_minus1; i++) { - ues(sps_max_dec_pic_buffering_minus1[i], - 0, HEVC_MAX_DPB_SIZE - 1, 1, i); - ues(sps_max_num_reorder_pics[i], - 0, current->sps_max_dec_pic_buffering_minus1[i], 1, i); - ues(sps_max_latency_increase_plus1[i], - 0, UINT32_MAX - 1, 1, i); - } - if (!current->sps_sub_layer_ordering_info_present_flag) { - for (i = 0; i < current->sps_max_sub_layers_minus1; i++) { - infer(sps_max_dec_pic_buffering_minus1[i], - current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]); - infer(sps_max_num_reorder_pics[i], - current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]); - infer(sps_max_latency_increase_plus1[i], - current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]); + if (!multi_layer_ext_sps_flag) { + flag(sps_sub_layer_ordering_info_present_flag); + for (i = (current->sps_sub_layer_ordering_info_present_flag ? + 0 : current->sps_max_sub_layers_minus1); + i <= current->sps_max_sub_layers_minus1; i++) { + ues(sps_max_dec_pic_buffering_minus1[i], + 0, HEVC_MAX_DPB_SIZE - 1, 1, i); + ues(sps_max_num_reorder_pics[i], + 0, current->sps_max_dec_pic_buffering_minus1[i], 1, i); + ues(sps_max_latency_increase_plus1[i], + 0, UINT32_MAX - 1, 1, i); + } + if (!current->sps_sub_layer_ordering_info_present_flag) { + for (i = 0; i < current->sps_max_sub_layers_minus1; i++) { + infer(sps_max_dec_pic_buffering_minus1[i], + current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]); + infer(sps_max_num_reorder_pics[i], + current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]); + infer(sps_max_latency_increase_plus1[i], + current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]); + } } } @@ -892,9 +930,17 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, flag(scaling_list_enabled_flag); if (current->scaling_list_enabled_flag) { - flag(sps_scaling_list_data_present_flag); - if (current->sps_scaling_list_data_present_flag) - CHECK(FUNC(scaling_list_data)(ctx, rw, ¤t->scaling_list)); + if (multi_layer_ext_sps_flag) + flag(sps_infer_scaling_list_flag); + else + infer(sps_infer_scaling_list_flag, 0); + if (current->sps_infer_scaling_list_flag) + ub(6, sps_scaling_list_ref_layer_id); + else { + flag(sps_scaling_list_data_present_flag); + if (current->sps_scaling_list_data_present_flag) + CHECK(FUNC(scaling_list_data)(ctx, rw, ¤t->scaling_list)); + } } else { infer(sps_scaling_list_data_present_flag, 0); } @@ -952,7 +998,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_range_extension_flag) CHECK(FUNC(sps_range_extension)(ctx, rw, current)); if (current->sps_multilayer_extension_flag) - return AVERROR_PATCHWELCOME; + CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current)); if (current->sps_3d_extension_flag) return AVERROR_PATCHWELCOME; if (current->sps_scc_extension_flag) @@ -993,6 +1039,167 @@ static int FUNC(pps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw, return 0; } +static int FUNC(colour_mapping_octants)(CodedBitstreamContext *ctx, RWContext *rw, + H265RawPPS *current, unsigned int inp_depth, + unsigned int idx_y, unsigned int idx_cb, + unsigned int idx_cr, unsigned int inp_length) +{ + int part_num_y, cm_res_bits; + int err; + + part_num_y = 1 << current->cm_y_part_num_log2; + + av_assert0(inp_depth <= 1); + if (inp_depth < current->cm_octant_depth) + flags(split_octant_flag[inp_depth], 1, inp_depth); + else + infer(split_octant_flag[inp_depth], 0); + + if (current->split_octant_flag[inp_depth]) + for (int k = 0; k < 2; k++) + for (int m = 0; m < 2; m++) + for (int n = 0; n < 2; n++) + CHECK(FUNC(colour_mapping_octants)(ctx, rw, current, inp_depth + 1, + idx_y + part_num_y * k * inp_length / 2, + idx_cb + m * inp_length / 2, + idx_cr + n * inp_length / 2, + inp_length / 2)); + else + for (int i = 0; i < part_num_y; i++) { + int idx_shift_y = idx_y + (i << (current->cm_octant_depth - inp_depth)); + for (int j = 0; j < 4; j++) { + flags(coded_res_flag[idx_shift_y][idx_cb][idx_cr][j], + 4, idx_shift_y, idx_cb, idx_cr, j); + if (current->coded_res_flag[idx_shift_y][idx_cb][idx_cr][j]) { + for (int c = 0; c < 3; c++) { + ues(res_coeff_q[idx_shift_y][idx_cb][idx_cr][j][c], 0, 3, + 5, idx_shift_y, idx_cb, idx_cr, j, c); + cm_res_bits = FFMAX(0, 10 + (current->luma_bit_depth_cm_input_minus8 + 8) - + (current->luma_bit_depth_cm_output_minus8 + 8) - + current->cm_res_quant_bits - (current->cm_delta_flc_bits_minus1 + 1)); + if (cm_res_bits) + ubs(cm_res_bits, res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c], + 5, idx_shift_y, idx_cb, idx_cr, j, c); + else + infer(res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c], 0); + if (current->res_coeff_q[idx_shift_y][idx_cb][idx_cr][j][c] || + current->res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c]) + ub(1, res_coeff_s[idx_shift_y][idx_cb][idx_cr][j][c]); + else + infer(res_coeff_s[idx_shift_y][idx_cb][idx_cr][j][c], 0); + } + } else { + for (int c = 0; c < 3; c++) { + infer(res_coeff_q[idx_shift_y][idx_cb][idx_cr][j][c], 0); + infer(res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c], 0); + infer(res_coeff_s[idx_shift_y][idx_cb][idx_cr][j][c], 0); + } + } + } + } + + return 0; +} + +static int FUNC(colour_mapping_table)(CodedBitstreamContext *ctx, RWContext *rw, + H265RawPPS *current) +{ + int err; + + ue(num_cm_ref_layers_minus1, 0, 61); + for (int i = 0; i <= current->num_cm_ref_layers_minus1; i++) + ubs(6, cm_ref_layer_id[i], 1, i); + + u(2, cm_octant_depth, 0, 1); + u(2, cm_y_part_num_log2, 0, 3 - current->cm_octant_depth); + + ue(luma_bit_depth_cm_input_minus8, 0, 8); + ue(chroma_bit_depth_cm_input_minus8, 0, 8); + ue(luma_bit_depth_cm_output_minus8, 0, 8); + ue(chroma_bit_depth_cm_output_minus8, 0, 8); + + ub(2, cm_res_quant_bits); + ub(2, cm_delta_flc_bits_minus1); + + if (current->cm_octant_depth == 1) { + se(cm_adapt_threshold_u_delta, -32768, 32767); + se(cm_adapt_threshold_v_delta, -32768, 32767); + } else { + infer(cm_adapt_threshold_u_delta, 0); + infer(cm_adapt_threshold_v_delta, 0); + } + + CHECK(FUNC(colour_mapping_octants)(ctx, rw, current, 0, 0, 0, 0, 1 << current->cm_octant_depth)); + + return 0; +} + +static int FUNC(pps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw, + H265RawPPS *current) +{ + CodedBitstreamH265Context *h265 = ctx->priv_data; + const H265RawVPS *vps = h265->active_vps; + int offset; + int err, i; + + flag(poc_reset_info_present_flag); + flag(pps_infer_scaling_list_flag); + if (current->pps_infer_scaling_list_flag) + ub(6, pps_scaling_list_ref_layer_id); + + if (!vps) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "VPS missing for PPS Multilayer Extension.\n"); + return AVERROR_INVALIDDATA; + } + + ue(num_ref_loc_offsets, 0, vps->vps_max_layers_minus1); + for (i = 0; i < current->num_ref_loc_offsets; i++) { + ubs(6, ref_loc_offset_layer_id[i], 1, i); + offset = current->ref_loc_offset_layer_id[i]; + flags(scaled_ref_layer_offset_present_flag[i], 1, i); + if (current->scaled_ref_layer_offset_present_flag[i]) { + ses(scaled_ref_layer_left_offset[offset], -16384, 16383, 1, offset); + ses(scaled_ref_layer_top_offset[offset], -16384, 16383, 1, offset); + ses(scaled_ref_layer_right_offset[offset], -16384, 16383, 1, offset); + ses(scaled_ref_layer_bottom_offset[offset], -16384, 16383, 1, offset); + } else { + infer(scaled_ref_layer_left_offset[offset], 0); + infer(scaled_ref_layer_top_offset[offset], 0); + infer(scaled_ref_layer_right_offset[offset], 0); + infer(scaled_ref_layer_bottom_offset[offset], 0); + } + flags(ref_region_offset_present_flag[i], 1, i); + if (current->ref_region_offset_present_flag[i]) { + ses(ref_region_left_offset[offset], -16384, 16383, 1, offset); + ses(ref_region_top_offset[offset], -16384, 16383, 1, offset); + ses(ref_region_right_offset[offset], -16384, 16383, 1, offset); + ses(ref_region_bottom_offset[offset], -16384, 16383, 1, offset); + } else { + infer(ref_region_left_offset[offset], 0); + infer(ref_region_top_offset[offset], 0); + infer(ref_region_right_offset[offset], 0); + infer(ref_region_bottom_offset[offset], 0); + } + flags(resample_phase_set_present_flag[i], 1, i); + if (current->resample_phase_set_present_flag[i]) { + ues(phase_hor_luma[offset], 0, 31, 1, offset); + ues(phase_ver_luma[offset], 0, 31, 1, offset); + ues(phase_hor_chroma_plus8[offset], 0, 63, 1, offset); + ues(phase_ver_chroma_plus8[offset], 0, 63, 1, offset); + } else { + infer(phase_hor_luma[offset], 0); + infer(phase_ver_luma[offset], 0); + infer(phase_hor_chroma_plus8[offset], 8); + } + } + + flag(colour_mapping_enabled_flag); + if (current->colour_mapping_enabled_flag) + CHECK(FUNC(colour_mapping_table)(ctx, rw, current)); + + return 0; +} + static int FUNC(pps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw, H265RawPPS *current) { @@ -1143,7 +1350,7 @@ static int FUNC(pps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->pps_range_extension_flag) CHECK(FUNC(pps_range_extension)(ctx, rw, current)); if (current->pps_multilayer_extension_flag) - return AVERROR_PATCHWELCOME; + CHECK(FUNC(pps_multilayer_extension)(ctx, rw, current)); if (current->pps_3d_extension_flag) return AVERROR_PATCHWELCOME; if (current->pps_scc_extension_flag) @@ -2077,6 +2284,48 @@ SEI_FUNC(sei_alpha_channel_info, (CodedBitstreamContext *ctx, RWContext *rw, return 0; } +SEI_FUNC(sei_3d_reference_displays_info, (CodedBitstreamContext *ctx, RWContext *rw, + H265RawSEI3DReferenceDisplaysInfo *current, + SEIMessageState *sei)) +{ + int length; + int err, i; + + HEADER("Three Dimensional Reference Displays Information"); + + ue(prec_ref_display_width, 0, 31); + flag(ref_viewing_distance_flag); + if (current->ref_viewing_distance_flag) + ue(prec_ref_viewing_dist, 0, 31); + ue(num_ref_displays_minus1, 0, 31); + for (i = 0; i <= current->num_ref_displays_minus1; i++) { + ues(left_view_id[i], 0, UINT8_MAX, 1, i); + ues(right_view_id[i], 0, UINT8_MAX, 1, i); + us(6, exponent_ref_display_width[i], 0, 62, 1, i); + if (!current->exponent_ref_display_width[i]) + length = FFMAX(0, (int)current->prec_ref_display_width - 30); + else + length = FFMAX(0, (int)current->exponent_ref_display_width[i] + + (int)current->prec_ref_display_width - 31); + ubs(length, mantissa_ref_display_width[i], 1, i); + if (current->ref_viewing_distance_flag) { + us(6, exponent_ref_viewing_distance[i], 0, 62, 1, i); + if (!current->exponent_ref_viewing_distance[i]) + length = FFMAX(0, (int)current->prec_ref_viewing_dist - 30); + else + length = FFMAX(0, (int)current->exponent_ref_viewing_distance[i] + + (int)current->prec_ref_viewing_dist - 31); + ubs(length, mantissa_ref_viewing_distance[i], 1, i); + } + flags(additional_shift_present_flag[i], 1, i); + if (current->additional_shift_present_flag[i]) + us(10, num_sample_shift_plus512[i], 0, 1023, 1, i); + } + flag(three_dimensional_reference_displays_extension_flag); + + return 0; +} + static int FUNC(sei)(CodedBitstreamContext *ctx, RWContext *rw, H265RawSEI *current, int prefix) { diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c index 47be8f8f74..35666699d5 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c @@ -292,7 +292,7 @@ static int decode_lt_rps(const HEVCSPS *sps, LongTermRPS *rps, lt_idx_sps = get_bits(gb, av_ceil_log2(sps->num_long_term_ref_pics_sps)); rps->poc[i] = sps->lt_ref_pic_poc_lsb_sps[lt_idx_sps]; - rps->used[i] = !!(sps->used_by_curr_pic_lt & (1 << lt_idx_sps)); + rps->used[i] = !!(sps->used_by_curr_pic_lt & (1U << lt_idx_sps)); } else { rps->poc[i] = get_bits(gb, sps->log2_max_poc_lsb); rps->used[i] = get_bits1(gb); @@ -645,6 +645,10 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext if (pps->dependent_slice_segments_enabled_flag) sh->dependent_slice_segment_flag = get_bits1(gb); + if (sh->dependent_slice_segment_flag && !s->slice_initialized) { + av_log(s->avctx, AV_LOG_ERROR, "Independent slice segment missing.\n"); + return AVERROR_INVALIDDATA; + } slice_address_length = av_ceil_log2(sps->ctb_width * sps->ctb_height); @@ -917,9 +921,6 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext } else { sh->slice_loop_filter_across_slices_enabled_flag = pps->seq_loop_filter_across_slices_enabled_flag; } - } else if (!s->slice_initialized) { - av_log(s->avctx, AV_LOG_ERROR, "Independent slice segment missing.\n"); - return AVERROR_INVALIDDATA; } sh->num_entry_point_offsets = 0; @@ -3187,8 +3188,11 @@ static int decode_slice(HEVCContext *s, const H2645NAL *nal, GetBitContext *gb) int ret; ret = hls_slice_header(&s->sh, s, gb); - if (ret < 0) + if (ret < 0) { + // hls_slice_header() does not cleanup on failure thus the state now is inconsistant so we cannot use it on depandant slices + s->slice_initialized = 0; return ret; + } if ((s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type == HEVC_SLICE_B) || (s->avctx->skip_frame >= AVDISCARD_NONINTRA && s->sh.slice_type != HEVC_SLICE_I) || diff --git a/src/ExtLib/ffmpeg/libavcodec/pngdec.c b/src/ExtLib/ffmpeg/libavcodec/pngdec.c index 180806e5e1..cb861e5f60 100644 --- a/src/ExtLib/ffmpeg/libavcodec/pngdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/pngdec.c @@ -1084,10 +1084,13 @@ static int decode_sbit_chunk(AVCodecContext *avctx, PNGDecContext *s, return AVERROR_INVALIDDATA; } - channels = ff_png_get_nb_channels(s->color_type); + channels = s->color_type & PNG_COLOR_MASK_PALETTE ? 3 : ff_png_get_nb_channels(s->color_type); - if (bytestream2_get_bytes_left(gb) != channels) + if (bytestream2_get_bytes_left(gb) != channels) { + av_log(avctx, AV_LOG_ERROR, "Invalid sBIT size: %d, expected: %d\n", + bytestream2_get_bytes_left(gb), channels); return AVERROR_INVALIDDATA; + } for (int i = 0; i < channels; i++) { int b = bytestream2_get_byteu(gb); diff --git a/src/ExtLib/ffmpeg/libavcodec/proresdec.c b/src/ExtLib/ffmpeg/libavcodec/proresdec.c index ec1d0bd0be..6a256107b4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/proresdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/proresdec.c @@ -511,7 +511,7 @@ static av_always_inline int decode_ac_coeffs(AVCodecContext *avctx, GetBitContex for (pos = block_mask;;) { bits_left = gb->size_in_bits - re_index; - if (!bits_left || (bits_left < 32 && !SHOW_UBITS(re, gb, bits_left))) + if (bits_left <= 0 || (bits_left < 32 && !SHOW_UBITS(re, gb, bits_left))) break; DECODE_CODEWORD(run, run_to_cb[FFMIN(run, 15)], LAST_SKIP_BITS); diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c index 8dd6ea77cd..3f9a75190b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/ctu.c @@ -1080,12 +1080,10 @@ static PredMode pred_mode_decode(VVCLocalContext *lc, } if (pred_mode_ibc_flag) pred_mode = MODE_IBC; + return pred_mode; } else { - pred_mode_flag = is_4x4 || mode_type == MODE_TYPE_INTRA || - mode_type != MODE_TYPE_INTER || IS_I(rsh); - pred_mode = pred_mode_flag ? MODE_INTRA : MODE_INTER; + return MODE_INTRA; } - return pred_mode; } static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps) diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.c b/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.c index 41e830a98a..648d54ebb2 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.c @@ -121,7 +121,9 @@ void ff_vvc_dsp_init(VVCDSPContext *vvcdsp, int bit_depth) break; } -#if ARCH_X86 +#if ARCH_AARCH64 + ff_vvc_dsp_init_aarch64(vvcdsp, bit_depth); +#elif ARCH_X86 ff_vvc_dsp_init_x86(vvcdsp, bit_depth); #endif } diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.h b/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.h index 1f14096c41..0b49b97021 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.h +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/dsp.h @@ -180,6 +180,7 @@ typedef struct VVCDSPContext { void ff_vvc_dsp_init(VVCDSPContext *hpc, int bit_depth); +void ff_vvc_dsp_init_aarch64(VVCDSPContext *hpc, const int bit_depth); void ff_vvc_dsp_init_x86(VVCDSPContext *hpc, const int bit_depth); #endif /* AVCODEC_VVC_DSP_H */ diff --git a/src/ExtLib/ffmpeg/libavcodec/vvc/filter_template.c b/src/ExtLib/ffmpeg/libavcodec/vvc/filter_template.c index 9b3a0e46f7..6dd7310089 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vvc/filter_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/vvc/filter_template.c @@ -77,7 +77,7 @@ static void FUNC(alf_filter_luma)(uint8_t *_dst, ptrdiff_t dst_stride, const uin const int is_near_vb_below = (y + i >= vb_pos) && (y + i <= vb_pos); const int is_near_vb = is_near_vb_above || is_near_vb_below; - if ((y + i < vb_pos) && ((y + i) >= vb_above)) { + if ((y + i < vb_pos) && ((y + i) > vb_above)) { p1 = (y + i == vb_pos - 1) ? p0 : p1; p3 = (y + i >= vb_pos - 2) ? p1 : p3; p5 = (y + i >= vb_pos - 3) ? p3 : p5; @@ -85,7 +85,7 @@ static void FUNC(alf_filter_luma)(uint8_t *_dst, ptrdiff_t dst_stride, const uin p2 = (y + i == vb_pos - 1) ? p0 : p2; p4 = (y + i >= vb_pos - 2) ? p2 : p4; p6 = (y + i >= vb_pos - 3) ? p4 : p6; - } else if ((y + i >= vb_pos) && ((y + i) <= vb_below)) { + } else if ((y + i >= vb_pos) && ((y + i) < vb_below)) { p2 = (y + i == vb_pos ) ? p0 : p2; p4 = (y + i <= vb_pos + 1) ? p2 : p4; p6 = (y + i <= vb_pos + 2) ? p4 : p6; @@ -153,8 +153,6 @@ static void FUNC(alf_filter_chroma)(uint8_t* _dst, ptrdiff_t dst_stride, const u const pixel *s2 = s0 - src_stride; const pixel *s3 = s1 + src_stride; const pixel *s4 = s2 - src_stride; - const pixel *s5 = s3 + src_stride; - const pixel *s6 = s4 - src_stride; for (int i = 0; i < ALF_BLOCK_SIZE; i++) { pixel *dst = (pixel *)_dst + (y + i) * dst_stride + x; @@ -164,8 +162,6 @@ static void FUNC(alf_filter_chroma)(uint8_t* _dst, ptrdiff_t dst_stride, const u const pixel *p2 = s2 + i * src_stride; const pixel *p3 = s3 + i * src_stride; const pixel *p4 = s4 + i * src_stride; - const pixel *p5 = s5 + i * src_stride; - const pixel *p6 = s6 + i * src_stride; const int is_near_vb_above = (y + i < vb_pos) && (y + i >= vb_pos - 1); const int is_near_vb_below = (y + i >= vb_pos) && (y + i <= vb_pos); @@ -174,19 +170,15 @@ static void FUNC(alf_filter_chroma)(uint8_t* _dst, ptrdiff_t dst_stride, const u if ((y + i < vb_pos) && ((y + i) >= vb_above)) { p1 = (y + i == vb_pos - 1) ? p0 : p1; p3 = (y + i >= vb_pos - 2) ? p1 : p3; - p5 = (y + i >= vb_pos - 3) ? p3 : p5; p2 = (y + i == vb_pos - 1) ? p0 : p2; p4 = (y + i >= vb_pos - 2) ? p2 : p4; - p6 = (y + i >= vb_pos - 3) ? p4 : p6; } else if ((y + i >= vb_pos) && ((y + i) <= vb_below)) { p2 = (y + i == vb_pos ) ? p0 : p2; p4 = (y + i <= vb_pos + 1) ? p2 : p4; - p6 = (y + i <= vb_pos + 2) ? p4 : p6; p1 = (y + i == vb_pos ) ? p0 : p1; p3 = (y + i <= vb_pos + 1) ? p1 : p3; - p5 = (y + i <= vb_pos + 2) ? p3 : p5; } for (int j = 0; j < ALF_BLOCK_SIZE; j++) { @@ -212,8 +204,6 @@ static void FUNC(alf_filter_chroma)(uint8_t* _dst, ptrdiff_t dst_stride, const u p2++; p3++; p4++; - p5++; - p6++; } } } diff --git a/src/ExtLib/ffmpeg/libavutil/avsscanf.c b/src/ExtLib/ffmpeg/libavutil/avsscanf.c index 7061e6d965..94f7710043 100644 --- a/src/ExtLib/ffmpeg/libavutil/avsscanf.c +++ b/src/ExtLib/ffmpeg/libavutil/avsscanf.c @@ -669,7 +669,6 @@ static double fffloatscan(FFFILE *f, int prec, int pok) while (i--) shunget(f); return NAN; } - return NAN; } if (i) { diff --git a/src/ExtLib/ffmpeg/libavutil/buffer.c b/src/ExtLib/ffmpeg/libavutil/buffer.c index e4562a79b1..a8101d83f0 100644 --- a/src/ExtLib/ffmpeg/libavutil/buffer.c +++ b/src/ExtLib/ffmpeg/libavutil/buffer.c @@ -264,7 +264,10 @@ AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque, if (!pool) return NULL; - ff_mutex_init(&pool->mutex, NULL); + if (ff_mutex_init(&pool->mutex, NULL)) { + av_free(pool); + return NULL; + } pool->size = size; pool->opaque = opaque; @@ -283,7 +286,10 @@ AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size if (!pool) return NULL; - ff_mutex_init(&pool->mutex, NULL); + if (ff_mutex_init(&pool->mutex, NULL)) { + av_free(pool); + return NULL; + } pool->size = size; pool->alloc = alloc ? alloc : av_buffer_alloc; diff --git a/src/ExtLib/ffmpeg/libavutil/cpu.c b/src/ExtLib/ffmpeg/libavutil/cpu.c index d6a6696726..1f9eb5bf64 100644 --- a/src/ExtLib/ffmpeg/libavutil/cpu.c +++ b/src/ExtLib/ffmpeg/libavutil/cpu.c @@ -186,6 +186,7 @@ int av_parse_cpu_caps(unsigned *flags, const char *s) { "rvi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVI }, .unit = "flags" }, { "rvf", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVF }, .unit = "flags" }, { "rvd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVD }, .unit = "flags" }, + { "rvb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB }, .unit = "flags" }, { "zve32x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I32 }, .unit = "flags" }, { "zve32f", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F32 }, .unit = "flags" }, { "zve64x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I64 }, .unit = "flags" }, diff --git a/src/ExtLib/ffmpeg/libavutil/cpu.h b/src/ExtLib/ffmpeg/libavutil/cpu.h index e4b1efaf86..6d305ba50b 100644 --- a/src/ExtLib/ffmpeg/libavutil/cpu.h +++ b/src/ExtLib/ffmpeg/libavutil/cpu.h @@ -92,6 +92,7 @@ #define AV_CPU_FLAG_RVB_ADDR (1 << 8) ///< Address bit-manipulations #define AV_CPU_FLAG_RV_ZVBB (1 << 9) ///< Vector basic bit-manipulations #define AV_CPU_FLAG_RV_MISALIGNED (1 <<10) ///< Fast misaligned accesses +#define AV_CPU_FLAG_RVB (1 <<11) ///< B (bit manipulations) /** * Return the flags which specify extensions supported by the CPU. diff --git a/src/ExtLib/ffmpeg/libavutil/file_open.c b/src/ExtLib/ffmpeg/libavutil/file_open.c index 08cf728586..e7e6c4226e 100644 --- a/src/ExtLib/ffmpeg/libavutil/file_open.c +++ b/src/ExtLib/ffmpeg/libavutil/file_open.c @@ -112,7 +112,10 @@ int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *l { FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx }; int fd = -1; -#if !HAVE_MKSTEMP +#if HAVE_MKSTEMP + size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ + *filename = av_malloc(len); +#elif HAVE_TEMPNAM void *ptr= tempnam(NULL, prefix); if(!ptr) ptr= tempnam(".", prefix); @@ -120,8 +123,7 @@ int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *l #undef free free(ptr); #else - size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ - *filename = av_malloc(len); + return AVERROR(ENOSYS); #endif /* -----common section-----*/ if (!*filename) { diff --git a/src/ExtLib/ffmpeg/libavutil/frame.c b/src/ExtLib/ffmpeg/libavutil/frame.c index 0775e2abd9..673a9afb3b 100644 --- a/src/ExtLib/ffmpeg/libavutil/frame.c +++ b/src/ExtLib/ffmpeg/libavutil/frame.c @@ -1107,7 +1107,7 @@ int av_frame_apply_cropping(AVFrame *frame, int flags) if (log2_crop_align < min_log2_align) return AVERROR_BUG; - if (min_log2_align < 5) { + if (min_log2_align < 5 && log2_crop_align != INT_MAX) { frame->crop_left &= ~((1 << (5 + log2_crop_align - min_log2_align)) - 1); calc_cropping_offsets(offsets, frame, desc); } diff --git a/src/ExtLib/ffmpeg/libavutil/slicethread.c b/src/ExtLib/ffmpeg/libavutil/slicethread.c index 115b099736..e6b82e31b6 100644 --- a/src/ExtLib/ffmpeg/libavutil/slicethread.c +++ b/src/ExtLib/ffmpeg/libavutil/slicethread.c @@ -102,6 +102,7 @@ int avpriv_slicethread_create(AVSliceThread **pctx, void *priv, { AVSliceThread *ctx; int nb_workers, i; + int ret; av_assert0(nb_threads >= 0); if (!nb_threads) { @@ -135,16 +136,37 @@ int avpriv_slicethread_create(AVSliceThread **pctx, void *priv, atomic_init(&ctx->first_job, 0); atomic_init(&ctx->current_job, 0); - pthread_mutex_init(&ctx->done_mutex, NULL); - pthread_cond_init(&ctx->done_cond, NULL); + ret = pthread_mutex_init(&ctx->done_mutex, NULL); + if (ret) { + av_freep(&ctx->workers); + av_freep(pctx); + return AVERROR(ret); + } + ret = pthread_cond_init(&ctx->done_cond, NULL); + if (ret) { + ctx->nb_threads = main_func ? 0 : 1; + avpriv_slicethread_free(pctx); + return AVERROR(ret); + } ctx->done = 0; for (i = 0; i < nb_workers; i++) { WorkerContext *w = &ctx->workers[i]; int ret; w->ctx = ctx; - pthread_mutex_init(&w->mutex, NULL); - pthread_cond_init(&w->cond, NULL); + ret = pthread_mutex_init(&w->mutex, NULL); + if (ret) { + ctx->nb_threads = main_func ? i : i + 1; + avpriv_slicethread_free(pctx); + return AVERROR(ret); + } + ret = pthread_cond_init(&w->cond, NULL); + if (ret) { + pthread_mutex_destroy(&w->mutex); + ctx->nb_threads = main_func ? i : i + 1; + avpriv_slicethread_free(pctx); + return AVERROR(ret); + } pthread_mutex_lock(&w->mutex); w->done = 0; diff --git a/src/ExtLib/ffmpeg/libavutil/timecode.c b/src/ExtLib/ffmpeg/libavutil/timecode.c index 0b306808b5..2f83c98352 100644 --- a/src/ExtLib/ffmpeg/libavutil/timecode.c +++ b/src/ExtLib/ffmpeg/libavutil/timecode.c @@ -100,11 +100,12 @@ uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss return tc; } -char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum) +char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum_arg) { int fps = tc->fps; int drop = tc->flags & AV_TIMECODE_FLAG_DROPFRAME; int hh, mm, ss, ff, ff_len, neg = 0; + int64_t framenum = framenum_arg; framenum += tc->start; if (drop) diff --git a/src/ExtLib/ffmpeg/libavutil/version.h b/src/ExtLib/ffmpeg/libavutil/version.h index 814892a4d5..852eeef1d6 100644 --- a/src/ExtLib/ffmpeg/libavutil/version.h +++ b/src/ExtLib/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 28 +#define LIBAVUTIL_VERSION_MINOR 29 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libswscale/output.c b/src/ExtLib/ffmpeg/libswscale/output.c index 0e6181b3e0..e8dd2145ce 100644 --- a/src/ExtLib/ffmpeg/libswscale/output.c +++ b/src/ExtLib/ffmpeg/libswscale/output.c @@ -1059,8 +1059,8 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter, for (i = 0; i < ((dstW + 1) >> 1); i++) { int j; - int Y1 = -0x40000000; - int Y2 = -0x40000000; + unsigned Y1 = -0x40000000; + unsigned Y2 = -0x40000000; int U = -(128 << 23); // 19 int V = -(128 << 23); int R, G, B; @@ -1088,9 +1088,9 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter, } // 8 bits: 12+15=27; 16 bits: 12+19=31 - Y1 >>= 14; // 10 + Y1 = (int)Y1 >> 14; // 10 Y1 += 0x10000; - Y2 >>= 14; + Y2 = (int)Y2 >> 14; Y2 += 0x10000; U >>= 14; V >>= 14; @@ -1109,20 +1109,20 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter, B = U * c->yuv2rgb_u2b_coeff; // 8 bits: 30 - 22 = 8 bits, 16 bits: 30 bits - 14 = 16 bits - output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16)); - output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16)); - output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[0], av_clip_uintp2(((int)(R_B + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2(((int)( G + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((int)(B_R + Y1) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); - output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); - output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[4], av_clip_uintp2(((int)(R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2(((int)( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[6], av_clip_uintp2(((int)(B_R + Y2) >> 14) + (1<<15), 16)); output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14); dest += 8; } else { - output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); - output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); - output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[3], av_clip_uintp2(((int)(R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[4], av_clip_uintp2(((int)( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2(((int)(B_R + Y2) >> 14) + (1<<15), 16)); dest += 6; } } diff --git a/src/ExtLib/ffmpeg/libswscale/utils.c b/src/ExtLib/ffmpeg/libswscale/utils.c index bc8d7627e2..c3154d82c1 100644 --- a/src/ExtLib/ffmpeg/libswscale/utils.c +++ b/src/ExtLib/ffmpeg/libswscale/utils.c @@ -2042,6 +2042,7 @@ static int context_init_threaded(SwsContext *c, if (!c->slice_ctx[i]) return AVERROR(ENOMEM); + c->nb_slice_ctx++; c->slice_ctx[i]->parent = c; ret = av_opt_copy((void*)c->slice_ctx[i], (void*)c); @@ -2054,8 +2055,6 @@ static int context_init_threaded(SwsContext *c, if (ret < 0) return ret; - c->nb_slice_ctx++; - if (c->slice_ctx[i]->dither == SWS_DITHER_ED) { av_log(c, AV_LOG_VERBOSE, "Error-diffusion dither is in use, scaling will be single-threaded."); diff --git a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c b/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c deleted file mode 100644 index a4741e6873..0000000000 --- a/src/ExtLib/ffmpeg/libswscale/x86/yuv2rgb_template.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * software YUV to RGB converter - * - * Copyright (C) 2001-2007 Michael Niedermayer - * (c) 2010 Konstantin Shishkov - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -#include "libavutil/x86/asm.h" -#include "libswscale/swscale_internal.h" - -#define YUV2RGB_LOOP(depth) \ - h_size = (c->dstW + 7) & ~7; \ - if (h_size * depth > FFABS(dstStride[0])) \ - h_size -= 8; \ - \ - vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ - \ - for (y = 0; y < srcSliceH; y++) { \ - uint8_t *image = dst[0] + (y + srcSliceY) * dstStride[0]; \ - const uint8_t *py = src[0] + y * srcStride[0]; \ - const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \ - const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \ - x86_reg index = -h_size / 2; \ - -extern void RENAME(ff_yuv_420_rgb24)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index); -extern void RENAME(ff_yuv_420_bgr24)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index); - -extern void RENAME(ff_yuv_420_rgb15)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index); -extern void RENAME(ff_yuv_420_rgb16)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index); -extern void RENAME(ff_yuv_420_rgb32)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index); -extern void RENAME(ff_yuv_420_bgr32)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index); -extern void RENAME(ff_yuva_420_rgb32)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index, const uint8_t *pa_2index); -extern void RENAME(ff_yuva_420_bgr32)(x86_reg index, uint8_t *image, const uint8_t *pu_index, - const uint8_t *pv_index, const uint64_t *pointer_c_dither, - const uint8_t *py_2index, const uint8_t *pa_2index); - -static inline int RENAME(yuv420_rgb15)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - - YUV2RGB_LOOP(2) - -#ifdef DITHER1XBPP - c->blueDither = ff_dither8[y & 1]; - c->greenDither = ff_dither8[y & 1]; - c->redDither = ff_dither8[(y + 1) & 1]; -#endif - - RENAME(ff_yuv_420_rgb15)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); - } - return srcSliceH; -} - -static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - - YUV2RGB_LOOP(2) - -#ifdef DITHER1XBPP - c->blueDither = ff_dither8[y & 1]; - c->greenDither = ff_dither4[y & 1]; - c->redDither = ff_dither8[(y + 1) & 1]; -#endif - - RENAME(ff_yuv_420_rgb16)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); - } - return srcSliceH; -} - -static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - - YUV2RGB_LOOP(4) - - RENAME(ff_yuv_420_rgb32)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); - } - return srcSliceH; -} - -static inline int RENAME(yuv420_bgr32)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - - YUV2RGB_LOOP(4) - - RENAME(ff_yuv_420_bgr32)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); - } - return srcSliceH; -} - -static inline int RENAME(yuva420_rgb32)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - YUV2RGB_LOOP(4) - - const uint8_t *pa = src[3] + y * srcStride[3]; - RENAME(ff_yuva_420_rgb32)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index, pa - 2 * index); - } - return srcSliceH; -} - -static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - - YUV2RGB_LOOP(4) - - const uint8_t *pa = src[3] + y * srcStride[3]; - RENAME(ff_yuva_420_bgr32)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index, pa - 2 * index); - } - return srcSliceH; -} - -static inline int RENAME(yuv420_rgb24)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - - YUV2RGB_LOOP(3) - - RENAME(ff_yuv_420_rgb24)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); - } - return srcSliceH; -} - -static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t *src[], - int srcStride[], - int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]) -{ - int y, h_size, vshift; - - YUV2RGB_LOOP(3) - - RENAME(ff_yuv_420_bgr24)(index, image, pu - index, pv - index, &(c->redDither), py - 2 * index); - } - return srcSliceH; -} From 2bb7df0c7d536b039fdfd2155f51cfdc6694235a Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 28 Jul 2024 07:58:50 +0300 Subject: [PATCH 077/102] =?UTF-8?q?=D0=9A=D0=BE=D1=81=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=20=D0=B4=D0=BB=D1=8F=20CFGManager::AddSource?= =?UTF-8?q?Filter.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/FGManager.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 4a419381e2..263510de14 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -661,11 +661,11 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP ASSERT(*ppBF == nullptr); - HRESULT hr; - CComPtr pBF; std::list> pUnks; - if (FAILED(hr = pFGF->Create(&pBF, pUnks))) { + + HRESULT hr = pFGF->Create(&pBF, pUnks); + if (FAILED(hr)) { return hr; } @@ -674,7 +674,8 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP return E_NOINTERFACE; } - if (FAILED(hr = AddFilter(pBF, lpcwstrFilterName))) { + hr = AddFilter(pBF, lpcwstrFilterName); + if (FAILED(hr)) { return hr; } @@ -688,8 +689,8 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP pmt = &mt; } - // sometimes looping with AviSynth - if (FAILED(hr = pFSF->Load(lpcwstrFileName, pmt)) || m_bOpeningAborted) { + hr = pFSF->Load(lpcwstrFileName, pmt); + if (FAILED(hr) || m_bOpeningAborted) { // sometimes looping with AviSynth RemoveFilter(pBF); return m_bOpeningAborted ? E_ABORT : hr; } From 62bf8d41759e1779d3a97647cd1c3e78a4d0c720 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 28 Jul 2024 08:58:13 +0300 Subject: [PATCH 078/102] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/FGManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 263510de14..bae2ea5de1 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -698,11 +698,11 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP // doh :P BeginEnumMediaTypes(GetFirstPin(pBF, PINDIR_OUTPUT), pEMT, pmt) { static const GUID guid1 = - { 0x640999A0, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; + { 0x640999A0, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; // ASX file Parser static const GUID guid2 = - { 0x640999A1, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; + { 0x640999A1, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; // ASX v.2 file Parser static const GUID guid3 = - { 0xD51BD5AE, 0x7548, 0x11CF, { 0xA5, 0x20, 0x00, 0x80, 0xC7, 0x7E, 0xF5, 0x8A } }; + { 0xD51BD5AE, 0x7548, 0x11CF, { 0xA5, 0x20, 0x00, 0x80, 0xC7, 0x7E, 0xF5, 0x8A } }; // XML Playlist if (pmt->subtype == guid1 || pmt->subtype == guid2 || pmt->subtype == guid3) { RemoveFilter(pBF); From fb9d8bdac05c6dc720a3c93c8753d7a283d20f09 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 28 Jul 2024 15:28:44 +0300 Subject: [PATCH 079/102] =?UTF-8?q?CFGManager:=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D1=8F=D0=B5=D0=BC=20=D0=BA=20=D0=BD=D0=B5=D0=BA?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=BC=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=D0=B0=D0=BC=20=D0=BF=D1=80=D0=B8=D0=BF=D0=B8=D1=81=D0=BA?= =?UTF-8?q?=D1=83=20*Internal,=20=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=83=D1=82=D0=B0=D1=82=D1=8C=20=D1=81=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=D0=BC=D0=B8=20=D0=B8=D0=BD=D1=82?= =?UTF-8?q?=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D0=B0=20IGraphBuilder.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/FGManager.cpp | 16 ++++++++-------- src/apps/mplayerc/FGManager.h | 6 +++--- src/apps/mplayerc/FGManagerBDA.cpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index bae2ea5de1..934c96a940 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -648,13 +648,13 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl return S_OK; } -HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppBF) +HRESULT CFGManager::AddSourceFilterInternal(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppBF) { if (m_bOpeningAborted) { return E_ABORT; } - DLog(L"FGM: AddSourceFilter() trying '%s'", pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName())/*CStringFromGUID(pFGF->GetCLSID())*/); + DLog(L"FGM: AddSourceFilterInternal() trying '%s'", pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName())/*CStringFromGUID(pFGF->GetCLSID())*/); CheckPointer(lpcwstrFileName, E_POINTER); CheckPointer(ppBF, E_POINTER); @@ -707,7 +707,7 @@ HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LP if (pmt->subtype == guid1 || pmt->subtype == guid2 || pmt->subtype == guid3) { RemoveFilter(pBF); pFGF = DNew CFGFilterRegistry(CLSID_NetShowSource); - hr = AddSourceFilter(pFGF, lpcwstrFileName, lpcwstrFilterName, ppBF); + hr = AddSourceFilterInternal(pFGF, lpcwstrFileName, lpcwstrFilterName, ppBF); delete pFGF; SAFE_DELETE(pmt); return hr; @@ -840,10 +840,10 @@ STDMETHODIMP CFGManager::SetDefaultSyncSource() STDMETHODIMP CFGManager::Connect(IPin* pPinOut, IPin* pPinIn) { - return Connect(pPinOut, pPinIn, true); + return ConnectInternal(pPinOut, pPinIn, true); } -HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) +HRESULT CFGManager::ConnectInternal(IPin* pPinOut, IPin* pPinIn, bool bContinueRender) { CAutoLock cAutoLock(this); @@ -1217,7 +1217,7 @@ STDMETHODIMP CFGManager::RenderFile(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrPlay CFGFilter* pFGF = fl.GetFilter(pos); CComPtr pBF; - if (SUCCEEDED(hr = AddSourceFilter(pFGF, lpcwstrFileName, pFGF->GetName(), &pBF))) { + if (SUCCEEDED(hr = AddSourceFilterInternal(pFGF, lpcwstrFileName, pFGF->GetName(), &pBF))) { m_streampath.clear(); m_deadends.clear(); @@ -1258,7 +1258,7 @@ STDMETHODIMP CFGManager::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwst for (unsigned pos = 0, fltnum = fl.GetSortedSize(); pos < fltnum; pos++) { CFGFilter* pFGF = fl.GetFilter(pos); - if (SUCCEEDED(hr = AddSourceFilter(pFGF, lpcwstrFileName, lpcwstrFilterName, ppFilter))) { + if (SUCCEEDED(hr = AddSourceFilterInternal(pFGF, lpcwstrFileName, lpcwstrFilterName, ppFilter))) { return hr; } } @@ -1812,7 +1812,7 @@ STDMETHODIMP CFGManager::RenderSubFile(LPCWSTR lpcwstrFileName) CFGFilter* pFG = DNew CFGFilterInternal(); CComPtr pBF; - if (SUCCEEDED(hr = AddSourceFilter(pFG, lpcwstrFileName, pFG->GetName(), &pBF))) { + if (SUCCEEDED(hr = AddSourceFilterInternal(pFG, lpcwstrFileName, pFG->GetName(), &pBF))) { m_streampath.clear(); m_deadends.clear(); diff --git a/src/apps/mplayerc/FGManager.h b/src/apps/mplayerc/FGManager.h index eb55303ac8..436db771e2 100644 --- a/src/apps/mplayerc/FGManager.h +++ b/src/apps/mplayerc/FGManager.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -69,8 +69,8 @@ class CFGManager bool CheckBytes(PBYTE buf, DWORD size, CString chkbytes); HRESULT EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl); - HRESULT AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppBF); - HRESULT Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender); + HRESULT AddSourceFilterInternal(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppBF); + HRESULT ConnectInternal(IPin* pPinOut, IPin* pPinIn, bool bContinueRender); // IFilterGraph diff --git a/src/apps/mplayerc/FGManagerBDA.cpp b/src/apps/mplayerc/FGManagerBDA.cpp index 6b0c6b0f2f..daa7edb34b 100644 --- a/src/apps/mplayerc/FGManagerBDA.cpp +++ b/src/apps/mplayerc/FGManagerBDA.cpp @@ -727,11 +727,11 @@ HRESULT CFGManagerBDA::CreateMicrosoftDemux(IBaseFilter* pReceiver, CComPtr Date: Sun, 28 Jul 2024 21:18:00 +0300 Subject: [PATCH 080/102] =?UTF-8?q?FFmpeg:=20=D0=B7=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D0=B5=D0=BC=20HAVE=5FUNISTD=5FH=20=D1=80=D0=B0=D0=B2=D0=BD?= =?UTF-8?q?=D1=8B=D0=BC=200,=20=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=BB=D1=8E=D1=87=D0=B8=D1=82=D1=8C=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BA=D1=83=20=D0=BD=D0=B5=D0=BD=D0=B0=D1=85=D0=BE?= =?UTF-8?q?=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=80=D0=B5=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B9=20=D1=84=D1=83=D0=BD=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D0=B9=20=5Fwsopen=20=D0=B8=20=5Fsopen=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B5=20standalon?= =?UTF-8?q?e=5Ffilters.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/config.asm | 2 +- src/ExtLib/ffmpeg/config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ExtLib/ffmpeg/config.asm b/src/ExtLib/ffmpeg/config.asm index bed81d0157..c34d8579d9 100644 --- a/src/ExtLib/ffmpeg/config.asm +++ b/src/ExtLib/ffmpeg/config.asm @@ -392,7 +392,7 @@ %define HAVE_VAAPI_WIN32 0 %define HAVE_TRUNC 1 %define HAVE_TRUNCF 1 -%define HAVE_UNISTD_H 1 +%define HAVE_UNISTD_H 0 %define HAVE_VALGRIND_VALGRIND_H 0 %define HAVE_USLEEP 1 %define HAVE_VDPAU_X11 0 diff --git a/src/ExtLib/ffmpeg/config.h b/src/ExtLib/ffmpeg/config.h index 254ce6eab2..4206d6d6be 100644 --- a/src/ExtLib/ffmpeg/config.h +++ b/src/ExtLib/ffmpeg/config.h @@ -486,7 +486,7 @@ #define HAVE_VAAPI_WIN32 0 #define HAVE_TRUNC 1 #define HAVE_TRUNCF 1 -#define HAVE_UNISTD_H 1 +#define HAVE_UNISTD_H 0 #define HAVE_VALGRIND_VALGRIND_H 0 #define HAVE_USLEEP 1 #define HAVE_VDPAU_X11 0 From dcdde306794418ffed923a8226909662cfe2913e Mon Sep 17 00:00:00 2001 From: v0lt Date: Mon, 29 Jul 2024 12:29:36 +0300 Subject: [PATCH 081/102] =?UTF-8?q?FFmpeg:=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BF?= =?UTF-8?q?=D0=B8=D0=BB=D1=8F=D1=86=D0=B8=D1=8F=20=D0=B2=D0=BD=D0=B5=D1=88?= =?UTF-8?q?=D0=BD=D0=B8=D1=85=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=20=D1=81=20HAVE=5FUNISTD=5FH=20=D1=80=D0=B0=D0=B2=D0=BD?= =?UTF-8?q?=D1=8B=D0=BC=201.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExtLib/ffmpeg/config.asm | 2 +- src/ExtLib/ffmpeg/config.h | 2 +- src/filters/ffmpeg_link_fix.h | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ExtLib/ffmpeg/config.asm b/src/ExtLib/ffmpeg/config.asm index c34d8579d9..bed81d0157 100644 --- a/src/ExtLib/ffmpeg/config.asm +++ b/src/ExtLib/ffmpeg/config.asm @@ -392,7 +392,7 @@ %define HAVE_VAAPI_WIN32 0 %define HAVE_TRUNC 1 %define HAVE_TRUNCF 1 -%define HAVE_UNISTD_H 0 +%define HAVE_UNISTD_H 1 %define HAVE_VALGRIND_VALGRIND_H 0 %define HAVE_USLEEP 1 %define HAVE_VDPAU_X11 0 diff --git a/src/ExtLib/ffmpeg/config.h b/src/ExtLib/ffmpeg/config.h index 4206d6d6be..254ce6eab2 100644 --- a/src/ExtLib/ffmpeg/config.h +++ b/src/ExtLib/ffmpeg/config.h @@ -486,7 +486,7 @@ #define HAVE_VAAPI_WIN32 0 #define HAVE_TRUNC 1 #define HAVE_TRUNCF 1 -#define HAVE_UNISTD_H 0 +#define HAVE_UNISTD_H 1 #define HAVE_VALGRIND_VALGRIND_H 0 #define HAVE_USLEEP 1 #define HAVE_VDPAU_X11 0 diff --git a/src/filters/ffmpeg_link_fix.h b/src/filters/ffmpeg_link_fix.h index 6b5b947acc..786513fa52 100644 --- a/src/filters/ffmpeg_link_fix.h +++ b/src/filters/ffmpeg_link_fix.h @@ -5,5 +5,10 @@ void *__imp__aligned_malloc = _aligned_malloc; void *__imp__aligned_realloc = _aligned_realloc; void *__imp__aligned_free = _aligned_free; +#ifdef REGISTER_FILTER +#include +void *__imp__sopen = _sopen; +void *__imp__wsopen = _wsopen; +#endif #endif // FFMPEG_LINK_FIX_H From e798dfe8e9d23fda610546ffeaa7507e6cd1a449 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 3 Aug 2024 07:53:06 +0300 Subject: [PATCH 082/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20ffmpeg=20n7.1-dev-2058-g677f28b310.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- src/ExtLib/ffmpeg/libavcodec/adpcm.c | 18 +- src/ExtLib/ffmpeg/libavcodec/allcodecs.c | 1 + src/ExtLib/ffmpeg/libavcodec/audiodsp.c | 53 +-- src/ExtLib/ffmpeg/libavcodec/av1dec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/decode.c | 2 +- src/ExtLib/ffmpeg/libavcodec/decode.h | 2 +- src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c | 1 + src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h | 5 +- src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/ffv1.c | 119 ++--- src/ExtLib/ffmpeg/libavcodec/ffv1.h | 65 ++- src/ExtLib/ffmpeg/libavcodec/ffv1_template.c | 22 +- src/ExtLib/ffmpeg/libavcodec/ffv1dec.c | 427 ++++++++---------- .../ffmpeg/libavcodec/ffv1dec_template.c | 69 +-- src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/libdav1d.c | 2 +- src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c | 9 +- src/ExtLib/ffmpeg/libavcodec/pngdec.c | 2 +- src/ExtLib/ffmpeg/libavcodec/snow.c | 2 +- src/ExtLib/ffmpeg/libavcodec/utils.c | 3 + src/ExtLib/ffmpeg/libavcodec/version.h | 2 +- src/ExtLib/ffmpeg/libavcodec/videodsp.c | 2 + src/ExtLib/ffmpeg/libavcodec/videodsp.h | 1 + .../ffmpeg/libavcodec/vp9dsp_template.c | 52 ++- src/ExtLib/ffmpeg/libavutil/cpu.c | 2 - src/ExtLib/ffmpeg/libavutil/dovi_meta.h | 9 + src/ExtLib/ffmpeg/libavutil/intreadwrite.h | 39 ++ src/ExtLib/ffmpeg/libavutil/timer.h | 2 - src/ExtLib/ffmpeg/libavutil/version.h | 2 +- .../ffmpeg/libavutil/x86/intreadwrite.h | 7 + 33 files changed, 496 insertions(+), 436 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index b5b26112c8..99f494fc2e 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -30,7 +30,7 @@ MPCVideoDec Обновлены библиотеки: dav1d 1.4.2-15-g2355eeb; - ffmpeg n7.1-dev-1969-g719e46f54c; + ffmpeg n7.1-dev-2058-g677f28b310; Little-CMS git-lcms2.16-60-g1c9021b; MediaInfo git-v24.06-10-g88f3ea4aa; ResizableLib v1.5.3-8-g25a89da; diff --git a/docs/Changelog.txt b/docs/Changelog.txt index b0f63ccdac..8770a59be6 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -30,7 +30,7 @@ Updated Japanese translation (by tsubasanouta). Updated libraries: dav1d 1.4.2-15-g2355eeb; - ffmpeg n7.1-dev-1969-g719e46f54c; + ffmpeg n7.1-dev-2058-g677f28b310; Little-CMS git-lcms2.16-60-g1c9021b; MediaInfo git-v24.06-10-g88f3ea4aa; ResizableLib v1.5.3-8-g25a89da; diff --git a/src/ExtLib/ffmpeg/libavcodec/adpcm.c b/src/ExtLib/ffmpeg/libavcodec/adpcm.c index afdbeaa15e..8d358bc414 100644 --- a/src/ExtLib/ffmpeg/libavcodec/adpcm.c +++ b/src/ExtLib/ffmpeg/libavcodec/adpcm.c @@ -260,10 +260,6 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) case AV_CODEC_ID_ADPCM_IMA_AMV: max_channels = 1; break; - case AV_CODEC_ID_ADPCM_DTK: - case AV_CODEC_ID_ADPCM_EA: - min_channels = 1; - break; case AV_CODEC_ID_ADPCM_AFC: case AV_CODEC_ID_ADPCM_EA_R1: case AV_CODEC_ID_ADPCM_EA_R2: @@ -1684,22 +1680,24 @@ static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, for (int count2 = 0; count2 < (channels == 2 ? 28 : 14); count2++) { byte = bytestream2_get_byteu(&gb); next_left_sample = sign_extend(byte >> 4, 4) * (1 << shift_left); - next_right_sample = sign_extend(byte, 4) * (1 << shift_right); next_left_sample = (next_left_sample + (current_left_sample * coeff1l) + (previous_left_sample * coeff2l) + 0x80) >> 8; - next_right_sample = (next_right_sample + - (current_right_sample * coeff1r) + - (previous_right_sample * coeff2r) + 0x80) >> 8; previous_left_sample = current_left_sample; current_left_sample = av_clip_int16(next_left_sample); - previous_right_sample = current_right_sample; - current_right_sample = av_clip_int16(next_right_sample); *samples++ = current_left_sample; if (channels == 2){ + next_right_sample = sign_extend(byte, 4) * (1 << shift_right); + + next_right_sample = (next_right_sample + + (current_right_sample * coeff1r) + + (previous_right_sample * coeff2r) + 0x80) >> 8; + + previous_right_sample = current_right_sample; + current_right_sample = av_clip_int16(next_right_sample); *samples++ = current_right_sample; } else { next_left_sample = sign_extend(byte, 4) * (1 << shift_left); diff --git a/src/ExtLib/ffmpeg/libavcodec/allcodecs.c b/src/ExtLib/ffmpeg/libavcodec/allcodecs.c index 9cb43e9222..9ba8701e46 100644 --- a/src/ExtLib/ffmpeg/libavcodec/allcodecs.c +++ b/src/ExtLib/ffmpeg/libavcodec/allcodecs.c @@ -890,6 +890,7 @@ extern const FFCodec ff_vp9_mediacodec_encoder; extern const FFCodec ff_vp9_qsv_decoder; extern const FFCodec ff_vp9_vaapi_encoder; extern const FFCodec ff_vp9_qsv_encoder; +extern const FFCodec ff_vvc_qsv_decoder; // null codecs extern const FFCodec ff_vnull_decoder; diff --git a/src/ExtLib/ffmpeg/libavcodec/audiodsp.c b/src/ExtLib/ffmpeg/libavcodec/audiodsp.c index c5427d3535..fd6a00345f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/audiodsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/audiodsp.c @@ -22,57 +22,16 @@ #include "libavutil/common.h" #include "audiodsp.h" -static inline float clipf_c_one(float a, uint32_t mini, - uint32_t maxi, uint32_t maxisign) -{ - uint32_t ai = av_float2int(a); - - if (ai > mini) - return av_int2float(mini); - else if ((ai ^ (1U << 31)) > maxisign) - return av_int2float(maxi); - else - return a; -} - -static void vector_clipf_c_opposite_sign(float *dst, const float *src, - float min, float max, int len) -{ - int i; - uint32_t mini = av_float2int(min); - uint32_t maxi = av_float2int(max); - uint32_t maxisign = maxi ^ (1U << 31); - - for (i = 0; i < len; i += 8) { - dst[i + 0] = clipf_c_one(src[i + 0], mini, maxi, maxisign); - dst[i + 1] = clipf_c_one(src[i + 1], mini, maxi, maxisign); - dst[i + 2] = clipf_c_one(src[i + 2], mini, maxi, maxisign); - dst[i + 3] = clipf_c_one(src[i + 3], mini, maxi, maxisign); - dst[i + 4] = clipf_c_one(src[i + 4], mini, maxi, maxisign); - dst[i + 5] = clipf_c_one(src[i + 5], mini, maxi, maxisign); - dst[i + 6] = clipf_c_one(src[i + 6], mini, maxi, maxisign); - dst[i + 7] = clipf_c_one(src[i + 7], mini, maxi, maxisign); - } -} - static void vector_clipf_c(float *dst, const float *src, int len, float min, float max) { - int i; + for (int i = 0; i < len; i += 8) { + float tmp[8]; - if (min < 0 && max > 0) { - vector_clipf_c_opposite_sign(dst, src, min, max, len); - } else { - for (i = 0; i < len; i += 8) { - dst[i] = av_clipf(src[i], min, max); - dst[i + 1] = av_clipf(src[i + 1], min, max); - dst[i + 2] = av_clipf(src[i + 2], min, max); - dst[i + 3] = av_clipf(src[i + 3], min, max); - dst[i + 4] = av_clipf(src[i + 4], min, max); - dst[i + 5] = av_clipf(src[i + 5], min, max); - dst[i + 6] = av_clipf(src[i + 6], min, max); - dst[i + 7] = av_clipf(src[i + 7], min, max); - } + for (int j = 0; j < 8; j++) + tmp[j]= av_clipf(src[i + j], min, max); + for (int j = 0; j < 8; j++) + dst[i + j] = tmp[j]; } } diff --git a/src/ExtLib/ffmpeg/libavcodec/av1dec.c b/src/ExtLib/ffmpeg/libavcodec/av1dec.c index dd3c7f4734..1d5b9ef4f4 100644 --- a/src/ExtLib/ffmpeg/libavcodec/av1dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/av1dec.c @@ -970,7 +970,7 @@ static int export_itut_t35(AVCodecContext *avctx, AVFrame *frame, if (!ret) break; - ret = ff_frame_new_side_data_from_buf(avctx, frame, AV_FRAME_DATA_A53_CC, &buf, NULL); + ret = ff_frame_new_side_data_from_buf(avctx, frame, AV_FRAME_DATA_A53_CC, &buf); if (ret < 0) return ret; diff --git a/src/ExtLib/ffmpeg/libavcodec/decode.c b/src/ExtLib/ffmpeg/libavcodec/decode.c index 791940648d..c5873391d0 100644 --- a/src/ExtLib/ffmpeg/libavcodec/decode.c +++ b/src/ExtLib/ffmpeg/libavcodec/decode.c @@ -1996,7 +1996,7 @@ int ff_frame_new_side_data_from_buf_ext(const AVCodecContext *avctx, int ff_frame_new_side_data_from_buf(const AVCodecContext *avctx, AVFrame *frame, enum AVFrameSideDataType type, - AVBufferRef **buf, AVFrameSideData **psd) + AVBufferRef **buf) { return ff_frame_new_side_data_from_buf_ext(avctx, &frame->side_data, &frame->nb_side_data, diff --git a/src/ExtLib/ffmpeg/libavcodec/decode.h b/src/ExtLib/ffmpeg/libavcodec/decode.h index 9d96bea1e8..d80d60a306 100644 --- a/src/ExtLib/ffmpeg/libavcodec/decode.h +++ b/src/ExtLib/ffmpeg/libavcodec/decode.h @@ -173,7 +173,7 @@ int ff_frame_new_side_data(const AVCodecContext *avctx, AVFrame *frame, */ int ff_frame_new_side_data_from_buf(const AVCodecContext *avctx, AVFrame *frame, enum AVFrameSideDataType type, - AVBufferRef **buf, AVFrameSideData **sd); + AVBufferRef **buf); /** * Same as `ff_frame_new_side_data_from_buf`, but taking a AVFrameSideData diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c index 5130a9598d..b67978403f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.c @@ -66,6 +66,7 @@ void ff_dovi_ctx_replace(DOVIContext *s, const DOVIContext *s0) for (int i = 0; i <= DOVI_MAX_DM_ID; i++) ff_refstruct_replace(&s->vdr[i], s0->vdr[i]); ff_refstruct_replace(&s->ext_blocks, s0->ext_blocks); + s->num_ext_blocks = s0->num_ext_blocks; } int ff_dovi_guess_profile_hevc(const AVDOVIRpuDataHeader *hdr) diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h index bfb118d6b5..205d16ffbc 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpu.h @@ -95,8 +95,9 @@ void ff_dovi_ctx_unref(DOVIContext *s); void ff_dovi_ctx_flush(DOVIContext *s); /** - * Parse the contents of a Dovi RPU NAL and update the parsed values in the - * DOVIContext struct. + * Parse the contents of a Dolby Vision RPU and update the parsed values in the + * DOVIContext struct. This function should receive the decoded unit payload, + * without any T.35 or NAL unit headers. * * Returns 0 or an error code. * diff --git a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c index c025800206..375e6e560b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c +++ b/src/ExtLib/ffmpeg/libavcodec/dovi_rpudec.c @@ -360,7 +360,7 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, emdf_protection = get_bits(gb, 5 + 12); VALIDATE(emdf_protection, 0x400, 0x400); } else { - /* NAL RBSP with prefix and trailing zeroes */ + /* NAL unit with prefix and trailing zeroes */ VALIDATE(rpu[0], 25, 25); /* NAL prefix */ rpu++; rpu_size--; diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1.c b/src/ExtLib/ffmpeg/libavcodec/ffv1.c index 6ec24fed4a..9c219b5ddb 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1.c +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "ffv1.h" +#include "refstruct.h" av_cold int ff_ffv1_common_init(AVCodecContext *avctx) { @@ -52,16 +53,33 @@ av_cold int ff_ffv1_common_init(AVCodecContext *avctx) return 0; } -av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs) +static void planes_free(FFRefStructOpaque opaque, void *obj) +{ + PlaneContext *planes = obj; + + for (int i = 0; i < MAX_PLANES; i++) { + PlaneContext *p = &planes[i]; + + av_freep(&p->state); + av_freep(&p->vlc_state); + } +} + +PlaneContext* ff_ffv1_planes_alloc(void) +{ + return ff_refstruct_alloc_ext(sizeof(PlaneContext) * MAX_PLANES, + 0, NULL, planes_free); +} + +av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, + FFV1SliceContext *sc) { int j, i; - fs->plane_count = f->plane_count; - fs->transparency = f->transparency; for (j = 0; j < f->plane_count; j++) { - PlaneContext *const p = &fs->plane[j]; + PlaneContext *const p = &sc->plane[j]; - if (fs->ac != AC_GOLOMB_RICE) { + if (f->ac != AC_GOLOMB_RICE) { if (!p->state) p->state = av_malloc_array(p->context_count, CONTEXT_SIZE * sizeof(uint8_t)); @@ -80,11 +98,11 @@ av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs) } } - if (fs->ac == AC_RANGE_CUSTOM_TAB) { + if (f->ac == AC_RANGE_CUSTOM_TAB) { //FIXME only redo if state_transition changed for (j = 1; j < 256; j++) { - fs->c. one_state[ j] = f->state_transition[j]; - fs->c.zero_state[256 - j] = 256 - fs->c.one_state[j]; + sc->c. one_state[ j] = f->state_transition[j]; + sc->c.zero_state[256 - j] = 256 - sc->c.one_state[j]; } } @@ -95,8 +113,7 @@ av_cold int ff_ffv1_init_slices_state(FFV1Context *f) { int i, ret; for (i = 0; i < f->max_slice_count; i++) { - FFV1Context *fs = f->slice_context[i]; - if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0) + if ((ret = ff_ffv1_init_slice_state(f, &f->slices[i])) < 0) return AVERROR(ENOMEM); } return 0; @@ -104,44 +121,43 @@ av_cold int ff_ffv1_init_slices_state(FFV1Context *f) av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f) { - int i, max_slice_count = f->num_h_slices * f->num_v_slices; + int max_slice_count = f->num_h_slices * f->num_v_slices; av_assert0(max_slice_count > 0); - for (i = 0; i < max_slice_count;) { + f->slices = av_calloc(max_slice_count, sizeof(*f->slices)); + if (!f->slices) + return AVERROR(ENOMEM); + + f->max_slice_count = max_slice_count; + + for (int i = 0; i < max_slice_count; i++) { + FFV1SliceContext *sc = &f->slices[i]; int sx = i % f->num_h_slices; int sy = i / f->num_h_slices; int sxs = f->avctx->width * sx / f->num_h_slices; int sxe = f->avctx->width * (sx + 1) / f->num_h_slices; int sys = f->avctx->height * sy / f->num_v_slices; int sye = f->avctx->height * (sy + 1) / f->num_v_slices; - FFV1Context *fs = av_mallocz(sizeof(*fs)); - - if (!fs) - goto memfail; - - f->slice_context[i++] = fs; - memcpy(fs, f, sizeof(*fs)); - memset(fs->rc_stat2, 0, sizeof(fs->rc_stat2)); - - fs->slice_width = sxe - sxs; - fs->slice_height = sye - sys; - fs->slice_x = sxs; - fs->slice_y = sys; - - fs->sample_buffer = av_malloc_array((fs->width + 6), 3 * MAX_PLANES * - sizeof(*fs->sample_buffer)); - fs->sample_buffer32 = av_malloc_array((fs->width + 6), 3 * MAX_PLANES * - sizeof(*fs->sample_buffer32)); - if (!fs->sample_buffer || !fs->sample_buffer32) - goto memfail; + + sc->slice_width = sxe - sxs; + sc->slice_height = sye - sys; + sc->slice_x = sxs; + sc->slice_y = sys; + + sc->sample_buffer = av_malloc_array((f->width + 6), 3 * MAX_PLANES * + sizeof(*sc->sample_buffer)); + sc->sample_buffer32 = av_malloc_array((f->width + 6), 3 * MAX_PLANES * + sizeof(*sc->sample_buffer32)); + if (!sc->sample_buffer || !sc->sample_buffer32) + return AVERROR(ENOMEM); + + sc->plane = ff_ffv1_planes_alloc(); + if (!sc->plane) + return AVERROR(ENOMEM); } - f->max_slice_count = max_slice_count; - return 0; -memfail: - f->max_slice_count = i; - return AVERROR(ENOMEM); + return 0; } int ff_ffv1_allocate_initial_states(FFV1Context *f) @@ -159,17 +175,14 @@ int ff_ffv1_allocate_initial_states(FFV1Context *f) return 0; } -void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1Context *fs) +void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc) { int i, j; for (i = 0; i < f->plane_count; i++) { - PlaneContext *p = &fs->plane[i]; - - p->interlace_bit_state[0] = 128; - p->interlace_bit_state[1] = 128; + PlaneContext *p = &sc->plane[i]; - if (fs->ac != AC_GOLOMB_RICE) { + if (f->ac != AC_GOLOMB_RICE) { if (f->initial_states[p->quant_table_index]) { memcpy(p->state, f->initial_states[p->quant_table_index], CONTEXT_SIZE * p->context_count); @@ -193,29 +206,25 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx) int i, j; for (j = 0; j < s->max_slice_count; j++) { - FFV1Context *fs = s->slice_context[j]; - for (i = 0; i < s->plane_count; i++) { - PlaneContext *p = &fs->plane[i]; + FFV1SliceContext *sc = &s->slices[j]; - av_freep(&p->state); - av_freep(&p->vlc_state); - } - av_freep(&fs->sample_buffer); - av_freep(&fs->sample_buffer32); + av_freep(&sc->sample_buffer); + av_freep(&sc->sample_buffer32); + + ff_refstruct_unref(&sc->plane); } av_freep(&avctx->stats_out); for (j = 0; j < s->quant_table_count; j++) { av_freep(&s->initial_states[j]); for (i = 0; i < s->max_slice_count; i++) { - FFV1Context *sf = s->slice_context[i]; - av_freep(&sf->rc_stat2[j]); + FFV1SliceContext *sc = &s->slices[i]; + av_freep(&sc->rc_stat2[j]); } av_freep(&s->rc_stat2[j]); } - for (i = 0; i < s->max_slice_count; i++) - av_freep(&s->slice_context[i]); + av_freep(&s->slices); return 0; } diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1.h b/src/ExtLib/ffmpeg/libavcodec/ffv1.h index 39eef8087c..6e7943b96b 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1.h +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1.h @@ -59,22 +59,53 @@ typedef struct VlcState { } VlcState; typedef struct PlaneContext { - int16_t quant_table[MAX_CONTEXT_INPUTS][256]; int quant_table_index; int context_count; uint8_t (*state)[CONTEXT_SIZE]; VlcState *vlc_state; - uint8_t interlace_bit_state[2]; } PlaneContext; #define MAX_SLICES 1024 +typedef struct FFV1SliceContext { + int16_t *sample_buffer; + int32_t *sample_buffer32; + + int slice_width; + int slice_height; + int slice_x; + int slice_y; + + int run_index; + int slice_coding_mode; + int slice_rct_by_coef; + int slice_rct_ry_coef; + + // RefStruct reference, array of MAX_PLANES elements + PlaneContext *plane; + PutBitContext pb; + RangeCoder c; + + int ac_byte_count; ///< number of bytes used for AC coding + + union { + // decoder-only + struct { + int slice_reset_contexts; + int slice_damaged; + }; + + // encoder-only + struct { + uint64_t rc_stat[256][2]; + uint64_t (*rc_stat2[MAX_QUANT_TABLES])[32][2]; + }; + }; +} FFV1SliceContext; + typedef struct FFV1Context { AVClass *class; AVCodecContext *avctx; - RangeCoder c; - GetBitContext gb; - PutBitContext pb; uint64_t rc_stat[256][2]; uint64_t (*rc_stat2[MAX_QUANT_TABLES])[32][2]; int version; @@ -89,27 +120,19 @@ typedef struct FFV1Context { ProgressFrame picture, last_picture; struct FFV1Context *fsrc; - AVFrame *cur; const AVFrame *cur_enc_frame; int plane_count; int ac; ///< 1=range coder <-> 0=golomb rice - int ac_byte_count; ///< number of bytes used for AC coding - PlaneContext plane[MAX_PLANES]; - int16_t quant_table[MAX_CONTEXT_INPUTS][256]; int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][256]; int context_count[MAX_QUANT_TABLES]; uint8_t state_transition[256]; uint8_t (*initial_states[MAX_QUANT_TABLES])[32]; - int run_index; int colorspace; - int16_t *sample_buffer; - int32_t *sample_buffer32; int use32bit; int ec; int intra; - int slice_damaged; int key_frame_ok; int context_model; @@ -119,27 +142,21 @@ typedef struct FFV1Context { int gob_count; int quant_table_count; - struct FFV1Context *slice_context[MAX_SLICES]; int slice_count; int max_slice_count; int num_v_slices; int num_h_slices; - int slice_width; - int slice_height; - int slice_x; - int slice_y; - int slice_reset_contexts; - int slice_coding_mode; - int slice_rct_by_coef; - int slice_rct_ry_coef; + + FFV1SliceContext *slices; } FFV1Context; int ff_ffv1_common_init(AVCodecContext *avctx); -int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs); +int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1SliceContext *sc); int ff_ffv1_init_slices_state(FFV1Context *f); int ff_ffv1_init_slice_contexts(FFV1Context *f); +PlaneContext *ff_ffv1_planes_alloc(void); int ff_ffv1_allocate_initial_states(FFV1Context *f); -void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1Context *fs); +void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc); int ff_ffv1_close(AVCodecContext *avctx); static av_always_inline int fold(int diff, int bits) diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1_template.c b/src/ExtLib/ffmpeg/libavcodec/ffv1_template.c index 7ff803ff2d..356d7f1b54 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1_template.c @@ -29,25 +29,25 @@ static inline int RENAME(predict)(TYPE *src, TYPE *last) return mid_pred(L, L + T - LT, T); } -static inline int RENAME(get_context)(PlaneContext *p, TYPE *src, - TYPE *last, TYPE *last2) +static inline int RENAME(get_context)(const int16_t quant_table[MAX_CONTEXT_INPUTS][256], + TYPE *src, TYPE *last, TYPE *last2) { const int LT = last[-1]; const int T = last[0]; const int RT = last[1]; const int L = src[-1]; - if (p->quant_table[3][127] || p->quant_table[4][127]) { + if (quant_table[3][127] || quant_table[4][127]) { const int TT = last2[0]; const int LL = src[-2]; - return p->quant_table[0][(L - LT) & 0xFF] + - p->quant_table[1][(LT - T) & 0xFF] + - p->quant_table[2][(T - RT) & 0xFF] + - p->quant_table[3][(LL - L) & 0xFF] + - p->quant_table[4][(TT - T) & 0xFF]; + return quant_table[0][(L - LT) & 0xFF] + + quant_table[1][(LT - T) & 0xFF] + + quant_table[2][(T - RT) & 0xFF] + + quant_table[3][(LL - L) & 0xFF] + + quant_table[4][(TT - T) & 0xFF]; } else - return p->quant_table[0][(L - LT) & 0xFF] + - p->quant_table[1][(LT - T) & 0xFF] + - p->quant_table[2][(T - RT) & 0xFF]; + return quant_table[0][(L - LT) & 0xFF] + + quant_table[1][(LT - T) & 0xFF] + + quant_table[2][(T - RT) & 0xFF]; } diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c b/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c index 32d2d58ca4..830c747132 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1dec.c @@ -38,6 +38,7 @@ #include "mathops.h" #include "ffv1.h" #include "progressframe.h" +#include "refstruct.h" #include "thread.h" static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, @@ -46,7 +47,7 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, if (get_rac(c, state + 0)) return 0; else { - int i, e; + int e; unsigned a; e = 0; while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10 @@ -56,7 +57,7 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, } a = 1; - for (i = e - 1; i >= 0; i--) + for (int i = e - 1; i >= 0; i--) a += a + get_rac(c, state + 22 + FFMIN(i, 9)); // 22..31 e = -(is_signed && get_rac(c, state + 11 + FFMIN(e, 10))); // 11..21 @@ -94,14 +95,13 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState *const state, return ret; } -static int is_input_end(FFV1Context *s) +static int is_input_end(RangeCoder *c, GetBitContext *gb, int ac) { - if (s->ac != AC_GOLOMB_RICE) { - RangeCoder *const c = &s->c; + if (ac != AC_GOLOMB_RICE) { if (c->overread > MAX_OVERREAD) return AVERROR_INVALIDDATA; } else { - if (get_bits_left(&s->gb) < 1) + if (get_bits_left(gb) < 1) return AVERROR_INVALIDDATA; } return 0; @@ -117,18 +117,20 @@ static int is_input_end(FFV1Context *s) #define RENAME(name) name ## 32 #include "ffv1dec_template.c" -static int decode_plane(FFV1Context *s, uint8_t *src, - int w, int h, int stride, int plane_index, +static int decode_plane(FFV1Context *f, FFV1SliceContext *sc, + GetBitContext *gb, + uint8_t *src, int w, int h, int stride, int plane_index, int pixel_stride) { + const int ac = f->ac; int x, y; int16_t *sample[2]; - sample[0] = s->sample_buffer + 3; - sample[1] = s->sample_buffer + w + 6 + 3; + sample[0] = sc->sample_buffer + 3; + sample[1] = sc->sample_buffer + w + 6 + 3; - s->run_index = 0; + sc->run_index = 0; - memset(s->sample_buffer, 0, 2 * (w + 6) * sizeof(*s->sample_buffer)); + memset(sc->sample_buffer, 0, 2 * (w + 6) * sizeof(*sc->sample_buffer)); for (y = 0; y < h; y++) { int16_t *temp = sample[0]; // FIXME: try a normal buffer @@ -139,23 +141,23 @@ static int decode_plane(FFV1Context *s, uint8_t *src, sample[1][-1] = sample[0][0]; sample[0][w] = sample[0][w - 1]; - if (s->avctx->bits_per_raw_sample <= 8) { - int ret = decode_line(s, w, sample, plane_index, 8); + if (f->avctx->bits_per_raw_sample <= 8) { + int ret = decode_line(f, sc, gb, w, sample, plane_index, 8, ac); if (ret < 0) return ret; for (x = 0; x < w; x++) src[x*pixel_stride + stride * y] = sample[1][x]; } else { - int ret = decode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample); + int ret = decode_line(f, sc, gb, w, sample, plane_index, f->avctx->bits_per_raw_sample, ac); if (ret < 0) return ret; - if (s->packed_at_lsb) { + if (f->packed_at_lsb) { for (x = 0; x < w; x++) { ((uint16_t*)(src + stride*y))[x*pixel_stride] = sample[1][x]; } } else { for (x = 0; x < w; x++) { - ((uint16_t*)(src + stride*y))[x*pixel_stride] = sample[1][x] << (16 - s->avctx->bits_per_raw_sample) | ((uint16_t **)sample)[1][x] >> (2 * s->avctx->bits_per_raw_sample - 16); + ((uint16_t*)(src + stride*y))[x*pixel_stride] = sample[1][x] << (16 - f->avctx->bits_per_raw_sample) | ((uint16_t **)sample)[1][x] >> (2 * f->avctx->bits_per_raw_sample - 16); } } } @@ -163,11 +165,12 @@ static int decode_plane(FFV1Context *s, uint8_t *src, return 0; } -static int decode_slice_header(const FFV1Context *f, FFV1Context *fs) +static int decode_slice_header(const FFV1Context *f, + FFV1SliceContext *sc, AVFrame *frame) { - RangeCoder *c = &fs->c; + RangeCoder *c = &sc->c; uint8_t state[CONTEXT_SIZE]; - unsigned ps, i, context_count; + unsigned ps, context_count; int sx, sy, sw, sh; memset(state, 128, sizeof(state)); @@ -184,28 +187,27 @@ static int decode_slice_header(const FFV1Context *f, FFV1Context *fs) if (sx > f->num_h_slices - sw || sy > f->num_v_slices - sh) return AVERROR_INVALIDDATA; - fs->slice_x = sx * (int64_t)f->width / f->num_h_slices; - fs->slice_y = sy * (int64_t)f->height / f->num_v_slices; - fs->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - fs->slice_x; - fs->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - fs->slice_y; + sc->slice_x = sx * (int64_t)f->width / f->num_h_slices; + sc->slice_y = sy * (int64_t)f->height / f->num_v_slices; + sc->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - sc->slice_x; + sc->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - sc->slice_y; - av_assert0((unsigned)fs->slice_width <= f->width && - (unsigned)fs->slice_height <= f->height); - av_assert0 ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width <= f->width - && (unsigned)fs->slice_y + (uint64_t)fs->slice_height <= f->height); + av_assert0((unsigned)sc->slice_width <= f->width && + (unsigned)sc->slice_height <= f->height); + av_assert0 ( (unsigned)sc->slice_x + (uint64_t)sc->slice_width <= f->width + && (unsigned)sc->slice_y + (uint64_t)sc->slice_height <= f->height); - if (fs->ac == AC_GOLOMB_RICE && fs->slice_width >= (1<<23)) + if (f->ac == AC_GOLOMB_RICE && sc->slice_width >= (1<<23)) return AVERROR_INVALIDDATA; - for (i = 0; i < f->plane_count; i++) { - PlaneContext * const p = &fs->plane[i]; + for (unsigned i = 0; i < f->plane_count; i++) { + PlaneContext * const p = &sc->plane[i]; int idx = get_symbol(c, state, 0); if (idx >= (unsigned)f->quant_table_count) { av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n"); return -1; } p->quant_table_index = idx; - memcpy(p->quant_table, f->quant_tables[idx], sizeof(p->quant_table)); context_count = f->context_count[idx]; if (p->context_count < context_count) { @@ -217,32 +219,32 @@ static int decode_slice_header(const FFV1Context *f, FFV1Context *fs) ps = get_symbol(c, state, 0); if (ps == 1) { - f->cur->flags |= AV_FRAME_FLAG_INTERLACED; - f->cur->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST; + frame->flags |= AV_FRAME_FLAG_INTERLACED; + frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST; } else if (ps == 2) { - f->cur->flags |= AV_FRAME_FLAG_INTERLACED; - f->cur->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST; + frame->flags |= AV_FRAME_FLAG_INTERLACED; + frame->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST; } else if (ps == 3) { - f->cur->flags &= ~AV_FRAME_FLAG_INTERLACED; + frame->flags &= ~AV_FRAME_FLAG_INTERLACED; } - f->cur->sample_aspect_ratio.num = get_symbol(c, state, 0); - f->cur->sample_aspect_ratio.den = get_symbol(c, state, 0); + frame->sample_aspect_ratio.num = get_symbol(c, state, 0); + frame->sample_aspect_ratio.den = get_symbol(c, state, 0); if (av_image_check_sar(f->width, f->height, - f->cur->sample_aspect_ratio) < 0) { + frame->sample_aspect_ratio) < 0) { av_log(f->avctx, AV_LOG_WARNING, "ignoring invalid SAR: %u/%u\n", - f->cur->sample_aspect_ratio.num, - f->cur->sample_aspect_ratio.den); - f->cur->sample_aspect_ratio = (AVRational){ 0, 1 }; + frame->sample_aspect_ratio.num, + frame->sample_aspect_ratio.den); + frame->sample_aspect_ratio = (AVRational){ 0, 1 }; } - if (fs->version > 3) { - fs->slice_reset_contexts = get_rac(c, state); - fs->slice_coding_mode = get_symbol(c, state, 0); - if (fs->slice_coding_mode != 1) { - fs->slice_rct_by_coef = get_symbol(c, state, 0); - fs->slice_rct_ry_coef = get_symbol(c, state, 0); - if ((uint64_t)fs->slice_rct_by_coef + (uint64_t)fs->slice_rct_ry_coef > 4) { + if (f->version > 3) { + sc->slice_reset_contexts = get_rac(c, state); + sc->slice_coding_mode = get_symbol(c, state, 0); + if (sc->slice_coding_mode != 1) { + sc->slice_rct_by_coef = get_symbol(c, state, 0); + sc->slice_rct_ry_coef = get_symbol(c, state, 0); + if ((uint64_t)sc->slice_rct_by_coef + (uint64_t)sc->slice_rct_ry_coef > 4) { av_log(f->avctx, AV_LOG_ERROR, "slice_rct_y_coef out of range\n"); return AVERROR_INVALIDDATA; } @@ -254,119 +256,95 @@ static int decode_slice_header(const FFV1Context *f, FFV1Context *fs) static int decode_slice(AVCodecContext *c, void *arg) { - FFV1Context *fs = *(void **)arg; - FFV1Context *f = fs->avctx->priv_data; + FFV1Context *f = c->priv_data; + FFV1SliceContext *sc = arg; int width, height, x, y, ret; const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step; - AVFrame * const p = f->cur; - int i, si; - - for( si=0; fs != f->slice_context[si]; si ++) - ; + AVFrame * const p = f->picture.f; + const int si = sc - f->slices; + GetBitContext gb; if (f->fsrc && !(p->flags & AV_FRAME_FLAG_KEY) && f->last_picture.f) ff_progress_frame_await(&f->last_picture, si); - if(f->fsrc && !(p->flags & AV_FRAME_FLAG_KEY)) { - FFV1Context *fssrc = f->fsrc->slice_context[si]; - FFV1Context *fsdst = f->slice_context[si]; - av_assert1(fsdst->plane_count == fssrc->plane_count); - av_assert1(fsdst == fs); + if (f->fsrc) { + const FFV1SliceContext *scsrc = &f->fsrc->slices[si]; if (!(p->flags & AV_FRAME_FLAG_KEY)) - fsdst->slice_damaged |= fssrc->slice_damaged; - - for (i = 0; i < f->plane_count; i++) { - PlaneContext *psrc = &fssrc->plane[i]; - PlaneContext *pdst = &fsdst->plane[i]; - - av_free(pdst->state); - av_free(pdst->vlc_state); - memcpy(pdst, psrc, sizeof(*pdst)); - pdst->state = NULL; - pdst->vlc_state = NULL; - - if (fssrc->ac) { - pdst->state = av_malloc_array(CONTEXT_SIZE, psrc->context_count); - memcpy(pdst->state, psrc->state, CONTEXT_SIZE * psrc->context_count); - } else { - pdst->vlc_state = av_malloc_array(sizeof(*pdst->vlc_state), psrc->context_count); - memcpy(pdst->vlc_state, psrc->vlc_state, sizeof(*pdst->vlc_state) * psrc->context_count); - } - } + sc->slice_damaged |= scsrc->slice_damaged; } - fs->slice_rct_by_coef = 1; - fs->slice_rct_ry_coef = 1; + sc->slice_rct_by_coef = 1; + sc->slice_rct_ry_coef = 1; if (f->version > 2) { - if (ff_ffv1_init_slice_state(f, fs) < 0) + if (ff_ffv1_init_slice_state(f, sc) < 0) return AVERROR(ENOMEM); - if (decode_slice_header(f, fs) < 0) { - fs->slice_x = fs->slice_y = fs->slice_height = fs->slice_width = 0; - fs->slice_damaged = 1; + if (decode_slice_header(f, sc, p) < 0) { + sc->slice_x = sc->slice_y = sc->slice_height = sc->slice_width = 0; + sc->slice_damaged = 1; return AVERROR_INVALIDDATA; } } - if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0) + if ((ret = ff_ffv1_init_slice_state(f, sc)) < 0) return ret; - if ((f->cur->flags & AV_FRAME_FLAG_KEY) || fs->slice_reset_contexts) { - ff_ffv1_clear_slice_state(f, fs); - } else if (fs->slice_damaged) { + if ((p->flags & AV_FRAME_FLAG_KEY) || sc->slice_reset_contexts) { + ff_ffv1_clear_slice_state(f, sc); + } else if (sc->slice_damaged) { return AVERROR_INVALIDDATA; } - width = fs->slice_width; - height = fs->slice_height; - x = fs->slice_x; - y = fs->slice_y; + width = sc->slice_width; + height = sc->slice_height; + x = sc->slice_x; + y = sc->slice_y; - if (fs->ac == AC_GOLOMB_RICE) { + if (f->ac == AC_GOLOMB_RICE) { if (f->version == 3 && f->micro_version > 1 || f->version > 3) - get_rac(&fs->c, (uint8_t[]) { 129 }); - fs->ac_byte_count = f->version > 2 || (!x && !y) ? fs->c.bytestream - fs->c.bytestream_start - 1 : 0; - init_get_bits(&fs->gb, - fs->c.bytestream_start + fs->ac_byte_count, - (fs->c.bytestream_end - fs->c.bytestream_start - fs->ac_byte_count) * 8); + get_rac(&sc->c, (uint8_t[]) { 129 }); + sc->ac_byte_count = f->version > 2 || (!x && !y) ? sc->c.bytestream - sc->c.bytestream_start - 1 : 0; + init_get_bits(&gb, + sc->c.bytestream_start + sc->ac_byte_count, + (sc->c.bytestream_end - sc->c.bytestream_start - sc->ac_byte_count) * 8); } av_assert1(width && height); - if (f->colorspace == 0 && (f->chroma_planes || !fs->transparency)) { + if (f->colorspace == 0 && (f->chroma_planes || !f->transparency)) { const int chroma_width = AV_CEIL_RSHIFT(width, f->chroma_h_shift); const int chroma_height = AV_CEIL_RSHIFT(height, f->chroma_v_shift); const int cx = x >> f->chroma_h_shift; const int cy = y >> f->chroma_v_shift; - decode_plane(fs, p->data[0] + ps*x + y*p->linesize[0], width, height, p->linesize[0], 0, 1); + decode_plane(f, sc, &gb, p->data[0] + ps*x + y*p->linesize[0], width, height, p->linesize[0], 0, 1); if (f->chroma_planes) { - decode_plane(fs, p->data[1] + ps*cx+cy*p->linesize[1], chroma_width, chroma_height, p->linesize[1], 1, 1); - decode_plane(fs, p->data[2] + ps*cx+cy*p->linesize[2], chroma_width, chroma_height, p->linesize[2], 1, 1); + decode_plane(f, sc, &gb, p->data[1] + ps*cx+cy*p->linesize[1], chroma_width, chroma_height, p->linesize[1], 1, 1); + decode_plane(f, sc, &gb, p->data[2] + ps*cx+cy*p->linesize[2], chroma_width, chroma_height, p->linesize[2], 1, 1); } - if (fs->transparency) - decode_plane(fs, p->data[3] + ps*x + y*p->linesize[3], width, height, p->linesize[3], (f->version >= 4 && !f->chroma_planes) ? 1 : 2, 1); + if (f->transparency) + decode_plane(f, sc, &gb, p->data[3] + ps*x + y*p->linesize[3], width, height, p->linesize[3], (f->version >= 4 && !f->chroma_planes) ? 1 : 2, 1); } else if (f->colorspace == 0) { - decode_plane(fs, p->data[0] + ps*x + y*p->linesize[0] , width, height, p->linesize[0], 0, 2); - decode_plane(fs, p->data[0] + ps*x + y*p->linesize[0] + 1, width, height, p->linesize[0], 1, 2); + decode_plane(f, sc, &gb, p->data[0] + ps*x + y*p->linesize[0] , width, height, p->linesize[0], 0, 2); + decode_plane(f, sc, &gb, p->data[0] + ps*x + y*p->linesize[0] + 1, width, height, p->linesize[0], 1, 2); } else if (f->use32bit) { uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0], p->data[1] + ps * x + y * p->linesize[1], p->data[2] + ps * x + y * p->linesize[2], p->data[3] + ps * x + y * p->linesize[3] }; - decode_rgb_frame32(fs, planes, width, height, p->linesize); + decode_rgb_frame32(f, sc, &gb, planes, width, height, p->linesize); } else { uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0], p->data[1] + ps * x + y * p->linesize[1], p->data[2] + ps * x + y * p->linesize[2], p->data[3] + ps * x + y * p->linesize[3] }; - decode_rgb_frame(fs, planes, width, height, p->linesize); + decode_rgb_frame(f, sc, &gb, planes, width, height, p->linesize); } - if (fs->ac != AC_GOLOMB_RICE && f->version > 2) { + if (f->ac != AC_GOLOMB_RICE && f->version > 2) { int v; - get_rac(&fs->c, (uint8_t[]) { 129 }); - v = fs->c.bytestream_end - fs->c.bytestream - 2 - 5*f->ec; + get_rac(&sc->c, (uint8_t[]) { 129 }); + v = sc->c.bytestream_end - sc->c.bytestream - 2 - 5*f->ec; if (v) { av_log(f->avctx, AV_LOG_ERROR, "bytestream end mismatching by %d\n", v); - fs->slice_damaged = 1; + sc->slice_damaged = 1; } } @@ -422,19 +400,19 @@ static int read_quant_tables(RangeCoder *c, static int read_extra_header(FFV1Context *f) { - RangeCoder *const c = &f->c; + RangeCoder c; uint8_t state[CONTEXT_SIZE]; - int i, j, k, ret; + int ret; uint8_t state2[32][CONTEXT_SIZE]; unsigned crc = 0; memset(state2, 128, sizeof(state2)); memset(state, 128, sizeof(state)); - ff_init_range_decoder(c, f->avctx->extradata, f->avctx->extradata_size); - ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8); + ff_init_range_decoder(&c, f->avctx->extradata, f->avctx->extradata_size); + ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8); - f->version = get_symbol(c, state, 0); + f->version = get_symbol(&c, state, 0); if (f->version < 2) { av_log(f->avctx, AV_LOG_ERROR, "Invalid version in global header\n"); return AVERROR_INVALIDDATA; @@ -445,27 +423,27 @@ static int read_extra_header(FFV1Context *f) return AVERROR_PATCHWELCOME; } if (f->version > 2) { - c->bytestream_end -= 4; - f->micro_version = get_symbol(c, state, 0); + c.bytestream_end -= 4; + f->micro_version = get_symbol(&c, state, 0); if (f->micro_version < 0) return AVERROR_INVALIDDATA; } - f->ac = get_symbol(c, state, 0); + f->ac = get_symbol(&c, state, 0); if (f->ac == AC_RANGE_CUSTOM_TAB) { - for (i = 1; i < 256; i++) - f->state_transition[i] = get_symbol(c, state, 1) + c->one_state[i]; + for (int i = 1; i < 256; i++) + f->state_transition[i] = get_symbol(&c, state, 1) + c.one_state[i]; } - f->colorspace = get_symbol(c, state, 0); //YUV cs type - f->avctx->bits_per_raw_sample = get_symbol(c, state, 0); - f->chroma_planes = get_rac(c, state); - f->chroma_h_shift = get_symbol(c, state, 0); - f->chroma_v_shift = get_symbol(c, state, 0); - f->transparency = get_rac(c, state); + f->colorspace = get_symbol(&c, state, 0); //YUV cs type + f->avctx->bits_per_raw_sample = get_symbol(&c, state, 0); + f->chroma_planes = get_rac(&c, state); + f->chroma_h_shift = get_symbol(&c, state, 0); + f->chroma_v_shift = get_symbol(&c, state, 0); + f->transparency = get_rac(&c, state); f->plane_count = 1 + (f->chroma_planes || f->version<4) + f->transparency; - f->num_h_slices = 1 + get_symbol(c, state, 0); - f->num_v_slices = 1 + get_symbol(c, state, 0); + f->num_h_slices = 1 + get_symbol(&c, state, 0); + f->num_v_slices = 1 + get_symbol(&c, state, 0); if (f->chroma_h_shift > 4U || f->chroma_v_shift > 4U) { av_log(f->avctx, AV_LOG_ERROR, "chroma shift parameters %d %d are invalid\n", @@ -485,15 +463,15 @@ static int read_extra_header(FFV1Context *f) return AVERROR_PATCHWELCOME; } - f->quant_table_count = get_symbol(c, state, 0); + f->quant_table_count = get_symbol(&c, state, 0); if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) { av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count); f->quant_table_count = 0; return AVERROR_INVALIDDATA; } - for (i = 0; i < f->quant_table_count; i++) { - f->context_count[i] = read_quant_tables(c, f->quant_tables[i]); + for (int i = 0; i < f->quant_table_count; i++) { + f->context_count[i] = read_quant_tables(&c, f->quant_tables[i]); if (f->context_count[i] < 0) { av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n"); return AVERROR_INVALIDDATA; @@ -502,20 +480,20 @@ static int read_extra_header(FFV1Context *f) if ((ret = ff_ffv1_allocate_initial_states(f)) < 0) return ret; - for (i = 0; i < f->quant_table_count; i++) - if (get_rac(c, state)) { - for (j = 0; j < f->context_count[i]; j++) - for (k = 0; k < CONTEXT_SIZE; k++) { + for (int i = 0; i < f->quant_table_count; i++) + if (get_rac(&c, state)) { + for (int j = 0; j < f->context_count[i]; j++) + for (int k = 0; k < CONTEXT_SIZE; k++) { int pred = j ? f->initial_states[i][j - 1][k] : 128; f->initial_states[i][j][k] = - (pred + get_symbol(c, state2[k], 1)) & 0xFF; + (pred + get_symbol(&c, state2[k], 1)) & 0xFF; } } if (f->version > 2) { - f->ec = get_symbol(c, state, 0); + f->ec = get_symbol(&c, state, 0); if (f->micro_version > 2) - f->intra = get_symbol(c, state, 0); + f->intra = get_symbol(&c, state, 0); } if (f->version > 2) { @@ -550,8 +528,8 @@ static int read_extra_header(FFV1Context *f) static int read_header(FFV1Context *f) { uint8_t state[CONTEXT_SIZE]; - int i, j, context_count = -1; //-1 to avoid warning - RangeCoder *const c = &f->slice_context[0]->c; + int context_count = -1; //-1 to avoid warning + RangeCoder *const c = &f->slices[0].c; memset(state, 128, sizeof(state)); @@ -566,7 +544,7 @@ static int read_header(FFV1Context *f) f->ac = get_symbol(c, state, 0); if (f->ac == AC_RANGE_CUSTOM_TAB) { - for (i = 1; i < 256; i++) { + for (int i = 1; i < 256; i++) { int st = get_symbol(c, state, 1) + c->one_state[i]; if (st < 1 || st > 255) { av_log(f->avctx, AV_LOG_ERROR, "invalid state transition %d\n", st); @@ -765,7 +743,7 @@ static int read_header(FFV1Context *f) ff_dlog(f->avctx, "%d %d %d\n", f->chroma_h_shift, f->chroma_v_shift, f->avctx->pix_fmt); if (f->version < 2) { - context_count = read_quant_tables(c, f->quant_table); + context_count = read_quant_tables(c, f->quant_tables[0]); if (context_count < 0) { av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n"); return AVERROR_INVALIDDATA; @@ -790,12 +768,10 @@ static int read_header(FFV1Context *f) return AVERROR_INVALIDDATA; } - for (j = 0; j < f->slice_count; j++) { - FFV1Context *fs = f->slice_context[j]; - fs->ac = f->ac; - fs->packed_at_lsb = f->packed_at_lsb; + for (int j = 0; j < f->slice_count; j++) { + FFV1SliceContext *sc = &f->slices[j]; - fs->slice_damaged = 0; + sc->slice_damaged = 0; if (f->version == 2) { int sx = get_symbol(c, state, 0); @@ -808,19 +784,24 @@ static int read_header(FFV1Context *f) if (sx > f->num_h_slices - sw || sy > f->num_v_slices - sh) return AVERROR_INVALIDDATA; - fs->slice_x = sx * (int64_t)f->width / f->num_h_slices; - fs->slice_y = sy * (int64_t)f->height / f->num_v_slices; - fs->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - fs->slice_x; - fs->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - fs->slice_y; + sc->slice_x = sx * (int64_t)f->width / f->num_h_slices; + sc->slice_y = sy * (int64_t)f->height / f->num_v_slices; + sc->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - sc->slice_x; + sc->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - sc->slice_y; - av_assert0((unsigned)fs->slice_width <= f->width && - (unsigned)fs->slice_height <= f->height); - av_assert0 ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width <= f->width - && (unsigned)fs->slice_y + (uint64_t)fs->slice_height <= f->height); + av_assert0((unsigned)sc->slice_width <= f->width && + (unsigned)sc->slice_height <= f->height); + av_assert0 ( (unsigned)sc->slice_x + (uint64_t)sc->slice_width <= f->width + && (unsigned)sc->slice_y + (uint64_t)sc->slice_height <= f->height); } - for (i = 0; i < f->plane_count; i++) { - PlaneContext *const p = &fs->plane[i]; + ff_refstruct_unref(&sc->plane); + sc->plane = ff_ffv1_planes_alloc(); + if (!sc->plane) + return AVERROR(ENOMEM); + + for (int i = 0; i < f->plane_count; i++) { + PlaneContext *const p = &sc->plane[i]; if (f->version == 2) { int idx = get_symbol(c, state, 0); @@ -830,19 +811,11 @@ static int read_header(FFV1Context *f) return AVERROR_INVALIDDATA; } p->quant_table_index = idx; - memcpy(p->quant_table, f->quant_tables[idx], - sizeof(p->quant_table)); context_count = f->context_count[idx]; - } else { - memcpy(p->quant_table, f->quant_table, sizeof(p->quant_table)); } if (f->version <= 2) { av_assert0(context_count >= 0); - if (p->context_count < context_count) { - av_freep(&p->state); - av_freep(&p->vlc_state); - } p->context_count = context_count; } } @@ -873,8 +846,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, uint8_t *buf = avpkt->data; int buf_size = avpkt->size; FFV1Context *f = avctx->priv_data; - RangeCoder *const c = &f->slice_context[0]->c; - int i, ret, key_frame; + RangeCoder *const c = &f->slices[0].c; + int ret, key_frame; uint8_t keystate = 128; uint8_t *buf_p; AVFrame *p; @@ -908,6 +881,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, } else { int w = avctx->width; int s = 1 + w / (1<<23); + int i; w /= s; @@ -922,7 +896,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, if (ret < 0) return ret; - f->cur = p = f->picture.f; + p = f->picture.f; p->pict_type = AV_PICTURE_TYPE_I; //FIXME I vs. P p->flags = (p->flags & ~AV_FRAME_FLAG_KEY) | key_frame; @@ -941,8 +915,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, ff_thread_finish_setup(avctx); buf_p = buf + buf_size; - for (i = f->slice_count - 1; i >= 0; i--) { - FFV1Context *fs = f->slice_context[i]; + for (int i = f->slice_count - 1; i >= 0; i--) { + FFV1SliceContext *sc = &f->slices[i]; int trailer = 3 + 5*!!f->ec; int v; @@ -969,7 +943,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, } else { av_log(f->avctx, AV_LOG_ERROR, "\n"); } - fs->slice_damaged = 1; + sc->slice_damaged = 1; } if (avctx->debug & FF_DEBUG_PICT_INFO) { av_log(avctx, AV_LOG_DEBUG, "slice %d, CRC: 0x%08"PRIX32"\n", i, AV_RB32(buf_p + v - 4)); @@ -977,36 +951,35 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, } if (i) { - ff_init_range_decoder(&fs->c, buf_p, v); + ff_init_range_decoder(&sc->c, buf_p, v); + ff_build_rac_states(&sc->c, 0.05 * (1LL << 32), 256 - 8); } else - fs->c.bytestream_end = buf_p + v; + sc->c.bytestream_end = buf_p + v; - fs->avctx = avctx; } avctx->execute(avctx, decode_slice, - &f->slice_context[0], + f->slices, NULL, f->slice_count, - sizeof(void*)); + sizeof(*f->slices)); - for (i = f->slice_count - 1; i >= 0; i--) { - FFV1Context *fs = f->slice_context[i]; - int j; - if (fs->slice_damaged && f->last_picture.f) { + for (int i = f->slice_count - 1; i >= 0; i--) { + FFV1SliceContext *sc = &f->slices[i]; + if (sc->slice_damaged && f->last_picture.f) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); const uint8_t *src[4]; uint8_t *dst[4]; ff_progress_frame_await(&f->last_picture, INT_MAX); - for (j = 0; j < desc->nb_components; j++) { + for (int j = 0; j < desc->nb_components; j++) { int pixshift = desc->comp[j].depth > 8; int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0; int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0; dst[j] = p->data[j] + p->linesize[j] * - (fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift); + (sc->slice_y >> sv) + ((sc->slice_x >> sh) << pixshift); src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] * - (fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift); + (sc->slice_y >> sv) + ((sc->slice_x >> sh) << pixshift); } if (desc->flags & AV_PIX_FMT_FLAG_PAL) { @@ -1016,8 +989,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, av_image_copy(dst, p->linesize, src, f->last_picture.f->linesize, avctx->pix_fmt, - fs->slice_width, - fs->slice_height); + sc->slice_width, + sc->slice_height); } } ff_progress_frame_report(&f->picture, INT_MAX); @@ -1031,57 +1004,55 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, return buf_size; } -static void copy_fields(FFV1Context *fsdst, const FFV1Context *fssrc, - const FFV1Context *fsrc) -{ - fsdst->version = fsrc->version; - fsdst->micro_version = fsrc->micro_version; - fsdst->chroma_planes = fsrc->chroma_planes; - fsdst->chroma_h_shift = fsrc->chroma_h_shift; - fsdst->chroma_v_shift = fsrc->chroma_v_shift; - fsdst->transparency = fsrc->transparency; - fsdst->plane_count = fsrc->plane_count; - fsdst->ac = fsrc->ac; - fsdst->colorspace = fsrc->colorspace; - - fsdst->ec = fsrc->ec; - fsdst->intra = fsrc->intra; - fsdst->slice_damaged = fssrc->slice_damaged; - fsdst->key_frame_ok = fsrc->key_frame_ok; - - fsdst->packed_at_lsb = fsrc->packed_at_lsb; - fsdst->slice_count = fsrc->slice_count; - if (fsrc->version<3){ - fsdst->slice_x = fssrc->slice_x; - fsdst->slice_y = fssrc->slice_y; - fsdst->slice_width = fssrc->slice_width; - fsdst->slice_height = fssrc->slice_height; - } -} - #if HAVE_THREADS static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { FFV1Context *fsrc = src->priv_data; FFV1Context *fdst = dst->priv_data; - int i; if (dst == src) return 0; - copy_fields(fdst, fsrc, fsrc); + fdst->version = fsrc->version; + fdst->micro_version = fsrc->micro_version; + fdst->chroma_planes = fsrc->chroma_planes; + fdst->chroma_h_shift = fsrc->chroma_h_shift; + fdst->chroma_v_shift = fsrc->chroma_v_shift; + fdst->transparency = fsrc->transparency; + fdst->plane_count = fsrc->plane_count; + fdst->ac = fsrc->ac; + fdst->colorspace = fsrc->colorspace; + + fdst->ec = fsrc->ec; + fdst->intra = fsrc->intra; + fdst->key_frame_ok = fsrc->key_frame_ok; + + fdst->packed_at_lsb = fsrc->packed_at_lsb; + fdst->slice_count = fsrc->slice_count; fdst->use32bit = fsrc->use32bit; memcpy(fdst->state_transition, fsrc->state_transition, sizeof(fdst->state_transition)); - memcpy(fdst->quant_table, fsrc->quant_table, sizeof(fsrc->quant_table)); - for (i = 0; i < fdst->num_h_slices * fdst->num_v_slices; i++) { - FFV1Context *fssrc = fsrc->slice_context[i]; - FFV1Context *fsdst = fdst->slice_context[i]; - copy_fields(fsdst, fssrc, fsrc); + // in version 1 there is a single per-keyframe quant table, so + // we need to propagate it between threads + if (fsrc->version < 2) + memcpy(fdst->quant_tables[0], fsrc->quant_tables[0], sizeof(fsrc->quant_tables[0])); + + for (int i = 0; i < fdst->num_h_slices * fdst->num_v_slices; i++) { + FFV1SliceContext *sc = &fdst->slices[i]; + const FFV1SliceContext *sc0 = &fsrc->slices[i]; + + sc->slice_damaged = sc0->slice_damaged; + + ff_refstruct_replace(&sc->plane, sc0->plane); + + if (fsrc->version < 3) { + sc->slice_x = sc0->slice_x; + sc->slice_y = sc0->slice_y; + sc->slice_width = sc0->slice_width; + sc->slice_height = sc0->slice_height; + } } - av_assert0(!fdst->plane[0].state); - av_assert0(!fdst->sample_buffer); av_assert1(fdst->max_slice_count == fsrc->max_slice_count); diff --git a/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c b/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c index a90c28cd0e..2da6bd935d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/ffv1dec_template.c @@ -22,21 +22,24 @@ #include "ffv1_template.c" -static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, - TYPE *sample[2], - int plane_index, int bits) +static av_always_inline int +RENAME(decode_line)(FFV1Context *f, FFV1SliceContext *sc, + GetBitContext *gb, + int w, TYPE *sample[2], int plane_index, int bits, + int ac) { - PlaneContext *const p = &s->plane[plane_index]; - RangeCoder *const c = &s->c; + PlaneContext *const p = &sc->plane[plane_index]; + RangeCoder *const c = &sc->c; + const int16_t (*quant_table)[256] = f->quant_tables[p->quant_table_index]; int x; int run_count = 0; int run_mode = 0; - int run_index = s->run_index; + int run_index = sc->run_index; - if (is_input_end(s)) + if (is_input_end(c, gb, ac)) return AVERROR_INVALIDDATA; - if (s->slice_coding_mode == 1) { + if (sc->slice_coding_mode == 1) { int i; for (x = 0; x < w; x++) { int v = 0; @@ -53,11 +56,12 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, int diff, context, sign; if (!(x & 1023)) { - if (is_input_end(s)) + if (is_input_end(c, gb, ac)) return AVERROR_INVALIDDATA; } - context = RENAME(get_context)(p, sample[1] + x, sample[0] + x, sample[1] + x); + context = RENAME(get_context)(quant_table, + sample[1] + x, sample[0] + x, sample[1] + x); if (context < 0) { context = -context; sign = 1; @@ -66,7 +70,7 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, av_assert2(context < p->context_count); - if (s->ac != AC_GOLOMB_RICE) { + if (ac != AC_GOLOMB_RICE) { diff = get_symbol_inline(c, p->state[context], 1); } else { if (context == 0 && run_mode == 0) @@ -74,13 +78,13 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, if (run_mode) { if (run_count == 0 && run_mode == 1) { - if (get_bits1(&s->gb)) { + if (get_bits1(gb)) { run_count = 1 << ff_log2_run[run_index]; if (x + run_count <= w) run_index++; } else { if (ff_log2_run[run_index]) - run_count = get_bits(&s->gb, ff_log2_run[run_index]); + run_count = get_bits(gb, ff_log2_run[run_index]); else run_count = 0; if (run_index) @@ -105,17 +109,17 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, if (run_count < 0) { run_mode = 0; run_count = 0; - diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], + diff = get_vlc_symbol(gb, &p->vlc_state[context], bits); if (diff >= 0) diff++; } else diff = 0; } else - diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits); + diff = get_vlc_symbol(gb, &p->vlc_state[context], bits); - ff_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n", - run_count, run_index, run_mode, x, get_bits_count(&s->gb)); + ff_dlog(f->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n", + run_count, run_index, run_mode, x, get_bits_count(gb)); } if (sign) @@ -123,27 +127,30 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, sample[1][x] = av_zero_extend(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits); } - s->run_index = run_index; + sc->run_index = run_index; return 0; } -static int RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[4], int w, int h, int stride[4]) +static int RENAME(decode_rgb_frame)(FFV1Context *f, FFV1SliceContext *sc, + GetBitContext *gb, + uint8_t *src[4], int w, int h, int stride[4]) { int x, y, p; TYPE *sample[4][2]; - int lbd = s->avctx->bits_per_raw_sample <= 8; - int bits = s->avctx->bits_per_raw_sample > 0 ? s->avctx->bits_per_raw_sample : 8; + int lbd = f->avctx->bits_per_raw_sample <= 8; + int bits = f->avctx->bits_per_raw_sample > 0 ? f->avctx->bits_per_raw_sample : 8; int offset = 1 << bits; - int transparency = s->transparency; + int transparency = f->transparency; + int ac = f->ac; for (x = 0; x < 4; x++) { - sample[x][0] = RENAME(s->sample_buffer) + x * 2 * (w + 6) + 3; - sample[x][1] = RENAME(s->sample_buffer) + (x * 2 + 1) * (w + 6) + 3; + sample[x][0] = RENAME(sc->sample_buffer) + x * 2 * (w + 6) + 3; + sample[x][1] = RENAME(sc->sample_buffer) + (x * 2 + 1) * (w + 6) + 3; } - s->run_index = 0; + sc->run_index = 0; - memset(RENAME(s->sample_buffer), 0, 8 * (w + 6) * sizeof(*RENAME(s->sample_buffer))); + memset(RENAME(sc->sample_buffer), 0, 8 * (w + 6) * sizeof(*RENAME(sc->sample_buffer))); for (y = 0; y < h; y++) { for (p = 0; p < 3 + transparency; p++) { @@ -155,10 +162,10 @@ static int RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[4], int w, int sample[p][1][-1]= sample[p][0][0 ]; sample[p][0][ w]= sample[p][0][w-1]; - if (lbd && s->slice_coding_mode == 0) - ret = RENAME(decode_line)(s, w, sample[p], (p + 1)/2, 9); + if (lbd && sc->slice_coding_mode == 0) + ret = RENAME(decode_line)(f, sc, gb, w, sample[p], (p + 1)/2, 9, ac); else - ret = RENAME(decode_line)(s, w, sample[p], (p + 1)/2, bits + (s->slice_coding_mode != 1)); + ret = RENAME(decode_line)(f, sc, gb, w, sample[p], (p + 1)/2, bits + (sc->slice_coding_mode != 1), ac); if (ret < 0) return ret; } @@ -168,10 +175,10 @@ static int RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[4], int w, int int r = sample[2][1][x]; int a = sample[3][1][x]; - if (s->slice_coding_mode != 1) { + if (sc->slice_coding_mode != 1) { b -= offset; r -= offset; - g -= (b * s->slice_rct_by_coef + r * s->slice_rct_ry_coef) >> 2; + g -= (b * sc->slice_rct_by_coef + r * sc->slice_rct_ry_coef) >> 2; b += g; r += g; } diff --git a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c index 35666699d5..83ca5efd8f 100644 --- a/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/hevc/hevcdec.c @@ -2903,7 +2903,7 @@ static int set_side_data(HEVCContext *s) if (!info_ref) return AVERROR(ENOMEM); - ret = ff_frame_new_side_data_from_buf(s->avctx, out, AV_FRAME_DATA_DYNAMIC_HDR_PLUS, &info_ref, NULL); + ret = ff_frame_new_side_data_from_buf(s->avctx, out, AV_FRAME_DATA_DYNAMIC_HDR_PLUS, &info_ref); if (ret < 0) return ret; } diff --git a/src/ExtLib/ffmpeg/libavcodec/libdav1d.c b/src/ExtLib/ffmpeg/libavcodec/libdav1d.c index 09fe767fb8..546b42e9c6 100644 --- a/src/ExtLib/ffmpeg/libavcodec/libdav1d.c +++ b/src/ExtLib/ffmpeg/libavcodec/libdav1d.c @@ -528,7 +528,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) if (!res) break; - res = ff_frame_new_side_data_from_buf(c, frame, AV_FRAME_DATA_A53_CC, &buf, NULL); + res = ff_frame_new_side_data_from_buf(c, frame, AV_FRAME_DATA_A53_CC, &buf); if (res < 0) goto fail; diff --git a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c index 3483587146..4c53a69320 100644 --- a/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c +++ b/src/ExtLib/ffmpeg/libavcodec/mpeg12dec.c @@ -1337,7 +1337,7 @@ static int mpeg_field_start(Mpeg1Context *s1, const uint8_t *buf, int buf_size) if (s1->a53_buf_ref) { ret = ff_frame_new_side_data_from_buf( s->avctx, s->cur_pic.ptr->f, AV_FRAME_DATA_A53_CC, - &s1->a53_buf_ref, NULL); + &s1->a53_buf_ref); if (ret < 0) return ret; } diff --git a/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c b/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c index 2c7feb512e..db4f2173dd 100644 --- a/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/pixblockdsp.c @@ -26,6 +26,13 @@ static void get_pixels_16_c(int16_t *restrict block, const uint8_t *pixels, ptrdiff_t stride) +{ + for (int i = 0; i < 8; i++) + AV_COPY128(block + i * 8, pixels + i * stride); +} + +static void get_pixels_unaligned_16_c(int16_t *restrict block, + const uint8_t *pixels, ptrdiff_t stride) { AV_COPY128U(block + 0 * 8, pixels + 0 * stride); AV_COPY128U(block + 1 * 8, pixels + 1 * stride); @@ -90,7 +97,7 @@ av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx) case 10: case 12: case 14: - c->get_pixels_unaligned = + c->get_pixels_unaligned = get_pixels_unaligned_16_c; c->get_pixels = get_pixels_16_c; break; default: diff --git a/src/ExtLib/ffmpeg/libavcodec/pngdec.c b/src/ExtLib/ffmpeg/libavcodec/pngdec.c index cb861e5f60..c5b32c166d 100644 --- a/src/ExtLib/ffmpeg/libavcodec/pngdec.c +++ b/src/ExtLib/ffmpeg/libavcodec/pngdec.c @@ -1097,7 +1097,7 @@ static int decode_sbit_chunk(AVCodecContext *avctx, PNGDecContext *s, bits = FFMAX(b, bits); } - if (bits < 0 || bits > s->bit_depth) { + if (bits <= 0 || bits > (s->color_type & PNG_COLOR_MASK_PALETTE ? 8 : s->bit_depth)) { av_log(avctx, AV_LOG_ERROR, "Invalid significant bits: %d\n", bits); return AVERROR_INVALIDDATA; } diff --git a/src/ExtLib/ffmpeg/libavcodec/snow.c b/src/ExtLib/ffmpeg/libavcodec/snow.c index 0285362d43..af6214d077 100644 --- a/src/ExtLib/ffmpeg/libavcodec/snow.c +++ b/src/ExtLib/ffmpeg/libavcodec/snow.c @@ -428,7 +428,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ !FF_ALLOCZ_TYPED_ARRAY(s->spatial_dwt_buffer, width * height) || //FIXME this does not belong here !FF_ALLOCZ_TYPED_ARRAY(s->temp_dwt_buffer, width) || !FF_ALLOCZ_TYPED_ARRAY(s->temp_idwt_buffer, width) || - !FF_ALLOCZ_TYPED_ARRAY(s->run_buffer, ((width + 1) >> 1) * ((height + 1) >> 1))) + !FF_ALLOCZ_TYPED_ARRAY(s->run_buffer, ((width + 1) >> 1) * ((height + 1) >> 1) + 1)) return AVERROR(ENOMEM); for(i=0; icodec_id == AV_CODEC_ID_SVQ1) { w_align = 64; h_align = 64; + } else if (s->codec_id == AV_CODEC_ID_SNOW) { + w_align = 16; + h_align = 16; } break; case AV_PIX_FMT_RGB555: diff --git a/src/ExtLib/ffmpeg/libavcodec/version.h b/src/ExtLib/ffmpeg/libavcodec/version.h index 80e2ae630d..8b53586be1 100644 --- a/src/ExtLib/ffmpeg/libavcodec/version.h +++ b/src/ExtLib/ffmpeg/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 10 +#define LIBAVCODEC_VERSION_MINOR 11 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libavcodec/videodsp.c b/src/ExtLib/ffmpeg/libavcodec/videodsp.c index bdff2e76f5..a19e87a819 100644 --- a/src/ExtLib/ffmpeg/libavcodec/videodsp.c +++ b/src/ExtLib/ffmpeg/libavcodec/videodsp.c @@ -51,6 +51,8 @@ av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc) ff_videodsp_init_arm(ctx, bpc); #elif ARCH_PPC ff_videodsp_init_ppc(ctx, bpc); +#elif ARCH_RISCV + ff_videodsp_init_riscv(ctx, bpc); #elif ARCH_X86 ff_videodsp_init_x86(ctx, bpc); #elif ARCH_MIPS diff --git a/src/ExtLib/ffmpeg/libavcodec/videodsp.h b/src/ExtLib/ffmpeg/libavcodec/videodsp.h index e8960b609d..1be3188d09 100644 --- a/src/ExtLib/ffmpeg/libavcodec/videodsp.h +++ b/src/ExtLib/ffmpeg/libavcodec/videodsp.h @@ -81,6 +81,7 @@ void ff_videodsp_init(VideoDSPContext *ctx, int bpc); void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc); void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc); void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc); +void ff_videodsp_init_riscv(VideoDSPContext *ctx, int bpc); void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc); void ff_videodsp_init_mips(VideoDSPContext *ctx, int bpc); void ff_videodsp_init_loongarch(VideoDSPContext *ctx, int bpc); diff --git a/src/ExtLib/ffmpeg/libavcodec/vp9dsp_template.c b/src/ExtLib/ffmpeg/libavcodec/vp9dsp_template.c index cb696a27e9..2228ee2b5a 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vp9dsp_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/vp9dsp_template.c @@ -30,7 +30,7 @@ // FIXME see whether we can merge parts of this (perhaps at least 4x4 and 8x8) // back with h264pred.[ch] -static void vert_4x4_c(uint8_t *_dst, ptrdiff_t stride, +static void vert_4x4_c(uint8_t *restrict _dst, ptrdiff_t stride, const uint8_t *left, const uint8_t *_top) { pixel *dst = (pixel *) _dst; @@ -44,49 +44,73 @@ static void vert_4x4_c(uint8_t *_dst, ptrdiff_t stride, AV_WN4PA(dst + stride * 3, p4); } -static void vert_8x8_c(uint8_t *_dst, ptrdiff_t stride, +static void vert_8x8_c(uint8_t *restrict _dst, ptrdiff_t stride, const uint8_t *left, const uint8_t *_top) { pixel *dst = (pixel *) _dst; const pixel *top = (const pixel *) _top; +#if BIT_DEPTH == 8 + uint64_t p8 = AV_RN64A(top); +#else pixel4 p4a = AV_RN4PA(top + 0); pixel4 p4b = AV_RN4PA(top + 4); +#endif int y; stride /= sizeof(pixel); for (y = 0; y < 8; y++) { +#if BIT_DEPTH == 8 + AV_WN64A(dst, p8); +#else AV_WN4PA(dst + 0, p4a); AV_WN4PA(dst + 4, p4b); +#endif dst += stride; } } -static void vert_16x16_c(uint8_t *_dst, ptrdiff_t stride, +static void vert_16x16_c(uint8_t *restrict _dst, ptrdiff_t stride, const uint8_t *left, const uint8_t *_top) { pixel *dst = (pixel *) _dst; const pixel *top = (const pixel *) _top; +#if BIT_DEPTH == 8 + uint64_t p8a = AV_RN64A(top); + uint64_t p8b = AV_RN64A(top + 8); +#else pixel4 p4a = AV_RN4PA(top + 0); pixel4 p4b = AV_RN4PA(top + 4); pixel4 p4c = AV_RN4PA(top + 8); pixel4 p4d = AV_RN4PA(top + 12); +#endif int y; stride /= sizeof(pixel); for (y = 0; y < 16; y++) { +#if BIT_DEPTH == 8 + AV_WN64A(dst + 0, p8a); + AV_WN64A(dst + 8, p8b); +#else AV_WN4PA(dst + 0, p4a); AV_WN4PA(dst + 4, p4b); AV_WN4PA(dst + 8, p4c); AV_WN4PA(dst + 12, p4d); +#endif dst += stride; } } -static void vert_32x32_c(uint8_t *_dst, ptrdiff_t stride, +static void vert_32x32_c(uint8_t *restrict _dst, ptrdiff_t stride, const uint8_t *left, const uint8_t *_top) { pixel *dst = (pixel *) _dst; const pixel *top = (const pixel *) _top; +#if BIT_DEPTH == 8 + uint64_t p8a = AV_RN64A(top); + uint64_t p8b = AV_RN64A(top + 8); + uint64_t p8c = AV_RN64A(top + 16); + uint64_t p8d = AV_RN64A(top + 24); +#else pixel4 p4a = AV_RN4PA(top + 0); pixel4 p4b = AV_RN4PA(top + 4); pixel4 p4c = AV_RN4PA(top + 8); @@ -95,10 +119,17 @@ static void vert_32x32_c(uint8_t *_dst, ptrdiff_t stride, pixel4 p4f = AV_RN4PA(top + 20); pixel4 p4g = AV_RN4PA(top + 24); pixel4 p4h = AV_RN4PA(top + 28); +#endif int y; stride /= sizeof(pixel); for (y = 0; y < 32; y++) { +#if BIT_DEPTH == 8 + AV_WN64A(dst + 0, p8a); + AV_WN64A(dst + 8, p8b); + AV_WN64A(dst + 16, p8c); + AV_WN64A(dst + 24, p8d); +#else AV_WN4PA(dst + 0, p4a); AV_WN4PA(dst + 4, p4b); AV_WN4PA(dst + 8, p4c); @@ -107,6 +138,7 @@ static void vert_32x32_c(uint8_t *_dst, ptrdiff_t stride, AV_WN4PA(dst + 20, p4f); AV_WN4PA(dst + 24, p4g); AV_WN4PA(dst + 28, p4h); +#endif dst += stride; } } @@ -1936,9 +1968,9 @@ static av_cold void vp9dsp_loopfilter_init(VP9DSPContext *dsp) #if BIT_DEPTH != 12 -static av_always_inline void copy_c(uint8_t *dst, ptrdiff_t dst_stride, - const uint8_t *src, ptrdiff_t src_stride, - int w, int h) +static av_always_inline void copy_c(uint8_t *restrict dst, ptrdiff_t dst_stride, + const uint8_t *restrict src, + ptrdiff_t src_stride, int w, int h) { do { memcpy(dst, src, w * sizeof(pixel)); @@ -1948,9 +1980,9 @@ static av_always_inline void copy_c(uint8_t *dst, ptrdiff_t dst_stride, } while (--h); } -static av_always_inline void avg_c(uint8_t *_dst, ptrdiff_t dst_stride, - const uint8_t *_src, ptrdiff_t src_stride, - int w, int h) +static av_always_inline void avg_c(uint8_t *restrict _dst, ptrdiff_t dst_stride, + const uint8_t *restrict _src, + ptrdiff_t src_stride, int w, int h) { pixel *dst = (pixel *) _dst; const pixel *src = (const pixel *) _src; diff --git a/src/ExtLib/ffmpeg/libavutil/cpu.c b/src/ExtLib/ffmpeg/libavutil/cpu.c index 1f9eb5bf64..18c204e92b 100644 --- a/src/ExtLib/ffmpeg/libavutil/cpu.c +++ b/src/ExtLib/ffmpeg/libavutil/cpu.c @@ -184,8 +184,6 @@ int av_parse_cpu_caps(unsigned *flags, const char *s) { "lasx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_LASX }, .unit = "flags" }, #elif ARCH_RISCV { "rvi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVI }, .unit = "flags" }, - { "rvf", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVF }, .unit = "flags" }, - { "rvd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVD }, .unit = "flags" }, { "rvb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB }, .unit = "flags" }, { "zve32x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I32 }, .unit = "flags" }, { "zve32f", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F32 }, .unit = "flags" }, diff --git a/src/ExtLib/ffmpeg/libavutil/dovi_meta.h b/src/ExtLib/ffmpeg/libavutil/dovi_meta.h index e168075a24..c942d0e133 100644 --- a/src/ExtLib/ffmpeg/libavutil/dovi_meta.h +++ b/src/ExtLib/ffmpeg/libavutil/dovi_meta.h @@ -46,6 +46,7 @@ * uint8_t el_present_flag * uint8_t bl_present_flag * uint8_t dv_bl_signal_compatibility_id + * uint8_t dv_md_compression, the compression method in use * @endcode * * @note The struct must be allocated with av_dovi_alloc() and @@ -60,8 +61,16 @@ typedef struct AVDOVIDecoderConfigurationRecord { uint8_t el_present_flag; uint8_t bl_present_flag; uint8_t dv_bl_signal_compatibility_id; + uint8_t dv_md_compression; } AVDOVIDecoderConfigurationRecord; +enum AVDOVICompression { + AV_DOVI_COMPRESSION_NONE = 0, + AV_DOVI_COMPRESSION_LIMITED = 1, + AV_DOVI_COMPRESSION_RESERVED = 2, + AV_DOVI_COMPRESSION_EXTENDED = 3, +}; + /** * Allocate a AVDOVIDecoderConfigurationRecord structure and initialize its * fields to default values. diff --git a/src/ExtLib/ffmpeg/libavutil/intreadwrite.h b/src/ExtLib/ffmpeg/libavutil/intreadwrite.h index 547e4786db..0b5f76837a 100644 --- a/src/ExtLib/ffmpeg/libavutil/intreadwrite.h +++ b/src/ExtLib/ffmpeg/libavutil/intreadwrite.h @@ -539,9 +539,41 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; #if AV_HAVE_BIGENDIAN # define AV_RLA(s, p) av_bswap##s(AV_RN##s##A(p)) # define AV_WLA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +# define AV_RBA(s, p) AV_RN##s##A(p) +# define AV_WBA(s, p, v) AV_WN##s##A(p, v) #else # define AV_RLA(s, p) AV_RN##s##A(p) # define AV_WLA(s, p, v) AV_WN##s##A(p, v) +# define AV_RBA(s, p) av_bswap##s(AV_RN##s##A(p)) +# define AV_WBA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +#endif + +#ifndef AV_RL16A +# define AV_RL16A(p) AV_RLA(16, p) +#endif +#ifndef AV_WL16A +# define AV_WL16A(p, v) AV_WLA(16, p, v) +#endif + +#ifndef AV_RB16A +# define AV_RB16A(p) AV_RBA(16, p) +#endif +#ifndef AV_WB16A +# define AV_WB16A(p, v) AV_WBA(16, p, v) +#endif + +#ifndef AV_RL32A +# define AV_RL32A(p) AV_RLA(32, p) +#endif +#ifndef AV_WL32A +# define AV_WL32A(p, v) AV_WLA(32, p, v) +#endif + +#ifndef AV_RB32A +# define AV_RB32A(p) AV_RBA(32, p) +#endif +#ifndef AV_WB32A +# define AV_WB32A(p, v) AV_WBA(32, p, v) #endif #ifndef AV_RL64A @@ -551,6 +583,13 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; # define AV_WL64A(p, v) AV_WLA(64, p, v) #endif +#ifndef AV_RB64A +# define AV_RB64A(p) AV_RBA(64, p) +#endif +#ifndef AV_WB64A +# define AV_WB64A(p, v) AV_WBA(64, p, v) +#endif + /* * The AV_COPYxxU macros are suitable for copying data to/from unaligned * memory locations. diff --git a/src/ExtLib/ffmpeg/libavutil/timer.h b/src/ExtLib/ffmpeg/libavutil/timer.h index 9fe6aa1385..663daf81c6 100644 --- a/src/ExtLib/ffmpeg/libavutil/timer.h +++ b/src/ExtLib/ffmpeg/libavutil/timer.h @@ -61,8 +61,6 @@ # include "arm/timer.h" #elif ARCH_PPC # include "ppc/timer.h" -#elif ARCH_RISCV -# include "riscv/timer.h" #elif ARCH_X86 # include "x86/timer.h" #elif ARCH_LOONGARCH diff --git a/src/ExtLib/ffmpeg/libavutil/version.h b/src/ExtLib/ffmpeg/libavutil/version.h index 852eeef1d6..24418600f0 100644 --- a/src/ExtLib/ffmpeg/libavutil/version.h +++ b/src/ExtLib/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 29 +#define LIBAVUTIL_VERSION_MINOR 31 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h b/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h index 65cc6b39a1..c92b75ed12 100644 --- a/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h +++ b/src/ExtLib/ffmpeg/libavutil/x86/intreadwrite.h @@ -37,6 +37,13 @@ static av_always_inline void AV_COPY128(void *d, const void *s) _mm_store_si128((__m128i *)d, tmp); } +#define AV_COPY128U AV_COPY128U +static av_always_inline void AV_COPY128U(void *d, const void *s) +{ + __m128i tmp = _mm_loadu_si128((const __m128i *)s); + _mm_storeu_si128((__m128i *)d, tmp); +} + #define AV_ZERO128 AV_ZERO128 static av_always_inline void AV_ZERO128(void *d) { From a5789b087918263db310a83eb465d8a6bf4ffe74 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 3 Aug 2024 12:26:50 +0300 Subject: [PATCH 083/102] =?UTF-8?q?=D0=A1=D0=BD=D0=B0=D1=87=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=B2=D0=B5=D1=80=D1=88=D0=B0=D0=B5=D0=BC?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B8=D0=B3=D1=80=D1=8B=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5,=20=D0=BF=D0=BE=D1=82=D0=BE=D0=BC=20=D1=81=D0=BA?= =?UTF-8?q?=D1=80=D1=8B=D0=B2=D0=B0=D0=B5=D0=BC=20=D0=BE=D0=BA=D0=BD=D0=BE?= =?UTF-8?q?=20=D0=BF=D0=BB=D0=B5=D0=B5=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef206c23997ea254d7c50a41cb63237976949a1d. --- src/apps/mplayerc/MainFrm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index ee0c49cf9f..df0daadf00 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -1033,10 +1033,10 @@ void CMainFrame::OnClose() SaveControlBars(); } - ShowWindow(SW_HIDE); - CloseMedia(); + ShowWindow(SW_HIDE); + s.WinLircClient.DisConnect(); s.UIceClient.DisConnect(); From af7eb076c2264c185514496711775248506949b2 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 4 Aug 2024 09:21:22 +0300 Subject: [PATCH 084/102] =?UTF-8?q?=D0=92=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD?= =?UTF-8?q?=D1=8F=D0=B5=D0=BC=20IAMOpenProgress::AbortOperation=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B4=20=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D0=B5=D0=BC=20=D0=B3=D1=80=D0=B0=D1=84=D0=B0.=20=D0=AD?= =?UTF-8?q?=D1=82=D0=BE=20=D1=83=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BF=D0=BB=D0=B5=D0=B5=D1=80=D0=B0=20=D1=81=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=BC=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC=D0=BD=D1=8B=D0=BC=D0=B8=20URL.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/MainFrm.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index df0daadf00..bff8fa5249 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -17651,6 +17651,19 @@ void CMainFrame::CloseMedia(BOOL bNextIsOpened/* = FALSE*/) m_fOpeningAborted = true; if (m_pGB) { + if (!m_pAMOP) { + m_pAMOP = m_pGB; + if (!m_pAMOP) { + BeginEnumFilters(m_pGB, pEF, pBF) + if (m_pAMOP = pBF) { + break; + } + EndEnumFilters; + } + } + if (m_pAMOP) { + m_pAMOP->AbortOperation(); + } m_pGB->Abort(); // TODO: lock on graph objects somehow, this is not thread safe } From 385a4d6925e968fb4c6f9d75eb8296713dff7327 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 5 Aug 2024 14:07:07 +1000 Subject: [PATCH 085/102] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20CH264Nalu::ReadNex?= =?UTF-8?q?t()=20-=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BE=D1=82=D0=B2=D1=80?= =?UTF-8?q?=D0=B0=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=D1=8B=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=B0=20=D0=B7=D0=B0=20=D0=B3=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D1=8B=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20"?= =?UTF-8?q?=D0=BB=D0=B5=D0=B2=D1=8B=D1=85"=20=D0=B7=D0=BD=D0=B0=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/H264Nalu.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/DSUtil/H264Nalu.cpp b/src/DSUtil/H264Nalu.cpp index 7b92c07d51..bec60a83bd 100644 --- a/src/DSUtil/H264Nalu.cpp +++ b/src/DSUtil/H264Nalu.cpp @@ -82,6 +82,10 @@ bool CH264Nalu::ReadNext() } if ((m_nNALSize != 0) && (m_nCurPos == m_nNextRTP)) { + if (m_nCurPos + m_nNALSize >= m_nSize) { + return false; + } + // RTP Nalu type : (XX XX) XX XX NAL..., with XX XX XX XX or XX XX equal to NAL size m_nNALStartPos = m_nCurPos; m_nNALDataPos = m_nCurPos + m_nNALSize; @@ -92,11 +96,19 @@ bool CH264Nalu::ReadNext() m_nNextRTP += nTemp + m_nNALSize; MoveToNextRTPStartcode(); } else { + if (m_nCurPos + 3 >= m_nSize) { + return false; + } + // Remove trailing bits while (m_pBuffer[m_nCurPos] == 0x00 && !CheckNaluStartCode(m_pBuffer + m_nCurPos)) { m_nCurPos++; } + if (m_nCurPos >= m_nSize) { + return false; + } + // AnnexB Nalu : 00 00 01 NAL... m_nNALStartPos = m_nCurPos; m_nCurPos += 3; From 31dd2242b9e4b696aa01d8fe5e2bc1118f7bf2e8 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Tue, 6 Aug 2024 09:38:01 +1000 Subject: [PATCH 086/102] =?UTF-8?q?=D0=9E=D0=BF=D1=86=D0=B8=D1=8F=20"?= =?UTF-8?q?=D0=A2=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D1=84=D0=BE=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5"=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D0=B5=D1=82=20=D1=81=20PGS/DVB=20=D1=82=D0=B0?= =?UTF-8?q?=D0=BA=20=D0=B6=D0=B5=20=D0=BA=D0=B0=D0=BA=20=D0=B8=20=D1=81=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=BE=D0=B2=D1=8B=D0=BC=D0=B8,?= =?UTF-8?q?=20=D1=81=D0=BC=D0=BE=D1=82=D1=80=D0=B8=D0=BC=20=D0=B2=20=D0=B8?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B8=20=D1=81=D0=B0=D0=B1=D0=BE=D0=B2=20"fo?= =?UTF-8?q?rced".=20=D0=92=20PGS=20=D1=81=D1=83=D0=B1=D1=82=D0=B8=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D1=85=20=D0=BE=D1=81=D1=82=D0=B0=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20"=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F"=20=D0=BF=D0=BE=20=D1=84=D0=BB=D0=B0=D0=B3=D1=83?= =?UTF-8?q?=20forced=20=D0=B2=20CompositionObject.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Subtitles/BaseSub.h | 4 ++++ src/Subtitles/DVBSub.cpp | 7 ++++++- src/Subtitles/HdmvSub.cpp | 5 +++-- src/Subtitles/RenderedHdmvSubtitle.cpp | 5 +++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Subtitles/BaseSub.h b/src/Subtitles/BaseSub.h index 7de467c4ba..74b41bed32 100644 --- a/src/Subtitles/BaseSub.h +++ b/src/Subtitles/BaseSub.h @@ -44,6 +44,8 @@ class CBaseSub HRESULT SetConvertType(LPCWSTR _yuvMatrix, ColorConvert::convertType _convertType); + void SetForced(bool bForced) { m_bForced = bForced; } + protected : SUBTITLE_TYPE m_nType; @@ -64,4 +66,6 @@ protected : YUVMATRIX yuvMatrix = {}; ColorConvert::convertType convertType; + + bool m_bForced = false; }; diff --git a/src/Subtitles/DVBSub.cpp b/src/Subtitles/DVBSub.cpp index c29a545d50..b315e39817 100644 --- a/src/Subtitles/DVBSub.cpp +++ b/src/Subtitles/DVBSub.cpp @@ -1,5 +1,5 @@ /* - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -395,6 +395,11 @@ POSITION CDVBSub::GetStartPosition(REFERENCE_TIME rt, double fps, bool CleanOld/ if (CleanOld) { CDVBSub::CleanOld(rt); } + + if (g_bForcedSubtitle && !m_bForced) { + return nullptr; + } + POSITION pos = m_pages.GetHeadPosition(); while (pos) { DVB_PAGE* pPage = m_pages.GetAt(pos); diff --git a/src/Subtitles/HdmvSub.cpp b/src/Subtitles/HdmvSub.cpp index cab682a4f3..6f68f108ca 100644 --- a/src/Subtitles/HdmvSub.cpp +++ b/src/Subtitles/HdmvSub.cpp @@ -1,5 +1,5 @@ /* - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -54,7 +54,8 @@ POSITION CHdmvSub::GetStartPosition(REFERENCE_TIME rt, double fps, bool CleanOld POSITION pos = m_pObjects.GetHeadPosition(); while (pos) { const CompositionObject* pObject = m_pObjects.GetAt(pos); - if (pObject->m_rtStop <= rt || (g_bForcedSubtitle && !pObject->m_forced_on_flag)) { + auto skipForced = pObject->m_forced_on_flag ? false : g_bForcedSubtitle && !m_bForced; + if (pObject->m_rtStop <= rt || skipForced) { m_pObjects.GetNext(pos); } else { break; diff --git a/src/Subtitles/RenderedHdmvSubtitle.cpp b/src/Subtitles/RenderedHdmvSubtitle.cpp index 1ec54c367b..6de5179f10 100644 --- a/src/Subtitles/RenderedHdmvSubtitle.cpp +++ b/src/Subtitles/RenderedHdmvSubtitle.cpp @@ -45,6 +45,11 @@ CRenderedHdmvSubtitle::CRenderedHdmvSubtitle(CCritSec* pLock, SUBTITLE_TYPE nTyp ASSERT(FALSE); m_pSub = nullptr; } + + if (m_pSub) { + auto bForced = (CString(name).MakeLower().Find(L"forced") >= 0); + m_pSub->SetForced(bForced); + } } CRenderedHdmvSubtitle::CRenderedHdmvSubtitle(CCritSec* pLock) From 4c9ab124dc93e67de3b7e581eb22a19156e9ace1 Mon Sep 17 00:00:00 2001 From: v0lt Date: Tue, 6 Aug 2024 20:30:39 +0300 Subject: [PATCH 087/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20Changelog.Rus.txt=20=D0=B8=20Changelog.txt?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 5 +++++ docs/Changelog.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 99f494fc2e..7c3de6f661 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -15,10 +15,15 @@ MPCVideoDec Оптимизирована работа c NVDEC. Исправлено определение выходного формата для видео FFV1. +Субтитры +Настройка "Только форсированные" теперь работает со всем потоком субтитров PSG, помеченным как Forced. + Плеер Улучшена поддержка перемещения окна свойств файла между дисплеями с разным масштабированием текста. Исправлено запоминания позиции некоторых DVD-Video. Субтитры добавленные вручную теперь сохраняются в плейлисте. +Не скрываем плеер до закрытия графа DirectShow. +Устранено зависание с некоторыми URL при использовании внешних фильтров. Инсталлятор Для компиляции инсталлятора требуется InnoSetup 6.3.1 или новее. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 8770a59be6..a5a3847b5f 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -15,10 +15,15 @@ Optimized P010 to NV12 conversion for processors without SSE4. Optimized work with NVDEC. Fixed output format detection for FFV1 video. +Subtitles +The "Forced Only" setting now works with the entire PSG subtitle track marked as Forced. + Player Improved support for moving the file properties window between displays with different text scaling. Fixed remembering the position of some DVD-Videos. Subtitles added manually are now saved in the playlist. +Do not hide the player until the DirectShow graph is closed. +Fixed freezing with some URLs when using external filters. Installer Compiling the installer requires InnoSetup 6.1.0 or later. From fe0a52ee32ed6c8c6a4af18d76c907782f5a5a0f Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Wed, 7 Aug 2024 08:18:04 +1000 Subject: [PATCH 088/102] Changelog --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 7c3de6f661..d686e6ae82 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -16,7 +16,7 @@ MPCVideoDec Исправлено определение выходного формата для видео FFV1. Субтитры -Настройка "Только форсированные" теперь работает со всем потоком субтитров PSG, помеченным как Forced. +Настройка "Только форсированные" теперь работает со всем потоком субтитров PGS, помеченным как Forced. Плеер Улучшена поддержка перемещения окна свойств файла между дисплеями с разным масштабированием текста. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index a5a3847b5f..0f632272e3 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -16,7 +16,7 @@ Optimized work with NVDEC. Fixed output format detection for FFV1 video. Subtitles -The "Forced Only" setting now works with the entire PSG subtitle track marked as Forced. +The "Forced Only" setting now works with the entire PGS subtitle track marked as Forced. Player Improved support for moving the file properties window between displays with different text scaling. From 9c0368fa02fd62e7a388b1d953c7bf44fa54deb2 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Wed, 7 Aug 2024 11:07:54 +1000 Subject: [PATCH 089/102] =?UTF-8?q?DVRSplitter=20-=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=D0=B8=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=BE=D1=82=D0=BA=D1=80?= =?UTF-8?q?=D1=8B=D1=82=D0=B8=D1=8F=20URL.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/parser/DVRSplitter/DVRSplitter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filters/parser/DVRSplitter/DVRSplitter.cpp b/src/filters/parser/DVRSplitter/DVRSplitter.cpp index 8e4f0a7cb8..a3ef2ee217 100644 --- a/src/filters/parser/DVRSplitter/DVRSplitter.cpp +++ b/src/filters/parser/DVRSplitter/DVRSplitter.cpp @@ -1,5 +1,5 @@ /* - * (C) 2018-2023 see Authors.txt + * (C) 2018-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -100,6 +100,7 @@ constexpr auto CCTV_PACKET_HEADER_END_SYNC = FCC(' uil'); CDVRSplitterFilter::CDVRSplitterFilter(LPUNKNOWN pUnk, HRESULT* phr) : CBaseSplitterFilter(L"CDVRSplitterFilter", pUnk, phr, __uuidof(this)) { + m_nFlag |= SOURCE_SUPPORT_URL; } HRESULT CDVRSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) From ebc18d5bf15af0958a3973a460990cb4325d7343 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Wed, 7 Aug 2024 11:09:52 +1000 Subject: [PATCH 090/102] =?UTF-8?q?CH264Nalu=20-=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=20=D0=BA=D0=BE=D0=B4=20Mov?= =?UTF-8?q?eToNextAnnexBStartcode(),=20=D0=BD=D0=B5=D0=B1=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D1=88=D0=B8=D0=B5=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/H264Nalu.cpp | 56 ++++++++++++++++++----------------------- src/DSUtil/H264Nalu.h | 4 ++- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/src/DSUtil/H264Nalu.cpp b/src/DSUtil/H264Nalu.cpp index bec60a83bd..d7c08fd623 100644 --- a/src/DSUtil/H264Nalu.cpp +++ b/src/DSUtil/H264Nalu.cpp @@ -21,8 +21,8 @@ #include "stdafx.h" #include "H264Nalu.h" -constexpr DWORD NALU_START_CODE = 0x00010000; -constexpr DWORD NALU_START_CODE_MASK = 0x00FFFFFF; +constexpr uint32_t NALU_START_CODE = 0x000001; +constexpr size_t NALU_START_CODE_SIZE = 3; void CH264Nalu::SetBuffer(const BYTE* pBuffer, const size_t nSize, const int nNALSize/* = 0*/) { @@ -40,23 +40,26 @@ void CH264Nalu::SetBuffer(const BYTE* pBuffer, const size_t nSize, const int nNA } } -static bool CheckNaluStartCode(const BYTE* pBuffer) -{ - return (*(reinterpret_cast(pBuffer)) & NALU_START_CODE_MASK) == NALU_START_CODE; -} - bool CH264Nalu::MoveToNextAnnexBStartcode() { - if (m_nSize < 4) { - return false; - } - const size_t nBuffEnd = m_nSize - 4; - - for (size_t i = m_nCurPos; i < nBuffEnd; i++) { - if (CheckNaluStartCode(m_pBuffer + i)) { - // Find next AnnexB Nal - m_nCurPos = i; - return true; + m_nNALStartCodeSize = NALU_START_CODE_SIZE; + + if (m_nCurPos + NALU_START_CODE_SIZE <= m_nSize) { + const auto nBuffEnd = m_nSize - NALU_START_CODE_SIZE; + for (size_t i = m_nCurPos; i < nBuffEnd; i++) { + auto CheckNaluStartCode = [](const BYTE* pBuffer) { + return (static_cast((pBuffer[0] << 16) | (pBuffer[1] << 8) | pBuffer[2])) == NALU_START_CODE; + }; + + if (CheckNaluStartCode(m_pBuffer + i)) { + if (i > m_nCurPos && m_pBuffer[i - 1] == 0x00) { + // 00 00 00 01 + m_nNALStartCodeSize = 4; + i--; + } + m_nCurPos = i; + return true; + } } } @@ -89,36 +92,27 @@ bool CH264Nalu::ReadNext() // RTP Nalu type : (XX XX) XX XX NAL..., with XX XX XX XX or XX XX equal to NAL size m_nNALStartPos = m_nCurPos; m_nNALDataPos = m_nCurPos + m_nNALSize; - unsigned nTemp = 0; + size_t nTemp = 0; for (int i = 0; i < m_nNALSize; i++) { nTemp = (nTemp << 8) + m_pBuffer[m_nCurPos++]; } m_nNextRTP += nTemp + m_nNALSize; MoveToNextRTPStartcode(); } else { - if (m_nCurPos + 3 >= m_nSize) { - return false; - } - - // Remove trailing bits - while (m_pBuffer[m_nCurPos] == 0x00 && !CheckNaluStartCode(m_pBuffer + m_nCurPos)) { - m_nCurPos++; - } - - if (m_nCurPos >= m_nSize) { + if (m_nCurPos + m_nNALStartCodeSize >= m_nSize) { return false; } // AnnexB Nalu : 00 00 01 NAL... m_nNALStartPos = m_nCurPos; - m_nCurPos += 3; + m_nCurPos += m_nNALStartCodeSize; m_nNALDataPos = m_nCurPos; MoveToNextAnnexBStartcode(); } forbidden_bit = (m_pBuffer[m_nNALDataPos] >> 7) & 1; nal_reference_idc = (m_pBuffer[m_nNALDataPos] >> 5) & 3; - nal_unit_type = (NALU_TYPE)(m_pBuffer[m_nNALDataPos] & 0x1f); + nal_unit_type = static_cast(m_pBuffer[m_nNALDataPos] & 0x1f); return true; } @@ -126,7 +120,7 @@ bool CH264Nalu::ReadNext() bool CH265Nalu::ReadNext() { if (__super::ReadNext()) { - nal_unit_type = (NALU_TYPE)((m_pBuffer[m_nNALDataPos] >> 1) & 0x3F); + nal_unit_type = static_cast((m_pBuffer[m_nNALDataPos] >> 1) & 0x3F); return true; } diff --git a/src/DSUtil/H264Nalu.h b/src/DSUtil/H264Nalu.h index 4aa0ec9c01..044572dc68 100644 --- a/src/DSUtil/H264Nalu.h +++ b/src/DSUtil/H264Nalu.h @@ -102,11 +102,13 @@ protected : size_t m_nSize = 0; int m_nNALSize = 0; + size_t m_nNALStartCodeSize = 3; + bool MoveToNextAnnexBStartcode(); bool MoveToNextRTPStartcode(); public : - CH264Nalu() { SetBuffer(nullptr, 0, 0); } + CH264Nalu() = default; NALU_TYPE GetType() const { return nal_unit_type; } bool IsRefFrame() const { return (nal_reference_idc != 0); } From fd904bc983bef78b163df3235f22b2583434760d Mon Sep 17 00:00:00 2001 From: v0lt Date: Wed, 7 Aug 2024 06:39:05 +0300 Subject: [PATCH 091/102] =?UTF-8?q?=D0=A0=D0=B5=D0=BB=D0=B8=D0=B7=201.7.3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 +- docs/Changelog.txt | 2 +- include/Version.h | 4 ++-- src/apps/mplayerc/res/mpc-be.exe.manifest.conf | 2 +- src/apps/mplayerc/res/mpc-be.exe.manifest.template | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index d686e6ae82..977759e079 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -1,6 +1,6 @@ В этом файле отображаются только ключевые изменения между разными версиями Media Player Classic - BE. -1.7.2.x dev +1.7.3 - 2024-08-07 ============================= Сплиттеры Улучшено определение дорожек DTS-HD. diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 0f632272e3..e89290212b 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -1,6 +1,6 @@ This file includes only a short list of the changes between Media Player Classic - BE's versions. -1.7.2.x dev +1.7.3 - 2024-08-07 ============================= Splitters Improved DTS-HD track detection. diff --git a/include/Version.h b/include/Version.h index f5fe524406..d85013eecd 100644 --- a/include/Version.h +++ b/include/Version.h @@ -45,9 +45,9 @@ #define MPC_VERSION_MAJOR 1 #define MPC_VERSION_MINOR 7 -#define MPC_VERSION_PATCH 2 +#define MPC_VERSION_PATCH 3 -#define MPC_VERSION_STATUS 0 +#define MPC_VERSION_STATUS 1 // MPC_VERSION_STATUS: 0 - dev; 1 - stable #define MPC_YEAR_COMMENTS "2002-2024" diff --git a/src/apps/mplayerc/res/mpc-be.exe.manifest.conf b/src/apps/mplayerc/res/mpc-be.exe.manifest.conf index 05506b3756..9ddbb8aac0 100644 --- a/src/apps/mplayerc/res/mpc-be.exe.manifest.conf +++ b/src/apps/mplayerc/res/mpc-be.exe.manifest.conf @@ -3,7 +3,7 @@ MPC-BE diff --git a/src/apps/mplayerc/res/mpc-be.exe.manifest.template b/src/apps/mplayerc/res/mpc-be.exe.manifest.template index 942ef4b3e4..9be0f391f4 100644 --- a/src/apps/mplayerc/res/mpc-be.exe.manifest.template +++ b/src/apps/mplayerc/res/mpc-be.exe.manifest.template @@ -3,7 +3,7 @@ MPC-BE From b7d371d70993787150f0ce2591f4daacce42c737 Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 8 Aug 2024 06:30:15 +0300 Subject: [PATCH 092/102] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D0=B8=D0=B8=20=D0=BD=D0=B0=201.7.3.x=20dev.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 4 ++++ docs/Changelog.txt | 4 ++++ include/Version.h | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 977759e079..940fdc9c41 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -1,5 +1,9 @@ В этом файле отображаются только ключевые изменения между разными версиями Media Player Classic - BE. +1.7.3.x dev +============================= + + 1.7.3 - 2024-08-07 ============================= Сплиттеры diff --git a/docs/Changelog.txt b/docs/Changelog.txt index e89290212b..6a10ff366f 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -1,5 +1,9 @@ This file includes only a short list of the changes between Media Player Classic - BE's versions. +1.7.3.x dev +============================= + + 1.7.3 - 2024-08-07 ============================= Splitters diff --git a/include/Version.h b/include/Version.h index d85013eecd..a6e508fa35 100644 --- a/include/Version.h +++ b/include/Version.h @@ -47,7 +47,7 @@ #define MPC_VERSION_MINOR 7 #define MPC_VERSION_PATCH 3 -#define MPC_VERSION_STATUS 1 +#define MPC_VERSION_STATUS 0 // MPC_VERSION_STATUS: 0 - dev; 1 - stable #define MPC_YEAR_COMMENTS "2002-2024" From e9c130e72806ce2f6d74dc01f8217497ca5bce67 Mon Sep 17 00:00:00 2001 From: v0lt Date: Thu, 8 Aug 2024 22:19:45 +0300 Subject: [PATCH 093/102] =?UTF-8?q?=D0=9A=D0=BE=D1=81=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=B4=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/FGManager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/mplayerc/FGManager.h b/src/apps/mplayerc/FGManager.h index 436db771e2..4f22941a65 100644 --- a/src/apps/mplayerc/FGManager.h +++ b/src/apps/mplayerc/FGManager.h @@ -149,7 +149,7 @@ class CFGManagerCustom : public CFGManager public: // IFilterGraph - STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName); + STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName) override; public: CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd = 0, bool IsPreview = false); @@ -160,7 +160,7 @@ class CFGManagerPlayer : public CFGManagerCustom protected: // IFilterGraph - STDMETHODIMP ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt); + STDMETHODIMP ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt) override; public: CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, int preview = 0); @@ -171,8 +171,8 @@ class CFGManagerDVD : public CFGManagerPlayer protected: // IGraphBuilder - STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList); - STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter); + STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList) override; + STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter) override; public: CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview = false); From d7215ddf3c8496ec9a012b5e767f38d65e0b5697 Mon Sep 17 00:00:00 2001 From: v0lt Date: Fri, 9 Aug 2024 06:26:41 +0300 Subject: [PATCH 094/102] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=84=D0=B0=D0=B9=D0=BB=20IURLSourceFilterLAV.h?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=8D=D0=BA=D1=81=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5=D0=BD=D1=82=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/IURLSourceFilterLAV.h | 27 +++++++++++++++++++++++++++ mpc-be.sln | 1 + 2 files changed, 28 insertions(+) create mode 100644 include/IURLSourceFilterLAV.h diff --git a/include/IURLSourceFilterLAV.h b/include/IURLSourceFilterLAV.h new file mode 100644 index 0000000000..85888d131e --- /dev/null +++ b/include/IURLSourceFilterLAV.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2024 Hendrik Leppkes + * http://www.1f0.de + * + * This program 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. + * + * This program 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 this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +interface __declspec(uuid("C8FF17F9-5365-4F32-8AD5-6C550342C2F7")) IURLSourceFilterLAV : public IUnknown +{ + // Load a URL with the specified user agent and referrer + // UserAgent and Referrer are optional, and either, both or none can be specified + STDMETHOD(LoadURL)(LPCOLESTR pszURL, LPCOLESTR pszUserAgent, LPCOLESTR pszReferrer) = 0; +}; diff --git a/mpc-be.sln b/mpc-be.sln index dc174b7722..70e22bb04f 100644 --- a/mpc-be.sln +++ b/mpc-be.sln @@ -168,6 +168,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Include", "Include", "{EA36 include\IMediaSideData.h = include\IMediaSideData.h include\inttypes.h = include\inttypes.h include\ITrackInfo.h = include\ITrackInfo.h + include\IURLSourceFilterLAV.h = include\IURLSourceFilterLAV.h include\LAVVideoSettings.h = include\LAVVideoSettings.h include\libdivide.h = include\libdivide.h include\MediaOffset3D.h = include\MediaOffset3D.h From df8100ed9937b21c4c1ac56bc6f5a482814cec4c Mon Sep 17 00:00:00 2001 From: v0lt Date: Fri, 9 Aug 2024 18:27:24 +0300 Subject: [PATCH 095/102] =?UTF-8?q?DSUtil:=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=B8=D1=81=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/DSMPropertyBag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DSUtil/DSMPropertyBag.cpp b/src/DSUtil/DSMPropertyBag.cpp index 5a7104b463..312782ed28 100644 --- a/src/DSUtil/DSMPropertyBag.cpp +++ b/src/DSUtil/DSMPropertyBag.cpp @@ -160,7 +160,7 @@ HRESULT IDSMPropertyBagImpl::GetProperty(LPCWSTR key, BSTR* value) std::lock_guard lock(m_mutex); - auto& it = m_properties.find(key); + auto it = m_properties.find(key); if (it == m_properties.end()) { return E_FAIL; } From cfe454496efd5049ce3eae00ff327e18226c1678 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 10 Aug 2024 06:56:56 +0300 Subject: [PATCH 096/102] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87?= =?UTF-8?q?=D0=B0=20UserAgent=20=D0=B2=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82?= =?UTF-8?q?=D1=80=D1=8B=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=B8?= =?UTF-8?q?=D0=B2=D0=B0=D1=8E=D1=89=D0=B8=D0=B5=20=D0=B8=D0=BD=D1=82=D0=B5?= =?UTF-8?q?=D1=80=D1=84=D0=B5=D0=B9=D1=81=20IURLSourceFilterLAV.=20=D0=A4?= =?UTF-8?q?=D0=B8=D1=87=D0=B0=20=D1=8D=D0=BA=D1=81=D0=BF=D0=B5=D1=80=D0=B8?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=B8=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=B1=D0=B5=D1=81=D0=BF=D0=BE=D0=BB=D0=B5=D0=B7=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/FGManager.cpp | 65 +++++++++++++++++++-------------- src/apps/mplayerc/FGManager.h | 5 +++ src/apps/mplayerc/MainFrm.cpp | 18 +++++++-- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 934c96a940..0c07ae6478 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -41,6 +41,7 @@ #include "MediaFormats.h" #include "Content.h" #include +#include class CFGMPCVideoDecoderInternal : public CFGFilterInternal { @@ -681,39 +682,49 @@ HRESULT CFGManager::AddSourceFilterInternal(CFGFilter* pFGF, LPCWSTR lpcwstrFile const AM_MEDIA_TYPE* pmt = nullptr; - CMediaType mt; - const std::list& types = pFGF->GetTypes(); - if (types.size() == 2 && (types.front() != GUID_NULL || types.back() != GUID_NULL)) { - mt.majortype = types.front(); - mt.subtype = types.back(); - pmt = &mt; - } - - hr = pFSF->Load(lpcwstrFileName, pmt); - if (FAILED(hr) || m_bOpeningAborted) { // sometimes looping with AviSynth - RemoveFilter(pBF); - return m_bOpeningAborted ? E_ABORT : hr; + hr = E_NOT_VALID_STATE; + if (::PathIsURLW(lpcwstrFileName)) { + CComQIPtr pUSFLAV = pBF.p; + if (pUSFLAV) { + hr = pUSFLAV->LoadURL(lpcwstrFileName, m_userAgent, m_referrer); + } } - // doh :P - BeginEnumMediaTypes(GetFirstPin(pBF, PINDIR_OUTPUT), pEMT, pmt) { - static const GUID guid1 = - { 0x640999A0, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; // ASX file Parser - static const GUID guid2 = - { 0x640999A1, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; // ASX v.2 file Parser - static const GUID guid3 = - { 0xD51BD5AE, 0x7548, 0x11CF, { 0xA5, 0x20, 0x00, 0x80, 0xC7, 0x7E, 0xF5, 0x8A } }; // XML Playlist + if (FAILED(hr)) { + CMediaType mt; + const std::list& types = pFGF->GetTypes(); + if (types.size() == 2 && (types.front() != GUID_NULL || types.back() != GUID_NULL)) { + mt.majortype = types.front(); + mt.subtype = types.back(); + pmt = &mt; + } - if (pmt->subtype == guid1 || pmt->subtype == guid2 || pmt->subtype == guid3) { + hr = pFSF->Load(lpcwstrFileName, pmt); + if (FAILED(hr) || m_bOpeningAborted) { // sometimes looping with AviSynth RemoveFilter(pBF); - pFGF = DNew CFGFilterRegistry(CLSID_NetShowSource); - hr = AddSourceFilterInternal(pFGF, lpcwstrFileName, lpcwstrFilterName, ppBF); - delete pFGF; - SAFE_DELETE(pmt); - return hr; + return m_bOpeningAborted ? E_ABORT : hr; + } + + // doh :P + BeginEnumMediaTypes(GetFirstPin(pBF, PINDIR_OUTPUT), pEMT, pmt) { + static const GUID guid1 = + { 0x640999A0, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; // ASX file Parser + static const GUID guid2 = + { 0x640999A1, 0xA946, 0x11D0, { 0xA5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; // ASX v.2 file Parser + static const GUID guid3 = + { 0xD51BD5AE, 0x7548, 0x11CF, { 0xA5, 0x20, 0x00, 0x80, 0xC7, 0x7E, 0xF5, 0x8A } }; // XML Playlist + + if (pmt->subtype == guid1 || pmt->subtype == guid2 || pmt->subtype == guid3) { + RemoveFilter(pBF); + pFGF = DNew CFGFilterRegistry(CLSID_NetShowSource); + hr = AddSourceFilterInternal(pFGF, lpcwstrFileName, lpcwstrFilterName, ppBF); + delete pFGF; + SAFE_DELETE(pmt); + return hr; + } } + EndEnumMediaTypes(pmt) } - EndEnumMediaTypes(pmt) *ppBF = pBF.Detach(); diff --git a/src/apps/mplayerc/FGManager.h b/src/apps/mplayerc/FGManager.h index 4f22941a65..5a25dbfeaa 100644 --- a/src/apps/mplayerc/FGManager.h +++ b/src/apps/mplayerc/FGManager.h @@ -124,6 +124,8 @@ class CFGManager BOOL m_bOnlySub = FALSE; BOOL m_bOnlyAudio = FALSE; + CStringW m_userAgent; + CStringW m_referrer; // not used // HWND m_hWnd; @@ -164,6 +166,9 @@ class CFGManagerPlayer : public CFGManagerCustom public: CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, int preview = 0); + + void SetUserAgent(CStringW useragent) { m_userAgent = useragent; }; + void SetReferrer(CStringW referrer) { m_referrer = referrer; }; }; class CFGManagerDVD : public CFGManagerPlayer diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index bff8fa5249..e577e250b0 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -11999,11 +11999,21 @@ CString CMainFrame::OpenCreateGraphObject(OpenMediaData* pOMD) m_bCustomGraph = m_bShockwaveGraph; if (!m_bCustomGraph) { - m_pGB = DNew CFGManagerPlayer(L"CFGManagerPlayer", nullptr, m_pVideoWnd->m_hWnd); + auto pFGManager = DNew CFGManagerPlayer(L"CFGManagerPlayer", nullptr, m_pVideoWnd->m_hWnd); + m_pGB = pFGManager; - if (m_pGB && bUseSmartSeek) { - // build graph for preview - m_pGB_preview = DNew CFGManagerPlayer(L"CFGManagerPlayer", nullptr, m_wndPreView.GetVideoHWND(), s.iSmartSeekVR+1); + if (m_pGB) { + pFGManager->SetUserAgent(s.strUserAgent); + + if (bUseSmartSeek) { + // build graph for preview + auto pFGManager_preview = DNew CFGManagerPlayer(L"CFGManagerPlayer", nullptr, m_wndPreView.GetVideoHWND(), s.iSmartSeekVR + 1); + m_pGB_preview = pFGManager_preview; + + if (m_pGB_preview) { + pFGManager_preview->SetUserAgent(s.strUserAgent); + } + } } } } else if (OpenDVDData* pDVDData = dynamic_cast(pOMD)) { From 0abbc153c390b4d896463a69d04bdc8ee5ae1144 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 10 Aug 2024 08:58:33 +0300 Subject: [PATCH 097/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20ffmpeg=20n7.1-dev-2090-gcda5f5c5ed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 2 ++ docs/Changelog.txt | 2 ++ .../ffmpeg/libavcodec/cbs_h265_syntax_template.c | 10 ++++++++-- src/ExtLib/ffmpeg/libavcodec/cbs_sei.c | 4 +--- src/ExtLib/ffmpeg/libavcodec/parser.c | 1 + src/ExtLib/ffmpeg/libavcodec/vp9mvs.c | 3 ++- src/ExtLib/ffmpeg/libavcodec/wmavoice.c | 2 +- src/ExtLib/ffmpeg/libavutil/cpu.c | 1 - src/ExtLib/ffmpeg/libavutil/cpu.h | 5 +++++ src/ExtLib/ffmpeg/libavutil/frame.c | 4 +++- src/ExtLib/ffmpeg/libavutil/timer.h | 1 + src/ExtLib/ffmpeg/libavutil/version.h | 3 ++- 12 files changed, 28 insertions(+), 10 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index 940fdc9c41..a70df19620 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -2,6 +2,8 @@ 1.7.3.x dev ============================= +Обновлены библиотеки: + ffmpeg n7.1-dev-2090-gcda5f5c5ed. 1.7.3 - 2024-08-07 diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 6a10ff366f..bdea23e10e 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -2,6 +2,8 @@ 1.7.3.x dev ============================= +Updated libraries: + ffmpeg n7.1-dev-2090-gcda5f5c5ed. 1.7.3 - 2024-08-07 diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c b/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c index f1be30a6c9..12fa185c77 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_h265_syntax_template.c @@ -2307,7 +2307,10 @@ SEI_FUNC(sei_3d_reference_displays_info, (CodedBitstreamContext *ctx, RWContext else length = FFMAX(0, (int)current->exponent_ref_display_width[i] + (int)current->prec_ref_display_width - 31); - ubs(length, mantissa_ref_display_width[i], 1, i); + if (length) + ubs(length, mantissa_ref_display_width[i], 1, i); + else + infer(mantissa_ref_display_width[i], 0); if (current->ref_viewing_distance_flag) { us(6, exponent_ref_viewing_distance[i], 0, 62, 1, i); if (!current->exponent_ref_viewing_distance[i]) @@ -2315,7 +2318,10 @@ SEI_FUNC(sei_3d_reference_displays_info, (CodedBitstreamContext *ctx, RWContext else length = FFMAX(0, (int)current->exponent_ref_viewing_distance[i] + (int)current->prec_ref_viewing_dist - 31); - ubs(length, mantissa_ref_viewing_distance[i], 1, i); + if (length) + ubs(length, mantissa_ref_viewing_distance[i], 1, i); + else + infer(mantissa_ref_viewing_distance[i], 0); } flags(additional_shift_present_flag[i], 1, i); if (current->additional_shift_present_flag[i]) diff --git a/src/ExtLib/ffmpeg/libavcodec/cbs_sei.c b/src/ExtLib/ffmpeg/libavcodec/cbs_sei.c index eefa07cf00..458751d92e 100644 --- a/src/ExtLib/ffmpeg/libavcodec/cbs_sei.c +++ b/src/ExtLib/ffmpeg/libavcodec/cbs_sei.c @@ -41,7 +41,6 @@ int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, const SEIMessageTypeDescriptor *desc) { void (*free_func)(FFRefStructOpaque, void*); - unsigned flags = 0; av_assert0(message->payload == NULL && message->payload_ref == NULL); @@ -53,10 +52,9 @@ int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, free_func = &cbs_free_user_data_unregistered; else { free_func = NULL; - flags = FF_REFSTRUCT_FLAG_NO_ZEROING; } - message->payload_ref = ff_refstruct_alloc_ext(desc->size, flags, + message->payload_ref = ff_refstruct_alloc_ext(desc->size, 0, NULL, free_func); if (!message->payload_ref) return AVERROR(ENOMEM); diff --git a/src/ExtLib/ffmpeg/libavcodec/parser.c b/src/ExtLib/ffmpeg/libavcodec/parser.c index af17ee9c15..426cc314fb 100644 --- a/src/ExtLib/ffmpeg/libavcodec/parser.c +++ b/src/ExtLib/ffmpeg/libavcodec/parser.c @@ -236,6 +236,7 @@ int ff_combine_frame(ParseContext *pc, int next, } pc->buffer = new_buffer; memcpy(&pc->buffer[pc->index], *buf, *buf_size); + memset(&pc->buffer[pc->index + *buf_size], 0, AV_INPUT_BUFFER_PADDING_SIZE); pc->index += *buf_size; return -1; } diff --git a/src/ExtLib/ffmpeg/libavcodec/vp9mvs.c b/src/ExtLib/ffmpeg/libavcodec/vp9mvs.c index b706d1660f..790cf629a6 100644 --- a/src/ExtLib/ffmpeg/libavcodec/vp9mvs.c +++ b/src/ExtLib/ffmpeg/libavcodec/vp9mvs.c @@ -294,7 +294,8 @@ void ff_vp9_fill_mv(VP9TileData *td, VP9mv *mv, int mode, int sb) VP9Block *b = td->b; if (mode == ZEROMV) { - AV_ZERO64(mv); + AV_ZERO32(&mv[0]); + AV_ZERO32(&mv[1]); } else { int hp; diff --git a/src/ExtLib/ffmpeg/libavcodec/wmavoice.c b/src/ExtLib/ffmpeg/libavcodec/wmavoice.c index 258c71330c..3db73773b7 100644 --- a/src/ExtLib/ffmpeg/libavcodec/wmavoice.c +++ b/src/ExtLib/ffmpeg/libavcodec/wmavoice.c @@ -655,7 +655,7 @@ static void calc_input_response(WMAVoiceContext *s, float *lpcs_src, lpcs[n] = angle_mul * pwr; /* 70.57 =~ 1/log10(1.0331663) */ - idx = av_clipf((pwr * gain_mul - 0.0295) * 70.570526123, 0, INT_MAX / 2); + idx = av_clipd((pwr * gain_mul - 0.0295) * 70.570526123, 0, INT_MAX / 2); if (idx > 127) { // fall back if index falls outside table range coeffs[n] = wmavoice_energy_table[127] * diff --git a/src/ExtLib/ffmpeg/libavutil/cpu.c b/src/ExtLib/ffmpeg/libavutil/cpu.c index 18c204e92b..54ea382059 100644 --- a/src/ExtLib/ffmpeg/libavutil/cpu.c +++ b/src/ExtLib/ffmpeg/libavutil/cpu.c @@ -189,7 +189,6 @@ int av_parse_cpu_caps(unsigned *flags, const char *s) { "zve32f", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F32 }, .unit = "flags" }, { "zve64x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I64 }, .unit = "flags" }, { "zve64d", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F64 }, .unit = "flags" }, - { "zba", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB_ADDR }, .unit = "flags" }, { "zbb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB_BASIC }, .unit = "flags" }, { "zvbb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RV_ZVBB }, .unit = "flags" }, { "misaligned", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RV_MISALIGNED }, .unit = "flags" }, diff --git a/src/ExtLib/ffmpeg/libavutil/cpu.h b/src/ExtLib/ffmpeg/libavutil/cpu.h index 6d305ba50b..640c6a84f1 100644 --- a/src/ExtLib/ffmpeg/libavutil/cpu.h +++ b/src/ExtLib/ffmpeg/libavutil/cpu.h @@ -22,6 +22,7 @@ #define AVUTIL_CPU_H #include +#include "version.h" #define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ @@ -82,14 +83,18 @@ // RISC-V extensions #define AV_CPU_FLAG_RVI (1 << 0) ///< I (full GPR bank) +#if FF_API_RISCV_FD_ZBA #define AV_CPU_FLAG_RVF (1 << 1) ///< F (single precision FP) #define AV_CPU_FLAG_RVD (1 << 2) ///< D (double precision FP) +#endif #define AV_CPU_FLAG_RVV_I32 (1 << 3) ///< Vectors of 8/16/32-bit int's */ #define AV_CPU_FLAG_RVV_F32 (1 << 4) ///< Vectors of float's */ #define AV_CPU_FLAG_RVV_I64 (1 << 5) ///< Vectors of 64-bit int's */ #define AV_CPU_FLAG_RVV_F64 (1 << 6) ///< Vectors of double's #define AV_CPU_FLAG_RVB_BASIC (1 << 7) ///< Basic bit-manipulations +#if FF_API_RISCV_FD_ZBA #define AV_CPU_FLAG_RVB_ADDR (1 << 8) ///< Address bit-manipulations +#endif #define AV_CPU_FLAG_RV_ZVBB (1 << 9) ///< Vector basic bit-manipulations #define AV_CPU_FLAG_RV_MISALIGNED (1 <<10) ///< Fast misaligned accesses #define AV_CPU_FLAG_RVB (1 <<11) ///< B (bit manipulations) diff --git a/src/ExtLib/ffmpeg/libavutil/frame.c b/src/ExtLib/ffmpeg/libavutil/frame.c index 673a9afb3b..5cbfc6a48b 100644 --- a/src/ExtLib/ffmpeg/libavutil/frame.c +++ b/src/ExtLib/ffmpeg/libavutil/frame.c @@ -166,6 +166,8 @@ void av_frame_free(AVFrame **frame) av_freep(frame); } +#define ALIGN (HAVE_SIMD_ALIGN_64 ? 64 : 32) + static int get_video_buffer(AVFrame *frame, int align) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); @@ -182,7 +184,7 @@ static int get_video_buffer(AVFrame *frame, int align) if (!frame->linesize[0]) { if (align <= 0) - align = 32; /* STRIDE_ALIGN. Should be av_cpu_max_align() */ + align = ALIGN; for (int i = 1; i <= align; i += i) { ret = av_image_fill_linesizes(frame->linesize, frame->format, diff --git a/src/ExtLib/ffmpeg/libavutil/timer.h b/src/ExtLib/ffmpeg/libavutil/timer.h index 663daf81c6..03706b0d10 100644 --- a/src/ExtLib/ffmpeg/libavutil/timer.h +++ b/src/ExtLib/ffmpeg/libavutil/timer.h @@ -80,6 +80,7 @@ return ts.tv_sec * INT64_C(1000000000) + ts.tv_nsec; } # define AV_READ_TIME ff_read_time +# define FF_TIMER_UNITS "ns" # endif #endif diff --git a/src/ExtLib/ffmpeg/libavutil/version.h b/src/ExtLib/ffmpeg/libavutil/version.h index 24418600f0..c8db361ddb 100644 --- a/src/ExtLib/ffmpeg/libavutil/version.h +++ b/src/ExtLib/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 31 +#define LIBAVUTIL_VERSION_MINOR 33 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -113,6 +113,7 @@ #define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_RISCV_FD_ZBA (LIBAVUTIL_VERSION_MAJOR < 60) /** * @} From 68ac3705e855014782361f4778c71fb86ee78ee3 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 10 Aug 2024 10:04:46 +0300 Subject: [PATCH 098/102] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20VVdeC=20v2.3.0-28-gf8ba8fd.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Changelog.Rus.txt | 3 ++- docs/Changelog.txt | 5 +++-- src/ExtLib/vvdec.vcxproj | 6 ++++++ src/ExtLib/vvdec.vcxproj.filters | 18 ++++++++++++++++++ src/ExtLib/vvdec/vvdec | 2 +- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/docs/Changelog.Rus.txt b/docs/Changelog.Rus.txt index a70df19620..01fcf5df60 100644 --- a/docs/Changelog.Rus.txt +++ b/docs/Changelog.Rus.txt @@ -3,7 +3,8 @@ 1.7.3.x dev ============================= Обновлены библиотеки: - ffmpeg n7.1-dev-2090-gcda5f5c5ed. + ffmpeg n7.1-dev-2090-gcda5f5c5ed; + vvdec v2.3.0-28-gf8ba8fd. 1.7.3 - 2024-08-07 diff --git a/docs/Changelog.txt b/docs/Changelog.txt index bdea23e10e..27ece4b5e8 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -3,7 +3,8 @@ 1.7.3.x dev ============================= Updated libraries: - ffmpeg n7.1-dev-2090-gcda5f5c5ed. + ffmpeg n7.1-dev-2090-gcda5f5c5ed; + vvdec v2.3.0-28-gf8ba8fd. 1.7.3 - 2024-08-07 @@ -45,7 +46,7 @@ Updated libraries: Little-CMS git-lcms2.16-60-g1c9021b; MediaInfo git-v24.06-10-g88f3ea4aa; ResizableLib v1.5.3-8-g25a89da; - vvdec v2.3.0-24-gad8f4bb. + 1.7.2 - 2024-06-07 diff --git a/src/ExtLib/vvdec.vcxproj b/src/ExtLib/vvdec.vcxproj index f1a989c345..5f32dec395 100644 --- a/src/ExtLib/vvdec.vcxproj +++ b/src/ExtLib/vvdec.vcxproj @@ -199,6 +199,10 @@ + + + + @@ -277,6 +281,8 @@ + + diff --git a/src/ExtLib/vvdec.vcxproj.filters b/src/ExtLib/vvdec.vcxproj.filters index 2aea1ad304..b66f50205f 100644 --- a/src/ExtLib/vvdec.vcxproj.filters +++ b/src/ExtLib/vvdec.vcxproj.filters @@ -294,6 +294,18 @@ Source Files + + Source Files + + + Source Files + + + Source Files\simd + + + Source Files\simd + @@ -518,6 +530,12 @@ Header Files + + Header Files + + + Header Files + diff --git a/src/ExtLib/vvdec/vvdec b/src/ExtLib/vvdec/vvdec index ad8f4bb7d6..f8ba8fd89d 160000 --- a/src/ExtLib/vvdec/vvdec +++ b/src/ExtLib/vvdec/vvdec @@ -1 +1 @@ -Subproject commit ad8f4bb7d6271b5fe6b3ab0a5e64114dec1af5d4 +Subproject commit f8ba8fd89d2c55d2bc831c1904d25e750f7607a9 From ae4cbe6b896c7529f9a99dabf054eac904fc0c23 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sat, 10 Aug 2024 11:02:52 +0300 Subject: [PATCH 099/102] LPCTSTR -> LPCWSTR --- src/apps/mplayerc/Content.cpp | 8 ++++---- src/apps/mplayerc/FGManager.cpp | 16 ++++++++-------- src/apps/mplayerc/FGManager.h | 14 +++++++------- src/apps/mplayerc/FGManagerBDA.cpp | 2 +- src/apps/mplayerc/FGManagerBDA.h | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/apps/mplayerc/Content.cpp b/src/apps/mplayerc/Content.cpp index 8f9b87b65c..5dceb7274e 100644 --- a/src/apps/mplayerc/Content.cpp +++ b/src/apps/mplayerc/Content.cpp @@ -41,7 +41,7 @@ static const CString ConvertToUTF16(const BYTE* pData, size_t size) if (bUTF16BE || bUTF16LE) { size /= 2; - CString str((LPCTSTR)pData, size); + CStringW str((LPCWSTR)pData, size); if (bUTF16BE) { for (int i = 0, j = str.GetLength(); i < j; i++) { str.SetAt(i, (str[i] << 8) | (str[i] >> 8)); @@ -205,10 +205,10 @@ namespace Content { || (content.body.GetLength() >= 4 && wcsncmp(content.body, L".RMF", 4) == 0)) { content.ct = L"audio/x-pn-realaudio"; } - if (content.body.GetLength() >= 4 && GETU32((LPCTSTR)content.body) == 0x75b22630) { + if (content.body.GetLength() >= 4 && GETU32((LPCWSTR)content.body) == 0x75b22630) { content.ct = L"video/x-ms-wmv"; } - if (content.body.GetLength() >= 8 && wcsncmp((LPCTSTR)content.body + 4, L"moov", 4) == 0) { + if (content.body.GetLength() >= 8 && wcsncmp((LPCWSTR)content.body + 4, L"moov", 4) == 0) { content.ct = L"video/quicktime"; } if (StartsWith(content.body, L"#EXTM3U") && content.body.Find(L"#EXT-X-MEDIA-SEQUENCE") > 7) { @@ -353,7 +353,7 @@ namespace Content { if (fn2.Find(':') < 0 && fn2.Find(L"\\\\") != 0 && fn2.Find(L"//") != 0) { CPath p; p.Combine(dir, fn2); - fn2 = (LPCTSTR)p; + fn2 = (LPCWSTR)p; } if (!fn2.CompareNoCase(fn)) { diff --git a/src/apps/mplayerc/FGManager.cpp b/src/apps/mplayerc/FGManager.cpp index 0c07ae6478..96d4781d89 100644 --- a/src/apps/mplayerc/FGManager.cpp +++ b/src/apps/mplayerc/FGManager.cpp @@ -137,7 +137,7 @@ class CFGMPCVideoDecoderInternal : public CFGFilterInternal // CFGManager // -CFGManager::CFGManager(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview) +CFGManager::CFGManager(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview) : CUnknown(pName, pUnk) , m_hWnd(hWnd) , m_bIsPreview(IsPreview) @@ -1851,7 +1851,7 @@ STDMETHODIMP CFGManager::RenderAudioFile(LPCWSTR lpcwstrFileName) // CFGManagerCustom // -CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview) +CFGManagerCustom::CFGManagerCustom(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview) : CFGManager(pName, pUnk, hWnd, IsPreview) { CAppSettings& s = AfxGetAppSettings(); @@ -2806,7 +2806,7 @@ STDMETHODIMP CFGManagerCustom::AddFilter(IBaseFilter* pBF, LPCWSTR pName) // CFGManagerPlayer // -CFGManagerPlayer::CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, int preview) +CFGManagerPlayer::CFGManagerPlayer(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd, int preview) : CFGManagerCustom(pName, pUnk, hWnd, (preview > 0)) { DLog(L"CFGManagerPlayer::CFGManagerPlayer() on thread: %u", GetCurrentThreadId()); @@ -2935,7 +2935,7 @@ STDMETHODIMP CFGManagerPlayer::ConnectDirect(IPin* pPinOut, IPin* pPinIn, const // CFGManagerDVD // -CFGManagerDVD::CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview) +CFGManagerDVD::CFGManagerDVD(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview) : CFGManagerPlayer(pName, pUnk, hWnd, IsPreview) { // elecard's decoder isn't suited for dvd playback (atm) @@ -2945,7 +2945,7 @@ CFGManagerDVD::CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPr class CResetDVD : public CDVDSession { public: - CResetDVD(LPCTSTR path) { + CResetDVD(LPCWSTR path) { if (Open(path)) { if (BeginSession()) { Authenticate(); /*GetDiscKey();*/ @@ -3028,7 +3028,7 @@ STDMETHODIMP CFGManagerDVD::AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpc // CFGManagerCapture // -CFGManagerCapture::CFGManagerCapture(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) +CFGManagerCapture::CFGManagerCapture(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd) : CFGManagerPlayer(pName, pUnk, hWnd) { CFGFilter* pFGF = DNew CFGFilterInternal(L"Deinterlacer", MERIT64_DO_USE); @@ -3040,7 +3040,7 @@ CFGManagerCapture::CFGManagerCapture(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) // CFGManagerMuxer // -CFGManagerMuxer::CFGManagerMuxer(LPCTSTR pName, LPUNKNOWN pUnk) +CFGManagerMuxer::CFGManagerMuxer(LPCWSTR pName, LPUNKNOWN pUnk) : CFGManagerCustom(pName, pUnk) { m_source.emplace_back(DNew CFGFilterInternal()); @@ -3050,7 +3050,7 @@ CFGManagerMuxer::CFGManagerMuxer(LPCTSTR pName, LPUNKNOWN pUnk) // CFGAggregator // -CFGAggregator::CFGAggregator(const CLSID& clsid, LPCTSTR pName, LPUNKNOWN pUnk, HRESULT& hr) +CFGAggregator::CFGAggregator(const CLSID& clsid, LPCWSTR pName, LPUNKNOWN pUnk, HRESULT& hr) : CUnknown(pName, pUnk) { hr = m_pUnkInner.CoCreateInstance(clsid, GetOwner()); diff --git a/src/apps/mplayerc/FGManager.h b/src/apps/mplayerc/FGManager.h index 5a25dbfeaa..6efb8e2b0d 100644 --- a/src/apps/mplayerc/FGManager.h +++ b/src/apps/mplayerc/FGManager.h @@ -139,7 +139,7 @@ class CFGManager std::mutex m_mutexRender; public: - CFGManager(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd = 0, bool IsPreview = false); + CFGManager(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd = 0, bool IsPreview = false); virtual ~CFGManager(); DECLARE_IUNKNOWN; @@ -154,7 +154,7 @@ class CFGManagerCustom : public CFGManager STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName) override; public: - CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd = 0, bool IsPreview = false); + CFGManagerCustom(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd = 0, bool IsPreview = false); }; class CFGManagerPlayer : public CFGManagerCustom @@ -165,7 +165,7 @@ class CFGManagerPlayer : public CFGManagerCustom STDMETHODIMP ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt) override; public: - CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, int preview = 0); + CFGManagerPlayer(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd, int preview = 0); void SetUserAgent(CStringW useragent) { m_userAgent = useragent; }; void SetReferrer(CStringW referrer) { m_referrer = referrer; }; @@ -180,19 +180,19 @@ class CFGManagerDVD : public CFGManagerPlayer STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter) override; public: - CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview = false); + CFGManagerDVD(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd, bool IsPreview = false); }; class CFGManagerCapture : public CFGManagerPlayer { public: - CFGManagerCapture(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd); + CFGManagerCapture(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd); }; class CFGManagerMuxer : public CFGManagerCustom { public: - CFGManagerMuxer(LPCTSTR pName, LPUNKNOWN pUnk); + CFGManagerMuxer(LPCWSTR pName, LPUNKNOWN pUnk); }; // @@ -203,7 +203,7 @@ class CFGAggregator : public CUnknown CComPtr m_pUnkInner; public: - CFGAggregator(const CLSID& clsid, LPCTSTR pName, LPUNKNOWN pUnk, HRESULT& hr); + CFGAggregator(const CLSID& clsid, LPCWSTR pName, LPUNKNOWN pUnk, HRESULT& hr); virtual ~CFGAggregator(); DECLARE_IUNKNOWN; diff --git a/src/apps/mplayerc/FGManagerBDA.cpp b/src/apps/mplayerc/FGManagerBDA.cpp index daa7edb34b..1729429519 100644 --- a/src/apps/mplayerc/FGManagerBDA.cpp +++ b/src/apps/mplayerc/FGManagerBDA.cpp @@ -264,7 +264,7 @@ static const AM_MEDIA_TYPE mt_Subtitle = { static CLSID CLSID_BDA_MPEG2_TIF = {0xFC772AB0, 0x0C7F, 0x11D3, {0x8F, 0xF2, 0x00, 0xA0, 0xC9, 0x22, 0x4C, 0xF4}}; -CFGManagerBDA::CFGManagerBDA(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd) +CFGManagerBDA::CFGManagerBDA(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd) : CFGManagerPlayer (pName, pUnk, hWnd) { LOG (L"\nStarting session ------------------------------------------------->"); diff --git a/src/apps/mplayerc/FGManagerBDA.h b/src/apps/mplayerc/FGManagerBDA.h index 4eca396dbe..1819d2e496 100644 --- a/src/apps/mplayerc/FGManagerBDA.h +++ b/src/apps/mplayerc/FGManagerBDA.h @@ -1,5 +1,5 @@ /* - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -114,7 +114,7 @@ private : class CFGManagerBDA : public CFGManagerPlayer, IBDATuner, IAMStreamSelect { public: - CFGManagerBDA(LPCTSTR pName, LPUNKNOWN pUnk, HWND hWnd); + CFGManagerBDA(LPCWSTR pName, LPUNKNOWN pUnk, HWND hWnd); ~CFGManagerBDA(); // IGraphBuilder From 72396d5fa4a83df1407430d29aeac89c6fcf2d5c Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 11 Aug 2024 07:54:20 +0300 Subject: [PATCH 100/102] =?UTF-8?q?=D0=9D=D0=B5=D0=B7=D0=BD=D0=B0=D1=87?= =?UTF-8?q?=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=20=D0=BE=D0=BF=D1=82=D0=B8=D0=BC=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/mplayerc/MediaControls.h | 4 ++-- src/apps/mplayerc/WebClient.h | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/apps/mplayerc/MediaControls.h b/src/apps/mplayerc/MediaControls.h index 0034bd7613..cdd64f887d 100644 --- a/src/apps/mplayerc/MediaControls.h +++ b/src/apps/mplayerc/MediaControls.h @@ -1,5 +1,5 @@ /* -* (C) 2021 see Authors.txt +* (C) 2021-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -48,7 +48,7 @@ class CMediaControls final CMediaControls(const CMediaControls&) = delete; CMediaControls& operator=(CMediaControls&&) = delete; CMediaControls& operator=(const CMediaControls&) = delete; - virtual ~CMediaControls(); + ~CMediaControls(); bool Init(CMainFrame* pMainFrame); bool Update(); diff --git a/src/apps/mplayerc/WebClient.h b/src/apps/mplayerc/WebClient.h index dadbf10779..80c5fd6c92 100644 --- a/src/apps/mplayerc/WebClient.h +++ b/src/apps/mplayerc/WebClient.h @@ -1,6 +1,6 @@ /* * (C) 2003-2006 Gabest - * (C) 2006-2023 see Authors.txt + * (C) 2006-2024 see Authors.txt * * This file is part of MPC-BE. * @@ -51,20 +51,20 @@ class CWebClientSocket : public CAsyncSocket CString m_sessid; CString m_cmd, m_path, m_query, m_ver; CStringA m_data; - std::map m_hdrlines; - std::map m_get; - std::map m_post; - std::map m_cookie; - std::map m_request; + std::map> m_hdrlines; + std::map> m_get; + std::map> m_post; + std::map> m_cookie; + std::map> m_request; - bool OnCommand(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnIndex(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnInfo(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnBrowser(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnControls(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnVariables(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnStatus(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnError404(CStringA& hdr, CStringA& body, CStringA& mime); - bool OnPlayer(CStringA& hdr, CStringA& body, CStringA& mime); + bool OnCommand (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnIndex (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnInfo (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnBrowser (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnControls (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnVariables (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnStatus (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnError404 (CStringA& hdr, CStringA& body, CStringA& mime); + bool OnPlayer (CStringA& hdr, CStringA& body, CStringA& mime); bool OnSnapShotJpeg(CStringA& hdr, CStringA& body, CStringA& mime); }; From 650f3e3dc6e09d629a65de0bea62a7b023f0b2f1 Mon Sep 17 00:00:00 2001 From: v0lt Date: Sun, 11 Aug 2024 11:45:14 +0300 Subject: [PATCH 101/102] =?UTF-8?q?=D0=9A=D0=BE=D1=81=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=B4=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DSUtil/Utils.h | 6 +++--- src/apps/mplayerc/MainFrm.cpp | 2 +- src/apps/mplayerc/SaveTaskDlg.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DSUtil/Utils.h b/src/DSUtil/Utils.h index bb0d48825d..7e5bdd9edd 100644 --- a/src/DSUtil/Utils.h +++ b/src/DSUtil/Utils.h @@ -23,15 +23,15 @@ #include #include -template // If the specified value is out of range, set to default values. +template inline T discard(T const& val, T const& def, T const& lo, T const& hi) { return (val > hi || val < lo) ? def : val; } -template // If the specified value is out of set, set to default values. +template inline T discard(T const& val, T const& def, const std::vector& vars) { if (val != def) { @@ -44,8 +44,8 @@ inline T discard(T const& val, T const& def, const std::vector& vars) return def; } -template // If the specified value is out of range, update lo or hi values. +template inline void expand_range(T const& val, T& lo, T& hi) { if (val > hi) { diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp index e577e250b0..cc28335761 100644 --- a/src/apps/mplayerc/MainFrm.cpp +++ b/src/apps/mplayerc/MainFrm.cpp @@ -19561,7 +19561,7 @@ CStringW GetCoverImgFromPath(CString fullfilename) path.AddBackslash(); - const std::vector coverNames = { + const CStringW coverNames[] = { L"cover", L"folder", foldername, diff --git a/src/apps/mplayerc/SaveTaskDlg.cpp b/src/apps/mplayerc/SaveTaskDlg.cpp index a114dd85cb..00aa9f2243 100644 --- a/src/apps/mplayerc/SaveTaskDlg.cpp +++ b/src/apps/mplayerc/SaveTaskDlg.cpp @@ -390,8 +390,8 @@ void CSaveTaskDlg::SaveHTTP(const int iSubLangDefault) const CStringW finalext = finalfile.GetExtension().Mid(1).MakeLower(); const CStringW tmpfile = finalfile + L".tmp"; const CStringW format = - (finalext == L"m4a") ? L"mp4" : - (finalext == L"mka") ? L"matroska" : + (finalext == L"m4a") ? CStringW(L"mp4") : + (finalext == L"mka") ? CStringW(L"matroska") : finalext; CStringW strArgs = L"-y"; From fd4eac6ea9758890ea95be43b9154e2cba636043 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 12 Aug 2024 12:20:15 +1000 Subject: [PATCH 102/102] =?UTF-8?q?MP4Splitter=20-=20=D0=BA=D0=BE=D1=80?= =?UTF-8?q?=D1=80=D0=B5=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BC=D0=B5=D1=82=D0=B0?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parser/MP4Splitter/MP4Splitter.cpp | 92 ++++++++++--------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp index f81eee6d08..c01b55ff06 100644 --- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp +++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp @@ -2103,53 +2103,55 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) } } } else if (AP4_DataAtom* data = dynamic_cast(atom->GetChild(AP4_ATOM_TYPE_DATA))) { - const AP4_DataBuffer* db = data->GetData(); - - if (atom->GetType() == AP4_ATOM_TYPE_TRKN) { - if (db->GetDataSize() >= 4) { - unsigned short n = (db->GetData()[2] << 8) | db->GetData()[3]; - if (n > 0 && n < 100) { - track.Format(L"%02d", n); - } else if (n >= 100) { - track.Format(L"%d", n); + auto db = data->GetData(); + + if (db->GetDataSize() > 0) { + if (atom->GetType() == AP4_ATOM_TYPE_TRKN) { + if (db->GetDataSize() >= 4) { + unsigned short n = (db->GetData()[2] << 8) | db->GetData()[3]; + if (n > 0 && n < 100) { + track.Format(L"%02d", n); + } else if (n >= 100) { + track.Format(L"%d", n); + } } - } - } else { - CStringW str = UTF8ToWStr(CStringA((LPCSTR)db->GetData(), db->GetDataSize())); - - switch (atom->GetType()) { - case AP4_ATOM_TYPE_NAM: - title = str; - break; - case AP4_ATOM_TYPE_ART: - artist = str; - break; - case AP4_ATOM_TYPE_WRT: - writer = str; - break; - case AP4_ATOM_TYPE_ALB: - album = str; - break; - case AP4_ATOM_TYPE_DAY: - year = str; - break; - case AP4_ATOM_TYPE_TOO: - appl = str; - break; - case AP4_ATOM_TYPE_CMT: - desc = str; - break; - case AP4_ATOM_TYPE_DESC: - if (desc.IsEmpty()) { + } else { + CStringW str = UTF8ToWStr(CStringA((LPCSTR)db->GetData(), db->GetDataSize())); + + switch (atom->GetType()) { + case AP4_ATOM_TYPE_NAM: + title = str; + break; + case AP4_ATOM_TYPE_ART: + artist = str; + break; + case AP4_ATOM_TYPE_WRT: + writer = str; + break; + case AP4_ATOM_TYPE_ALB: + album = str; + break; + case AP4_ATOM_TYPE_DAY: + year = str; + break; + case AP4_ATOM_TYPE_TOO: + appl = str; + break; + case AP4_ATOM_TYPE_CMT: desc = str; - } - break; - case AP4_ATOM_TYPE_GEN: - gen = str; - break; - case AP4_ATOM_TYPE_CPRT: - copyright = str; - break; + break; + case AP4_ATOM_TYPE_DESC: + if (desc.IsEmpty()) { + desc = str; + } + break; + case AP4_ATOM_TYPE_GEN: + gen = str; + break; + case AP4_ATOM_TYPE_CPRT: + copyright = str; + break; + } } } }