1. Field of the Invention
The present invention relates to a method of picture display and device thereof, and more particularly, to a method of picture display and device thereof capable of displaying high-resolution pictures swiftly.
2. Description of the Prior Art
Due to limited memories and retrenched processors, embedded products, such as multimedia players, TVs, mobile phones, etc., are unable to behave as well as PCs or laptops. When playing a high-resolution picture, the embedded products are bound to have problems of poor playback of the picture or system failure due to insufficient memories.
A conventional picture display method is briefed as follows. Please refer to
In short, the electronic device 10 saves row data of the picture in the display memory 104 upon receiving the picture. Take a 4096×4096 image for example, each pixel is 4 bytes, which requires 4096×4096×4=64 MB of memories. A larger image requires even more memories. When employing a PC or laptop for picture display, no issue would arise with sufficient memories. However, under an embedded environment with limited memories, poor playback of the picture or the picture cannot be played at all is often the case.
It is therefore a primary objective of the present invention to provide a method of picture display and device thereof to avoid poor playback of pictures, so as to enhance display performance.
The present invention discloses a picture display method for an electronic device having a display function. The method includes determining whether a resolution of an inputted picture of the electronic device is greater than a resolution of a display device of the electronic device, and scaling down the resolution of the picture, and displaying the downscale picture via display device when the resolution of the picture is greater than the resolution of the display device.
The present invention further discloses an electronic device, for displaying an inputted picture thereof. The electronic device includes a memory for store a program codes of a process, a processor, coupled to the memory, for processing the program codes to execute the process, wherein the process includes determining whether a resolution of the inputted picture of the electronic device is greater than a resolution of a display device of the electronic device, and scaling down the resolution of the picture, and displaying the downscale picture via display device when the resolution of the picture is greater than the resolution of the display device.
The present invention further discloses a picture processor for processing an inputted picture of an electronic device having a display function. The picture processor includes a display detection unit for acquiring width pixel numbers and height pixel numbers of a display device of the electronic device, a picture reading unit for reading data of the picture, a picture detection unit for acquiring width pixel numbers and height pixel numbers of the picture, and a picture scaling-down unit for calculating a desired downscale ratio for the width pixel numbers and height pixel numbers of the picture, and performing a scale-down operation to the data of the picture read by the picture reading unit, to scale down the picture to conform to the downscale ratio, according to the width pixel numbers and height pixel numbers of the display device and the picture acquired by the display detection unit and the picture detection unit respectively.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
Step 200: Start.
Step 202: Determine whether a resolution of an inputted the picture of the electronic device 10 is greater than a resolution of the display device 108 of the electronic device 10.
Step 204: Display the picture via the display device 108 when the resolution of the picture is less than or equal to the resolution of the display device 108.
Step 206: Scale down the resolution of the picture, and display the downscale the picture via the display device 108 when the resolution of the picture is greater than the resolution of the display device 108.
Step 208: End.
According to the process 20, after the picture is inputted into the electronic device 10, the electronic device 10 determines whether the resolution of the picture is greater than the resolution of the display device 108. If the resolution of the picture is less than or equal to the resolution of the display device 108, the electronic device 10 directly displays the picture on the display device 108. On the contrary, if the resolution of the picture is greater than the resolution of the display device 108, the electronic device 10 scales down the resolution of the picture, and then displays the downscale picture on the display device 108. With the process 20, when the resolution of the picture is greater than the resolution of the display device 108, the resolution of the picture is scaled down to reduce memory for storing the picture. Thus, the process 20 avoids lagging or delaying of the picture display caused by insufficient memories, so as to display high-resolution pictures swiftly, hence elevating display performance.
More specifically, when the resolution of the picture is less than or equal to the resolution of the display device 108, the processor 100 of the electronic device 10 reads the data of the picture, and saves all the read data of the picture in the display memory 104 of the electronic device 10, and the display unit 106 outputs the data of the picture in the display memory 104 to the display device 108. On the other hand, when the resolution of the picture is greater than the resolution of the display device 108, the processor 100 calculates a desired downscale ratio of the picture according to the resolution of the picture and the resolution of the display device 108, then reads the data of the picture, and performs a scale-down operation (can be stored in the random access memory 102) on the read data of the picture, to scale down the picture to conform to the calculated downscale ratio, and finally, saves the downscale data of the picture in the display memory 104, and outputs the data of the picture in the display memory 104 to the display device 108 via display unit 106.
In addition, the scale-down operation is detailed as follows. The processor 100 calculates a desired downscale ratio of height pixels and width pixels of the picture according to height pixel numbers and width pixel numbers of the picture and the display device 108 respectively, so as to scale down the picture to conform to the downscale ratio. Next, the processor 100 calculates minimum requisite memories of the scale-down operation according to the scale-down operation, reads the data of the picture in units of the minimum requisite memories sequentially, and performs the scale-down operation to one unit of the read data at a time, and the scale-down operation of all the units are completed until all the data of the picture are read. In short, when the original picture is greater than the maximum resolution of the display device 108, the processor 100 reads the data of the picture and scales down the read data to conform to the resolution of the display device 108 side by side, prior to saving in memory. Thus, the maximum requisite memories only have to satisfy the maximum resolution of the display device 108. Take a high-definition (HD) display device with 1920×1080 pixels for example, the requisite memories are merely 1920×1080×4=8 MB, which avoids defects of poor playback of the picture display caused by insufficient memory.
Please refer to
In addition, for those skilled in the art, implementations of the process 20 can to be achieved by software or hardware methods via the processor 100. For example, please refer to
Note that, the process 20 is realized by the picture processor 40 via utilizing the display detection unit 400, the picture reading unit 402 and the picture detection unit 404 to execute the step 202, wherein the picture detection unit 404 acquires the width pixel numbers and height pixel numbers of the picture according to a header of the data of the picture read by the picture reading unit 402, and via using the picture reading unit 402 and the picture scaling-down unit 406 to execute the step 206. Noticeably, the picture scaling-down unit 406 calculates minimum requisite memories of the scale-down operation, and uses the picture reading unit 402 to read the data of the picture in units of the minimum requisite memories, performs the scale-down operation to one unit of the read data at a time, until all the data of the picture are read, and the scale-down operation of all the units are completed, to scale down the picture to conform to the downscale ratio. In addition, the picture scaling-down unit 406 is further utilized for saving the data of the downscale picture in a memory, e.g. the display memory 104 shown in
To sum up, the present invention determines whether to scale down a resolution of an inputted picture by determining whether the resolution of the picture is greater than a resolution of a display device. When the resolution of the picture is greater than the resolution of the display device, the present invention properly scales down the resolution of the picture, to avoid defects of unsuccessful playback of picture display due to insufficient memories, so as to heighten efficiency of the picture display.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention.
Number | Date | Country | Kind |
---|---|---|---|
099145749 | Dec 2010 | TW | national |