2017년 11월 29일 수요일

STARTUP.A51

The file STARTUP.A51  contains the startup code for a C51 target program. This source file is located in the \FSI\LIB  directory. Include a copy of this file in each 8051 project that needs custom startup code.
STARTUP.A51 파일에는 C51 대상 프로그램의 시작 코드가 들어 있습니다. 이 소스 파일은 \ FSI \ LIB 디렉토리에 있습니다. 사용자 지정 시작 코드가 필요한 각 8051 프로젝트에이 파일의 복사본을 포함시킵니다.

This code is executed immediately upon reset of the target system and optionally performs the following operations in order:
이 코드는 대상 시스템을 다시 설정하면 즉시 실행되며 선택적으로 다음 작업을 순서대로 수행합니다.


  Clears internal data memory
  Clears external data memory
  Clears paged external data memory

  Initializes the small model reentrant stack and pointer
  Initializes the large model reentrant stack and pointer
  Initializes the compact model reentrant stack and pointer

  Initializes the 8051 hardware stack pointer

  Transfers control to the main C function.

STARTUP.A51  provides assembly constants you may change to control the actions taken at startup. These are defined in the following table.
STARTUP.A51은 시작할 때 취하는 동작을 제어하기 위해 변경할 수있는 어셈블리 상수를 제공합니다. 이들은 다음 표에 정의되어 있습니다.

IDATALEN
Indicates the number of bytes of idata that are to be initialized to 0.  The default is 80h because most 8051 derivatives contain at least 128 bytes of internal data memory. Use a value of 100h for the 8052 and other derivatives that have 256 bytes of internal data memory.

If your target system supports a power-down mode and you want to disable internal data memory clearing, set IDATALEN  to 0. However, you must ensure that the byte variable ?C_DSTK_LEVEL is set to zero. This is required by functions included from the library.

 XDATASTART
Specifies the xdata address to start initializing to 0.

 XDATALEN
Indicates the number of bytes of xdata to be initialized to 0. The default is 0.

 PDATASTART
Specifies the pdata address to start initializing to 0.

 PDATALEN
Indicates the number of bytes of pdata to be initialized to 0. The default is 0.

 IBPSTACK
Indicates whether or not the small model reentrant stack pointer (?C_IBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

 IBPSTACKTOP
Specifies the top start address of the small model reentrant stack area. The default is 0xFF in idata memory.

C51 does not check to see if the stack area available satisfies the requirements of the applications. It is your responsibility to perform such a test.

 XBPSTACK
Indicates whether or not the large model reentrant stack pointer (?C_XBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

 XBPSTACKTOP
Specifies the top start address of the large model reentrant stack area. The default is 0xFFFF in xdata memory.

C51 does not check to see if the stack area available satisfies the requirements of the applications. It is your responsibility to perform such a test.

 PBPSTACK
Indicates whether the compact model reentrant stack pointer (?C_PBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

 PBPSTACKTOP
Specifies the top start address of the compact model reentrant stack area. The default is 0xFF in pdata memory.

C51 does not check to see if the stack area available satisfies the requirements of the applications. It is your responsibility to perform such a test.

 PPAGEENABLE
Enables (a value of 1) or disables (a value of 0) the initialization of port 2 of the 8051 device. The default is 0. The addressing of port 2 allows the mapping of 256 byte variable memory in any arbitrary xdata page.

 PPAGE
Specifies the value to write to Port 2 of the 8051 for pdata memory access. This value represents the xdata memory page to use for pdata.  This is the upper 8 bits of the absolute address range to use for pdata.

As an example, if the pdata area begins at address 1000h (page 10h) in the xdata memory, PPAGEENABLE  should be set to 1 and PPAGE  should be set to 10h. The L51 Linker/Locator must contain a value between 1000h and 10FFh in the PDATA control directive. For example:

L51 <input modules> PDATA (1050H)

Neither L51 nor C51 checks to see if the PDATA control directive and the PPAGE  assembler constant are specified correctly. You must ensure that these parameters contain suitable values.


Memory Models (Link)
컴파일러 옵션에서 어떤 모델(Small, Compact, Large) 를 쓸건지 체크를 하면 그에 맞춰서 Complie 이 된다. 보통 XDATA 를 사용하는 Large 를 선택한다.








2017년 11월 26일 일요일

Tooling in the automotive industry

Tooling is an important process in the production of automobiles today. The current market is moving from high-volume and low-mix to low-volume and high-mix car production. Every single part of a new car requires a unique tool. Once the product design department finalizes the design of a new part, such as for example a deck-lid, fender, bracket or cross member, it is released to the feasibility and tooling departments, where an appropriate tool to produce the part is then designed. With so many new auto plants and new vehicle designs being launched faster than ever before, companies which make these tools must find effective ways to meet these demands.
오늘날 자동차 생산에서 공구 가공은 중요한 프로세스입니다. 현재 시장은 대량 생산 및 저비용에서 저용량 및 하이 믹스 자동차 생산으로 이동하고 있습니다. 새 차의 모든 부분에는 고유 한 도구가 필요합니다. 제품 디자인 부서에서 갑판 뚜껑, 흙 받이, 브래킷 또는 크로스 멤버와 같은 새 부품의 설계를 완료하면 실현 가능성 및 툴링 부서에 배포되고 부품을 생산하기위한 적절한 도구가 설계됩니다 . 많은 새로운 자동차 공장과 새로운 차량 설계가 그 어느 때보다도 빠르게 출시됨에 따라 이러한 도구를 만드는 회사는 이러한 요구를 충족 할 수있는 효과적인 방법을 찾아야합니다.

Tooling: Every single part of a new car requires a unique tool.
새 차의 모든 부분에는 고유 한 도구가 필요합니다

Up until now, a tooling company could manufacture one tool that ran, for example, 500,000 parts for one model. Now, it is necessary to manufacture five or six tools that stamp 100,000 parts in five or six styles to support a platform of customized vehicles. This poses huge challenges for tooling companies as they have to find an efficient way to reduce overall lead time and costs and at the same time to ensure high tool and part quality. In order to do this, the number of press tryouts and optimization loops as well as the total lead time in the tooling process must be reduced.
지금까지 툴 제조 회사는 한 모델에 대해 예를 들어 500,000 개의 부품을 실행하는 하나의 툴을 제조 할 수있었습니다. 이제 맞춤 차량의 플랫폼을 지원하기 위해 5 개 또는 6 개의 스타일로 10 만 개의 부품을 스탬프 처리하는 5 개 또는 6 개의 공구를 제조해야합니다. 이는 전반적인 리드 타임과 비용을 줄이는 동시에 효율적인 툴과 부품 품질을 보장 할 수있는 효율적인 방법을 찾아야하기 때문에 툴링 회사에게는 커다란 도전 과제입니다. 이를 수행하기 위해 프레스 트라이 아웃 횟수와 최적화 루프 수 및 툴링 공정의 총 리드 타임을 줄여야합니다.

In order to achieve these goals, tooling engineers look for the best solutions to quickly and efficiently setup the entire tooling process, make process modifications and evaluate different process layouts to select the best one. The rapid verification of multiple new concepts for quality and cost improvements is very important as well as the identification of complex forming problems during the early phase of tool development. The main goal is to increase the reliability of stamping tools in order to achieve efficient and reliable production or, in other words, to find the best optimized tool designs for a robust stamping process.
이러한 목표를 달성하기 위해 툴링 엔지니어는 전체 툴링 프로세스를 빠르고 효율적으로 설정하고 프로세스를 수정하며 다양한 프로세스 레이아웃을 평가하여 최상의 툴을 선택하는 최상의 솔루션을 모색합니다. 품질 및 비용 향상을위한 여러 가지 새로운 개념의 신속한 검증은 도구 개발의 초기 단계에서 복잡한 성형 문제를 확인하는 것뿐만 아니라 매우 중요합니다. 주요 목표는 효율적이고 신뢰할 수있는 생산을 달성하기 위해 스탬핑 툴의 신뢰성을 높이는 것입니다. 즉, 견고한 스탬핑 공정을위한 최적의 최적화 된 툴 디자인을 찾는 것입니다.

YCbCr

YCbCr, Y′CbCr, or Y Pb/Cb Pr/Cr, also written as YCBCR or Y'CBCR, is a family of color spaces used as a part of the color image pipeline in video and digital photography systems. Y′ is the luma component and CB and CR are the blue-difference and red-difference chroma components. Y′ (with prime) is distinguished from Y, which is luminance, meaning that light intensity is nonlinearly encoded based on gamma corrected RGB primaries.
YCBCR 또는 Y'CBCR로도 쓰여진 YCbCr, Y'CbCr 또는 Y Pb / Cb Pr / Cr은 비디오 및 디지털 사진 시스템에서 컬러 이미지 파이프 라인의 일부로 사용되는 색 공간 계열입니다. Y '는 휘도 성분이고 CB 및 CR은 청색 및 적색 차 성분의 색차 성분이다. Y '(프라임과 함께)는 Y와 구별되며, 이는 광도가 감마 보정 된 RGB 원색을 기반으로 비선형 적으로 인코딩된다는 것을 의미합니다.

Y′CbCr color spaces are defined by a mathematical coordinate transformation from an associated RGB color space. If the underlying RGB color space is absolute, the Y′CbCr color space is an absolute color space as well; conversely, if the RGB space is ill-defined, so is Y′CbCr.
Y'CbCr 색상 공간은 연관된 RGB 색상 공간의 수학 좌표 변환에 의해 정의됩니다. 기본 RGB 색상 공간이 절대적인 경우 Y'CbCr 색상 공간은 절대 색상 공간이기도합니다. 반대로 RGB 공간이 잘못 정의 된 경우 Y'CbCr도 잘못 정의됩니다.

Rationale
Cathode ray tube displays are driven by red, green, and blue voltage signals, but these RGB signals are not efficient as a representation for storage and transmission, since they have a lot of redundancy.

YCbCr and Y′CbCr are a practical approximation to color processing and perceptual uniformity, where the primary colors corresponding roughly to red, green and blue are processed into perceptually meaningful information. By doing this, subsequent image/video processing, transmission and storage can do operations and introduce errors in perceptually meaningful ways. Y′CbCr is used to separate out a luma signal (Y′) that can be stored with high resolution or transmitted at high bandwidth, and two chroma components (CB and CR) that can be bandwidth-reduced, subsampled, compressed, or otherwise treated separately for improved system efficiency.

One practical example would be decreasing the bandwidth or resolution allocated to "color" compared to "black and white", since humans are more sensitive to the black-and-white information (see image example to the right). This is called chroma subsampling.
음극선 관 디스플레이는 적색, 녹색 및 청색 전압 신호에 의해 구동되지만 이러한 RGB 신호는 많은 중복성을 가지고 있기 때문에 저장 및 전송의 표현으로는 효율적이지 않습니다.

YCbCr 및 Y'CbCr은 색상 처리 및 지각 균일성에 대한 실질적인 근사치이며, 대략적으로 적색, 녹색 및 청색에 대응하는 원색이 지각 적으로 의미있는 정보로 처리된다. 이렇게하면 후속 이미지 / 비디오 처리, 전송 및 저장이 작업을 수행하고 오류를 지각 적으로 의미있는 방식으로 도입 할 수 있습니다. Y'CbCr은 고해상도로 저장되거나 고 대역폭으로 전송 될 수있는 휘도 신호 (Y ')와 대역폭 감소, 서브 샘플링, 압축 또는 기타 두 가지 색도 요소 (CB 및 CR)를 분리하는 데 사용됩니다 향상된 시스템 효율성을 위해 별도로 처리됩니다.

한 가지 실용적인 예는 "흑백"에 비해 "컬러"에 할당 된 대역폭 또는 해상도를 줄이는 것입니다. 왜냐하면 인간은 흑백 정보에 더 민감하기 때문입니다 (오른쪽 이미지 예제 참조). 이것을 크로마 서브 샘플링이라고합니다.

YCbCr
YCbCr is sometimes abbreviated to YCC. Y′CbCr is often called YPbPr when used for analog component video, although the term Y′CbCr is commonly used for both systems, with or without the prime.

Y′CbCr is often confused with the YUV color space, and typically the terms YCbCr and YUV are used interchangeably, leading to some confusion. The main difference is that YUV is analog and YCbCr is digital.

Y′CbCr signals (prior to scaling and offsets to place the signals into digital form) are called YPbPr, and are created from the corresponding gamma-adjusted RGB (red, green and blue) source using three defined constants KR, KG, and KB as follows:
YCbCr은 때때로 YCC로 축약됩니다. Y'CbCr은 아날로그 구성 요소 비디오 용으로 사용되는 경우 YPbPr이라고도하며, Y'CbCr이라는 용어는 소수 또는 유선 모두 시스템에 공통으로 사용됩니다.

Y'CbCr은 종종 YUV 색 공간과 혼동되며 일반적으로 YCbCr 및 YUV라는 용어는 서로 혼용되어 혼란을 야기합니다. 주요 차이점은 YUV가 아날로그이고 YCbCr이 디지털이라는 것입니다.

Y'CbCr 신호 (신호를 디지털 형식으로 변환하기위한 스케일링 및 오프셋 이전)는 YPbPr이라고하며, 정의 된 상수 KR, KG 및 KB를 사용하여 해당 감마 조정 RGB (적색, 녹색 및 청색) 소스로부터 생성됩니다 다음과 같이

where KR, KG, and KB are ordinarily derived from the definition of the corresponding RGB space, and required to satisfy {\displaystyle K_{R}+K_{G}+K_{B}=1} {\displaystyle K_{R}+K_{G}+K_{B}=1}. (The equivalent matrix manipulation is often referred to as the "color matrix".)

Here, the prime ′ symbols mean gamma correction is being used; thus R′, G′ and B′ nominally range from 0 to 1, with 0 representing the minimum intensity (e.g., for display of the color black) and 1 the maximum (e.g., for display of the color white). The resulting luma (Y) value will then have a nominal range from 0 to 1, and the chroma (PB and PR) values will have a nominal range from -0.5 to +0.5. The reverse conversion process can be readily derived by inverting the above equations.

When representing the signals in digital form, the results are scaled and rounded, and offsets are typically added. For example, the scaling and offset applied to the Y′ component per specification (e.g. MPEG-2[1]) results in the value of 16 for black and the value of 235 for white when using an 8-bit representation. The standard has 8-bit digitized versions of CB and CR scaled to a different range of 16 to 240. Consequently, rescaling by the fraction (235-16)/(240-16) = 219/224 is sometimes required when doing color matrixing or processing in YCbCr space, resulting in quantization distortions when the subsequent processing is not performed using higher bit depths.

The scaling that results in the use of a smaller range of digital values than what might appear to be desirable for representation of the nominal range of the input data allows for some "overshoot" and "undershoot" during processing without necessitating undesirable clipping. This "head-room" and "toe-room" can also be used for extension of the nominal color gamut, as specified by xvYCC.

The value 235 accommodates a maximum black-to-white overshoot of 255 - 235 = 20, or 20 / ( 235 - 16 ) = 9.1%, which is slightly larger than the theoretical maximum overshoot (Gibbs' Phenomenon) of about 8.9% of the maximum step. The toe-room is smaller, allowing only 16 / 219 = 7.3% overshoot, which is less than the theoretical maximum overshoot of 8.9%.

Since the equations defining YCbCr are formed in a way that rotates the entire nominal RGB color cube and scales it to fit within a (larger) YCbCr color cube, there are some points within the YCbCr color cube that cannot be represented in the corresponding RGB domain (at least not within the nominal RGB range). This causes some difficulty in determining how to correctly interpret and display some YCbCr signals. These out-of-range YCbCr values are used by xvYCC to encode colors outside the BT.709 gamut.
여기서, KR, KG 및 KB는 통상적으로 대응하는 RGB 공간의 정의로부터 유도되고, {\ displaystyle K_ {R} + K_ {G} + K_ {B} = 1} + K_ {G} + K_ {B} = 1}이다. (동등한 행렬 조작은 종종 "색 행렬"이라고도합니다.)

여기에서 프라임 기호는 감마 보정이 사용되고 있음을 의미합니다. 따라서, R ', G'및 B '는 명목상 0 내지 1의 범위를 가지며, 0은 (예를 들어, 컬러 블랙의 디스플레이를위한) 최소 강도를 나타내고, 1은 (예를 들어, 컬러 화이트의 디스플레이를위한) 최대 강도를 나타낸다. 결과 루마 (Y) 값은 0에서 1까지의 공칭 범위를 가지며 채도 (PB 및 PR) 값은 공칭 범위 -0.5에서 +0.5까지입니다. 역변환 과정은 상기 방정식을 반전시킴으로써 쉽게 유도 될 수있다.

디지털 형식으로 신호를 나타낼 때 결과는 크기가 조정되고 반올림되며 일반적으로 오프셋이 추가됩니다. 예를 들어, 스펙 당 Y '컴포넌트에 적용된 스케일링 및 오프셋 (예 : MPEG-2 [1])은 8 비트 표현을 사용할 때 검정에 대해 16의 값을, 흰색에 대해 235의 값을 산출합니다. 표준에는 CB 및 CR의 8 비트 디지털화 된 버전이 16에서 240의 다른 범위로 조정됩니다. 따라서 색상 매트릭스를 수행 할 때 분수 (235-16) / (240-16) = 219/224로 재분석 할 때가 있습니다 또는 YCbCr 공간에서 처리함으로써, 후속 처리가 더 높은 비트 깊이를 사용하여 수행되지 않을 때 양자화 왜곡을 초래할 수있다.

입력 데이터의 공칭 범위를 나타내는 데 바람직한 것으로 보이는 것보다 작은 범위의 디지털 값을 사용하는 스케일링은 바람직하지 않은 클리핑을 필요로하지 않고 처리 중에 일부 "오버 슈트"및 "언더 슈트"를 허용합니다. 이 "head-room"및 "toe-room"은 xvYCC에 지정된 공칭 색상 영역의 확장에도 사용될 수 있습니다.

235 값은 255-235 = 20 또는 20 / (235-16) = 9.1 %의 최대 검정 / 흰색 오버 슛을 수용하며 이는 이론적 인 최대 오버 슛 (Gibbs '현상)의 약 8.9 %보다 약간 큽니다 최대 단계. 토우 룸은 작아서 이론적 인 최대 오버 슈트 인 8.9 %보다 적은 16/219 = 7.3 % 오버 슛을 허용합니다.

YCbCr을 정의하는 방정식은 공칭 RGB 색상 큐브 전체를 회전하고 (더 큰) YCbCr 색상 큐브에 맞도록 크기가 조정되므로 YCbCr 색상 큐브 내에 해당 RGB 도메인으로 표현할 수없는 점이 있습니다 (적어도 공칭 RGB 범위 내에 있지는 않음). 이로 인해 일부 YCbCr 신호를 올바르게 해석하고 표시하는 방법을 결정하는 데 약간의 어려움이 있습니다. 이러한 범위를 벗어나는 YCbCr 값은 xvYCC에서 BT.709 영역 외부의 색을 인코딩하는 데 사용됩니다.


YUV

참조: Link

YUV is a color encoding system typically used as part of a color image pipeline. It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, thereby typically enabling transmission errors or compression artifacts to be more efficiently masked by the human perception than using a "direct" RGB-representation. Other color encodings have similar properties, and the main reason to implement or investigate properties of Y′UV would be for interfacing with analog or digital television or photographic equipment that conforms to certain Y′UV standards.
YUV는 일반적으로 컬러 이미지 파이프 라인의 일부로 사용되는 컬러 인코딩 시스템입니다. 이는 인간의 인식을 고려한 컬러 이미지 또는 비디오를 인코딩하여 크로 미 넌스 구성 요소의 대역폭을 줄임으로써 전송 오류 또는 압축 아티팩트를 일반적으로 "직접"RGB 표현을 사용하는 것보다 인간의 인식으로보다 효율적으로 마스킹 할 수있게합니다. 다른 컬러 인코딩은 유사한 속성을 가지고 있으며 Y'UV의 속성을 구현하거나 조사하는 주된 이유는 특정 Y'UV 표준을 준수하는 아날로그 또는 디지털 TV 또는 사진 장비와 인터페이스하기위한 것입니다.

The scope of the terms Y′UV, YUV, YCbCr, YPbPr, etc., is sometimes ambiguous and overlapping. Historically, the terms YUV and Y′UV were used for a specific analog encoding of color information in television systems, while YCbCr was used for digital encoding of color information suited for video and still-image compression and transmission such as MPEG and JPEG. Today, the term YUV is commonly used in the computer industry to describe file-formats that are encoded using YCbCr.
용어 Y'UV, YUV, YCbCr, YPbPr 등의 범위는 때로는 모호하며 중복됩니다. 역사적으로, YUV 및 Y'UV는 텔레비전 시스템에서 컬러 정보의 특정 아날로그 인코딩에 사용되었고, YCbCr은 비디오 및 MPEG 및 JPEG와 같은 정지 이미지 압축 및 전송에 적합한 컬러 정보의 디지털 인코딩에 사용되었습니다. 오늘날 YUV라는 용어는 YCbCr을 사용하여 인코딩 된 파일 형식을 설명하기 위해 컴퓨터 업계에서 일반적으로 사용됩니다.

The Y′UV model defines a color space in terms of one luma (Y′) and two chrominance (UV) components. The Y′UV color model is used in the PAL composite color video (excluding PAL-N) standard. Previous black-and-white systems used only luma (Y′) information. Color information (U and V) was added separately via a sub-carrier so that a black-and-white receiver would still be able to receive and display a color picture transmission in the receiver's native black-and-white format.
Y'UV 모델은 하나의 휘도 (Y ') 및 2 개의 색차 (UV) 성분으로 색 공간을 정의합니다. Y'UV 컬러 모델은 PAL 합성 컬러 비디오 (PAL-N 제외) 표준에 사용됩니다. 이전의 흑백 시스템은 루마 (Y ') 정보 만 사용했습니다. 컬러 정보 (U 및 V)는 서브 캐리어를 통해 개별적으로 추가되어, 흑백 수신기는 여전히 수신기의 네이티브 흑백 포맷의 컬러 화상 전송을 수신하고 디스플레이 할 수있게됩니다.

Y′ stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y′ – the prime symbols (') denote gamma compression,[1] with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness.
Y '는 휘도 성분 (밝기)을 나타내며 U와 V는 색차 성분 (색)을 나타냅니다. 휘도는 Y로 표시되고 luma는 Y '로 표시됩니다. - 소수점 기호 (')는 감마 압축을 나타내며, '휘도'는 지각 (색 과학) 밝기를 의미하고 '루마'는 전자식 밝기입니다.

The YPbPr color model used in analog component video and its digital version YCbCr used in digital video are more or less derived from it, and are sometimes called Y′UV. (CB/PB and CR/PR are deviations from grey on blue–yellow and red–cyan axes, whereas U and V are blue–luminance and red–luminance differences respectively.) The Y′IQ color space used in the analog NTSC television broadcasting system is related to it, although in a more complex way. The YDbDr color space used in the analog SECAM and PAL-N television broadcasting systems, are also related.
아날로그 컴포넌트 비디오에 사용 된 YPbPr 컬러 모델디지털 비디오에 사용되는 YCbCr 디지털 버전은 다소 차이가 있으며 Y'UV라고도합니다. (CB / PB 및 CR / PR은 청색 - 황색 및 적색 - 시안 축상의 회색으로부터의 편차이고, U 및 V는 각각 청색 - 휘도 및 적색 - 휘도 차이이다.) 아날로그 NTSC 텔레비전에서 사용되는 Y'IQ 색 공간 방송 시스템은 좀 더 복잡한 방식으로 관련되어있다. 아날로그 SECAM 및 PAL-N 텔레비전 방송 시스템에 사용되는 YDbDr 색 공간 또한 관련되어 있습니다.

As for etymology, Y, Y′, U, and V are not abbreviations. The use of the letter Y for luminance can be traced back to the choice of XYZ primaries. This lends itself naturally to the usage of the same letter in luma (Y′), which approximates a perceptually uniform correlate of luminance. Likewise, U and V were chosen to differentiate the U and V axes from those in other spaces, such as the x and y chromaticity space. See the equations below or compare the historical development of the math.
어원에 관해서는 Y, Y ', U, V는 원래 단어를 축약한 것이 아닙니다. 휘도에 문자 Y를 사용하는 것은 XYZ 기본 색의 선택으로 거슬러 올라갈 수 있습니다. 이것은 휘도의 지각 적으로 일정한 상관 관계를 근사화하는 luma (Y ')에서 같은 문자를 사용하는 데 자연스럽게 적합합니다. 마찬가지로 U 및 V는 x 및 y 색도 공간과 같은 다른 공간의 U 및 V 축을 구분하기 위해 선택되었습니다. 아래의 방정식을 보거나 수학의 역사적 발전을 비교하십시오.

역사
Y′UV was invented when engineers wanted color television in a black-and-white infrastructure. They needed a signal transmission method that was compatible with black-and-white (B&W) TV while being able to add color. The luma component already existed as the black and white signal; they added the UV signal to this as a solution.

The UV representation of chrominance was chosen over straight R and B signals because U and V are color difference signals. In other words, the U and V signals tell the television to shift the color of a certain pixel without altering its brightness. Or the U and V signals tell the monitor to make one color brighter at the cost of the other and by how much it should be shifted. The higher the (or the lower when negative) the U and V values are, the more the saturated (colorful) the pixel gets. The closer the U and V values get to zero, the lesser it shifts the color meaning that the red, green and blue lights will be more equally bright, producing a greyer pixel. This is the benefit of using color difference signals, i.e. instead of telling how much red there is to a color, it tells by how much it is more red than green or blue. In turn this meant that when the U and V signals would be zero or absent, it would just display a greyscale image. If R and B were to have been used, these would have non-zero values even in a B&W scene, requiring all three data-carrying signals. This was important in the early days of color television, because old black and white TV signals had no U and V signals present, meaning the color TV would just display it as B&W TV out of the box. In addition, black and white receivers could take the Y′ signal and ignore the U- and V-color signals, making Y′UV backward-compatible with all existing black-and-white equipment, input and output. If the color-TV standard wouldn't have used color difference signals, it could mean a color TV would make funny colors out of a B&W broadcast or it would need additional circuitry to translate the B&W signal to color. It was necessary to assign a narrower bandwidth to the chrominance channel because there was no additional bandwidth available. If some of the luminance information arrived via the chrominance channel (as it would have if RB signals were used instead of differential UV signals), B&W resolution would have been compromised.
Y'UV는 엔지니어가 컬러 텔레비전을 흑백 인프라로 원할 때 발명되었습니다. 컬러를 추가 할 수있는 흑백 (B & W) TV와 호환되는 신호 전송 방법이 필요했습니다. 루마 성분은 이미 흑백 신호로 존재합니다. 그들은 솔루션에 자외선 신호를 추가했습니다.

U와 V는 색차 신호이기 때문에 직선의 R과 B 신호보다 색차의 UV 표현이 선택되었습니다. 즉, U 및 V 신호는 텔레비전에 밝기를 변경하지 않고 특정 픽셀의 색상을 이동 시키도록 지시합니다. 또는 U 및 V 신호는 모니터가 다른 색상의 비용으로 한 색상을 더 밝게 만들고 이동해야하는 정도를 알려줍니다. U 및 V 값이 높을수록 (또는 음수 일 때 더 낮아짐) 픽셀이 더 포화 된 (색상이 다양해질수록). U와 V 값이 0에 가까울수록 빨강, 녹색 및 파랑 조명이 더 밝아 져 회색 픽셀이 생성된다는 의미의 색상이 조금씩 이동합니다. 이는 색상 차이 신호를 사용하는 이점입니다. 즉, 색상에 빨간색이 얼마나 많은지 알려주지 않고 녹색 또는 파란색보다 더 많이 빨간색으로 표시합니다. 이것은 U 및 V 신호가 0이거나 없을 때 그레이 스케일 이미지 만 표시한다는 것을 의미합니다. R과 B를 사용하면 B & W 장면에서도 3 가지 데이터 운반 신호가 모두 필요하므로 0이 아닌 값을 갖게됩니다. 오래된 흑백 TV 신호에는 U 및 V 신호가 없으므로 컬러 TV 초기에는 중요했습니다. 즉, 컬러 TV는 B & W TV를 그대로 상자에 넣어 표시합니다. 또한 흑백 수신기는 Y '신호를 받아 U 및 V 색상 신호를 무시할 수 있으므로 기존의 모든 흑백 장비, 입력 및 출력과 Y'UV의 역 호환이 가능합니다. 컬러 TV 표준이 색차 신호를 사용하지 않는다면 컬러 TV가 흑백 방송에서 재미있는 색상을 만들거나 흑백 신호를 색상으로 변환하는 추가 회로가 필요하다는 것을 의미 할 수 있습니다. 사용 가능한 추가 대역폭이 없었기 때문에 색차 채널에 더 좁은 대역폭을 할당해야했습니다. 휘도 정보 중 일부가 색차 채널을 통해 도착한 경우 (차동 UV 신호 대신 RB 신호가 사용 된 것처럼) B & W 해상도가 손상되었을 수 있습니다.


Y'UV 는 RGB 와 서로 계산될 수 있다.
Y는 휘도
Y'는 루마
UV 는 색차

R, G, B 는 색의 값

그러면 왜 센서에서 바로 받은 값인 RGB를 사용하지 않고 Y'UV를 사용하느냐?


Conversion to/from RGB


Numerical approximations


Luminance/chrominance systems in general
The primary advantage of luma/chroma systems such as Y′UV, and its relatives Y′IQ and YDbDr, is that they remain compatible with black and white analog television (largely due to the work of Georges Valensi). The Y′ channel saves all the data recorded by black and white cameras, so it produces a signal suitable for reception on old monochrome displays. In this case, the U and V are simply discarded. If displaying color, all three channels are used, and the original RGB information can be decoded.
Y'UV 및 그 친척 Y'IQ 및 YDbDr과 같은 루마 / 크로마 시스템의 주요 이점은 흑백 아날로그 TV와 호환이 가능하다는 것입니다 (주로 Georges Valensi의 작업으로 인해). Y '채널은 흑백 카메라로 기록 된 모든 데이터를 저장하므로 오래된 흑백 디스플레이의 수신에 적합한 신호를 생성합니다. 이 경우 U와 V는 단순히 버려집니다. 색상을 표시하면 세 개의 채널이 모두 사용되고 원본 RGB 정보가 디코딩 될 수 있습니다.

Another advantage of Y′UV is that some of the information can be discarded in order to reduce bandwidth. The human eye has fairly little spatial sensitivity to color: the accuracy of the brightness information of the luminance channel has far more impact on the image detail discerned than that of the other two. Understanding this human shortcoming, standards such as NTSC and PAL reduce the bandwidth of the chrominance channels considerably. (Bandwidth is in the temporal domain, but this translates into the spatial domain as the image is scanned out.)
Y'UV의 또 다른 이점은 대역폭을 줄이기 위해 일부 정보를 삭제할 수 있다는 것입니다. 인간의 눈은 색에 대한 공간 감도가 거의 없습니다. 휘도 채널의 밝기 정보의 정확도는 다른 두 가지보다 더 세부적인 이미지 세부 사항에 훨씬 더 많은 영향을 미칩니다. NTSC 및 PAL과 같은 표준에서는 이러한 인간적인 단점을 이해하여 색차 채널의 대역폭을 상당히 줄입니다. (대역폭은 시간 영역에 있지만 이미지가 스캔되면 공간 영역으로 변환됩니다.)

Therefore, the resulting U and V signals can be substantially "compressed". In the NTSC (Y′IQ) and PAL systems, the chrominance signals had significantly narrower bandwidth than that for the luminance. Early versions of NTSC rapidly alternated between particular colors in identical image areas to make them appear adding up to each other to the human eye, while all modern analogue and even most digital video standards use chroma subsampling by recording a picture's color information at reduced resolution. Only half the horizontal resolution compared to the brightness information is kept (termed 4:2:2 chroma subsampling), and often the vertical resolution is also halved (giving 4:2:0). The 4:x:x standard was adopted due to the very earliest color NTSC standard which used a chroma subsampling of 4:1:1 (where the horizontal color resolution is quartered while the vertical is full resolution) so that the picture carried only a quarter as much color resolution compared to brightness resolution. Today, only high-end equipment processing uncompressed signals uses a chroma subsampling of 4:4:4 with identical resolution for both brightness and color information.
따라서, 결과적인 U 및 V 신호는 실질적으로 "압축"될 수있다. NTSC (Y'IQ) 및 PAL 시스템에서 색차 신호는 휘도보다 신호 대역폭이 상당히 좁습니다. 초기 버전의 NTSC는 동일한 이미지 영역에서 특정 색상을 신속하게 번갈아 가며 서로 눈을 가깝게 보이게하는 반면 현대의 모든 아날로그 및 대부분의 디지털 비디오 표준은 축소 된 해상도로 사진의 색상 정보를 기록하여 크로마 하위 샘플링을 사용합니다. 밝기 정보에 비해 수평 해상도의 절반 만 유지됩니다 (4 : 2 : 2 크로마 하위 샘플링이라고 함). 종종 수직 해상도도 절반으로 감소합니다 (4 : 2 : 0 제공). 4 : 1 : 1의 크로마 서브 샘플링을 사용하는 가장 초기의 컬러 NTSC 표준 (가로 해상도는 4 배, 세로 해상도는 4 등분)으로 인해 4 : x : x 표준이 채택되었습니다. 밝기 해상도보다 4 분의 1 컬러 해상도. 오늘날, 비 압축 신호를 처리하는 고급 장비 만이 밝기 및 색상 정보 모두에 대해 동일한 해상도로 4 : 4 : 4의 채도 서브 샘플링을 사용합니다.

The I and Q axes were chosen according to bandwidth needed by human vision, one axis being that requiring the most bandwidth, and the other (fortuitously at 90 degrees) the minimum. However, true I and Q demodulation was relatively more complex, requiring two analog delay lines, and NTSC receivers rarely used it.
I 및 Q 축은 인간의 시력에 필요한 대역폭에 따라 선택되었으며, 한 축은 가장 많은 대역폭을 필요로하고, 다른 축은 (최소 90도에서 우연히) 최소값을 필요로합니다. 그러나 사실 I 및 Q 복조는 상대적으로 더 복잡하여 두 개의 아날로그 지연 라인이 필요했으며 NTSC 리시버는 거의 사용하지 않았습니다.

However, this color space conversion is lossy, particularly obvious in crosstalk from the luma to the chroma-carrying wire, and vice versa, in analogue equipment (including RCA connectors to transfer a digital signal, as all they carry is analogue composite video, which is either YUV, YIQ, or even CVBS). Furthermore, NTSC and PAL encoded color signals in a manner that causes high bandwidth chroma and luma signals to mix with each other in a bid to maintain backward compatibility with black and white television equipment, which results in dot crawl and cross color artifacts. When the NTSC standard was created in the 1950s, this was not a real concern since the quality of the image was limited by the monitor equipment, not the limited-bandwidth signal being received. However today′s modern television is capable of displaying more information than is contained in these lossy signals. To keep pace with the abilities of new display technologies, attempts were made since the late 1970s to preserve more of the Y′UV signal while transferring images, such as SCART (1977) and S-Video (1987) connectors.
그러나이 색 공간 변환은 손실이 많습니다. 아날로그 장비 (디지털 신호를 전송하는 RCA 커넥터 포함, 루마에서 크로마 전송 와이어로의 크로스 토크에서 특히나 그 반대의 경우도 마찬가지 임)는 아날로그 합성 비디오입니다. YUV, YIQ 또는 CVBS 임). 또한 NTSC 및 PAL은 고 대역폭 크로마 및 루마 신호가 흑백 TV 장비와의 역 호환성을 유지하기 위해 서로 섞여서 도트 크롤 및 크로스 컬러 아티팩트를 발생시키는 방식으로 색상 신호를 인코딩했습니다. 1950 년대에 NTSC 표준이 만들어 졌을 때 이미지의 품질이 제한된 대역폭 신호가 아닌 모니터 장비에 의해 제한 되었기 때문에 이것은 실제 관심사가 아니 었습니다. 그러나 오늘날의 현대 TV는 이러한 손실 신호에 포함 된 것보다 많은 정보를 표시 할 수 있습니다. 새로운 디스플레이 기술의 능력에 발 맞추어 1970 년대 말 SCART (1977) 및 S-Video (1987) 커넥터와 같은 이미지를 전송하는 동안 Y'UV 신호를 더 많이 보존하려는 시도가있었습니다.

Instead of Y′UV, Y′CbCr was used as the standard format for (digital) common video compression algorithms such as MPEG-2. Digital television and DVDs preserve their compressed video streams in the MPEG-2 format, which uses a full Y′CbCr color space, although retaining the established process of chroma subsampling. The professional CCIR 601 digital video format also uses Y′CbCr at the common chroma subsampling rate of 4:2:2, primarily for compatibility with previous analog video standards. This stream can be easily mixed into any output format needed.
Y'UV 대신 Y'CbCr이 MPEG-2와 같은 (디지털) 공통 비디오 압축 알고리즘의 표준 형식으로 사용되었습니다. 디지털 텔레비전과 DVD는 압축 된 비디오 스트림을 MPEG-2 형식으로 보존합니다.이 형식은 확립 된 채도 서브 샘플링 프로세스를 유지하면서도 전체 Y'CbCr 색 공간을 사용합니다. 전문가 용 CCIR 601 디지털 비디오 형식은 이전 아날로그 비디오 표준과의 호환성을 위해 4 : 2 : 2의 공통 크로마 하위 샘플링 속도로 Y'CbCr을 사용합니다. 이 스트림은 필요한 모든 출력 형식으로 쉽게 혼합 될 수 있습니다.

Y′UV is not an absolute color space. It is a way of encoding RGB information, and the actual color displayed depends on the actual RGB colorants used to display the signal. Therefore, a value expressed as Y′UV is only predictable if standard RGB colorants are used (i.e. a fixed set of primary chromaticities, or particular set of red, green, and blue).
Y'UV는 절대 색 공간이 아닙니다. 이것은 RGB 정보를 인코딩하는 방법이며, 실제 표시되는 색은 신호를 표시하는 데 사용되는 실제 RGB 색소에 따라 다릅니다. 따라서,  Y'UV로 표현 된 값은 표준 RGB 색소가 사용되는 경우 (즉, 1 차 색도의 고정 된 세트 또는 적색, 녹색 및 청색의 특정 세트) 에만 예측 가능합니다.

Furthermore, the range of colors and brightnesses (known as the color gamut) of RGB (whether it be BT.601 or Rec.709) is far smaller than the range of colors and brightnesses allowed by Y′UV. This can be very important when converting from Y′UV (or Y′CbCr) to RGB, since the formulas above can produce "invalid" RGB values – i.e., values below 0% or very far above 100% of the range (e.g., outside the standard 16–235 luma range (and 16–240 chroma range) for TVs and HD content, or outside 0–255 for standard definition on PCs). Unless these values are dealt with they will usually be "clipped" (i.e., limited) to the valid range of the channel affected. This changes the hue of the color, which is very undesirable, so it is therefore often considered better to desaturate the offending colors such that they fall within the RGB gamut.[9] Likewise, when RGB at a given bit depth is converted to YUV at the same bit depth, several RGB colors can become the same Y′UV color, resulting in information loss.
또한 RGB (BT.601이든 Rec.709이든)의 색상과 밝기 (색상 영역으로 알려짐)의 범위는 Y'UV가 허용하는 색상 및 밝기의 범위보다 훨씬 작습니다. 위의 공식은 범위의 0 % 이하 또는 100 %를 훨씬 초과하는 값 (예 : 0 %)을 생성 할 수 있기 때문에 Y'UV (또는 Y'CbCr)에서 RGB로 변환 할 때 매우 중요 할 수 있습니다. TV 및 HD 컨텐츠의 표준 16-235 루마 범위 (및 16-240 크로마 범위)를 벗어나거나 PC의 표준 정의를위한 0-255 범위를 벗어납니다. 이 값을 처리하지 않으면 영향을받는 채널의 유효 범위에 대해 일반적으로 "클리핑"(즉, 제한)됩니다. 이렇게하면 색상의 색조가 바뀌므로 매우 바람직하지 않습니다. 따라서 RGB 색상 영역에 해당하는 색상을 채도 감소시키는 것이 더 좋습니다. [9] 마찬가지로 특정 비트 심도의 RGB가 동일한 비트 심도에서 YUV로 변환되면 여러 RGB 색상이 동일한 Y'UV 색상이되어 정보가 손실 될 수 있습니다.


Relation with Y′CbCr
Y′UV is often used as a term for YCbCr. However, they are completely different formats with different scale factors.
Y'UV는 종종 YCbCr의 용어로 사용됩니다. 그러나, 그들은 다른 스케일 팩터와 완전히 다른 포맷입니다.

Nevertheless, the relationship between them in the standard case is simple. In particular, the Y channel is the same in both, both Cb and U are proportional to (B-Y), and both Cr and V are proportional to (R-Y).
그럼에도 불구하고, 표준 경우에 그들 사이의 관계는 간단합니다. 특히 Y 채널은 둘 다 동일하며 Cb와 U는 (B-Y)에 비례하고 Cr과 V는 (R-Y)에 비례합니다.


Types of sampling


Converting between Y′UV and RGB



Y′UV444 to RGB888 conversion
Y′UV420p is a planar format, meaning that the Y′, U, and V values are grouped together instead of interspersed. The reason for this is that by grouping the U and V values together, the image becomes much more compressible. When given an array of an image in the Y′UV420p format, all the Y′ values come first, followed by all the U values, followed finally by all the V values.

The Y′V12 format is essentially the same as Y′UV420p, but it has the U and V data switched: the Y′ values are followed by the V values, with the U values last. As long as care is taken to extract U and V values from the proper locations, both Y′UV420p and Y′V12 can be processed using the same algorithm.

As with most Y′UV formats, there are as many Y′ values as there are pixels. Where X equals the height multiplied by the width, the first X indices in the array are Y′ values that correspond to each individual pixel. However, there are only one fourth as many U and V values. The U and V values correspond to each 2 by 2 block of the image, meaning each U and V entry applies to four pixels. After the Y′ values, the next X/4 indices are the U values for each 2 by 2 block, and the next X/4 indices after that are the V values that also apply to each 2 by 2 block.

Translating Y′UV420p to RGB is a more involved process compared to the previous formats. Lookup of the Y′, U and V values can be done using the following method:
Y'UV420p는 평면 형식이므로 Y ', U 및 V 값이 산재되어있는 대신 함께 그룹화됩니다. 그 이유는 U와 V 값을 함께 그룹화하면 이미지가 훨씬 압축 될 수 있기 때문입니다. Y'UV420p 형식의 이미지 배열이 주어지면 모든 Y 값이 먼저오고 그 다음에는 모든 U 값이옵니다. 마지막으로 모든 V 값이옵니다.

Y'V12 형식은 기본적으로 Y'UV420p와 동일하지만 U 및 V 데이터가 전환됩니다. Y 값 뒤에는 V 값이 나오고 U 값이 마지막에옵니다. 올바른 위치에서 U 및 V 값을 추출하는 데주의를 기울이는 한 동일한 알고리즘을 사용하여 Y'UV420p 및 Y'V12를 모두 처리 할 수 ​​있습니다.

대부분의 Y'UV 형식과 마찬가지로 픽셀만큼 많은 Y '값이 있습니다. X가 높이에 폭을 곱한 값인 경우 배열의 첫 번째 X 인덱스는 각 픽셀에 해당하는 Y '값입니다. 그러나 U와 V 값이 4 분의 1에 불과합니다. U 및 V 값은 이미지의 각 2 x 2 블록에 해당합니다. 즉, 각 U 및 V 항목은 4 개의 픽셀에 적용됩니다. Y '값 다음에 다음 X / 4 인덱스는 각 2 x 2 블록에 대한 U 값이고 그 다음 X / 4 인덱스는 각 2 x 2 블록에도 적용되는 V 값입니다.

Y'UV420p를 RGB로 변환하는 것은 이전 형식에 비해 더 복잡한 프로세스입니다. Y ', U 및 V 값의 검색은 다음 방법을 사용하여 수행 할 수 있습니다.
Y'UV420p는 평면 형식이므로 Y ', U 및 V 값이 산재되어있는 대신 함께 그룹화됩니다. 그 이유는 U와 V 값을 함께 그룹화하면 이미지가 훨씬 압축 될 수 있기 때문입니다. Y'UV420p 형식의 이미지 배열이 주어지면 모든 Y 값이 먼저오고 그 다음에는 모든 U 값이옵니다. 마지막으로 모든 V 값이옵니다.

Y'V12 형식은 기본적으로 Y'UV420p와 동일하지만 U 및 V 데이터가 전환됩니다. Y 값 뒤에는 V 값이 나오고 U 값이 마지막에옵니다. 올바른 위치에서 U 및 V 값을 추출하는 데주의를 기울이는 한 동일한 알고리즘을 사용하여 Y'UV420p 및 Y'V12를 모두 처리 할 수 ​​있습니다.

대부분의 Y'UV 형식과 마찬가지로 픽셀만큼 많은 Y '값이 있습니다. X가 높이에 폭을 곱한 값인 경우 배열의 첫 번째 X 인덱스는 각 픽셀에 해당하는 Y '값입니다. 그러나 U와 V 값이 4 분의 1에 불과합니다. U 및 V 값은 이미지의 각 2 x 2 블록에 해당합니다. 즉, 각 U 및 V 항목은 4 개의 픽셀에 적용됩니다. Y '값 다음에 다음 X / 4 인덱스는 각 2 x 2 블록에 대한 U 값이고 그 다음 X / 4 인덱스는 각 2 x 2 블록에도 적용되는 V 값입니다.

Y'UV420p를 RGB로 변환하는 것은 이전 형식에 비해 더 복잡한 프로세스입니다. Y ', U 및 V 값의 검색은 다음 방법을 사용하여 수행 할 수 있습니다.


2017년 11월 23일 목요일

kiss goodbye

Baby不要再哭泣 這一幕多麼熟
Baby bu yao zai ku qi, zhe yi mu duo yao shou xi
Baby, don't cry anymore, this scene is so familiar

緊握著妳的手彼此 都捨不得分
jin wo zhao ni de shou bi ci, dou she bu de fen chi
Tightly holding your hand, we are both unwilling to separate
緊: 진할 진
握: 쥘 악
著: 나타날 저
妳: 너 니
的: 관형어 뒤에 쓰여, 관형어와 중심어 사이가 종속 관계임을 나타냄
手: 손 수
彼: 저 피
此: 이 차

都: 모두
捨: 버릴 사
不: 아닐 부
得: 얻을 득
分: 나눌 분
離: 떠날 리


此: 서로
不得: 얻을 수 없다, Bùdé
離: 분리 된, Fēnlí不得離: 분리 없다.

每一次想開口 但不如保持安靜
mei yi ci xiang kai kou dan bu ru bao chi an jing
Every time I want to say something I instead preserve the silence

給我一分鐘專心好好欣賞妳的
gei wo yi fen zhong zhuan xin, hao hao xin shang ni de mei
Give me a minute to concentrate on admiring your beauty


幸福搭配悲傷 同時在我心交叉
xing fu da pei bei shang, tong shi zai wo xin jiao cha
Happiness complements sorrow, crossing paths within my heart at the same time

挫折的眼淚不能測試愛的重量
cuo zhe de yan lei bu neng ce shi ai de zhong liang
Tears of frustration cannot measure the weight of love

付出的愛收不回 還欠妳的我不能
fu chu de ai shou bu hui, hai qian ni de wo bu neng gei
I can’t withdraw the love I already gave and I can't give you all the love I owe you 

別把我心也帶走去跟隨
bie ba wo xin ye dai zou, qu gen sui
Don't take along my heart to follow you


*
每一次和妳分開 深深地被妳打
mei yi ci he ni fen kai, shen shen de bei ni da bai
Every time we part ways, I am deeply defeated by you

每一次放棄妳的溫柔 痛苦難以釋懷
mei yi ci fang qi ni de wen rou, tong ku nan yi shi huai
Every time I give up your tenderness, it is hard to release my pain 

每一次和妳分開 每一次Kiss You Goodbye
mei yi ci he ni fen kai, mei yi ci kiss you Goodbye
Every time we part ways, Every time I kiss you goodbye

愛情的滋味此刻我終於最明白
ai qing de zi wei ci ke wo zhong yu zui ming bai (wo zhong yu ming bai)
at that moment I finally fully understand the taste of love


幸福搭配悲傷 同時在我心交叉
xing fu da pei bei shang, tong shi zai wo xin jiao cha
Happiness complements sorrow, crossing paths within my heart at the same time

挫折的眼淚不能測試愛的重量
cuo zhe de yan lei bu neng ce shi ai de zhong liang
Tears of frustration cannot measure the weight of love 

付出的愛收不回 還欠妳的我不能
fu chu de ai shou bu hui, dan qian ni de wo bu neng gei
I cannot withdraw the love I already gave and I can't give you all the love I owe you

我才明白愛最真實的滋
wo cai ming bai ai zui zhen shi de zi wei
I finally understand the truest taste of love

2017년 11월 19일 일요일

Compiler 관련

Compiler: LX51

Segment
Prefix
Memory
Class
Description
?BA?DATABit-addressable data in internal data memory
?BI?BITBit data in internal data memory
?CO?CONSTConstant data in program memory
?DT?DATADATA memory
?FC?HCONSTFar constant data in program memory
?FD?HDATAHDATA memory for far variables
?ID?IDATAIDATA memory
?PD?XDATAPaged data in XDATA memory
?PR?CODEExecutable program code
?PR?ECODEExecutable program code in far memory
?XD?XDATAXDATA memory

Example
    - PDATA (first 256 bytes of XDATA)
    - Link

.m51 file

ACTIVE MEMORY CLASSES OF MODULE:  SERDES_CTL_SW_NIOCAM_RELIABILITY_UART_PROGRAM_171114.OMF.CRBUILD (EXTINT)

BASE        START       END         USED      MEMORY CLASS
LX51 LINKER/LOCATER V4.66.30.0                         11/20/2017  10:47:23  PAGE 2
==========================================================
C:000000H   C:000000H   C:003FFEH   00111CH   CODE
C:000000H   C:000000H   C:003FFEH   000E3CH   CONST
C:000000H   C:000000H   C:003FFEH             ECODE

B00:0000H   C:000000H   C:003FFEH             HCONST

X:000000H   X:000000H   X:0007FFH   0000C1H   XDATA
X:000000H   X:000000H   X:0007FFH             HDATA

I:000020H.0 I:000020H.0 I:00002FH.7 000000H.5 BIT
I:000000H   I:000000H   I:00007FH   000032H   DATA
I:000000H   I:000000H   I:0000FFH   000001H   IDATA

CODE: 111C hex를 사용 4380 byte
CONST: E3C hex를 사용 3644 byte
XDATA: C1 hex 를 사용 193 byte

XDATA는 내가 직접 선언해서 쓸 수 있다(directly)

그 외의
DATA 는 모두 Internal DATA(Internal RAM) 으로 각 심볼마다 어떤 
메모리를 사용했는지 알 수 있다.

2017년 11월 18일 토요일

Color space and bits per pixel

Color model name describes the video color representation. YIQ was used in NTSC television. It corresponds closely to the YUV scheme used in NTSC and PAL television and the YDbDr scheme used by SECAM television.
색상 모델 이름은 비디오 색상 표현을 설명합니다. YIQ는 NTSC 텔레비전에서 사용되었습니다. NTSC 및 PAL TV에서 사용되는 YUV 체계 및 SECAM 텔레비전에서 사용되는 YDbDr 체계와 밀접하게 일치합니다.

The number of distinct colors a pixel can represent depends on the number of bits per pixel (bpp). A common way to reduce the amount of data required in digital video is by chroma subsampling (e.g., 4:4:4, 4:2:2, 4:2:0/4:1:1). Because the human eye is less sensitive to details in color than brightness, the luminance data for all pixels is maintained, while the chrominance data is averaged for a number of pixels in a block and that same value is used for all of them. For example, this results in a 50% reduction in chrominance data using 2 pixel blocks (4:2:2) or 75% using 4 pixel blocks(4:2:0). This process does not reduce the number of possible color values that can be displayed, it reduces the number of distinct points at which the color changes.
픽셀이 표현할 수있는 고유 한 색상의 수는 픽셀 당 비트 수 (bpp)에 따라 다릅니다. 디지털 비디오에 필요한 데이터의 양을 줄이는 일반적인 방법은 크로마 하위 샘플링 (예 : 4 : 4 : 4, 4 : 2 : 2, 4 : 2 : 0/4 : 1 : 1)입니다. 인간의 눈은 밝기보다 색의 디테일에 덜 민감하기 때문에 모든 픽셀의 휘도 데이터가 유지되고 블록의 픽셀 수에 대해 색차 데이터가 평균화되고 모든 값에 동일한 값이 사용됩니다. 예를 들어, 2 픽셀 블록 (4 : 2 : 2) 또는 4 픽셀 블록 (4 : 2 : 0)을 사용하는 75 %를 사용하여 색차 데이터를 50 % 감소시킵니다. 이 프로세스는 표시 할 수있는 가능한 색상 값의 수를 줄이지 않으며 색상이 변하는 고유 한 포인트의 수를 줄입니다.

NTSC: YIQ
NTSC, PAL: YUV
SECAM: YDbDr

Terminology
Chroma: 채도
luminance: 휘도
-> 일정한 범위를 가진 광원(光源)의 광도(光度)를, 그 광원의 면적으로 나눈 양. 그 자체가 발광하고 있는 광원뿐만 아니라, 조명되어 빛나는 2차적인 광원에 대해서도 밝기를 나타내는 양으로 쓴다.
다만 이와 같은 정의는 광원의 면과 수직인 방향에서 관찰했을 때의 휘도이고, 광원의 면을 비스듬한 방향에서 본 경우는 그 방향에서 본 겉보기의 면적으로 나눈다.
YUV:


The Components of Color
Hue, Chroma, Value, Temperature
Link

Chroma subsampling
Link

YUV: Link
Y: luminance(휘도, 광원의 단위 면적당 밝기의 정도)
UV: chrominance(색차, 임의의 색과 그 색과 같은 휘도를 가진 기준색과의 차로, 색차 신호로서 얻어진다.)
 -> U = B′ − Y′ (blue − luma).
 -> V = R′ − Y′ (red − luma).

YCbCr: Link
Y: 휘도 성분
Cb: 색차 성분
Cr: 색차 성분
RGB 정보를 인코딩 하는 방식


참조 Why YUV is preferred over RGB

YCbCr is a consumer video format and this is the way HD is encoded. RGB is the traditional computer format. One is not superior to the other because each has it's own strengths and weaknesses.
CbCr은 소비자 비디오 형식이며 이것이 HD가 인코딩되는 방식입니다. RGB는 전통적인 컴퓨터 형식입니다. 하나는 자기 자신의 강점과 약점을 가지고 있기 때문에 다른 하나보다 우월하지 않습니다.

YCbCr is preferred because it is the native format. However many displays (almost all DVI inputs) only except RGB. If your display is HDMI it will likely except YCbCr if not switch to RGB. Auto should use YCbCr whenever possible. YCbCr is the digital counterpart to analog YPbPr component video. (YCbCr converted to analog is YPbPr). Digital RGB converted to analog is usually referred to as VGA. SD and HD DVDs are encoded in 8bit YCbCr 4:2:0. After/during decoding it's upsampled to YCbCr 4:2:2. If RGB output is required the YCbCr is upsampled again to 4:4:4 (sometimes done only once 4:2:0 -> 4:4:4) and a standard and simple transform converts to RGB 4:4:4. If done properly, you'll never notice the difference between the two. The advantage of YCbCr 4:2:2 is that it can be sent as 10bit (or 12bit) video via HDMI (all versions). RGB 4:4:4 is restricted to 8bit (except for the new deep color formats). However, if your display takes 8bit video and then upsamples to 10bit or higher for display, you may only need 8bit video. RGB is also the only format used with DVI(with a few exceptions).
YCbCr이 기본 형식이기 때문에 YCbCr이 좋습니다. 그러나 RGB를 제외한 많은 디스플레이 (거의 모든 DVI 입력). 디스플레이가 HDMI 인 경우 RGB로 전환하지 않으면 YCbCr을 제외 할 가능성이 높습니다. 가능한 경우 자동으로 YCbCr을 사용해야합니다. YCbCr은 아날로그 YPbPr 컴포넌트 비디오의 디지털 대응 물입니다. (아날로그로 변환 된 YCbCr은 YPbPr 임). 아날로그로 변환 된 디지털 RGB는 일반적으로 VGA라고합니다. SD 및 HD DVD는 8 비트 YCbCr 4 : 2 : 0으로 인코딩됩니다. 디코딩 중 / 디코딩 중 YCbCr 4 : 2 : 2로 업 샘플링됩니다. RGB 출력이 필요한 경우 YCbCr은 다시 4 : 4 : 4로 업 샘플링되며 (때때로 4 : 2 : 0 -> 4 : 4 : 4 한 번만 수행됨) 표준 및 단순 변환이 RGB 4 : 4 : 4로 변환됩니다. 제대로 완료되면 두 가지의 차이를 알 수 없습니다. YCbCr 4 : 2 : 2의 이점은 HDMI (모든 버전)를 통해 10 비트 (또는 12 비트) 비디오로 전송 될 수 있다는 것입니다. RGB 4 : 4 : 4는 8 비트로 제한됩니다 (새로운 짙은 색상 형식 제외). 그러나 디스플레이가 8 비트 비디오를 취한 다음 디스플레이를 위해 10 비트 이상으로 업 샘플링하면 8 비트 비디오 만 필요할 수 있습니다. RGB는 DVI와 함께 사용되는 유일한 형식이기도합니다 (몇 가지 예외가 있음).

YUV is a color spacetypically used as part of a color image pipeline.It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, thereby typically enabling transmission errors or compression artifacts to be more efficiently masked by the human perception than using a "direct"RGB-representation. Other color spaces have similar properties, and the main reason to implement or investigate properties of Y'UV would be for interfacing with analog or digital television or photographic equipment that conforms to certain Y'UV standards.
YUV는 컬러 이미지 파이프 라인의 일부로 공간적으로 사용되는 컬러입니다. 이는 인간의 인식을 고려한 컬러 이미지 또는 비디오를 인코딩하므로 크로 미 넌스 구성 요소의 대역폭이 줄어들어 일반적으로 전송 오류 또는 압축 아티팩트가 인간에 의해보다 효율적으로 가려집니다 "직접적인"RGB 표현을 사용하는 것보다 다른 색 공간은 유사한 속성을 가지고 있으며 Y'UV의 속성을 구현하거나 조사하는 주요 이유는 특정 Y'UV 표준을 준수하는 아날로그 또는 디지털 TV 또는 사진 장비와 인터페이스하기위한 것입니다.

The scope of the terms Y'UV, YUV, YCbCr ,YPbPr , etc., is sometimes ambiguous andoverlapping. Historically, the terms YUV and Y'UV were used for a specific analog encoding of color information in television systems, while YCbCr was used for digital encoding of color information suited for video and still-image compression and transmission such as MPEG and JPEG. Today, the term YUV is commonly used in the computer industry to describe file-formats that are encoded using YCbCr. The Y'UV model defines a color space in terms of one luma(Y') and two chrominance (UV) components. The Y'UV color model is used in the PAL and SECAM composite color video standards. Previous black-and-white systems used only luma (Y')information. Color information (U and V) was added separately via a sub-carrier  so that a black-and-white receiver would still be able to receive and display a color picture transmission in the receiver's native  black-and-white format. Y' stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y' – the prime symbols (')denote gamma compression, with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness
용어 Y'UV, YUV, YCbCr, YPbPr 등의 범위는 때로는 모호하고 중복됩니다. 역사적으로, YUV 및 Y'UV는 텔레비전 시스템에서 컬러 정보의 특정 아날로그 인코딩에 사용되었고, YCbCr은 비디오 및 MPEG 및 JPEG와 같은 정지 이미지 압축 및 전송에 적합한 컬러 정보의 디지털 인코딩에 사용되었습니다. 오늘날 YUV라는 용어는 YCbCr을 사용하여 인코딩 된 파일 형식을 설명하기 위해 컴퓨터 업계에서 일반적으로 사용됩니다. Y'UV 모델은 하나의 휘도 (Y ') 및 2 개의 색차 (UV) 성분으로 색 공간을 정의합니다. Y'UV 컬러 모델은 PAL 및 SECAM 합성 컬러 비디오 표준에 사용됩니다. 이전의 흑백 시스템은 루마 (Y ') 정보 만 사용했습니다. 컬러 정보 (U 및 V)는 서브 캐리어를 통해 개별적으로 추가되어, 흑백 수신기는 여전히 수신기의 네이티브 흑백 포맷의 컬러 화상 전송을 수신하고 디스플레이 할 수있게된다. Y '는 휘도 성분 (밝기)을 나타내고 U 및 V는 색차 성분 (색)을 나타냅니다. 

휘도는 Y로 표시하고"휘도"는 지각 (색 과학) 밝기를 의미,
luma는 Y '로 표시 - 프라임 기호 (')는 감마 압축을 나타내며, "루마"는 전자 (표시의 전압) 밝기