KR101889942B1 - Apparatus and method for controlling video processing unit - Google Patents

Apparatus and method for controlling video processing unit Download PDF

Info

Publication number
KR101889942B1
KR101889942B1 KR1020170154298A KR20170154298A KR101889942B1 KR 101889942 B1 KR101889942 B1 KR 101889942B1 KR 1020170154298 A KR1020170154298 A KR 1020170154298A KR 20170154298 A KR20170154298 A KR 20170154298A KR 101889942 B1 KR101889942 B1 KR 101889942B1
Authority
KR
South Korea
Prior art keywords
vpu
driver
application
function
memory
Prior art date
Application number
KR1020170154298A
Other languages
Korean (ko)
Inventor
김민성
박영규
신재혁
Original Assignee
(주)위아데브
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by (주)위아데브 filed Critical (주)위아데브
Priority to KR1020170154298A priority Critical patent/KR101889942B1/en
Application granted granted Critical
Publication of KR101889942B1 publication Critical patent/KR101889942B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

The present invention relates to a device and a method for controlling a video processing unit (VPU), and more particularly, to a device including a VPU operated in an operating system, which is Windows Embedded Compact 2013 or Windows Embedded Compact 7. To this end, the present invention is to provide a VPU driver for controlling a VPU under an operating system of Windows Embedded Compact 2013 and Windows Embedded Compact 7. According to an aspect of the present invention, the device for controlling a VPU comprises an application which is executed in any one operating system of Windows Embedded Compact 2013 and Windows Embedded Compact 7; and a VPU driver which is a stream driver communicating with the application to control an operation of a VPU.

Description

비디오 처리 유닛을 제어하는 장치 및 방법{Apparatus and method for controlling video processing unit} [0001] Apparatus and method for controlling a video processing unit [0002]

비디오 처리 유닛을 제어하는 장치 및 방법에 관한 것으로, Windows Embedded Compact 2013 또는 Windows Embedded Compact 7인 운영체제에서 동작하는 비디오 처리 유닛을 포함하는 장치 및 방법에 관한 것이다.And more particularly, to an apparatus and a method including a video processing unit operating in an operating system such as Windows Embedded Compact 2013 or Windows Embedded Compact 7.

Android와 Linux 운영체제의 경우는 VPU 드라이버가 제공되고 그 드라이버를 이용한 비디오 디코딩과 인코딩을 위한 코덱이 NXP 사에서 제공되고 있다.For Android and Linux operating systems, a VPU driver is provided, and codecs for video decoding and encoding using the driver are provided by NXP.

하지만 Windows Embedded Compact 2013 운영체제용 VPU 드라이버는 없으며, 그것을 이용한 코덱은 제공되지 않고 있다. However, there is no VPU driver for the Windows Embedded Compact 2013 operating system, and codecs using it are not available.

Windows Embedded Compact 2013 및 Windows Embedded Compact 7 운영체제는 마이크로소프트 사의 실시간 운영체제의 최신 버전이고 안정성과 실시간성이 우수한 운영체제이다. Windows Embedded Compact 2013 및 Windows Embedded Compact 7 운영체제는 빠른 부팅을 가능하게 하고, 운영체제 자체 용량이 작아서 여러 산업 분야에서 이용되고 있다.The Windows Embedded Compact 2013 and Windows Embedded Compact 7 operating systems are the latest versions of Microsoft's real-time operating system and are highly reliable and real-time operating systems. The Windows Embedded Compact 2013 and Windows Embedded Compact 7 operating systems enable fast booting and are used in a variety of industries due to the small operating system capacity.

따라서, Windows Embedded Compact 2013 및 Windows Embedded Compact 7 운영체제하에서 VPU를 제어하기 위한 VPU 드라이버를 제공할 필요가 있다.Therefore, it is necessary to provide a VPU driver for controlling VPU under Windows Embedded Compact 2013 and Windows Embedded Compact 7 operating system.

제안된 발명이 해결하고자 하는 하나의 과제는 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 운영체제하에서 VPU를 제어하기 위한 VPU 드라이버를 제공하는 것이다.One challenge for the proposed invention is to provide a VPU driver for controlling the VPU under Windows Embedded Compact 2013 and Windows Embedded Compact 7 operating systems.

한편, 본 발명이 이루고자 하는 기술적 과제는 이상에서 언급한 기술적 과제로 제한되지 않으며, 이하에서 설명할 내용으로부터 통상의 기술자에게 자명한 범위 내에서 다양한 기술적 과제가 포함될 수 있다.It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are intended to provide further explanation of the invention as claimed.

일 양상에 있어서, 비디오 처리 유닛을 제어하는 장치는 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 중 어느 하나인 운영체제에서 실행되는 어플리케이션; 상기 어플리케이션과 통신하여 VPU(Video Processing Unit)의 동작을 제어하는 스트림 드라이버인 VPU 드라이버;를 포함한다.In an aspect, an apparatus for controlling a video processing unit is an application running on an operating system that is either Windows Embedded Compact 2013 or Windows Embedded Compact 7; And a VPU driver that is a stream driver that controls the operation of a VPU (Video Processing Unit) by communicating with the application.

다른 양상에 있어서, 상기 어플리케이션은 동영상 재생, 녹화 중 적어도 하나를 포함하는 작업에 따라 VPU 드라이버로 초기화 명령을 전송하고, VPU 드라이버는 VPU의 전원을 공급하고, VPU에 클럭 신호를 입력하도록 제어하는 것을 특징으로 한다.In another aspect, the application transmits an initialization command to the VPU driver in accordance with an operation including at least one of video reproduction and video recording, and the VPU driver supplies power to the VPU and controls the VPU to input a clock signal .

또 다른 양상에 있어서, 상기 VPU 드라이버는 상기 어플리케이션의 가상 공유 메모리 할당 명령에 따라, VPU가 사용할 가상 공유 메모리를 할당하는 것을 특징으로 한다.In another aspect, the VPU driver allocates a virtual shared memory to be used by the VPU according to a virtual shared memory allocation command of the application.

또 다른 양상에 있어서, 상기 운영체제가 부팅되면 로드되는 디바이스 매니저;를 더 포함하고, 상기 디바이스 매니저가 로드되면 레지스트리에 등록 되어 있는 VPU 드라이버를 로드하고, 상기 VPU 드라이버는 VPU_Init 함수를 호출하고, 상기 VPU 드라이버는 VPU_Init 함수를 호출하고, 유저 이벤트(User Event) 초기화, 커널 이벤트(Kernel Event) 초기화, 스레드(Thread) 초기화, 클럭(Clock) 초기화, 뮤텍스(Mutex) 초기화, 물리 메모리 관리 리스트(Physical Memory Management list) 초기화, 비디오 처리 유닛 레지스터 액세스 변수(VPU Register Access) 초기화를 수행하는 것을 특징으로 한다.According to still another aspect of the present invention, there is provided a device management method comprising the steps of: loading a VPU driver registered in a registry when the device manager is loaded; calling the VPU_Init function; The driver calls the VPU_Init function and initializes a user event, a kernel event, a thread, a clock, a mutex, a physical memory management list list initialization and initialization of a video processing unit register access variable (VPU Register Access).

상기 유저 이벤트 초기화는 상기 VPU 드라이버가 VPU_Init 함수를 호출하고 CreateEvent 함수를 호출하여 VPU 드라이버가 어플리케이션으로 전달하기 위한 이벤트를 생성하는 것이고, 상기 스레드 초기화는 상기 VPU 드라이버는 VPU_Init 함수를 호출하고, CreateThread 함수를 호출하여, 스레드가 VPU 인터럽트를 수신할 수 있는 상태가 되는 것을 특징으로 한다.Wherein the VPU driver calls the VPU_Init function and calls the CreateEvent function to generate an event for the VPU driver to transfer to the application. The VPU driver calls the VPU_Init function and the CreateThread function So that the thread is ready to receive the VPU interrupt.

상기 어플리케이션은 VPU 드라이버를 CreateFile 함수로 호출하고, DeviceIoControl 함수를 이용해, 물리 연속 메모리를 할당하고, 어플리케이션의 메모리 접근 권한을 설정하고, 상기 VPU가 디코딩 혹은 인코딩 동작을 완료하면, VPU 드라이버가 해당 어플리케이션을 위해 할당한 메모리 자원들을 모두 해제하도록 상기 어플리케이션은 CloseHandle 함수를 실행한다.The application calls the VPU driver with the CreateFile function, allocates the physical contiguous memory using the DeviceIoControl function, sets the memory access right of the application, and when the VPU completes the decoding or encoding operation, The application executes the CloseHandle function to release all memory resources allocated to the application.

상기 VPU는 디코딩 혹은 인코딩의 동작을 완료하면 VPU 드라이버로 인터럽트를 출력하고, 상기 VPU 드라이버는 상기 인터럽트를 수신하면 어플리케이션에 이벤트를 통해 상기 인터럽트를 전달한다.Upon completion of the decoding or encoding operation, the VPU outputs an interrupt to the VPU driver. When the VPU driver receives the interrupt, the VPU driver transmits the interrupt to the application via an event.

제안된 발명은 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 운영체제하에서 VPU를 제어하기 위한 VPU 드라이버를 제공할 수 있다. The proposed invention can provide a VPU driver for controlling the VPU under the Windows Embedded Compact 2013 and Windows Embedded Compact 7 operating systems.

VPU 드라이버를 이용하여 비디오 인코딩과 디코딩을 수행할 수 있다. Video encoding and decoding can be performed using the VPU driver.

본 발명의 효과는 이상에서 언급한 효과들로 제한되지 않으며, 이하에서 설명할 내용으로부터 통상의 기술자에게 자명한 범위 내에서 다양한 효과들이 포함될 수 있다.The effects of the present invention are not limited to the above-mentioned effects, and various effects can be included within the range that is obvious to a person skilled in the art from the following description.

도 1은 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치의 전체적인 구성을 도시한다.
도 2는 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.
도 3은 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.
도 4는 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.
도 5는 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.
1 shows an overall configuration of an apparatus for controlling a video processing unit according to an embodiment.
2 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.
3 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.
4 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.
5 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.

전술한, 그리고 추가적인 양상들은 첨부된 도면을 참조하여 설명하는 실시예들을 통해 구체화된다. 각 실시예들의 구성 요소들은 다른 언급이나 상호간에 모순이 없는 한 실시예 내에서 다양한 조합이 가능한 것으로 이해된다. 나아가 제안된 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. The foregoing and further aspects are embodied through the embodiments described with reference to the accompanying drawings. It is to be understood that the components of each embodiment are capable of various combinations within an embodiment as long as no other mention or mutual contradiction exists. Furthermore, the proposed invention may be embodied in many different forms and is not limited to the embodiments described herein.

도면에서 제안된 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다. 그리고, 어떤 부분이 어떤 구성 요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성 요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있는 것을 의미한다. In order to clearly illustrate the claimed invention, parts not related to the description are omitted, and like reference numerals are used for like parts throughout the specification. And, when a section is referred to as "including " an element, it does not exclude other elements unless specifically stated to the contrary.

또한, 명세서 전체에서, 어떤 부분이 다른 부분과 "연결"되어 있다고 할 때, 이는 "직접적으로 연결"되어 있는 경우뿐 아니라, 그 중간에 다른 소자를 사이에 두고 "전기적으로 연결"되어 있는 경우도 포함한다. 나아가, 명세서 전체에서 신호는 전압이나 전류 등의 전기량을 의미한다.In addition, throughout the specification, when a part is referred to as being "connected" to another part, it is not limited to a case where it is "directly connected", but also an "electrically connected" . Further, in the specification, a signal means a quantity of electricity such as a voltage or a current.

명세서에서 기술한 부란, "하드웨어 또는 소프트웨어의 시스템을 변경이나 플러그인 가능하도록 구성한 블록"을 의미하는 것으로서, 즉 하드웨어나 소프트웨어에 있어 특정 기능을 수행하는 하나의 단위 또는 블록을 의미한다.As used herein, the term " block " refers to a block of hardware or software configured to be changed or pluggable, i.e., a unit or block that performs a specific function in hardware or software.

도 1은 비디오 처리 유닛을 제어하는 장치를 도시한다. Figure 1 shows an apparatus for controlling a video processing unit.

도 2는 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.2 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.

도 3은 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.3 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.

도 4는 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.4 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.

도 5는 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.5 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.

도 1 에 도시된 실시예에서 운영체제(10)는 어플리케이션(20), 파일 시스템(30), 디바이스 매니저(50) 및 VPU 드라이버(40)를 모두 포함할 수 있다.1, the operating system 10 may include both the application 20, the file system 30, the device manager 50, and the VPU driver 40. In the embodiment shown in FIG.

비디오 처리 유닛은 Video Processing Unit(VPU)로 비디오 코덱 관련 연산 처리를 하는 장치이다. 비디오 처리 유닛을 제어하는 장치는 하나의 칩셋 또는 상기 칩셋이 탑재된 휴대용 단말 장치일 수 있다. 비디오 처리 유닛을 제어하는 장치는 비디오 처리 유닛과 일체된 하나의 장치일 수 있고, 비디오 처리 유닛과 구별되는 별개의 장치일 수 있다.The video processing unit is a device that performs a video codec-related operation process with a video processing unit (VPU). The device for controlling the video processing unit may be one chipset or a portable terminal device on which the chipset is mounted. The apparatus for controlling the video processing unit may be a single apparatus integrated with the video processing unit, and may be a separate apparatus that is separate from the video processing unit.

일 실시예에 있어서, 비디오 처리 유닛을 제어하는 장치는 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 중 어느 하나인 운영체제에서 실행되는 어플리케이션; 상기 어플리케이션과 통신하여 VPU(Video Processing Unit)의 동작을 제어하는 스트림 드라이버인 VPU 드라이버;를 포함한다.In one embodiment, the device controlling the video processing unit is an application running on an operating system that is either Windows Embedded Compact 2013 or Windows Embedded Compact 7; And a VPU driver that is a stream driver that controls the operation of a VPU (Video Processing Unit) by communicating with the application.

일 실시예에 있어서, 어플리케이션은 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 중 어느 하나인 운영체제에서 실행된다. 어플리케이션은 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 중 어느 하나인 운영체제에서 실행되는 다양한 어플리케이션으로 영상 재생, 편집 또는 녹화 어플리케이션일 수 있다. Windows Embedded Compact 2013 및 Windows Embedded Compact 7은 Microsoft 사의 실시간 운영체제로 임베디드 시스템을 위한 운영체제이다.In one embodiment, the application runs on an operating system that is either Windows Embedded Compact 2013 or Windows Embedded Compact 7. Applications can be video playback, editing, or recording applications in a variety of applications running on the operating system, either Windows Embedded Compact 2013 or Windows Embedded Compact 7. Windows Embedded Compact 2013 and Windows Embedded Compact 7 are Microsoft's real-time operating systems and operating systems for embedded systems.

일 실시예에 있어서, VPU 드라이버는 상기 어플리케이션과 통신하여 VPU(Video Processing Unit)의 동작을 제어하는 스트림 드라이버이다. Windows Embedded Compact 2013 또는 Windows Embedded Compact 7인 운영체제에서는 어플리케이션에서 VPU와 같은 하드웨어를 직접 제어할 수 없다. 어플리케이션은 VPU 드라이버를 통해 VPU를 제어할 수 있다.In one embodiment, the VPU driver is a stream driver that communicates with the application to control the operation of a VPU (Video Processing Unit). Windows Embedded Compact 2013 or Windows Embedded Compact 7 operating systems can not directly control hardware such as VPU in an application. The application can control the VPU through the VPU driver.

종래의 Windows Embedded Compact 2013 또는 Windows Embedded Compact 7인 운영체제는 VPU 드라이버를 제공하지 않는다. 따라서, VPU를 제어하는 VPU 드라이버를 Windows Embedded Compact 2013 및 Windows Embedded Compact 7의 운영체제에서 구현할 필요가 있다.  Conventional Windows Embedded Compact 2013 or Windows Embedded Compact 7 operating systems do not provide a VPU driver. Therefore, the VPU driver that controls the VPU needs to be implemented in Windows Embedded Compact 2013 and Windows Embedded Compact 7 operating systems.

VPU 드라이버는 스트림(Stream) 드라이버 형태로 구현되며, Windows Embedded Compact 2013 과 Windows Embedded Compact 7 운영체제의 디바이스 매니저(Device Manager)에 의해서 실행 되며, 파일 시스템(File System)을 통해서 어플리케이션(Application) 에서 VPU 드라이버를 제어할 수 있다. The VPU driver is implemented as a stream driver and is executed by the Device Manager of the Windows Embedded Compact 2013 and Windows Embedded Compact 7 operating system. The VPU driver is used in the application through the file system. Can be controlled.

스트림 드라이버인 VPU 드라이버는 열기, 닫기, 읽기, 쓰기(Open, Close, Read, Write) 함수를 통해 VPU와 같은 하드웨어를 제어한다. 이에 한정되는 것은 아니고, VPU 드라이버는 PowerUp, PowerDown, IOControl, Init, DeInit의 함수를 통해 VPU와 같은 하드웨어를 제어한다.The VPU driver, which is a stream driver, controls hardware such as the VPU through open, close, read, and write functions. The VPU driver controls hardware such as VPU through functions of PowerUp, PowerDown, IOControl, Init, and DeInit.

파일 시스템은 저장 장치에 저장된 데이터의 이름을 지정, 읽고, 쓰거나 검색하는 방법 등을 미리 정리해 놓은 체제를 의미한다. 파일 시스템의 대표적인 예를 들면, 윈도우 체제에서는 NT(New Technology) 파일 시스템, FAT(File Allocation Table) 파일 시스템 등이 있고, 리눅스 체제에서는 EXT(Extended) 파일 시스템, Raiser 파일 시스템 등이 있다.The file system refers to a system in which the name of the data stored in the storage device is specified, read, written, or retrieved. A typical example of a file system is an NT (New Technology) file system, a FAT (File Allocation Table) file system, and the Linux system has an EXT (Extended) file system and a Raiser file system.

어플리케이션은 파일 시스템을 이용하여 VPU 드라이버에 명령을 내리거나 데이터를 받아올 수 있다.The application can issue commands or receive data to the VPU driver using the file system.

어플리케이션은 CreateFile 과 DeviceIOControl 등의 함수를 포함하는 API로 File System을 통해 VPU 드라이버를 제어한다.An application is an API that includes functions such as CreateFile and DeviceIOControl and controls the VPU driver through the file system.

비디오 처리 유닛을 제어하는 장치는 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 중 어느 하나인 운영체제하에서 VPU 드라이버를 제어하기 위한 함수와 함수에 따른 기능을 정의한다. The device that controls the video processing unit defines functions and functions for controlling the VPU driver under the operating system of either Windows Embedded Compact 2013 or Windows Embedded Compact 7.

상기 함수는 VPU_Init, VPU_Open, VPU_Close, VPU_DeInit, VPU_PowerUp, VPU_PowerDown, VPU_Read, VPU_Write, VPU_IOControl 중 적어도 하나를 포함한다.The function includes at least one of VPU_Init, VPU_Open, VPU_Close, VPU_DeInit, VPU_PowerUp, VPU_PowerDown, VPU_Read, VPU_Write, and VPU_IOControl.

함수에서 앞쪽에 위치한 VPU는 Prefix로 VPU로 한정되는 것은 아니고 다양하게 설정될 수 있다. 함수의 종류 역시 전술한 예에 한정되는 것은 아니다.In the function, the VPU located in the front side is not limited to the VPU as the prefix, but can be variously set. The type of function is not limited to the above example.

VPU_Init는 비디오 처리 유닛을 제어하는 장치가 부팅후, 처음 실행되는 함수이며, 이 함수를 통해 VPU를 위한 초기화가 이루어진다. 초기화는 메모리 설정, 레지스터 설정을 포함한다. 디바이스 매니저가 VPU 드라이버를 로드하면, VPU 드라이버는 VPU_Init 함수를 호출하고 VPU 드라이버는 VPU가 사용할 메모리 및 레지스터를 설정한다.VPU_Init is a function that is executed first after booting the device controlling the video processing unit, and initialization for the VPU is performed through this function. Initialization includes memory setting and register setting. When the device manager loads the VPU driver, the VPU driver calls the VPU_Init function, and the VPU driver sets the memory and registers to be used by the VPU.

자세하게는 VPU 드라이버가 VPU_Init 함수를 호출하면, VPU 드라이버는 초기화 기능을 수행한다.Specifically, when the VPU driver calls the VPU_Init function, the VPU driver performs the initialization function.

상기 초기화 기능은 유저 이벤트(User Event) 초기화, 커널 이벤트(Kernel Event) 초기화, 스레드(Thread) 초기화, 클럭(Clock) 초기화, 뮤텍스(Mutex) 초기화, 물리 메모리 관리 리스트(Physical Memory Management list) 초기화, 비디오 처리 유닛 레지스터 액세스 변수(VPU Register Access) 초기화 기능을 포함한다.The initialization function includes initialization of a user event, initialization of a kernel event, initialization of a thread, initialization of a clock, initialization of a mutex, initialization of a physical memory management list, Video processing unit register access variable (VPU Register Access) initialization function.

도 3은 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.3 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.

시스템(WEC2013 운영체제)인 운영체제가 부팅(Reset)되면(S100), 디바이스 매니저가 로드(S110)되고 디바이스 매니저는 레지스트리에 등록 되어 있는 VPU 드라이버를 로드하고, VPU 드라이버는 VPU_Init 함수를 호출한다. 디바이스 매니저가 VPU_Init 함수를 호출하면, VPU 디바이스 드라이버 초기화 작업을 수행한다.When the operating system of the system (WEC2013 operating system) is reset (S100), the device manager is loaded (S110), the device manager loads the VPU driver registered in the registry, and the VPU driver calls the VPU_Init function. When the device manager calls the VPU_Init function, the VPU device driver initialization operation is performed.

유저 이벤트(User Event)는 VPU가 어플리케이션의 요청에 따라 디코딩과 인코딩을 수행하고 완료되었음을 어플리케이션에 알리는 이벤트이다. 즉, VPU 드라이버는 어플리케이션의 요청에 따라 VPU로 디코딩 또는 인코딩 명령을 전송한다. VPU 드라이버는 VPU로부터 디코딩 또는 인코딩 완료 메시지를 수신하면, 어플리케이션으로 디코딩 또는 인코딩 완료 메시지를 전송한다. 상기 완료 메시지가 유저 이벤트이다.A user event is an event in which the VPU performs decoding and encoding according to an application request and informs the application that the VPU has been completed. That is, the VPU driver transmits a decoding or encoding command to the VPU in response to an application request. When the VPU driver receives a decoding or encoding completion message from the VPU, it sends a decoding or encoding completion message to the application. The completion message is a user event.

유저 이벤트 초기화는 VPU 드라이버와 어플리케이션이 이벤트 통신을 하기 위해, VPU 드라이버가 VPU_Init 함수를 호출하고 CreateEvent 함수를 호출하여 VPU 드라이버가 어플리케이션으로 전달하기 위한 이벤트를 생성하는 것이다. In order for the VPU driver and the application to perform event communication, the VPU driver calls the VPU_Init function and calls the CreateEvent function to generate an event for the VPU driver to deliver to the application.

커널 이벤트는 VPU가 디코딩과 인코딩이 완료되었을 때, 이를 VPU 드라이버에 알리기 위한 이벤트이다. 즉, VPU 드라이버는 어플리케이션의 요청에 따라 VPU로 디코딩 또는 인코딩 명령을 전송한다. VPU 드라이버는 VPU가 디코딩 또는 인코딩을 완료하면, 커널로부터 VPU 인터럽트인 커널 이벤트를 수신한다.The kernel event is an event for notifying the VPU driver when the VPU completes decoding and encoding. That is, the VPU driver transmits a decoding or encoding command to the VPU in response to an application request. When the VPU driver completes decoding or encoding, the VPU driver receives a kernel event, which is a VPU interrupt, from the kernel.

커널 이벤트 초기화는 커널 이벤트가 VPU 인터럽트와 함께 커널에 등록되어, VPU에서 인터럽트가 발생되었을 때, 커널이 VPU 인터럽트를 VPU 드라이버로 전송할 수 있는 상태로 만드는 것이다. 즉, VPU 드라이버가 VPU 인터럽트를 수신할 수 있는 상태로 만드는 것이다.Kernel event initialization is to cause the kernel event to be registered with the kernel along with the VPU interrupt, so that the kernel can send VPU interrupts to the VPU driver when the VPU is interrupted. That is, the VPU driver is put in a state in which VPU interrupts can be received.

VPU 드라이버가 VPU 인터럽트를 수신할 수 있는 상태는 VPU 드라이버는 VPU 인터럽트가 발생하는 것을 확인하여, 이를 어플리케이션에 전달하는 것이다.In a state where the VPU driver can receive the VPU interrupt, the VPU driver confirms that the VPU interrupt occurs, and transmits it to the application.

VPU가 인코딩 또는 디코딩 수행을 완료하거나, VPU 에서 예외 상황이 발생했을 경우, VPU는 인터럽트를 생성하여 커널로 전송한다. 상기 예외 상황은 에러 등이다.When the VPU completes encoding or decoding, or an exception occurs in the VPU, the VPU generates an interrupt and transmits it to the kernel. The exception is an error or the like.

커널은 VPU로부터 인터럽트를 수신하면, VPU 인터럽트를 VPU 드라이버로 전송한다. 즉, VPU로부터 인터럽트를 수신한 커널이 생성한 VPU 인터럽트를 VPU 드라이버가 수신하기 위해서, 커널에 이벤트를 하나 등록 해야 한다. 상기 이벤트가 커널 이벤트이다. 상기 과정을 커널 이벤트 초기화라고 한다.When the kernel receives an interrupt from the VPU, it transfers the VPU interrupt to the VPU driver. That is, in order for the VPU driver to receive the VPU interrupt generated by the kernel receiving the interrupt from the VPU, one event must be registered in the kernel. The event is a kernel event. This process is called kernel event initialization.

VPU 드라이버는 CreateEvent, KernelIoControl, InterruptInitialize등의 함수를 호출하여 커널 이벤트를 초기화 한다.The VPU driver initializes kernel events by calling functions such as CreateEvent, KernelIoControl, and InterruptInitialize.

스레드(Thread)는 상기 커널 이벤트를 수신하여 처리한다. VPU 디바이스 드라이버에서 스레드가 실행된다. 상기 실행된 스레드는 VPU 인터럽트를 대기하고, VPU 인터럽트가 발생하면 이를 수신하여 처리한다.A thread receives and processes the kernel event. The thread is executed in the VPU device driver. The executed thread waits for a VPU interrupt and receives and processes a VPU interrupt when it occurs.

스레드는 VPU 드라이버에서 VPU_Init 함수가 호출될 때, 최초 실행된다. 상기 스레드가 VPU 인터럽트를 수신 대기한다. 커널 이벤트를 수신하여 처리한다는 것은 VPU 드라이버에서 실행된 스레드가 VPU 인터럽트를 대기하고, 인터럽트가 발생하면, 상기 인터럽트를 수신한다는 것이다.The thread is executed first when the VPU_Init function is called in the VPU driver. The thread waits for a VPU interrupt. Receiving and processing a kernel event means that a thread executed in the VPU driver waits for a VPU interrupt and, when an interrupt occurs, the interrupt is received.

스레드 초기화는 스레드가 VPU 인터럽트를 수신할 수 있도록 실행되는 것이다. 즉, VPU 드라이버는 VPU_Init 함수를 호출하고, CreateThread 함수를 호출하여, 스레드는 VPU 인터럽트를 수신할 수 있는 상태가 된다.Thread initialization is performed so that the thread can receive VPU interrupts. That is, the VPU driver calls the VPU_Init function and calls the CreateThread function, so that the thread is ready to receive the VPU interrupt.

클럭은 VPU가 동작하기 위해 VPU로 입력되는 신호이다. 어플리케이션은 VPU 드라이버에로 IOCTL 명령을 전송한다. 상기 IOCTL 명령을 수신한 VPU 드라이버는 VPU에 입력되는 클럭을 Enable하거나 Disable한다The clock is a signal input to the VPU to operate the VPU. The application sends an IOCTL command to the VPU driver. The VPU driver receiving the IOCTL command enables or disables the clock input to the VPU

클럭 초기화는 VPU 드라이버가 VPU_Init함수를 호출하여 VPU의 입력 클럭을 Enable하거나 Disable하는 것이다.In the clock initialization, the VPU driver calls the VPU_Init function to enable or disable the input clock of the VPU.

뮤텍스는 복수의 프로그램(또는 스레드)이 멀티 인스턴스 처리가 가능하도록 하여 다수의 어플리케이션이나 라이브러리가 VPU 드라이버를 엑세스할 수 있도록 해주는 역할을 한다.A mutex allows multiple programs (or threads) to be multi-instance processed, allowing multiple applications or libraries to access the VPU driver.

뮤텍스 초기화는 VPU 드라이버가 VPU_Init 함수를 호출하고, CreateMutex 함수를 호출하여 뮤텍스가 생성되는 것이다.In the mutex initialization, the VPU driver calls the VPU_Init function and calls the CreateMutex function to generate the mutex.

어플리케이션이나 라이브러리가 메모리(예: 프레임 버퍼)를 할당하도록 VPU 드라이버에게 요청하고, VPU 드라이버는 메모리를 할당한다. 상기 요청은 어플리케이션과 라이브러리의 개수에 따라 계속적으로 발생될 수 있다. 물리 메모리 관리 리스트는 상기 요청에 따라 할당된 메모리를 관리하기 위한 것이다. 여기서, 물리 메모리 관리 리스트는 물리 메모리(Physical Memory)만을 관리한다. VPU는 물리 메모리로만 접근 가능하기에, 상기 물리 메모리 관리 리스트는 물리 메모리만 관리한다.The application or library requests the VPU driver to allocate memory (eg, a frame buffer), and the VPU driver allocates memory. The request may be continuously generated depending on the number of applications and libraries. The physical memory management list is for managing the memory allocated according to the request. Here, the physical memory management list manages only a physical memory. Since the VPU is accessible only to the physical memory, the physical memory management list manages only the physical memory.

즉, VPU 드라이버가 할당한 메모리의 크기를 확인하거나, 할당한 메모리를 할당 해제 하기 위해 물리 메모리 관리 리스트가 사용된다. 물리 메모리 관리 리스트 초기화는 VPU 드라이버가 VPU_Init 함수를 호출하여 상기 물리 메모리 관리 리스트를 생성하는 것이다.That is, the physical memory management list is used to confirm the size of the memory allocated by the VPU driver or to deallocate the allocated memory. In the physical memory management list initialization, the VPU driver calls the VPU_Init function to generate the physical memory management list.

WEC2013 운영체제에는 유저 영역과 커널 영역이 있다. 유저 영역에서는 VPU의 레지스터를 접근할 수 없다. 즉, 어플리케이션은 직접 VPU의 레지스터를 접근할 수 없다. VPU 레지스터를 접근하기 위해서는 같은 커널 레벨에 있는 VPU 드라이버에서 해야 한다. 어플리케이션이 VPU 드라이버에 요청을 하고, VPU 드라이버가 VPU의 레지스터를 제어한다. 결국, 커널 레벨에서 제어한다는 것은 VPU 드라이버가 VPU의 레지스터를 제어한다는 것이다.The WEC2013 operating system has a user area and a kernel area. In the user area, the register of the VPU can not be accessed. That is, the application can not access the register of the VPU directly. To access the VPU registers, the VPU driver at the same kernel level must do so. The application makes a request to the VPU driver, and the VPU driver controls the register of the VPU. As a result, controlling at the kernel level means that the VPU driver controls the registers of the VPU.

비디오 처리 유닛 레지스터 액세스 변수(VPU Register Access)는 VPU 동작을 커널(Kernel) 레벨에서 제어하기 위한 레지스터 액세스용 변수이다.The video processing unit register access variable (VPU Register Access) is a register access variable for controlling the VPU operation at the kernel level.

비디오 처리 유닛 레지스터 액세스 변수(VPU Register Access) 초기화는 어플리케이션이 VPU_Init 함수를 호출하고, MmMapIoSpace, INREG32BF 등의 함수를 호출하여 레지스터 액세스용 변수를 할당하는 것이다. 레지스터 액세스용 변수가 할당되면, VPU 드라이버는 VPU 레지스터를 엑세스할 수 있다.Initialization of the video processing unit register access variable (VPU Register Access) is such that the application calls the VPU_Init function, and calls a function such as MmMapIoSpace, INREG32BF, etc., to assign a register access variable. When a variable for register access is assigned, the VPU driver can access the VPU register.

디바이스 매니저(50)는 VPU 드라이버를 포함한 WEC 운영체제에서 실행되는 모든 디바이스 드라이버를 관리한다. 디바이스 매니저(50)는 VPU 드라이버가 운영체제에 등록되어 있기 때문에, 시스템이 부팅될 때, VPU 드라이버를 로딩해주는 역할을 한다. The device manager 50 manages all the device drivers executed in the WEC operating system including the VPU driver. Since the VPU driver is registered in the operating system, the device manager 50 loads the VPU driver when the system is booted.

도 4은 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다.4 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment.

시스템(WEC2013 운영체제)이 부팅(Reset)(S100)되면, 디바이스 매니저가 실행, 즉 로드(S110)되고 디바이스 매니저는 레지스트리에 등록 되어 있는 VPU 드라이버를 로드하고, 상기 VPU 드라이버는 VPU_Init 함수를 호출한다. 디바이스 매니저가 VPU_Init 함수를 호출하면 VPU 디바이스 드라이버 초기화 작업이 수행된다.When the system (WEC2013 operating system) is booted (S100), the device manager is executed, that is, loaded (S110), the device manager loads the VPU driver registered in the registry, and the VPU driver calls the VPU_Init function. When the device manager calls the VPU_Init function, the VPU device driver initialization operation is performed.

시스템온(S120)은 WEC2013 운영체제가 정상적으로 부팅 완료되고, 어플리케이션이 실행될 수 있는 상태이다. The system on (S120) is a state in which the WEC2013 operating system is normally booted and the application can be executed.

디바이스 매니저가 실행되고, 시스템 온 상태 이후에 어플리케이션은 로드(S130)되거나 로드되지 않는다.The device manager is executed, and the application is loaded (S130) or not loaded after the system-on state.

어플리케이션이 로드(S130)되면, 어플리케이션이 VPU 드라이버를 CreateFile 함수로 호출하고, DeviceIoControl 함수를 이용해, VPU 드라이버가 물리 연속 메모리를 할당하도록 한다. 어플리케이션이 VPU 드라이버를 CreateFile 함수로 호출하고, DeviceIoControl 함수를 호출하면, VPU 드라이버는 VPU_IOControl를 이용하여 물리 연속 메모리를 할당(S140)한다. 즉, 물리 연속 메모리를 어플리케이션에서 접근하여 사용할 수 있도록, VPU 드라이버는 접근 권한을 설정한다.When the application is loaded (S130), the application calls the VPU driver with the CreateFile function, and uses the DeviceIoControl function to allow the VPU driver to allocate the physical contiguous memory. When the application calls the VPU driver with the CreateFile function and calls the DeviceIoControl function, the VPU driver allocates physical continuous memory using VPU_IOControl (S140). That is, the VPU driver sets the access authority so that the physical continuous memory can be accessed and used by the application.

어플리케이션이 CreateFile 함수를 실행하면, VPU 드라이버는 VPU_Open함수를 실행한다. VPU 드라이버가 VPU_Open함수를 실행하면, 최초 한번 MmMapIoSpace 함수를 이용하여, VPU 레지스터 접근을 위한 변수를 생성하고, VPU의 클럭을 Enable한다.When the application executes the CreateFile function, the VPU driver executes the VPU_Open function. When the VPU driver executes the VPU_Open function, a variable for accessing the VPU register is generated using the MmMapIoSpace function for the first time, and the VPU clock is enabled.

어플리케이션이 필요로 하는 물리 연속 메모리 할당 및 메모리 접근 권한 설정이 완료되면, 어플리케이션은 VPU가 디코딩 혹은 인코딩 동작을 수행(S150)하도록 제어한다.When the physical continuity memory allocation and the memory access right setting required by the application are completed, the application controls the VPU to perform the decoding or encoding operation (S150).

어플리케이션이 DeviceIoControl 함수를 통해 VPU 드라이버에게 연속된 물리 메모리를 요청하면, VPU 디바이스 드라이버는 연속된 물리 메모리를 할당한다.When an application requests consecutive physical memory from the VPU driver through the DeviceIoControl function, the VPU device driver allocates contiguous physical memory.

물리 연속 메모리를 할당한다는 것은 프레임 버퍼(Frame Buffer)를 생성하고, 비트 워크(Bit Work) 메모리 영역을 생성한다는 것이다.Allocating physical contiguous memory means creating a frame buffer and creating a bit work memory area.

어플리케이션의 메모리 할당 요청에 의해 VPU 드라이버는 AllocPhysMem 함수를 실행하여 필요한 물리 연속 메모리를 할당한다.By the memory allocation request of the application, the VPU driver executes the AllocPhysMem function to allocate the required physical contiguous memory.

프레임 버퍼는 VPU가 디코딩과 인코딩을 수행하기 위해 필요한 물리적으로 연속된 메모리 영역으로 VPU가 디코딩해주는 한 장의 영상 이미지 버퍼 또는, VPU가 인코딩시에 필요한 영상 이미지 버퍼일 수 있다.The frame buffer may be a piece of video image buffer that the VPU decodes into a physically contiguous memory area necessary for the VPU to perform decoding and encoding, or the VPU may be a video image buffer necessary for encoding.

비트 워크 메모리는 VPU가 디코딩하는 대상인 대상 영상 압축 데이터를 저장한다.The bit work memory stores the target image compression data to be decoded by the VPU.

어플리케이션은 DeviceIoControl 함수를 통해 VPU 드라이버로 기 생성된 메모리를 사용할 수 있도록 메모리 접근 권한을 요청한다. VPU 드라이버는 어플리케이션이 연속된 메모리를 사용할 수 있도록 메모리 접근 권한을 설정한다.The application requests the memory access privilege to use the memory created by the VPU driver through the DeviceIoControl function. The VPU driver sets the memory access permissions so that the application can use contiguous memory.

VPU 드라이버는 커널(Kernel) 레벨의 메모리 영역이고 어플리케이션은 사용자 레벨의 메모리 영역이므로, 어플리케이션은 VPU 드라이버가 생성한 물리 연속 메모리를 사용할 수 없다.Since the VPU driver is a memory area of the kernel level and the application is a user level memory area, the application can not use the physical contiguous memory created by the VPU driver.

하지만, VPU 드라이버가 메모리 접근 권한을 설정하면 어플리케이션도 VPU 브라이버가 생성한 물리 연속 메모리를 사용할 수 있다.However, if the VPU driver sets the memory access privilege, the application can also use the physical contiguous memory created by the VPU browser.

VPU 드라이버는 GetCallerVMProcessId, VirtualAllocEx, VirtualCopyEx 함수를 수행하여, 어플리케이션의 메모리 접근 권한을 설정한다.The VPU driver executes GetCallerVMProcessId, VirtualAllocEx, and VirtualCopyEx functions to set the memory access privileges of the application.

VPU가 디코딩 혹은 인코딩 동작을 완료하고, 어플리케이션이 다시 로드(S160)되면, 어플리케이션은 VPU가 디코딩 혹은 인코딩 동작을 수행하도록 제어한다.When the VPU completes the decoding or encoding operation and the application is reloaded (S160), the application controls the VPU to perform the decoding or encoding operation.

VPU가 디코딩 혹은 인코딩 동작을 완료하고, 어플리케이션이 로드되지 않으면(S160), 어플리케이션은 CloseHandle 함수를 실행하고 VPU 드라이버는 상기 어플리케이션을 위해 할당한 메모리를 모두 해제한다. If the VPU completes the decoding or encoding operation and the application is not loaded (S160), the application executes the CloseHandle function and the VPU driver releases all the memory allocated for the application.

어플리케이션이 로드되지 않는다는 것은 어플리케이션이 재생 혹은 녹화를 완료하거나 어플리케이션이 종료된다는 것이다.If an application does not load, it means the application has finished playing or recording, or the application has terminated.

CloseHandle 함수가 실행되면, VPU 드라이버의 VPU_Close 함수가 실행되고, VPU 드라이버는 어플리케이션을 위해 할당된 메모리들을 모두 할당 해제(S170)한다.When the CloseHandle function is executed, the VPU_Close function of the VPU driver is executed, and the VPU driver deallocates all of the memories allocated for the application (S170).

VPU_Close함수가 실행되면, VPU 드라이버는 물리 연속 메모리 할당을 해제한다. VPU 드라이버는 어플리케이션으로부터 요청받는 메모리 할당에 따라 필요한 연속된 물리 메모리를 할당하고, 이에 대한 메모리 영역을 Address 별로 연결 리스트에 저장하여 관리한다. VPU 드라이버는 어플리케이션으로부터 해제 요청을 받거나, VPU 드라이버가 종료될 때, 연결 리스트에 저장된 메모리 Address를 이용하여 메모리 할당 해제를 수행한다.When the VPU_Close function is executed, the VPU driver releases physical continuous memory allocation. The VPU driver allocates necessary contiguous physical memory according to the memory allocation requested by the application, and manages the memory area by storing the memory area in the linked list by Address. When the VPU driver receives a release request from the application or when the VPU driver terminates, the VPU driver performs memory deallocation using the memory address stored in the connection list.

어플리케이션이 CloseHandle 함수를 실행하여 VPU 드라이버와의 연동을 해제하는 경우, VPU 드라이버는 VPU_Close 함수를 실행하고, 할당된 물리 연속 메모리를 FreePhysMem 함수를 이용해 해제한다.When the application releases the interaction with the VPU driver by executing the CloseHandle function, the VPU driver executes the VPU_Close function and releases the allocated physical contiguous memory by using the FreePhysMem function.

VPU_Close함수가 실행되면, VPU 드라이버는 어플리케이션의 메모리 접근 권한을 해제한다. 어플리케이션은 VPU에 대한 모든 자원을 사용한 후, 종료할 경우에 메모리 접근 권한을 해제 동작을 수행해야 한다. 그렇지 않을 경우 메모리 Leak이 발생되어 시스템에 심각한 오류를 발생시킬 수 있다.When the VPU_Close function is executed, the VPU driver releases the memory access right of the application. The application must use all resources for the VPU and then release the memory access privilege when terminated. Otherwise, a memory leak may occur and cause a serious error in the system.

VPU 드라이버는 VPU_Close 함수를 실행하고, VirtualFreeEx 함수를 실행하여 어플리케이션이 얻은 메모리 접근 권한을 해제한다.The VPU driver executes the VPU_Close function and executes the VirtualFreeEx function to release the memory access right acquired by the application.

함수를 실행한다는 것은 함수를 호출한다는 의미와 같은 의미일 수 있다.Running a function can mean the same thing as calling a function.

도 5는 일 실시예에 따른 비디오 처리 유닛을 제어하는 장치가 수행하는 기능의 흐름을 도시한다. 자세하게, 비디오 처리 유닛을 제어하는 장치는 도 4에 따른 디코딩 또는 인코딩 수행 단계 및 어플리케이션 로드 단계 사이에 세부적인 기능을 더 수행한다.5 shows a flow of functions performed by an apparatus for controlling a video processing unit according to an embodiment. In detail, the apparatus for controlling the video processing unit further performs detailed functions between performing the decoding or encoding step and the application loading step according to FIG.

시스템(WEC2013 운영체제)이 부팅(Reset)되면, 디바이스 매니저가 실행되고 디바이스 매니저는 레지스트리에 등록 되어 있는 VPU 디바이스 드라이버를 로드하여 VPU_Init 함수를 호출하고 이 함수를 통해 VPU 디바이스 드라이버 초기화 작업이 수행된다.When the system (WEC2013 operating system) is booted, the device manager is executed and the device manager loads the VPU device driver registered in the registry, calls the VPU_Init function, and the VPU device driver initialization operation is performed through this function.

WEC2013 운영체제가 정상적으로 부팅 완료되면, 어플리케이션이 실행될 수 있는 시스템 온 상태가 된다. 시스템 온 상태 이후에 어플리케이션은 호출된다.When the WEC2013 operating system is normally booted, the system is in a system-on state where the application can be executed. After the system-on state, the application is invoked.

어플리케이션은 VPU 드라이버를 CreateFile 함수로 호출하고, DeviceIoControl 함수를 이용해, 물리 연속 메모리를 할당하고, 어플리케이션의 메모리 접근 권한을 설정한다. The application calls the VPU driver with the CreateFile function, uses the DeviceIoControl function to allocate the physical contiguous memory, and sets the memory access privilege of the application.

VPU 라이브러리는 어플리케이션과 같은 의미이다. 사용자가 어플리케이션을 실행한다는 것은 VPU 라이브러리가 로드(Load)되는 것이다.The VPU library is synonymous with the application. When the user executes the application, the VPU library is loaded.

어플리케이션 혹은 VPU 라이브러리가 필요로 하는 물리 연속 메모리 할당 및 메모리 접근 권한 설정을 완료하게 되면, 어플리케이션은 VPU가 디코딩 혹은 인코딩 동작을 수행하도록 제어한다. When the application or the VPU library completes the physical consecutive memory allocation and memory access permission setting, the application controls the VPU to perform the decoding or encoding operation.

VPU가 디코딩 혹은 인코딩 동작을 완료하면, VPU 드라이버가 해당 어플리케이션을 위해 할당한 메모리 자원들을 모두 해제하도록 상기 어플리케이션은 CloseHandle 함수를 실행한다.When the VPU completes the decoding or encoding operation, the application executes the CloseHandle function to release all the memory resources allocated for the application by the VPU driver.

어플리케이션이 CloseHandle 함수를 실행하면, VPU 드라이버의 VPU_Close 함수가 실행되고, 이때 VPU 드라이버는 어플리케이션이 사용하기 위해 할당된 메모리 자원들을 모두 해제 한다.When the application executes the CloseHandle function, the VPU_Close function of the VPU driver is executed. At this time, the VPU driver releases all memory resources allocated for use by the application.

또한, VPU 드라이버가 물리 연속 메모리를 할당하고, 어플리케이션의 메모리 접근 권한을 설정한 후 VPU가 디코딩 또는 인코딩을 수행하면, VPU 드라이버는 어플리케이션이 VPU 레지스터를 읽기(Write) 또는 쓰기(Read)(S151)할 수 있도록 어플리케이션으로 IOCTL 명령을 제공한다.When the VPU driver decodes or encodes the physical continuity memory and sets the memory access right of the application, the VPU driver reads the VPU register from the VPU register (S151) IOCTL commands are provided to the application so that it can do so.

전술 또는 후술할 함수 호출과 관련된 설명은 생략한다.The description related to the tact or the function call described below is omitted.

VPU 드라이버에서 VPU_IOControl 함수가 호출되면, VPU 드라이버는 어플리케이션이 VPU의 레지스터를 읽기 또는 쓰기(S151) 할 수 있도록 IOCTL 명령을 제공한다. VPU 드라이버는 VPU의 디코딩 또는 인코딩 수행에 관여하지 않으며, 모든 동작 수행은 어플리케이션에서 이루어진다. VPU 드라이버는 VPU를 제어할 수 있는 제어용 IOCTL를 제공한다.When the VPU_IOControl function is called in the VPU driver, the VPU driver provides an IOCTL instruction so that the application can read or write the register of the VPU (S151). The VPU driver does not participate in the decoding or encoding of the VPU, and all the operation is performed in the application. The VPU driver provides a control IOCTL that can control the VPU.

어플리케이션은 IOCTL 명령을 통해 VPU 드라이버에 제어 명령을 보내고, VPU 드라이버는 어플리케이션의 제어 명령에 따라 VPU_IOC_READ_REG 및 VPU_IOC_WRITE_REG를 인자로 INREG32 및 OUTREG32 함수를 수행하여 VPU를 제어한다.The application sends a control command to the VPU driver through an IOCTL command, and the VPU driver controls the VPU by executing the functions INREG32 and OUTREG32 with arguments VPU_IOC_READ_REG and VPU_IOC_WRITE_REG in accordance with the application control command.

VPU 드라이버는 VPU로부터 발생되는 인터럽트를 어플리케이션에 전달한다.The VPU driver transfers the interrupt generated from the VPU to the application.

어플리케이션은 VPU의 디코딩 혹은 인코딩의 동작 완료를 대기한다. VPU가 디코딩 혹은 인코딩의 동작을 완료하면 VPU 드라이버로 인터럽트를 출력(S152)한다. VPU 드라이버가 상기 인터럽트를 수신하면 어플리케이션에 이벤트를 통해 상기 인터럽트를 전달한다. 어플리케이션은 IOCTL 명령에 따라, VPU의 인터럽트 처리 완료를 확인한다.The application waits for completion of VPU decoding or encoding operation. When the VPU completes the decoding or encoding operation, the VPU driver outputs an interrupt (S152). When the VPU driver receives the interrupt, the interrupt is transmitted to the application through an event. The application verifies that the VPU has completed the interrupt processing according to the IOCTL command.

VPU가 VPU 드라이버로 인터럽트를 출력하지 않으면(S152), VPU 드라이버는 어플리케이션으로부터 Reset 요청을 수신한다.If the VPU does not output an interrupt to the VPU driver (S152), the VPU driver receives a reset request from the application.

어플리케이션은 VPU_IOC_WAIT4INT IOCTL 명령을 통해 VPU의 인터럽트 출력 상태를 VPU 드라이버로부터 수신한다. VPU 디바이스 드라이버는 WaitForSingleObject, INREG32, OUTREG32, InterruptDone등의 함수를 이용하여 발생된 VPU 인터럽트를 수신하고, 인터럽트에 따른 동작을 수행한다.The application receives the interrupt output status of the VPU from the VPU driver through the VPU_IOC_WAIT4INT IOCTL command. The VPU device driver receives VPU interrupts using functions such as WaitForSingleObject, INREG32, OUTREG32, and InterruptDone, and performs operations according to the interrupts.

어플리케이션 혹은 VPU 드라이버가 VPU를 제어할 때, 예외 상황이 발생(S153) 되면, VPU를 리셋할 수 있다.When the application or the VPU driver controls the VPU, if an exception occurs (S153), the VPU can be reset.

예외 상황(Exception)은 VPU가 이상 동작을 하거나, VPU가 디코딩 혹은 인코딩 완료로 인터럽트를 발생시키는 상황 등이다.Exception is the situation where the VPU performs an abnormal operation or the VPU generates an interrupt due to decoding or encoding completion.

리셋(S154) 은 VPU를 동작시키다가 예외 상황이 발생되었을 때, 필요에 의해 VPU를 초기화 시키는 것이다. 이 동작은 어플리케이션이 VPU 드라이버로 요청하여 동작된다. 이에 한정되는 것은 아니고, VPU 드라이버가 단독으로 VPU를 리셋시킬 수도 있다.The reset operation (S154) is for activating the VPU and initializing the VPU as needed when an exception occurs. This operation is requested by the application with the VPU driver. The present invention is not limited to this, and the VPU driver may reset the VPU alone.

어플리케이션 혹은 VPU 드라이버가 VPU를 제어할 때, 예외 상황이 되지 않고, 어플리케이션이 다시 로드(S160)되면, 어플리케이션은 VPU가 디코딩 혹은 인코딩 동작을 수행하도록 제어한다. 어플리케이션이 로드되지 않으면(S160), 어플리케이션은 CloseHandle 함수를 실행하여 VPU 드라이버는 상기 어플리케이션을 위해 할당한 메모리를 모두 해제한다.When the application or the VPU driver controls the VPU, there is no exception, and when the application is reloaded (S160), the application controls the VPU to perform the decoding or encoding operation. If the application is not loaded (S160), the application executes the CloseHandle function and the VPU driver releases all the memory allocated for the application.

어플리케이션이 로드되지 않는 것은 어플리케이션이 VPU 드라이버를 더 이상 사용하지 않거나 어플리케이션이 종료되는 것이다.The application is not loaded because the application no longer uses the VPU driver or the application is terminated.

VPU가 예외(Exception)에 따라 리셋(Reset)이 요구될 경우, VPU 드라이버는 어플리케이션으로부터 Reset 요청을 수신한다. When the VPU requests reset according to an exception, the VPU driver receives a Reset request from the application.

어플리케이션이 DeviceIoControl 함수를 이용해 VPU_IOC_SYS_SW_RESET IOCTL 명령을 VPU 디바이스 드라이버에 전달하면, VPU 드라이버는 VPU를 리셋시킨다. When the application passes the VPU_IOC_SYS_SW_RESET IOCTL command to the VPU device driver using the DeviceIoControl function, the VPU driver resets the VPU.

VPU 드라이버는 VPU 레지스터에 접근하여 INREG32, OUTREG32 함수를 호출하여, VPU를 리셋시킨다.The VPU driver accesses the VPU register and calls the INREG32 and OUTREG32 functions to reset the VPU.

VPU_Open은 어플리케이션에서 VPU 드라이버를 CreateFile로 호출할 경우 실행되는 함수이다. VPU_Open함수가 실행되면 VPU 인스턴스가 생성된다. 비디오 처리 유닛을 제어하는 장치가 부팅 후, VPU_Open함수가 처음으로 실행되는 경우 VPU 드라이버는 VPU의 전원을 켜고, 클럭을 설정한다.VPU_Open is a function that is executed when an application calls the VPU driver with CreateFile. When the VPU_Open function is executed, a VPU instance is created. If the VPU_Open function is executed for the first time after booting the device controlling the video processing unit, the VPU driver turns on the VPU and sets the clock.

어플리케이션이 VPU_IOC_PHYMEM_ALLOC IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 VPU 드라이버는 VPU가 사용할 물리 메모리를 할당하고, 데이터 전송을 위한 버퍼를 생성한다.When the application calls VPU_IOControl function with VPU_IOC_PHYMEM_ALLOC IOCTL value as argument, the VPU driver allocates the physical memory to be used by the VPU and creates a buffer for data transfer.

어플리케이션이 VPU_IOC_PHYMEM_FREE IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 VPU 드라이버는 VPU가 사용하기 위해 할당된 물리 메모리를 해제한다.When an application calls the VPU_IOControl function with the VPU_IOC_PHYMEM_FREE IOCTL value as an argument, the VPU driver releases the physical memory allocated for use by the VPU.

어플리케이션이 VPU_IOC_WAIT4INT IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 VPU 로부터 발생되는 인터럽트를 어플리케이션에 전달한다.When the application calls the VPU_IOControl function with the VPU_IOC_WAIT4INT IOCTL value as an argument, the VPU driver transfers the interrupt generated from the VPU to the application.

어플리케이션이 VPU_IOC_IRAM_SETTING IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 VPU 드라이버는 비디오 처리 유닛을 제어하는 장치, 예를 들어 i.MX6와 같은 칩셋에 있는 IRAM Setting 을 어플리케이션에 전달한다.When the application calls the VPU_IOControl function with the VPU_IOC_IRAM_SETTING IOCTL value as an argument, the VPU driver passes the IRAM setting in the chipset such as the device controlling the video processing unit, for example i.MX6, to the application.

어플리케이션이 VPU_IOC_CLKGATE_SETTING IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 VPU 드라이버는 VPU의 클럭을 Enable/Disable한다. VPU의 클럭을 Enable하는 것은 VPU의 클럭 신호를 입력해주는 것이다. VPU의 클럭을 disable하는 것은 VPU의 클럭 신호를 입력하지 않는 것이다.When the application calls the VPU_IOControl function with the VPU_IOC_CLKGATE_SETTING IOCTL value as an argument, the VPU driver enables / disables the VPU clock. Enable VPU clock is to input VPU clock signal. Disabling the clock of the VPU means not inputting the clock signal of the VPU.

어플리케이션이 VPU_IOC_REQ_VSHARE_MEM IOCTL 값과 메모리 크기를 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 VSHARE_MEM(공유 메모리)를 커널 영역과 유저 영역에서 액세스 가능하도록 메모리를 할당해 주고 그 정보를 어플리케이션에 전달 한다. 이미 메모리가 할당되어 있다면, 메모리는 재할당되지 않고 정보만 어플리케이션에 전달 한다. 여기서 VSHARE_MEM은 Codec 인스턴스, 인코딩, 디코딩에 관련된 정보와 데이터를 어플리케이션과 VPU가 공유할 수 있도록 해주는 메모리 공간이다.When the application calls the VPU_IOControl function with the VPU_IOC_REQ_VSHARE_MEM IOCTL value and the memory size as arguments, the VPU driver allocates the memory so that VSHARE_MEM (shared memory) can be accessed from the kernel area and user area and transfers the information to the application. If memory is already allocated, the memory is not reallocated and only the information is passed to the application. Where VSHARE_MEM is a memory space that allows applications and VPUs to share Codec instance, encoding, and decoding related information and data.

어플리케이션이 VPU_IOC_GET_SHARE_MEM IOCTL 값과 메모리 크기를 인자로 VPU_IOControl 함수를 호출하면 VPU 드라이버는 Bitwork_Mem(비트 워크 메모리)를 커널 영역과 유저 영역에서 엑세스 가능하도록 연속된 메모리를 할당해주고, 그 정보를 어플리케이션으로 전달한다. 이미 메모리가 할당되어 있다면, 메모리는 재할당되지 않고, 정보만 어플리케이션으로 전달한다. 여기서 Bitwork_Mem는 VPU가 필요로 하는 Code 버퍼, Parameter 버퍼, Temp 버퍼를 사용할 수 있도록 해주는 메모리 공간이다. 어플리케이션이나 VPU 라이브러리가 VPU에서 사용되는 메모리를 공유할 수 있도록 시작 주소와 메모리 크기를 지정하는데, 이때 시작 주소가 메모리 공유 위치에 대응된다.When the application calls the VPU_IOControl function with the VPU_IOC_GET_SHARE_MEM IOCTL value and the memory size as arguments, the VPU driver allocates the contiguous memory so that BitWork_Mem (bit work memory) can be accessed in the kernel area and user area, and transfers the information to the application. If memory is already allocated, the memory is not reallocated and only information is passed to the application. Bitwork_Mem is a memory space that allows the VPU to use the code buffer, the parameter buffer, and the Temp buffer. The start address and the memory size are specified so that the application or the VPU library can share the memory used in the VPU, in which the start address corresponds to the memory shared location.

어플리케이션이 VPU_IOC_SYS_SW_RESET IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 VPU를 리셋시킨다. 리셋은 재부팅을 의미한다. When the application calls the VPU_IOControl function with the VPU_IOC_SYS_SW_RESET IOCTL value as an argument, the VPU driver resets the VPU. Reset means reboot.

어플리케이션이 VPU_IOC_REG_DUMP IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 VPU의 레지스터를 읽어온다.When the application calls the VPU_IOControl function with the VPU_IOC_REG_DUMP IOCTL value as an argument, the VPU driver reads the VPU register.

어플리케이션이 VPU_IOC_PHYMEM_DUMP IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 VPU의 물리 메모리를 읽어온다.When the application calls the VPU_IOControl function with the VPU_IOC_PHYMEM_DUMP IOCTL value as an argument, the VPU driver reads the physical memory of the VPU.

어플리케이션이 VPU_IOC_PHYMEM_CHECK IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 VPU의 물리 메모리가 유효한지 검사한다. 물리 메모리가 유효한지 검사한다는 것은 메모리에 데이터가 저장되었는지 여부를 검사하는 것이다.When the application calls the VPU_IOControl function with the VPU_IOC_PHYMEM_CHECK IOCTL value as an argument, the VPU driver checks whether the physical memory of the VPU is valid. To check whether physical memory is valid is to check whether data is stored in memory.

어플리케이션이 VPU_IOC_LOCK_DEV IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 뮤텍스 락(Lock) 또는 언락(UnLock) 한다. 뮤텍스란, 파일과 같은 공유 자원이 수행 중 한 프로그램이나 스레드에게만 소요되어야 할 필요가 있을 때, 락을 걸어 다른 프로세스나 스레드가 접근할 수 없도록 하고, 언락을 걸어 자원 점유를 마치고, 다른 프로세스나 스레드가 접근할 수 있도록 한다. When an application calls the VPU_IOControl function with the VPU_IOC_LOCK_DEV IOCTL value as an argument, the VPU driver locks or unlocks the mutex. Mutex means that when a shared resource such as a file needs to be dedicated to a running program or thread, it locks it so that it can not be accessed by another process or thread, unlocks it and ends up occupying resources, .

즉, 어플리케이션이나 VPU 라이브러리는 VPU 드라이버에 VPU를 위해 사용되는 공유 자원들을 액세스하기 위해 뮤텍스 락을 걸어 다른 어플리케이션이나 라이브러리가 액세스할 수 없도록 한다. 또한, 공유 자원의 액세스를 마치게 되면 언락을 걸어 다른 어플리케이션이나 라이브러리가 VPU를 위해 사용되는 공유 자원들을 사용할 수 있도록 한다.In other words, an application or VPU library locks the VPU driver to mutex locks to access shared resources used for the VPU, making it inaccessible to other applications or libraries. In addition, when access to the shared resource is completed, an unlock is made so that another application or library can use the shared resources used for the VPU.

일 실시예에 있어서, Windows Embedded Compact 2013 또는 Windows Embedded Compact 7 운영체제하의 VPU 드라이버는 VPU_Init 함수를 호출하여 VPU가 사용할 메모리 및 레지스터를 설정하여 초기화한다. WEC2013 운영체제 레지스트리에 VPU 드라이버가 존재하면, Prefix를 이용하여 VPU 드라이버를 로드하고 초기화를 진행한다. In one embodiment, the VPU driver under the Windows Embedded Compact 2013 or Windows Embedded Compact 7 operating system calls the VPU_Init function to set and initialize the memory and registers to be used by the VPU. If the VPU driver exists in the WEC2013 operating system registry, the VPU driver is loaded using the prefix and initialized.

일 실시예에 있어서, 상기 어플리케이션은 동영상 재생, 녹화 중 적어도 하나를 포함하는 작업에 따라 VPU 드라이버로 초기화 명령을 전송하고, VPU 드라이버는 VPU의 전원을 공급하고, VPU에 클럭 신호를 입력하도록 제어하는 것을 특징으로 한다. 자세하게, 어플리케이션은 CreateFile 함수를 호출하여 VPU_Open 함수를 실행시키고, 비디오 처리 유닛을 제어하는 장치가 부팅 후, VPU_Open함수가 처음으로 실행되는 경우 VPU 드라이버는 VPU의 전원을 켜고, 클럭을 설정한다.In one embodiment, the application transmits an initialization command to the VPU driver in accordance with an operation including at least one of video reproduction and video recording, and the VPU driver supplies power to the VPU and controls the VPU to input a clock signal . In detail, the application calls the CreateFile function to execute the VPU_Open function. When the VPU_Open function is executed for the first time after booting the device controlling the video processing unit, the VPU driver turns on the VPU and sets the clock.

일 실시예에 있어서, 상기 VPU 드라이버는 상기 어플리케이션의 가상 공유 메모리 할당 명령에 따라, VPU가 사용할 가상 공유 메모리를 할당하는 것을 특징으로 한다. VPU 드라이버가 어플리케이션이 VPU_IOC_GET_SHARE_MEM IOCTL 값을 인자로 VPU_IOControl 함수를 호출함에 따른 공유 메모리 할당 명령을 수신하면, VPU 드라이버는 VPU가 사용할 공유 메모리를 생성하고, 생성된 공유 메모리 주소를 어플리케이션으로 전달한다.In one embodiment, the VPU driver allocates a virtual shared memory to be used by the VPU according to a virtual shared memory allocation command of the application. When the VPU driver receives a shared memory allocation instruction by the application calling the VPU_IOControl function with the VPU_IOC_GET_SHARE_MEM IOCTL value as an argument, the VPU driver generates a shared memory to be used by the VPU and transfers the generated shared memory address to the application.

일 실시예에 있어서, 상기 VPU 드라이버는 상기 어플리케이션의 뮤텍스 락 또는 언락 명령에 따라, 뮤텍스를 락 또는 언락 하는 것을 특징으로 한다. 어플리케이션의 VPU_IOC_LOCK_DEV IOCTL 값을 인자로 VPU_IOControl 함수를 호출함에 따른 뮤텍스 락 또는 언락 명령에 따라, VPU 드라이버는 VPU의 뮤텍스를 락(Lock) 또는 언락(UnLock) 한다.In one embodiment, the VPU driver locks or unlocks a mutex according to a mutex lock or unlock command of the application. The VPU driver locks or unlocks the mutex of the VPU in response to a mutex lock or unlock command resulting from calling the VPU_IOControl function with the VPU_IOC_LOCK_DEV IOCTL value of the application as an argument.

비디오 처리 유닛을 제어하는 장치는 VPU의 공유 자원을 액세스하기 위해 뮤텍스 락(Lock) 또는 언락(UnLock) 한다.The device controlling the video processing unit may mutex lock or unlock to access the shared resources of the VPU.

일 실시예에 있어서, 상기 VPU 드라이버는 상기 어플리케이션의 클럭 활성화 또는 비활성화 명령에 따라, VPU의 클럭을 CPU에 포함된 클럭과 동기화 시키거나, VPU의 클럭을 비활성화 하는 것을 특징으로 한다. 어플리케이션의 VPU_IOC_ CLKGATE _SETTING IOCTL 값을 인자로 VPU_IOControl 함수를 호출함에 따른 클럭 활성화 또는 비활성화 명령에 따라 VPU 드라이버는 VPU의 클럭을 CPU에 포함된 클럭과 동기화 시키거나, VPU의 클럭을 비활성화 시킨다.In one embodiment, the VPU driver synchronizes the clock of the VPU with the clock included in the CPU or deactivates the clock of the VPU according to a clock activation or deactivation instruction of the application. The VPU driver synchronizes the VPU clock with the clock included in the CPU or deactivates the VPU clock in accordance with the clock activation or deactivation command by calling the VPU_IOControl function with the VPU_IOC_CLKGATE_SETTING IOCTL value of the application as an argument.

일 실시예에 있어서, 상기 VPU 드라이버는 VPU가 출력하는 인터럽트를 어플리케이션으로 전달하는 것을 특징으로 한다. 어플리케이션이 VPU_IOC_WAIT4INT IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, VPU 드라이버는 VPU가 출력하는 인터럽트를 어플리케이션으로 전달한다. In one embodiment, the VPU driver transfers an interrupt output from the VPU to an application. When the application calls the VPU_IOControl function with the VPU_IOC_WAIT4INT IOCTL value as an argument, the VPU driver transfers the interrupt output by the VPU to the application.

일 실시예에 있어서, 상기 VPU 드라이버는 상기 어플리케이션의 물리 메모리 할당 명령에 따라, VPU가 사용할 물리 공유 메모리를 할당하는 것을 특징으로한다. 어플리케이션의 VPU_IOC_PHYMEM_ALLOC IOCTL 값을 인자로 VPU_IOControl 함수를 호출함에 따른 물리 메모리 할당 명령에 따라 VPU 드라이버는 VPU가 사용할 물리 메모리를 할당한다.In one embodiment, the VPU driver allocates a physical shared memory to be used by the VPU according to a physical memory allocation command of the application. VPU_IOC_PHYMEM_ALLOC VPU_IOC_PHYMEM_ALLOC The VPU driver allocates the physical memory to be used by the VPU according to the physical memory allocation instruction by calling the VPU_IOControl function with the IOCTL value as an argument.

일 실시예에 있어서, 상기 VPU 드라이버는 상기 어플리케이션의 VPU 리셋 명령에 따라, VPU를 리셋 시키는 것을 특징으로 한다. 어플리케이션의 VPU_IOC_SYS_SW_RESET IOCTL 값을 인자로 VPU_IOControl 함수를 호출함에 따른 VPU 리셋 명령에 따라 , VPU 드라이버는 VPU를 리셋시킨다.In one embodiment, the VPU driver resets the VPU according to a VPU reset command of the application. The VPU driver resets the VPU according to the VPU reset command for calling the VPU_IOControl function with the VPU_IOC_SYS_SW_RESET IOCTL value of the application as a parameter.

일 실시예에 있어서, 상기 VPU 드라이버는 상기 어플리케이션의 물리 메모리 할당 해제 명령에 따라, VPU를 위해 할당된 물리 메모리의 할당을 해제한다. 어플리케이션의 VPU_IOC_PHYMEM_FREE IOCTL 값을 인자로 VPU_IOControl 함수 호출에 따른 물리 메모리 할당 해제 명령에 따라, VPU 드라이버는 VPU가 사용하기 위해 할당된 물리 메모리를 해제한다.In one embodiment, the VPU driver releases the allocation of the physical memory allocated for the VPU in accordance with the physical memory deallocation command of the application. According to the VPU_IOC_PHYMEM_FREE IOCTL value of the application as a parameter, the VPU driver releases the physical memory allocated for use by the VPU in response to the physical memory deallocation command following the VPU_IOControl function call.

도 2는 일 실시예에 따른 비디오 처리 유닛을 제어하는 방법의 흐름도이다.2 is a flow diagram of a method of controlling a video processing unit in accordance with one embodiment.

일 실시예에 있어서, 비디오 처리 유닛을 제어하는 방법은 Windows Embedded Compact 2013 및 Windows Embedded Compact 7 중 어느 하나인 운영체제에서 어플리케이션을 실행하는 어플리케이션 실행 단계(S610); 상기 어플리케이션과 통신하여 VPU(Video Processing Unit)의 동작을 제어하는 스트림 드라이버인 VPU 드라이버를 제어하는 VPU 드라이버 제어 단계(S620);를 포함한다.In one embodiment, a method for controlling a video processing unit includes: executing an application (S610) for executing an application in an operating system that is one of Windows Embedded Compact 2013 and Windows Embedded Compact 7; And a VPU driver control step (S620) for controlling a VPU driver that is a stream driver that controls the operation of a VPU (Video Processing Unit) by communicating with the application.

일 실시예에 있어서, 상기 어플리케이션 실행 단계(S610)에서, 어플리케이션은 동영상 재생, 녹화 중 적어도 하나를 포함하는 작업에 따라 VPU 드라이버로 초기화 명령을 전송하고, 상기 VPU 드라이버 제어 단계(S620)에서, VPU 드라이버는 VPU의 전원을 공급하고, VPU에 클럭 신호를 입력하도록 제어하는 것을 특징으로 한다.In one embodiment, in the application execution step S610, the application transmits an initialization command to the VPU driver in accordance with a job including at least one of video reproduction and video recording, and in the VPU driver control step S620, The driver supplies power to the VPU and controls the VPU to input a clock signal.

일 실시예에 있어서, 상기 VPU 드라이버 제어 단계(S620)에서, VPU 드라이버는 어플리케이션의 가상 공유 메모리 할당 명령에 따라, VPU가 사용할 가상 공유 메모리를 할당하는 것을 특징으로 한다.In one embodiment, in the VPU driver control step (S620), the VPU driver allocates a virtual shared memory to be used by the VPU according to a virtual shared memory allocation instruction of the application.

VPU 드라이버 제어 단계(S620)는 VPU 초기화 단계, VPU 제어 단계 및 VPU 종료 단계를 포함할 수 있다.The VPU driver control step (S620) may include a VPU initialization step, a VPU control step, and a VPU end step.

VPU 초기화 단계에서 어플리케이션은 CreateFile을 통해 VPU 드라이버를 Open한다. 이때, VPU 드라이버는 VPU에 전원과 클럭을 공급하고, 필요한 레지스터 설정을 한다. 어플리케이션은 특정 IOCTL 인자를 통해 DeviceIOControl 함수를 호출하고, VPU 드라이버는 VPU_IOControl 함수를 통해 IOCTL 인자를 수신하며 어플리케이션과 통신을 수행하고, 어플리케이션으로부터 받은 IOCTL 명령 종류에 따라 메모리 설정, 클럭 ON/OFF, 리셋, 뮤텍스 관리등을 수행한다.In the VPU initialization step, the application opens the VPU driver via CreateFile. At this time, the VPU driver supplies power and clock to the VPU and sets necessary registers. The application calls the DeviceIOControl function through a specific IOCTL argument. The VPU driver receives the IOCTL argument via the VPU_IOControl function and communicates with the application. The VPU driver communicates with the application and sets the memory setting, clock ON / OFF, reset, Mutex management, and so on.

VPU 제어 단계에서 어플리케이션이 동영상을 재생하거나 녹화하는 동안, VPU가 특별한 이벤트를 출력하면, VPU 드라이버는 출력된 이벤트를 감지하고 감지된 결과를 어플리케이션에 전달한다. 예를 들어, 동영상 재생 중 한 프레임의 인코딩 또는 디코딩이 완료되었거나, 재생 중 에러가 발생되었을 때, VPU에 의한 인터럽트가 발생되며, 이를 VPU 드라이버가 감지하고, 어플리케이션은 인터럽트 발생 이벤트를 전달 받는다.If the VPU outputs a special event while the application reproduces or records the moving picture in the VPU control step, the VPU driver senses the output event and delivers the detected result to the application. For example, when the encoding or decoding of one frame is completed or an error occurs during playback of the moving picture, an interrupt is generated by the VPU, the VPU driver detects this, and the application receives the interrupt occurrence event.

VPU 제어 단계는 VPU의 클럭을 주기적으로 On/Off 하여, VPU의 전원과 동작을 관리한다.The VPU control step periodically turns on / off the clock of the VPU to manage the power and operation of the VPU.

VPU 종료 단계에서 어플리케이션이 동영상 재생 혹은 녹화를 완료되었을 때, VPU 드라이버가 할당 받은 제어 권한과 사용된 메모리를 반환하는 것을 특징으로 한다. 어플리케이션은 CloseFile을 통해 VPU 드라이버와 연결을 Close하고, 어플리케이션이 VPU_Close 함수를 호출함에 따라 VPU 드라이버는 VPU의 종료를 수행한다. 종료시에 VPU 드라이버와 연결된 다른 어플리케이션이 없다면, VPU 드라이버는 VPU의 전원을 Off한다.And when the application completes the movie reproduction or recording in the VPU termination step, the VPU driver returns the control right and the memory used by the VPU driver. The application closes the connection with the VPU driver via CloseFile, and the VPU driver terminates the VPU as the application calls the VPU_Close function. If there is no other application connected to the VPU driver at the time of termination, the VPU driver turns off the power of the VPU.

일 실시예에 있어서, 컴퓨터 판독 가능 기록매체는 비디오 처리 유닛을 제어하는 방법을 수행하는 프로그램을 저장한다.In one embodiment, the computer-readable medium stores a program for performing a method of controlling a video processing unit.

이와 같이, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 실시 형태로 실시될 수 있다는 것을 인지할 수 있을 것이다. 따라서 이상에서 기술한 실시 예들은 예시적인 것일 뿐이며, 그 범위를 제한해놓은 한정적인 것이 아닌 것으로 이해해야만 한다. 또한, 도면에 도시된 순서도들은 본 발명을 실시함에 있어서 가장 바람직한 결과를 달성하기 위해 예시적으로 도시된 순차적인 순서에 불과하며, 다른 추가적인 단계들이 제공되거나, 일부 단계가 삭제될 수 있음은 물론이다.Thus, those skilled in the art will appreciate that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. It is therefore to be understood that the above-described embodiments are illustrative only and not restrictive of the scope of the invention. It is also to be understood that the flow charts shown in the figures are merely the sequential steps illustrated in order to achieve the most desirable results in practicing the present invention and that other additional steps may be provided or some steps may be deleted .

본 명세서에서 기술한 기술적 특징과 이를 실행하는 구현물은 디지털 전자 회로로 구현되거나, 본 명세서에서 기술하는 구조 및 그 구조적인 등가물 등을 포함하는 컴퓨터 소프트웨어, 펌웨어 또는 하드웨어로 구현되거나, 이들 중 하나 이상의 조합으로 구현 가능하다. 또한 본 명세서에서 기술한 기술적 특징을 실행하는 구현물은 컴퓨터 프로그램 제품, 다시 말해 처리 시스템의 동작을 제어하기 위하여 또는 이것에 의한 실행을 위하여 유형의 프로그램 저장매체 상에 인코딩된 컴퓨터 프로그램 명령어에 관한 모듈로서 구현될 수도 있다.The technical features and implementations described herein may be implemented in digital electronic circuitry, or may be implemented in computer software, firmware, or hardware, including the structures described herein, and structural equivalents thereof, . Also, implementations that implement the technical features described herein may be implemented as computer program products, that is, modules relating to computer program instructions encoded on a program storage medium of the type for execution by, or for controlling, the operation of the processing system .

컴퓨터로 판독 가능한 매체는 기계로 판독 가능한 저장 장치, 기계로 판독 가능한 저장 기판, 메모리 장치, 기계로 판독 가능한 전파형 신호에 영향을 미치는 물질의 조성물 또는 이들 중 하나 이상의 조합일 수 있다.The computer-readable medium can be a machine-readable storage device, a machine-readable storage substrate, a memory device, a composition of matter that affects the machine readable propagation type signal, or a combination of one or more of the foregoing.

한편, 본 명세서에서 "장치"나 "시스템"이라 함은 예를 들어, 프로세서, 컴퓨터 또는 다중 프로세서나 컴퓨터를 포함하여 정보를 처리하기 위한 모든 기구, 장치 및 기계를 모두 포함한다. 처리 시스템은, 하드웨어에 부가하여 예를 들어, 프로세서 펌웨어를 구성하는 코드, 프로토콜 스택, 정보베이스 관리 시스템, 운영 제체 또는 이들 중 하나 이상의 조합 등 요청 시 컴퓨터 프로그램에 대한 실행 환경을 형성하는 모든 코드를 포함할 수 있다.In the present specification, the term " apparatus "or" system "includes all apparatuses, apparatuses, and machines for processing information, including, for example, a processor, a computer or a multiprocessor or a computer. The processing system may include, in addition to the hardware, all of the code that forms an execution environment for the computer program upon request, such as code comprising the processor firmware, a protocol stack, an information base management system, an operating system, .

프로그램, 소프트웨어, 소프트웨어 애플리케이션, 스크립트 또는 코드 등으로 알려진 컴퓨터 프로그램은 컴파일 되거나 해석된 언어 또는 선험적, 절차적 언어를 포함하는 프로그래밍 언어의 어떠한 형태로도 작성될 수 있으며, 독립형 프로그램이나 모듈, 컴포넌트, 서브루틴 또는 컴퓨터 환경에서 사용하기에 적합한 다른 유닛을 포함하여 어떠한 형태로도 구현될 수 있다.A computer program, known as a program, software, software application, script or code, may be written in any form of programming language, including compiled or interpreted language or a priori, procedural language, Routines, or other units suitable for use in a computer environment.

한편, 컴퓨터 프로그램은 파일 시스템의 파일에 반드시 대응되는 것은 아니며, 요청된 프로그램에 제공되는 단일 파일 내에 또는 다중의 상호 작용하는 파일(예를 들어, 하나 이상의 모듈, 하위 프로그램 또는 코드의 일부를 저장하는 파일)내에, 또는 다른 프로그램이나 정보를 보유하는 파일의 일부(예를 들어, 마크업 언어 문서 내에 저장되는 하나 이상의 스크립트)내에 저장될 수 있다.On the other hand, a computer program does not necessarily correspond to a file in the file system, but may be stored in a single file provided to the requested program or in a plurality of interactive files (for example, one or more modules, File), or a portion of a file holding another program or information (e.g., one or more scripts stored in a markup language document).

컴퓨터 프로그램은 하나의 사이트에 위치하거나 복수의 사이트에 걸쳐서 분산되어 유/무선 통신 네트워크에 의해 상호 접속된 다중 컴퓨터나 하나 이상의 컴퓨터 상에서 실행되도록 구현될 수 있다.A computer program may be embodied to run on multiple computers or on one or more computers located at one site or distributed across a plurality of sites and interconnected by a wired / wireless communication network.

한편, 컴퓨터 프로그램 명령어와 정보를 저장하기에 적합한 컴퓨터로 판독 가능한 매체는, 예를 들어 EPROM, EEPROM 및 플래시메모리 장치와 같은 반도체 메모리 장치, 예컨대 내부 하드디스크나 외장형 디스크와 같은 자기 디스크, 자기광학 디스크 및 CD와 DVD 디스크를 포함하여 모든 형태의 비휘발성 메모리, 매체 및 메모리 장치를 포함할 수 있다. 프로세서와 메모리는 특수 목적의 논리 회로에 의해 보충되거나, 그것에 통합될 수 있다.On the other hand, computer readable media suitable for storing computer program instructions and information include, for example, semiconductor memory devices such as EPROM, EEPROM and flash memory devices, for example magnetic disks such as internal hard disks or external disks, And any type of non-volatile memory, media and memory devices, including CD and DVD discs. The processor and memory may be supplemented by, or incorporated in, special purpose logic circuits.

본 명세서에서 기술한 기술적 특징을 실행하는 구현물은 예를 들어, 정보 서버와 같은 백엔드 컴포넌트를 포함하거나, 예를 들어, 애플리케이션 서버와 같은 미들웨어 컴포넌트를 포함하거나, 예컨대 사용자가 본 명세서에서 설명한 주제의 구현물과 상호 작용할 수 있는 웹 브라우저나 그래픽 유저 인터페이스를 갖는 클라이언트 컴퓨터와 같은 프론트엔드 컴포넌트 혹은 그러한 백엔드, 미들웨어 혹은 프론트엔드 컴포넌트의 하나 이상의 모든 조합을 포함하는 연산 시스템에서 구현될 수도 있다. 시스템의 컴포넌트는 예를 들어, 통신 네트워크와 같은 디지털 정보 통신의 어떠한 형태나 매체에 의해서도 상호 접속 가능하다.Implementations that implement the technical features described herein may include, for example, a back-end component such as an information server, or may include a middleware component, such as, for example, an application server, Or a client computer having a graphical user interface, or any combination of one or more of such backend, middleware or front end components. The components of the system may be interconnected by any form or medium of digital information communication, for example, a communication network.

이하, 상기 기술한 내용과 더불어 본 명세서에 기술한 시스템과 방법이 포함하는 구성들을 구현할 수 있는 보다 구체적인 실시 예에 대하여 자세히 기술하도록 한다.Hereinafter, more specific embodiments capable of implementing the configurations including the systems and methods described herein will be described in detail.

본 명세서에서 방법은 클라이언트 디바이스 또는 웹 기반의 스토리지 시스템과 관련된 서버 또는 서버에 포함된 하나 이상의 프로세서(Processor) 상에서 컴퓨터 소프트웨어, 프로그램 코드 또는 명령어를 실행하는 수단을 통해 부분적 또는 전체적으로 사용될 수 있다. 여기서 프로세서는 서버, 클라이언트, 네트워크 인프라 구조, 모바일 컴퓨팅 플랫폼, 고정 컴퓨팅 플랫폼 등과 같은 컴퓨팅 플랫폼 중 일부일 수 있으며, 구체적으로 프로그램 명령어, 코드 등을 실행할 수 있는 컴퓨터 또는 프로세싱 디바이스의 한 종류일 수 있다. 또한, 프로세서는 방법, 명령어, 코드 및 프로그램을 저장하는 메모리를 더 포함할 수 있으며, 메모리를 포함하지 않는 경우 별도의 인터페이스를 통해 본 발명에 따른 방법, 명령어, 코드 및 프로그램이 저장된 CD-ROM, DVD, 메모리, 하드 디스크, 플래시 드라이브, RAM, ROM, 캐시 등과 같은 스토리지 디바이스에 접근(Access)할 수도 있다.The methods herein may be used, in part or in whole, through means for executing computer software, program code or instructions on one or more processors included in a server or server associated with a client device or a web-based storage system. The processor may be part of a computing platform, such as a server, a client, a network infrastructure, a mobile computing platform, a fixed computing platform, and the like, and may specifically be a type of computer or processing device capable of executing program instructions, code, In addition, the processor may further include a memory for storing the method, the instruction, the code and the program, and the method, the instruction, the code and the program according to the present invention may be stored in a CD-ROM, A DVD, a memory, a hard disk, a flash drive, a RAM, a ROM, a cache, and the like.

또한, 본 명세서에서 기술한 시스템과 방법은 서버, 클라이언트, 게이트웨이, 허브, 라우터 또는 네트워크 하드웨어 상의 컴퓨터 소프트웨어를 실행하는 장치를 통해 부분적 또는 전체적으로 사용될 수 있다. 여기서 소프트웨어는 파일 서버, 프린트 서버, 도메인 서버, 인터넷 서버, 인트라넷 서버, 호스트 서버, 분산 서버 등과같이 다양한 종류의 서버에서 실행될 수 있으며, 상기 언급한 서버들은 메모리, 프로세서, 컴퓨터에서 판독 가능한 저장매체, 스토리지 매체, 통신 디바이스, 포트, 클라이언트 그리고 다른 서버들을 유/무선 네트워크를 통해 접근할 수 있는 인터페이스를 더 포함할 수 있다.Further, the systems and methods described herein may be used, in part or in whole, through a server, a client, a gateway, a hub, a router, or an apparatus executing computer software on network hardware. The software may be executed in various types of servers such as a file server, a print server, a domain server, an Internet server, an intranet server, a host server, a distributed server, A storage medium, a communication device, a port, a client, and other servers via a wired / wireless network.

또한, 본 발명에 따른 방법, 명령어, 코드 등 역시 서버에 의해 실행될 수 있으며, 방법을 실행하기 위해 필요한 다른 디바이스들은 서버와 연관된 계층구조의 일 부분으로 구현될 수 있다.Also, the methods, instructions, code, etc., according to the present invention may also be executed by the server, and other devices needed to implement the method may be implemented as part of a hierarchical structure associated with the server.

아울러, 서버는 클라이언트, 다른 서버, 프린터, 정보베이스 서버, 프린트 서버, 파일 서버, 통신 서버, 분산 서버 등을 제한 없이 포함하는 다른 디바이스에게 인터페이스를 제공할 수 있으며, 인터페이스를 통한 연결은 유/무선 네트워크를 통해 프로그램의 원격 실행을 용이하게 할 수 있다.In addition, the server can provide an interface to other devices including, without limitation, clients, other servers, printers, information base servers, print servers, file servers, communication servers, distributed servers, It is possible to facilitate remote execution of the program via the network.

또한, 인터페이스를 통해 서버에 연결된 디바이스 중 어느 것이라도방법, 명령어, 코드 등을 저장할 수 있는 적어도 하나의 스토리지 디바이스를 더 포함할 수 있으며, 서버의 중앙 프로세서는 상이한 디바이스 상에서 실행될 명령어, 코드 등을 디바이스에 제공하여 스토리지 디바이스에 저장되게 할 수 있다.Also, the central processor of the server may include instructions, code, etc., to be executed on different devices, and may further include at least one storage device capable of storing methods, instructions, codes, etc., To be stored in the storage device.

한편, 본 명세서에서 방법은 네트워크 인프라구조를 통해 부분적 또는 전체적으로 사용될 수 있다. 여기서 네트워크 인프라구조는 컴퓨팅 디바이스, 서버, 라우터, 허브, 방화벽, 클라이언트, 개인용 컴퓨터, 통신 디바이스, 라우팅 디바이스 등과 같은 디바이스와 각각의 기능을 실행할 수 있는 별도의 모듈 등을 모두 포함할 수 있으며, 상기 언급한 디바이스와 모듈 외에 스토리 플래시 메모리, 버퍼, 스택, RAM, ROM 등과 같은 스토리지 매체를 더 포함할 수 있다. 또한, 방법, 명령어, 코드 등 역시 네트워크 인프라구조가 포함하는 디바이스, 모듈, 스토리지 매체 중 어느 하나에 의해 실행 및 저장될 수 있으며, 방법을 실행하기 위해 필요한 다른 디바이스 역시 네트워크 인프라구조의 일 부분으로 구현될 수 있다.On the other hand, the method herein may be used partly or entirely through a network infrastructure. The network infrastructure may include both a device such as a computing device, a server, a router, a hub, a firewall, a client, a personal computer, a communication device, a routing device, etc. and a separate module capable of performing each function, In addition to one device and module, it may further include storage media such as a story flash memory, buffer, stack, RAM, ROM, and the like. Also, methods, commands, code, etc. may be executed and stored by any of the devices, modules, and storage media included in the network infrastructure, and other devices required to implement the method may also be implemented as part of the network infrastructure .

또한, 본 명세서에서 기술한 시스템과 방법은 하드웨어 또는 특정 애플리케이션(Application)에 적합한 하드웨어와 소프트웨어의 조합으로 구현될 수 있다. 여기서 하드웨어는 개인용 컴퓨터, 이동통신 단말기 등과 같은 범용 컴퓨터 디바이스와 기업형 특정 컴퓨터 디바이스를 모두 포함하며, 컴퓨터 디바이스는 메모리, 마이크로프로세서, 마이크로콘트롤러, 디지털 신호 프로세서, 애플리케이션 집적 회로, 프로그래머블 게이트 어레이, 프로그래머블 어레이 조직 등을 포함하는 디바이스 또는 이들의 조합으로 구현될 수 있다.In addition, the systems and methods described herein may be implemented in hardware or a combination of hardware and software suitable for a particular application. Herein, the hardware includes both general-purpose computer devices such as personal computers, mobile communication terminals, and enterprise-specific computer devices, and the computer devices may include memory, a microprocessor, a microcontroller, a digital signal processor, an application integrated circuit, a programmable gate array, Or the like, or a combination thereof.

이상에서 기술한 컴퓨터 소프트웨어, 명령어, 코드 등은 판독 가능한 디바이스에 의해 저장 또는 접근될 수 있으며, 여기서 판독 가능한 디바이스는 일정 시간 간격 동안 컴퓨팅하는데 사용되는 디지털 정보를 구비하는 컴퓨터 컴포넌트, RAM 또는 ROM과 같은 반도체 스토리지, 광디스크와 같은 영구적인 스토리지, 하드 디스크, 테이프, 드럼 등과 같은 대용량 스토리지, CD 또는 DVD와 같은 광 스토리지, 플래시 메모리, 플로피 디스크, 자기 테이프, 페이퍼 테이프, 독립형 RAM 디스크, 컴퓨터로부터 착탈 가능한 대용량 스토리지와 동적 메모리, 정적 메모리, 가변 스토리지, 클라우드와 같은 네트워크 접속형 스토리지 등과 같은 메모리를 포함할 수 있다. 한편, 여기서 명령어와 코드 등은 SQL, dBase 등과 같은 정보 지향 언어, C, Objective C, C++, 어셈블리 등과 같은 시스템 언어, Java, NET 등과 같은 아키텍처 언어, PHP, Ruby, Perl, Python 등과 같은 애플리케이션 언어 등과 같은 언어들을 모두 포함하지만, 이에 한정되지는 않고 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 널리 알려진 언어들을 모두 포함할 수 있다.Computer software, instructions, code, etc., as described above, may be stored or accessed by a readable device, such as a computer component having digital information used to compute for a period of time, such as RAM or ROM Permanent storage such as semiconductor storage, optical disc, large capacity storage such as hard disk, tape, drum, optical storage such as CD or DVD, flash memory, floppy disk, magnetic tape, paper tape, Memory such as storage and dynamic memory, static memory, variable storage, network-attached storage such as the cloud, and the like. Here, the commands and codes can be classified into information-oriented languages such as SQL and dBase, system languages such as C, Objective C, C ++, and assembly, architectural languages such as Java and NET and application languages such as PHP, Ruby, Perl and Python But it is not so limited and may include all languages well known to those skilled in the art.

또한, 본 명세서에서 기술한 "컴퓨터에서 판독 가능한 매체"는 프로그램 실행을 위해 명령어를 프로세서로 제공하는데 기여하는 모든 매체를 포함한다. 구체적으로 정보 스토리지 디바이스, 광디스크, 자기 디스크 등과 같은 비휘발성 매체, 동적 메모리 등과 같은 휘발성 매체와 정보를 전송하는 동축 케이블, 구리 와이어, 광섬유 등과 같은 전송 매체를 포함하지만 이에 한정되지는 않는다.In addition, "computer readable media" as described herein includes all media that contribute to providing instructions to a processor for program execution. But are not limited to, non-volatile media such as information storage devices, optical disks, magnetic disks, and the like, transmission media such as coaxial cables, copper wires, optical fibers, etc. that transmit information to volatile media such as dynamic memory and the like.

한편, 본 명세서에 첨부된 도면에 도시된 블록도와 순서도에 포함된 본 발명의 기술적 특징을 실행하는 구성들은 상기 구성들 사이의 논리적인 경계를 의미한다.On the other hand, configurations implementing the technical features of the present invention, which are included in the block diagrams and flowcharts shown in the accompanying drawings, refer to the logical boundaries between the configurations.

그러나 소프트웨어나 하드웨어의 실시 예에 따르면, 도시된 구성들과 그 기능들은 독립형 소프트웨어 모듈, 모놀리식 소프트웨어 구조, 코드, 서비스 및 이들을 조합한 형태로 실행되며, 저장된 프로그램 코드, 명령어 등을 실행할 수 있는 프로세서를 구비한 컴퓨터에서 실행 가능한 매체에 저장되어 그 기능들이 구현될 수 있으므로 이러한 모든 실시 예 역시 본 발명의 권리범위 내에 속하는 것으로 보아야 할 것이다.However, according to an embodiment of the software or hardware, the depicted arrangements and their functions may be implemented in the form of a stand alone software module, a monolithic software structure, a code, a service and a combination thereof and may execute stored program code, All such embodiments are to be regarded as being within the scope of the present invention since they can be stored in a medium executable on a computer with a processor and their functions can be implemented.

따라서, 첨부된 도면과 그에 대한 기술은 본 발명의 기술적 특징을 설명하기는 하나, 이러한 기술적 특징을 구현하기 위한 소프트웨어의 특정 배열이 분명하게 언급되지 않는 한, 단순히 추론되어서는 안된다. 즉, 이상에서 기술한 다양한 실시 예들이 존재할 수 있으며, 그러한 실시 예들이 본 발명과 동일한 기술적 특징을 보유하면서 일부 변형될 수 있으므로, 이 역시 본 발명의 권리범위 내에 속하는 것으로 보아야 할 것이다.Accordingly, the appended drawings and the description thereof illustrate the technical features of the present invention, but should not be inferred unless a specific arrangement of software for implementing such technical features is explicitly mentioned. That is, various embodiments described above may exist, and some embodiments may be modified while retaining the same technical features as those of the present invention, and these should also be considered to be within the scope of the present invention.

또한, 순서도의 경우 특정한 순서로 도면에서 동작들을 묘사하고 있지만, 이는 가장 바람직한 결과를 얻기 위하여 도시된 것으로서, 도시된 특정한 순서나 순차적인 순서대로 그러한 동작들을 반드시 실행되어야 한다거나 모든 도시된 동작들이 반드시 실행되어야 하는 것으로 이해되어서는 안 된다. 특정한 경우, 멀티 태스킹과 병렬 프로세싱이 유리할 수 있다. 아울러, 이상에서 기술한 실시형태의 다양한 시스템 컴포넌트의 분리는 그러한 분리를 모든 실시형태에서 요구하는 것으로 이해되어서는 안되며, 설명한 프로그램 컴포넌트와 시스템들은 일반적으로 단일의 소프트웨어 제품으로 함께 통합되거나 다중 소프트웨어 제품에 패키징될 수 있다는 점을 이해하여야 한다.It should also be understood that although the flowcharts depict the operations in the drawings in a particular order, they are shown for the sake of obtaining the most desirable results, and such operations must necessarily be performed in the specific order or sequential order shown, Should not be construed as being. In certain cases, multitasking and parallel processing may be advantageous. In addition, the separation of the various system components of the above-described embodiments should not be understood as requiring such separation in all embodiments, and the described program components and systems are generally integrated into a single software product, It can be packaged.

이와 같이, 본 명세서는 그 제시된 구체적인 용어에 의해 본 발명을 제한하려는 의도가 아니다. 따라서, 이상에서 기술한 실시 예를 참조하여 본 발명을 상세하게 설명하였지만, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자라면 본 발명의 범위를 벗어나지 않으면서도 본 실시 예들에 대한 개조, 변경 및 변형을 가할 수 있다.As such, the specification is not intended to limit the invention to the precise form disclosed. While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is evident that many alternatives, modifications, and variations will be apparent to those skilled in the art without departing from the spirit and scope of the present invention as defined by the appended claims. It is possible to apply a deformation.

본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 등가개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 권리범위에 포함되는 것으로 해석되어야 한다.The scope of the present invention is defined by the appended claims rather than the foregoing description, and all changes or modifications derived from the meaning and scope of the claims and equivalents thereof are deemed to be included in the scope of the present invention. .

10: 운영체제
20: 어플리케이션
30: 파일 시스템
40: VPU 드라이버
50: 디바이스 매니저
60: VPU
70: 커널
10: Operating system
20: Application
30: File system
40: VPU driver
50: Device Manager
60: VPU
70: The kernel

Claims (7)

비디오 처리 유닛을 제어하는 장치 ― 상기 비디오 처리 유닛을 제어하는 장치는 i.MX6 칩셋을 포함함 ― 에 있어서,
Windows Embedded Compact 2013 및 Windows Embedded Compact 7 중 어느 하나인 운영체제 ― 상기 Windows Embedded Compact 2013 및 Windows Embedded Compact 7은 상기 운영체제 전용 VPU 드라이버를 포함하지 않음 ― 에서 실행되는 어플리케이션; 및
상기 어플리케이션과 통신하여 VPU(Video Processing Unit)의 동작을 제어하는 스트림 드라이버인 VPU 드라이버;를
포함하고,
상기 어플리케이션은 동영상 재생 또는 녹화 중 적어도 하나를 포함하는 작업에 따라 VPU 드라이버로 초기화 명령을 전송하고,
상기 VPU 드라이버는 상기 VPU의 전원을 공급하고 상기 VPU에 클럭 신호를 입력하도록 제어하며, 상기 어플리케이션의 가상 메모리 할당 명령에 따라 상기 VPU가 사용할 가상 메모리를 할당하는 것을 특징으로 하며,
상기 어플리케이션이 VPU_IOC_PHYMEM_ALLOC IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 상기 VPU 드라이버는 상기 VPU가 사용할 물리 메모리를 할당하고, 데이터 전송을 위한 버퍼를 생성하며,
상기 어플리케이션이 VPU_IOC_PHYMEM_FREE IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 상기 VPU 드라이버는 상기 VPU가 사용하기 위해 할당된 물리 메모리를 해제하고,
상기 어플리케이션이 VPU_IOC_WAIT4INT IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, 상기 VPU 드라이버는 상기 VPU 로부터 발생되는 인터럽트를 어플리케이션에 전달하고,
상기 어플리케이션이 VPU_IOC_IRAM_SETTING IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 상기 VPU 드라이버는 VPU를 제어하는 칩셋의 IRAM Setting 을 상기 어플리케이션에 전달하고,
상기 어플리케이션이 VPU_IOC_CLKGATE_SETTING IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면 상기 VPU 드라이버는 상기 VPU의 클럭을 Enable/Disable하고,
상기 어플리케이션이 VPU_IOC_REQ_VSHARE_MEM IOCTL 값과 메모리 크기를 인자로 VPU_IOControl 함수를 호출하면, 상기 VPU 드라이버는 공유 메모리를 커널 영역과 유저 영역에서 액세스 가능하도록 메모리를 할당한 후 할당에 대한 정보를 상기 어플리케이션에 전달하고,
상기 어플리케이션이 VPU_IOC_GET_SHARE_MEM IOCTL 값과 메모리 크기를 인자로 VPU_IOControl 함수를 호출하면 상기 VPU 드라이버는 비트 워크 메모리(Bitwork_Mem)를 커널 영역과 유저 영역에서 엑세스 가능하도록 연속된 메모리를 할당한 후 할당에 대한 정보를 어플리케이션으로 전달하고,
상기 어플리케이션이 VPU_IOC_SYS_SW_RESET IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, 상기 VPU 드라이버는 상기 VPU를 리셋하고,
상기 어플리케이션이 VPU_IOC_REG_DUMP IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, 상기 VPU 드라이버는 상기 VPU의 레지스터를 읽어오고,
상기 어플리케이션이 VPU_IOC_PHYMEM_DUMP IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, 상기 VPU 드라이버는 상기 VPU의 물리 메모리를 읽어오고,
상기 어플리케이션이 VPU_IOC_PHYMEM_CHECK IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, 상기 VPU 드라이버는 상기 VPU의 물리 메모리가 유효한지 검사하고,
상기 어플리케이션이 VPU_IOC_LOCK_DEV IOCTL 값을 인자로 VPU_IOControl 함수를 호출하면, 상기 VPU 드라이버는 뮤텍스 락(Lock) 또는 언락(UnLock)하는 비디오 처리 유닛을 제어하는 장치.
An apparatus for controlling a video processing unit, the apparatus for controlling the video processing unit comprising an i.MX6 chipset,
An operating system that is either Windows Embedded Compact 2013 or Windows Embedded Compact 7, the Windows Embedded Compact 2013 and Windows Embedded Compact 7 do not include the VPU driver for the operating system; And
A VPU driver that is a stream driver that communicates with the application and controls the operation of a VPU (Video Processing Unit)
Including,
The application transmits an initialization command to the VPU driver according to a job including at least one of video playback and video recording,
Wherein the VPU driver supplies power to the VPU and inputs a clock signal to the VPU, and allocates a virtual memory to be used by the VPU according to a virtual memory allocation command of the application,
When the application calls the VPU_IOControl function with the VPU_IOC_PHYMEM_ALLOC IOCTL value as an argument, the VPU driver allocates a physical memory to be used by the VPU, generates a buffer for data transmission,
If the application calls the VPU_IOControl function with the VPU_IOC_PHYMEM_FREE IOCTL value as an argument, the VPU driver releases the physical memory allocated for use by the VPU,
When the application calls the VPU_IOControl function with the VPU_IOC_WAIT4INT IOCTL value as an argument, the VPU driver transfers an interrupt generated from the VPU to the application,
When the application calls the VPU_IOControl function with the VPU_IOC_IRAM_SETTING IOCTL value as an argument, the VPU driver transfers the IRAM setting of the chipset controlling the VPU to the application,
When the application calls the VPU_IOControl function with the VPU_IOC_CLKGATE_SETTING IOCTL value as an argument, the VPU driver enables / disables the clock of the VPU,
When the application calls the VPU_IOControl function with the VPU_IOC_REQ_VSHARE_MEM IOCTL value and the memory size as arguments, the VPU driver allocates a memory so that the shared memory can be accessed in the kernel area and the user area,
When the application calls the VPU_IOControl function with the VPU_IOC_GET_SHARE_MEM IOCTL value and the memory size as a factor, the VPU driver allocates a continuous memory so that the bitwork memory (Bitwork_Mem) can be accessed in the kernel area and the user area, Lt; / RTI >
When the application calls the VPU_IOControl function with the VPU_IOC_SYS_SW_RESET IOCTL value as an argument, the VPU driver resets the VPU,
When the application calls the VPU_IOControl function with the VPU_IOC_REG_DUMP IOCTL value as an argument, the VPU driver reads the register of the VPU,
When the application calls the VPU_IOControl function with the VPU_IOC_PHYMEM_DUMP IOCTL value as an argument, the VPU driver reads the physical memory of the VPU,
If the application calls the VPU_IOControl function with the VPU_IOC_PHYMEM_CHECK IOCTL value as an argument, the VPU driver checks whether the physical memory of the VPU is valid,
Wherein the VPU driver controls a video processing unit that locks or unlocks when a VPU_IOC_LOCK_DEV IOCTL value is used as an argument by the application to call the VPU_IOControl function.
삭제delete 삭제delete 제 1 항에 있어서,
상기 운영체제가 부팅되면 로드되는 디바이스 매니저;를 더 포함하고,
상기 디바이스 매니저가 로드되면 레지스트리에 등록 되어 있는 VPU 드라이버를 로드하고, 상기 VPU 드라이버는 VPU_Init 함수를 호출하되,
상기 VPU 드라이버는
VPU_Init 함수를 호출하고, 유저 이벤트(User Event) 초기화, 커널 이벤트(Kernel Event) 초기화, 스레드(Thread) 초기화, 클럭(Clock) 초기화, 뮤텍스(Mutex) 초기화, 물리 메모리 관리 리스트(Physical Memory Management list) 초기화, 비디오 처리 유닛 레지스터 액세스 변수(VPU Register Access) 초기화를 수행하는,
비디오 처리 유닛을 제어하는 장치.
The method according to claim 1,
And a device manager loaded when the operating system is booted,
When the device manager is loaded, it loads a VPU driver registered in the registry, and the VPU driver calls a VPU_Init function,
The VPU driver
A VPU_Init function, a user event initialization, a kernel event initialization, a thread initialization, a clock initialization, a mutex initialization, a physical memory management list, Initialization, video processing unit register access variable (VPU Register Access) initialization,
An apparatus for controlling a video processing unit.
제 4 항에 있어서,
상기 유저 이벤트 초기화는
상기 VPU 드라이버가 VPU_Init 함수를 호출하고 CreateEvent 함수를 호출하여 VPU 드라이버가 어플리케이션으로 전달하기 위한 이벤트를 생성하는 것이고,
상기 스레드 초기화는
상기 VPU 드라이버는 VPU_Init 함수를 호출하고, CreateThread 함수를 호출하여, 스레드가 VPU 인터럽트를 수신할 수 있는 상태가 되는 것인
비디오 처리 유닛을 제어하는 장치.
5. The method of claim 4,
The user event initialization
The VPU driver calls the VPU_Init function and calls the CreateEvent function to generate an event for the VPU driver to deliver to the application,
The thread initialization
The VPU driver calls the VPU_Init function and calls the CreateThread function to determine that the thread is ready to receive the VPU interrupt
An apparatus for controlling a video processing unit.
제 1 항에 있어서,
상기 어플리케이션은 VPU 드라이버를 CreateFile 함수로 호출하고, DeviceIoControl 함수를 이용해, 물리 연속 메모리를 할당하고, 어플리케이션의 메모리 접근 권한을 설정하고,
상기 VPU가 디코딩 혹은 인코딩 동작을 완료하면, VPU 드라이버가 해당 어플리케이션을 위해 할당한 메모리 자원들을 모두 해제하도록 상기 어플리케이션은 CloseHandle 함수를 실행하는,
비디오 처리 유닛을 제어하는 장치.
The method according to claim 1,
The application calls the VPU driver with the CreateFile function, allocates the physical contiguous memory using the DeviceIoControl function, sets the memory access right of the application,
When the VPU completes the decoding or encoding operation, the application executes the CloseHandle function to release all the memory resources allocated for the application by the VPU driver,
An apparatus for controlling a video processing unit.
제 1 항에 있어서,
상기 VPU는 디코딩 혹은 인코딩의 동작을 완료하면 VPU 드라이버로 인터럽트를 출력하고, 상기 VPU 드라이버는 상기 인터럽트를 수신하면 어플리케이션에 이벤트를 통해 상기 인터럽트를 전달하는,
비디오 처리 유닛을 제어하는 장치.
The method according to claim 1,
The VPU outputs an interrupt to the VPU driver when the decoding or encoding operation is completed. When the VPU driver receives the interrupt, the VPU driver transmits the interrupt to the application via an event.
An apparatus for controlling a video processing unit.
KR1020170154298A 2017-11-17 2017-11-17 Apparatus and method for controlling video processing unit KR101889942B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170154298A KR101889942B1 (en) 2017-11-17 2017-11-17 Apparatus and method for controlling video processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170154298A KR101889942B1 (en) 2017-11-17 2017-11-17 Apparatus and method for controlling video processing unit

Publications (1)

Publication Number Publication Date
KR101889942B1 true KR101889942B1 (en) 2018-08-20

Family

ID=63443127

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170154298A KR101889942B1 (en) 2017-11-17 2017-11-17 Apparatus and method for controlling video processing unit

Country Status (1)

Country Link
KR (1) KR101889942B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933495A (en) * 2019-12-06 2020-03-27 深圳市斯迈龙科技有限公司 Video playing method and device based on embedded system
CN117435259A (en) * 2023-12-20 2024-01-23 芯瞳半导体技术(山东)有限公司 VPU configuration method and device, electronic equipment and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100026604A (en) * 2008-09-01 2010-03-10 주식회사 케이티 Platform developing appratus for mobile communication device
KR20120031756A (en) * 2010-09-27 2012-04-04 삼성전자주식회사 Method and apparatus for compiling and executing application using virtualization in heterogeneous system using cpu and gpu

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100026604A (en) * 2008-09-01 2010-03-10 주식회사 케이티 Platform developing appratus for mobile communication device
KR20120031756A (en) * 2010-09-27 2012-04-04 삼성전자주식회사 Method and apparatus for compiling and executing application using virtualization in heterogeneous system using cpu and gpu

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933495A (en) * 2019-12-06 2020-03-27 深圳市斯迈龙科技有限公司 Video playing method and device based on embedded system
CN117435259A (en) * 2023-12-20 2024-01-23 芯瞳半导体技术(山东)有限公司 VPU configuration method and device, electronic equipment and computer readable storage medium
CN117435259B (en) * 2023-12-20 2024-03-22 芯瞳半导体技术(山东)有限公司 VPU configuration method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US10169068B2 (en) Live migration for virtual computing resources utilizing network-based storage
JP6074038B2 (en) Transparent host-side caching of virtual disks on shared storage
US8171504B1 (en) System and method for using virtual machine for driver installation sandbox
US9614931B2 (en) Identifying a resource set require for a requested application and launching the resource set in a container for execution in a host operating system
US20180121366A1 (en) Read/write request processing method and apparatus
US9836327B1 (en) Network-based storage access control for migrating live storage clients
KR101496325B1 (en) Method and apparatus for save/restore state of virtual machine
JP4805238B2 (en) Method, apparatus and system for enabling a secure location aware platform
US10936350B2 (en) Active drive API
WO2020177482A1 (en) Desktop virtualization method, related device and computer storage medium
US8677449B1 (en) Exposing data to virtual machines
US20190042321A1 (en) Elastic container management system
KR20110139130A (en) Uniform storage device by partial virtualization machine
US9934404B2 (en) Inter-process access control
KR101889942B1 (en) Apparatus and method for controlling video processing unit
CN113826072B (en) Code update in system management mode
JP2015517159A (en) Method for controlling the use of hardware resources in a computer system, system and piece of code method
CN107844362B (en) System, method, virtual machine and readable storage medium for virtualizing TPM (trusted platform Module) equipment
KR20130127629A (en) Apparatus and method for providing virtual application
US8356140B2 (en) Methods and apparatus for controlling data between storage systems providing different storage functions
CN111078367A (en) Request processing method and device, electronic equipment and storage medium
WO2017012339A1 (en) Resource management method and apparatus
CA2878759C (en) Methods and systems for providing software applications
KR101950485B1 (en) Task Management Method for Providing Real-time Performance to Android
CN113127258A (en) Data backup method, device, equipment and medium

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant