-
Notifications
You must be signed in to change notification settings - Fork 233
feat: Add Korean translation for assembly lessons #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully appreciate your endeavor for translating this marvelous material in Korean! Here are some minor comments and suggestions.
lesson_01/index.ko.md
Outdated
|
||
## 왜 어셈블리어를 사용하나요? | ||
|
||
결론부터 말씀드리자면 멀티미디어를 빠르게 처리하기 위해서입니다. 어셈블리어로 작성된 코드는 10배 이상의 속도 향상을 가져오는 경향이 있으며, 특히 실시간으로 끊김 없는 영상을 재생하려는 경우에 특히 중요합니다. 추가로 에너지 소비를 줄이고 배터리 수명을 늘리는 데도 도움이 됩니다. 비디오 인코딩 및 디코딩 기능은 대기업의 데이터센터를 포함한 일반 사용자 모두에게 지구상에서 가장 많이 사용되는 기능 중 일부라는 점을 강조하고 싶습니다. 따라서 작은 개선도 빠르게 누적됩니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the phrase 가장 많이 사용되는 기능 중 일부, '하나' instead of '일부' seems natural.
결론부터 말씀드리자면 멀티미디어를 빠르게 처리하기 위해서입니다. 어셈블리어로 작성된 코드는 10배 이상의 속도 향상을 가져오는 경향이 있으며, 특히 실시간으로 끊김 없는 영상을 재생하려는 경우에 특히 중요합니다. 추가로 에너지 소비를 줄이고 배터리 수명을 늘리는 데도 도움이 됩니다. 비디오 인코딩 및 디코딩 기능은 대기업의 데이터센터를 포함한 일반 사용자 모두에게 지구상에서 가장 많이 사용되는 기능 중 일부라는 점을 강조하고 싶습니다. 따라서 작은 개선도 빠르게 누적됩니다. | ||
|
||
<!-- online과 intrisics를 어떻게 번역할지 grocery를 정한 다음 수정을 할 필요가 있음. --> | ||
주변(online)에서는 intrinsics(내장 함수)을 사용하는걸 흔하게 볼 수 있습니다. 이는 어셈블리 명령어에 매핑되는 C 스타일 함수로, 주로 개발 속도를 높이기 위해 사용됩니다. 하지만 FFmpeg에서는 이러한 intrinsic을 사용하지 않고 어셈블리어 코드를 직접 작성합니다. 이 부분에 대해선 논쟁이 있지만, 컴파일러에 따라 일반적으로 intri은sics는 수작업으로 작성된 어셈블리 코드보다 약 10~15% 정도 느린 것으로 알려져 있습니다. FFmpeg에서는 가능한 모든 성능을 끌어내는 것이 중요하기 때문에, intrinsic에 의존하지 않는 방식을 택하고 있습니다 (옹호자들은 동의하지 않겠지만요). 또한 intrinsic은 변수에 [헝가리안 표기법](https://en.wikipedia.org/wiki/Hungarian_notation)을 사용하고 있기 때문에 읽기 어렵다는 의견도 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explanation in parentheses should be moved to the former sentence to match with the original.
Also, there is an apparent typo intri은sics는
.
lesson_01/index.ko.md
Outdated
<!-- online과 intrisics를 어떻게 번역할지 grocery를 정한 다음 수정을 할 필요가 있음. --> | ||
주변(online)에서는 intrinsics(내장 함수)을 사용하는걸 흔하게 볼 수 있습니다. 이는 어셈블리 명령어에 매핑되는 C 스타일 함수로, 주로 개발 속도를 높이기 위해 사용됩니다. 하지만 FFmpeg에서는 이러한 intrinsic을 사용하지 않고 어셈블리어 코드를 직접 작성합니다. 이 부분에 대해선 논쟁이 있지만, 컴파일러에 따라 일반적으로 intri은sics는 수작업으로 작성된 어셈블리 코드보다 약 10~15% 정도 느린 것으로 알려져 있습니다. FFmpeg에서는 가능한 모든 성능을 끌어내는 것이 중요하기 때문에, intrinsic에 의존하지 않는 방식을 택하고 있습니다 (옹호자들은 동의하지 않겠지만요). 또한 intrinsic은 변수에 [헝가리안 표기법](https://en.wikipedia.org/wiki/Hungarian_notation)을 사용하고 있기 때문에 읽기 어렵다는 의견도 있습니다. | ||
|
||
또한 FFmpeg 코드 중 일부에는 역사적인 이유로 인라인 어셈블리가 남아 있는 경우가 있으며, 리눅스 커널 같은 프로젝트에서도 아주 특수한 목적을 위해 사용되곤 합니다. 인라인 어셈블리는 어셈블리어를 별도의 파일이 아닌 C 코드 내부에 직접 작성하는 방식입니다. 하지만 FFmpeg과 같은 프로젝트에서는 이런 코드가 읽기 어렵고, 컴파일러에서 널리 지원되지 않으며 유지는수가 어렵다는 것이 일반적인 견해입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a typo 유지는수가
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a known issue in VSCode where there's occasionally shift the character position. I think that's probaly what caused it. anyway fixed similar typos and thanks for the catching this 33eff68
|
||
## 참고 자료 | ||
|
||
의외로 책이나 Stack Overflow 같은 온라인 자료는 참고용으로 그다지 도움이 되지 않을 수도 있습니다. 이는 부분적으로 Intel 문법을 사용한 수작업 어셈블리를 선택했기 때문이기도 하지만, 많은 온라인 자료들이 주로 운영체제나 하드웨어 프로그래밍에 초점을 맞추고 있으며, 대부분 SIMD를 사용하지 않는 코드를 다루고 있기 때문입니다. FFmpeg 어셈블리는 특히 고성능 이미지 처리에 중점을 두고 있으며, 보시게 되겠지만 어셈블리 프로그래밍에서 특히 독특한 접근 방식을 취합니다. 하지만 이 강좌를 완료하고 나면 다른 어셈블리 활용 사례들을 쉽게 이해할 수 있게 될 것입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term 어셈블리어
and 어셈블리
are both used as a translation of 'assembly'. Perhaps we should unify the usage throughout the lecture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had been using '어셈블리' and '어셈블리어' depending on the context (or simply mistake). I think '어셈블리어' would seems more appropriate if we were to unify the groceries. thanks for the suggestion 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or we could consider '어셈블리 코드' instead of '어셈블리어' in some contexts. 🤔
lesson_01/index.ko.md
Outdated
imul r0q, 5 | ||
``` | ||
|
||
첫 번째 줄에서는 즉시 `3`(메모리에서 읽어온 값이 아닌 코드 자체에 저장된 값)을 레지스터 `r0`에 쿼드워드(64비트) 크기로 저장합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the term immediate is a noun here, it should be represented as 즉시값
.
lesson_01/index.ko.md
Outdated
|
||
`mov`에서 대괄호 `[]`는 해당 주소를 역참조한다는 뜻이며, C언어의 `*src`와 같습니다. 이를 **로드(load)** 라고 합니다. 여기서 `q` 접미사는 포인터 크기를 나타내며 (64비트 시스템에서 `sizeof(*src) == 8`), 32비트 시스템에서는 자동으로 32비트를 사용합니다. 하지만 실제 로드는 128비트 단위로 이루어집니다. | ||
|
||
또한 벡터 레지스터는 `xmm0`처럼 전체 이름으로 부르지 않고 `m0`같이 추상화된 이름을 사용합니다. 이렇게 하면 한 번 작성한 코드를 다양한 SIMD 레지스터 크기에서 사용할 수 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of 다양한 SIMD 레지스터 크기
, how about 다양한 크기의 SIMD 레지스터
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied. definitely more natural than current sentences
33eff68
lesson_01/index.ko.md
Outdated
paddb m0, m1 | ||
``` | ||
|
||
`paddb`(머릿속에서 *p-add-b*라고 읽으면 됩니다)는 각 래지스터의 각 바이트를 서로 더하는 명령입니다. 여기서 접두사 `p`는 *packed*를 의미하며, 벡터 명령어와 스칼라 명령어를 구분하는데 쓰입니다. 접미사 `b`는 이 연산이 바이트 단위 덧셈임을 나타냅니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo 래지스터
here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! fixed in this commit 33eff68
|
||
## 소개 | ||
|
||
FFmpeg 어셈블리어 학교에 오신걸 환영합니다. 여러분은 프로그래밍에서 가장 흥미로우면서 도전적이고 보람도 있는 여정의 첫걸음을 내디디셨습니다. 이 강의들은 FFmpeg에서 어셈블리어가 어떻게 사용되는지, 그리고 여러분들의 컴퓨터에서 실제로는 어떤 일이 일어나고 있는지 단초를 제공해줄 것입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 오신걸
→ 오신 걸
이 강의들은 FFmpeg에서 어셈블리어가 어떻게 사용되는지, 그리고 여러분들의 컴퓨터에서 실제로는 어떤 일이 일어나고 있는지 단초를 제공해줄 것입니다.
Original: These lessons will give you a grounding in the way assembly language is written in FFmpeg and open your eyes to what's actually going on in your computer.
I suggest "이 강의를 통해 여러분은 FFmpeg에서 어셈블리어 코드를 작성하는 방법의 기초를 배우고, 컴퓨터에서 실제로는 어떤 일이 일어나고 있는지에 눈뜨게 될 것입니다."
Changes:
- This text focuses on reader's gain. I feel it more natural in Korean to write in reader's active voice.
- 단초를 제공해줄 것입니다 seems like a direct translation of "give you a grounding in", but the counterpart for "open your eyes to" is missing.
- The author wrote "the way assembly language is written", not "used". This is about syntax, code styles, or rules (so "작성"), not about how FFmpeg utilizes things ("사용") written in assembly language.
## 사전 지식 | ||
|
||
- C 언어 지식, 특히 포인터에 대한 이해가 필요합니다. 만약 아직 C에 익숙하지 않다면 [The C Programming Language](https://en.wikipedia.org/wiki/The_C_Programming_Language) 책을 참고하세요. | ||
- 고등학교 수학 (스칼라 vs 벡터 덧셈, 곱셈 등) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Should be 스칼라 vs 벡터, 덧셈, 곱셈 등
|
||
어셈블리어는 CPU가 처리하는 명령어와 직접 대응하는 코드를 작성하는 프로그래밍 언어입니다. 사람이 읽을 수 있는 형태의 어셈블리어는 이름 그대로 '조립(assemble)'되어 CPU가 이해할 수 있는 이진 데이터, 즉 머신 코드(machine code)로 변환됩니다. 어셈블리어 코드는 종종 "어셈블리" 또는 "asm"으로 불립니다. | ||
|
||
FFmpeg에서 사용되는 대부분의 어셈블리 코드는 단일 명령 다중 데이터 방식인 SIMD(Single Instruction Multiple Data)로 작성되어 있습니다. SIMD는 종종 벡터 프로그래밍(vector programming)이라고도 불립니다. 이 방식은 하나의 명령어가 동시에 여러 데이터 요소를 처리할 수 있게 해줍니다. 반면 대부분의 프로그래밍 언어는 한 번에 하나의 데이터만 처리하는 스칼라 프로그래밍(scalar programming) 방식입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FFmpeg에서 사용되는 대부분의 어셈블리 코드는 단일 명령 다중 데이터 방식인 SIMD(Single Instruction Multiple Data)로 작성되어 있습니다.
Original: The vast majority of assembly code in FFmpeg is what's known as SIMD, Single Instruction Multiple Data.
I suggest "FFmpeg에서 사용되는 대부분의 어셈블리어 코드는 SIMD(단일 명령어 다중 데이터)로 작성되어 있습니다."
"단일 명령어 다중 데이터" and "SIMD" are the same object. "단일 명령 다중 데이터 방식인 SIMD" reads as if SIMD is one of a such kind.
|
||
FFmpeg에서 사용되는 대부분의 어셈블리 코드는 단일 명령 다중 데이터 방식인 SIMD(Single Instruction Multiple Data)로 작성되어 있습니다. SIMD는 종종 벡터 프로그래밍(vector programming)이라고도 불립니다. 이 방식은 하나의 명령어가 동시에 여러 데이터 요소를 처리할 수 있게 해줍니다. 반면 대부분의 프로그래밍 언어는 한 번에 하나의 데이터만 처리하는 스칼라 프로그래밍(scalar programming) 방식입니다. | ||
|
||
짐작하셨겠지만, SIMD는 이미지, 비디오 그리고 오디오처럼 메모리에 연속적으로 정렬된 대량의 데이터를 처리할 때 매우 효과적입니다. 이러한 순차적 데이터를 효율적으로 처리하기 위해 CPU에는 특수한 명령어들이 내장되어 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original: As you might have guessed, SIMD lends itself well to processing images, video, and audio which have lots of data ordered sequentially in memory. There are specialist instructions available in the CPU to help us process sequential data.
I suggest "짐작하셨겠지만, SIMD는 이미지, 비디오, 오디오처럼 데이터의 대부분이 메모리에 연속적으로 정렬되어 있을 때 매우 효과적입니다. CPU에는 이렇게 연속적인 데이터를 처리하는 데 특화된 명령어들이 내장되어 있습니다."
Changes:
- Images, video, and audio are mostly but not totally sequential, hence "데이터의 대부분이 ~". This change forced me to omit "processing" part, but it is implied from the context.
- "연속적" and "순차적" have both temporal and spatial meaning. Sticking to "연속적" is better since the context "메모리에서" is preserved.
- "특화" seems better since the instructions are not just special but specialized for our goal.
|
||
짐작하셨겠지만, SIMD는 이미지, 비디오 그리고 오디오처럼 메모리에 연속적으로 정렬된 대량의 데이터를 처리할 때 매우 효과적입니다. 이러한 순차적 데이터를 효율적으로 처리하기 위해 CPU에는 특수한 명령어들이 내장되어 있습니다. | ||
|
||
FFmpeg에서는 "어셈블리 함수", "SIMD", "벡터화(vectorize)"라는 용어들이 혼재되어 사용되지만, 모두 여러 데이터 요소를 한 번에 처리하기 위해 어셈블리어로 직접 함수를 작성했다는 의미로 나타냅니다. 어떤 프로젝트에서는 이를 "어셈블리 커널(assembley kernel)"이라고 부르기도 합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 의미로 나타냅니다
→ 의미입니다
, assembley
→ assembly
, also 혼재되어 사용되지만
can be just 혼용되지만
I'm not sure but if "assembly function", "SIMD", and "vector(ise)" refer to comments in FFmpeg code (not this guide) it should be written intact like "어셈블리 함수(assembly function)", "벡터(vector)", or "벡터화(vectorise)".
|
||
FFmpeg에서는 "어셈블리 함수", "SIMD", "벡터화(vectorize)"라는 용어들이 혼재되어 사용되지만, 모두 여러 데이터 요소를 한 번에 처리하기 위해 어셈블리어로 직접 함수를 작성했다는 의미로 나타냅니다. 어떤 프로젝트에서는 이를 "어셈블리 커널(assembley kernel)"이라고 부르기도 합니다. | ||
|
||
이 모든 것이 당장은 복잡하게 느껴질 수도 있지만, FFmpeg에서는 고등학생들도 어셈블리 코드를 작성했다는 점을 기억하는게 중요합니다. 어떤 것을 배우든 그 과정의 시작은 용어 익히기, 나머지 끝은 실제로 이해하기입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 기억하는게
→ 기억하는 게
어떤 것을 배우든 그 과정의 시작은 용어 익히기, 나머지 끝은 실제로 이해하기입니다.
Original: As with everything, learning is 50% jargon and 50% actual learning.
I strongly suggest "모든 것이 그렇듯이 공부의 반은 용어이고 나머지 반이 진짜 공부입니다." since this phrase is mainly emphasizing the amount of jargons.
|
||
## 왜 어셈블리어를 사용하나요? | ||
|
||
결론부터 말씀드리자면 멀티미디어를 빠르게 처리하기 위해서입니다. 어셈블리어로 작성된 코드는 10배 이상의 속도 향상을 가져오는 경향이 있으며, 특히 실시간으로 끊김 없는 영상을 재생하려는 경우에 특히 중요합니다. 추가로 에너지 소비를 줄이고 배터리 수명을 늘리는 데도 도움이 됩니다. 비디오 인코딩 및 디코딩 기능은 대기업의 데이터센터를 포함한 일반 사용자 모두에게 지구상에서 가장 많이 사용되는 기능 중 하나라는 점을 강조하고 싶습니다. 따라서 작은 개선도 빠르게 누적됩니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어셈블리어로 작성된 코드는 10배 이상의 속도 향상을 가져오는 경향이 있으며, 특히 실시간으로 끊김 없는 영상을 재생하려는 경우에 특히 중요합니다.
Original: It’s very common to get a 10x or more speed improvement from writing assembly code, which is especially important when wanting to play videos in real time without stuttering.
This is misleading. It should be "어셈블리어로 코드를 작성해서 속도를 10배 이상 향상시키는 일은 아주 흔하며, 영상을 실시간으로 끊김 없이 재생하려면 특히 중요합니다." Current translation reads as if assembly code is naturally fast, which is not.
비디오 인코딩 및 디코딩 기능은 대기업의 데이터센터를 포함한 일반 사용자 모두에게 지구상에서 가장 많이 사용되는 기능 중 하나라는 점을 강조하고 싶습니다.
Original: It’s worth pointing out that video encode and decode functions are some of the most heavily used functions on earth, both by end-users and by big companies in their datacentres.
I suggest "비디오 인코딩 및 디코딩 기능은 개인 사용자부터 대기업의 데이터센터에 이르기까지 지구상에서 가장 많이 사용되는 기능 중 하나라는 점도 중요합니다."
Changes:
- More like typo: "일반 사용자" does not contain "대기업의 데이터센터" in normal sense.
- This sentence is more like a build-up for the real point (small improvements matter) so less direct "중요합니다" feels more appropriate here?
|
||
결론부터 말씀드리자면 멀티미디어를 빠르게 처리하기 위해서입니다. 어셈블리어로 작성된 코드는 10배 이상의 속도 향상을 가져오는 경향이 있으며, 특히 실시간으로 끊김 없는 영상을 재생하려는 경우에 특히 중요합니다. 추가로 에너지 소비를 줄이고 배터리 수명을 늘리는 데도 도움이 됩니다. 비디오 인코딩 및 디코딩 기능은 대기업의 데이터센터를 포함한 일반 사용자 모두에게 지구상에서 가장 많이 사용되는 기능 중 하나라는 점을 강조하고 싶습니다. 따라서 작은 개선도 빠르게 누적됩니다. | ||
|
||
<!-- online과 intrisics를 어떻게 번역할지 grocery를 정한 다음 수정을 할 필요가 있음. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest "인터넷에서" "웹상에서" for online (I don't think this belongs to glossary), "컴파일러 내장 함수" "(컴파일러) 인트린직" for "intrinsics". "Intrinsics" here refers only to compiler intrinsics, different from "내장 함수(normally language builtins)"
결론부터 말씀드리자면 멀티미디어를 빠르게 처리하기 위해서입니다. 어셈블리어로 작성된 코드는 10배 이상의 속도 향상을 가져오는 경향이 있으며, 특히 실시간으로 끊김 없는 영상을 재생하려는 경우에 특히 중요합니다. 추가로 에너지 소비를 줄이고 배터리 수명을 늘리는 데도 도움이 됩니다. 비디오 인코딩 및 디코딩 기능은 대기업의 데이터센터를 포함한 일반 사용자 모두에게 지구상에서 가장 많이 사용되는 기능 중 하나라는 점을 강조하고 싶습니다. 따라서 작은 개선도 빠르게 누적됩니다. | ||
|
||
<!-- online과 intrisics를 어떻게 번역할지 grocery를 정한 다음 수정을 할 필요가 있음. --> | ||
주변(online)에서는 intrinsics(내장 함수)을 사용하는걸 흔하게 볼 수 있습니다. 이는 어셈블리 명령어에 매핑되는 C 스타일 함수로, 주로 개발 속도를 높이기 위해 사용됩니다. 하지만 FFmpeg에서는 이러한 intrinsic을 사용하지 않고 어셈블리어 코드를 직접 작성합니다. 이 부분에 대해선 논쟁이 있지만, 컴파일러에 따라 일반적으로 intri은sics는 수작업으로 작성된 어셈블리 코드보다 약 10~15% 정도 느린 것으로 알려져 있습니다. FFmpeg에서는 가능한 모든 성능을 끌어내는 것이 중요하기 때문에, intrinsic에 의존하지 않는 방식을 택하고 있습니다 (옹호자들은 동의하지 않겠지만요). 또한 intrinsic은 변수에 [헝가리안 표기법](https://en.wikipedia.org/wiki/Hungarian_notation)을 사용하고 있기 때문에 읽기 어렵다는 의견도 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
또한 intrinsic은 변수에 헝가리안 표기법을 사용하고 있기 때문에 읽기 어렵다는 의견도 있습니다.
I suppose "변수에" should be omitted?
<!-- online과 intrisics를 어떻게 번역할지 grocery를 정한 다음 수정을 할 필요가 있음. --> | ||
주변(online)에서는 intrinsics(내장 함수)을 사용하는걸 흔하게 볼 수 있습니다. 이는 어셈블리 명령어에 매핑되는 C 스타일 함수로, 주로 개발 속도를 높이기 위해 사용됩니다. 하지만 FFmpeg에서는 이러한 intrinsic을 사용하지 않고 어셈블리어 코드를 직접 작성합니다. 이 부분에 대해선 논쟁이 있지만, 컴파일러에 따라 일반적으로 intri은sics는 수작업으로 작성된 어셈블리 코드보다 약 10~15% 정도 느린 것으로 알려져 있습니다. FFmpeg에서는 가능한 모든 성능을 끌어내는 것이 중요하기 때문에, intrinsic에 의존하지 않는 방식을 택하고 있습니다 (옹호자들은 동의하지 않겠지만요). 또한 intrinsic은 변수에 [헝가리안 표기법](https://en.wikipedia.org/wiki/Hungarian_notation)을 사용하고 있기 때문에 읽기 어렵다는 의견도 있습니다. | ||
수 | ||
또한 FFmpeg 코드 중 일부에는 역사적인 이유로 인라인 어셈블리가 남아 있는 경우가 있으며, 리눅스 커널 같은 프로젝트에서도 아주 특수한 목적을 위해 사용되곤 합니다. 인라인 어셈블리는 어셈블리어를 별도의 파일이 아닌 C 코드 내부에 직접 작성하는 방식입니다. 하지만 FFmpeg과 같은 프로젝트에서는 이런 코드가 읽기 어렵고, 컴파일러에서 널리 지원되지 않으며 유지보수가 어렵다는 것이 일반적인 의견입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하지만 FFmpeg과 같은 프로젝트에서는 이런 코드가 읽기 어렵고, 컴파일러에서 널리 지원되지 않으며 유지보수가 어렵다는 것이 일반적인 의견입니다.
Original: The prevailing opinion in projects like FFmpeg is that this code is hard to read, not widely supported by compilers and unmaintainable.
I strongly suggest "하지만 이런 코드는 읽기 어렵고, 여러 컴파일러에서 널리 지원하지 않으며, 유지보수가 어렵다는 것이 FFmpeg와 같은 프로젝트에서의 주된 의견입니다." The original text says that the opinion is prevailing in FFmpeg, not that the content applies to FFmpeg. I don't really understand what "projects like FFmpeg" specifically are, by the way.
수 | ||
또한 FFmpeg 코드 중 일부에는 역사적인 이유로 인라인 어셈블리가 남아 있는 경우가 있으며, 리눅스 커널 같은 프로젝트에서도 아주 특수한 목적을 위해 사용되곤 합니다. 인라인 어셈블리는 어셈블리어를 별도의 파일이 아닌 C 코드 내부에 직접 작성하는 방식입니다. 하지만 FFmpeg과 같은 프로젝트에서는 이런 코드가 읽기 어렵고, 컴파일러에서 널리 지원되지 않으며 유지보수가 어렵다는 것이 일반적인 의견입니다. | ||
|
||
마지막으로 인터넷에서는 "컴파일러가 알아서 벡터화를 해주기 때문에 어셈블리어는 더 이상 필요 없다"고 주장하는 '자칭 전문가'들도 자주 볼 수 있습니다. 하지만 적어도 학습 단계에서는 신경쓰지 않아도 됩니다. 예를 들어 [dav1d 프로젝트](https://www.videolan.org/projects/dav1d.html)의 최근 테스트에서는 컴파일러의 자동 벡터화가 약 2배의 속도 향상을 보여준 반면, 수작업으로 작성한 버전은 최대 8배 까지의 성능 개선을 보여주었습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 8배 까지의
→ 8배까지의
and following
|
||
## 어셈블리어의 종류 | ||
|
||
이 강좌는 x86 64비트 어셈블리어를 중심으로 다룹니다. amd64라고도 하지만 인텔 CPU에서도 동일하게 동작합니다. 이 밖에도 ARM이나 RISC-V 같은 다른 CPU용 어셈블리어가 있으며, 이러한 아키텍처 까지 강의가 확장될 가능성도 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor note: "강의" was used at the beginning
|
||
## 참고 자료 | ||
|
||
의외로 책이나 Stack Overflow 같은 온라인 자료는 참고용으로 그다지 도움이 되지 않을 수도 있습니다. 이는 부분적으로 Intel 문법을 사용한 수작업 어셈블리를 선택했기 때문이기도 하지만, 많은 온라인 자료들이 주로 운영체제나 하드웨어 프로그래밍에 초점을 맞추고 있으며, 대부분 SIMD를 사용하지 않는 코드를 다루고 있기 때문입니다. FFmpeg 어셈블리는 특히 고성능 이미지 처리에 중점을 두고 있으며, 보시게 되겠지만 어셈블리 프로그래밍에서 특히 독특한 접근 방식을 취합니다. 하지만 이 강좌를 완료하고 나면 다른 어셈블리 활용 사례들을 쉽게 이해할 수 있게 될 것입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
의외로 책이나 Stack Overflow 같은 온라인 자료는 참고용으로 그다지 도움이 되지 않을 수도 있습니다.
Original: You might be surprised to hear that books or online resources like Stack Overflow are not particularly helpful as references.
I suggest "책이나 Stack Overflow 같은 온라인 자료가 참고 자료로서 특별히 유용하지는 않다고 하면 놀라실 것 같습니다." The original text is more conclusive.
|
||
질문을 할 수 있는 디스코드 서버도 있습니다: https://discord.com/invite/Ks5MhUhqfB | ||
|
||
## 레지스터 (Register) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor note: spaces before parentheses are inconsistent.
|
||
첫 번째 종류의 레지스터는 범용 레지스터(GPR, General Purpose Register)라고 불립니다. '범용'이라는 이름은 이 레지스터가 데이터(최대 64비트 값)나 메모리 주소(포인터)를 모두 담을 수 있기 때문에 붙었습니다. GPR에 들어 있는 값은 덧셈, 곱셈, 시프트(shift) 등의 연산을 통해 처리할 수 있습니다. | ||
|
||
대부분의 어셈블리 관련 서적에서는 GPR의 세부 동작 방식이나 역사적 배경 등에 대해 지면을 할애해 다룹니다. 이는 운영체제 프로그래밍이나 리버스 엔지니어링처럼 GPR이 중요한 분야가 있기 때문입니다. 그러나 FFmpeg에서 작성하는 대부분은 어셈블리 코드는 GPR은 보조적인 역할(scaffolding)에 가깝기 때문에 복잡한 세부 기능이 필요하지 않은 경우가 많아 대부분 추상화 되어 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대부분의 어셈블리 관련 서적에서는 GPR의 세부 동작 방식이나 역사적 배경 등에 대해 지면을 할애해 다룹니다.
Original: In most assembly books, there are whole chapters dedicated to the subtleties of GPRs, the historical background etc.
This should be "대부분의 어셈블리 관련 서적에서는 GPR 사이의 차이점이나, GPR의 역사적 배경 등에 대해 지면을 할애해 다룹니다."
Subtleties, in this (historical) context, seem to be the purposes of different GPRs, e.g. rcx is used in counters.
그러나 FFmpeg에서 작성하는 대부분은 어셈블리 코드는 GPR은 보조적인 역할(scaffolding)에 가깝기 때문에 복잡한 세부 기능이 필요하지 않은 경우가 많아 대부분 추상화 되어 있습니다.
Original: In the assembly code written in FFmpeg, GPRs are more like scaffolding and most of the time their complexities are not needed and abstracted away.
Also I suggest: "FFmpeg에서 작성하는 어셈블리 코드에서 GPR은 형식적인 도구에 가깝고, 대부분의 경우 그런 복잡한 맥락은 불필요하기 때문에 추상화되어 사라집니다."
- "scaffolding" is not a jargon here. The point is: It is only important that GPRs can store values.
- I can't fully express "abstract away" in Korean but the "removal" of complexity is the point at least.
벡터(SIMD) 레지스터는 이름 그대로 여러 개의 데이터 요소를 담을 수 있는 레지스터입니다. 이 레지스터에는 여러 종류가 있습니다. | ||
|
||
- **mm 레지스터**: MMX 레지스터, 64비트 크기, 현재는 잘 사용되지 않음 | ||
- **xmm 레지스터**: XMM 레지스터, 128비트 크기, 널리 사용됨 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"widely available" should be "대부분의 환경에서 사용 가능"
|
||
비디오 압축과 압축 해제에서 대부분의 연산은 정수 기반이므로 여기서는 정수 데이터를 기준으로 설명하겠습니다. | ||
|
||
다음은 xmm 레지스터에 담긴 16바이트의 예시입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Along with the following examples, it should be "16개의 바이트가 xmm 레지스터에 담긴 예시입니다."
|
||
## 간단한 어셈블리 예제 | ||
|
||
이번에는 간단한 (인위적이지만요) 스칼라 어셈블리 코드 조각(snippet)을 보면서 어떤 일들이 일어나는지 살펴보겠습니다. 여기서 _스칼라 어셈블리_ 란, 각 명령이 한 번에 하나의 데이터 항목만 처리하는 어셈블리 코드를 의미합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이번에는 간단한 (인위적이지만요) 스칼라 어셈블리 코드 조각(snippet)을 보면서 어떤 일들이 일어나는지 살펴보겠습니다.
I suggest "이번에는 인위적이지만 간단한 스칼라 어셈블리 코드를 보면서 어떤 일이 일어나는지 살펴보겠습니다."
WIP
Translating the assembly lessons into Korean, with plans to translate all available documents.
Note: Converted bold text separators to proper markdown headers for better rendering